/* Spectrum Affirming Yoga — shared design system
   Palette, type, and layout tokens. See the design-plan note in README.md for why
   these specific choices (not the generic cream+terracotta AI-default combo). */

@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400&family=Inter:wght@600;700;800&display=swap');

:root {
  --paper: #EFEAF7;
  --paper-raised: #F8F6FC;
  --ink: #26332F;
  --ink-soft: #5A6B64;
  --sage: #5B7B6D;
  --sage-deep: #435D52;
  --clay: #C08262;
  --gold: #D9A441;
  --border: #DCD5E8;
  --radius: 14px;
  --font-display: 'Inter', Arial, sans-serif;
  --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif;
  --step: 1; /* text-size multiplier, controlled by the size toggle */
}

/* High-contrast mode — an explicit choice, not a "dark mode." Some visitors need more
   contrast; some need less visual intensity. Offering both, rather than guessing which
   one "neurodivergent-friendly" means, is the actual accessible choice here. */
body[data-mode="high-contrast"] {
  --paper: #FFFFFF;
  --paper-raised: #FFFFFF;
  --ink: #0F1512;
  --ink-soft: #262626;
  --sage: #2F5544;
  --sage-deep: #1F3D30;
  --clay: #8C3F1E;
  --gold: #8A5A00;
  --border: #000000;
}

/* Low-stimulation mode — muted further still, for anyone who finds even the default
   palette too visually active. Toggled independently of high-contrast. */
body[data-low-stim="true"] {
  --sage: #7A8B84;
  --clay: #A88E7D;
  --gold: #B9A06A;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: calc(16px * var(--step));
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

body[data-dyslexia="true"] {
  font-family: 'OpenDyslexic', var(--font-body);
  letter-spacing: 0.02em;
}

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); font-weight: 700; line-height: 1.25; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: calc(2.4rem * var(--step)); font-weight: 800; }
h2 { font-size: calc(1.6rem * var(--step)); }
h3 { font-size: calc(1.15rem * var(--step)); }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--sage-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.page { display: flex; width: 100%; }
.content { flex: 1; min-width: 0; }
.wrap { max-width: 780px; margin: 0 auto; padding: clamp(28px,6vw,56px) clamp(18px,4vw,24px) clamp(56px,10vw,96px); }

.btn {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: calc(0.95rem * var(--step));
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--sage); color: #fff; }
.btn-primary:hover { background: var(--sage-deep); }
.btn-outline { background: transparent; color: var(--sage-deep); border-color: var(--sage); }
.btn-outline:hover { background: var(--sage); color: #fff; }

.card {
  background: var(--paper-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* Reduced motion: respected everywhere, not just here — but stated once, centrally. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

footer {
  border-top: 1px solid var(--border);
  padding: 24px clamp(18px,4vw,24px) 40px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  max-width: 780px;
  margin: 0 auto;
}
footer .links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
footer a { color: var(--ink-soft); }

input, textarea, select {
  font-family: var(--font-body);
  font-size: calc(1rem * var(--step));
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper-raised);
  color: var(--ink);
  width: 100%;
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 4px; }
.field { margin-bottom: 16px; }

/* ── Navigation: side rail (desktop) / bottom bar (mobile) ─────────────────────── */
.side-rail {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.rail-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
}
.side-rail ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.side-rail a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-size: 0.92rem; }
.side-rail a[aria-current="page"] { background: var(--sage); color: #fff; font-weight: 700; }
.rail-controls { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.rail-controls button {
  font-family: var(--font-body); font-size: 0.78rem; text-align: left; background: none;
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--ink-soft); cursor: pointer;
}
.mobile-bar { display: none; }

@media (max-width: 860px) {
  .side-rail { display: none; }
  .mobile-bar {
    display: flex; justify-content: space-around; position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--paper-raised); border-top: 1px solid var(--border); padding: 8px 4px;
    z-index: 20;
  }
  .mobile-bar a { color: var(--ink-soft); text-decoration: none; font-size: 0.72rem; text-align: center; }
  .mobile-bar a[aria-current="page"] { color: var(--sage-deep); font-weight: 700; }
  .content { padding-bottom: 56px; }
}
