/* ============================================================
   HARVEST · THEME TOKENS
   Faith Schooling Harvest Assessment
   Design language: warm dawn-light, paper card, forest+gold
   ============================================================ */

/* ──────────────────────────────────────────────────────────────
   FAITH SCHOOLING brand tokens (authoritative — sourced from
   faithschooling.com theme stylesheet, version 3.0.0).
   HARVEST is the assessment product within Faith Schooling.
   ────────────────────────────────────────────────────────────── */
:root {
  /* Faith Schooling parent-brand tokens (use these in new code) */
  --fs-bg:            #F9F5EF;
  --fs-primary:       #2D5016;
  --fs-primary-dark:  #1E3A0E;
  --fs-secondary:     #7B3F00;
  --fs-secondary-dark:#5A2E00;
  --fs-accent:        #C8860A;
  --fs-accent-light:  #E5A830;
  --fs-earth:         #3D1C02;
  --fs-text:          #1A0F00;
  --fs-text-light:    #4A3520;
  --fs-text-muted:    #7A6A55;
  --fs-card-bg:       #FFFFFF;
  --fs-card-shadow:   0 2px 12px rgba(61, 28, 2, 0.08);
  --fs-card-shadow-hover: 0 6px 24px rgba(61, 28, 2, 0.14);
  --fs-border-light:  rgba(61, 28, 2, 0.12);

  /* ─── Atmosphere — warm parchment sky to align with Faith Schooling ── */
  --sky-top:    #F9F5EF;     /* parchment cream (FS bg) */
  --sky-mid:    #F2EADB;     /* slightly deeper cream */
  --sky-bottom: #E8DEC5;     /* warm horizon */
  --hills-far:  #6B8B5C;     /* sage-green hills */
  --hills-near: #2D5016;     /* FS primary forest green */

  /* ─── Paper / Cards — bright but warm ─── */
  --paper:        #FFFFFF;            /* FS card bg */
  --paper-warm:   #FAF6EE;
  --paper-cream:  #F2EADB;
  --paper-deep:   #E8DEC5;
  --paper-line:   var(--fs-border-light);
  --paper-grid:   rgba(61, 28, 2, 0.05);

  /* ─── Ink / Text — FS-aligned dark earth tones ─── */
  --ink:        var(--fs-text);          /* #1A0F00 deep earth */
  --ink-rich:   #2C1F0C;
  --ink-soft:   var(--fs-text-light);    /* #4A3520 */
  --ink-mute:   var(--fs-text-muted);    /* #7A6A55 */
  --ink-faint:  #B5A88E;
  --ink-error:  #8B1E2A;
  --ink-warn:   var(--fs-secondary);     /* #7B3F00 brown */
  --ink-ok:     var(--fs-primary);       /* #2D5016 green */

  /* ─── Brand Greens — aligned to FS forest green ─── */
  --green:        var(--fs-primary);       /* #2D5016 */
  --green-rich:   var(--fs-primary-dark);  /* #1E3A0E */
  --green-mid:    #4A7C2F;                 /* FS badge free */
  --green-soft:   #6B9E4E;
  --sage:         #8AAB75;
  --sage-light:   #B8CFA8;
  --green-glaze:  rgba(45, 80, 22, 0.06);

  /* ─── Gold Accents — FS accent palette ─── */
  --gold:        var(--fs-accent);         /* #C8860A */
  --gold-rich:   var(--fs-secondary);      /* #7B3F00 brown */
  --gold-warm:   var(--fs-accent-light);   /* #E5A830 */
  --gold-light:  #F0C050;
  --gold-pale:   #FBEFD5;

  /* ─── Status Colors — FS aligned ───────────────────────────── */
  --ok:          var(--fs-primary);     /* #2D5016 */
  --ok-soft:     #4A7C2F;
  --ok-pale:     #E0EBD3;
  --warn:        var(--fs-accent);      /* #C8860A */
  --warn-soft:   var(--fs-accent-light);
  --warn-pale:   #FBEFD5;
  --alert:       #A83236;
  --alert-soft:  #C66058;
  --alert-pale:  #F5DDD9;
  --info:        #3D6B8F;
  --info-soft:   #6890B0;
  --info-pale:   #DDE7F0;

  /* ─── Section Colors — one per assessment section ─── */
  --sec-a:       var(--fs-secondary);    /* Intake — brown */
  --sec-a-pale:  #F0E0CC;
  --sec-b:       var(--fs-primary);      /* Reading Foundations — FS green */
  --sec-b-pale:  #E0EBD3;
  --sec-c:       #3D6B8F;                /* Reading — info blue */
  --sec-c-pale:  #DDE7F0;
  --sec-d:       #6B3F70;                /* Writing — plum */
  --sec-d-pale:  #EBDCEE;
  --sec-e:       var(--fs-accent);       /* Math — FS gold */
  --sec-e-pale:  #FBEFD5;
  --sec-f:       #B85A48;                /* Reasoning — terracotta */
  --sec-f-pale:  #F5D9D2;
  --sec-g:       var(--fs-primary-dark); /* Faith — FS deep forest */
  --sec-g-pale:  #C9DBB9;

  /* ─── Mastery Bands ───────────────────────────────────────── */
  --mastery-secure:    var(--fs-primary);
  --mastery-watch:     var(--fs-accent);
  --mastery-needs:     #B85A48;
  --mastery-blocked:   #A83236;

  /* ─── Shadows — FS-aligned brown tint ─── */
  --shadow-xs: 0 1px 4px rgba(61, 28, 2, 0.06);
  --shadow-sm: var(--fs-shadow-sm, 0 2px 6px rgba(61, 28, 2, 0.10), 0 1px 2px rgba(61, 28, 2, 0.06));
  --shadow-md: var(--fs-shadow-md, 0 8px 20px rgba(61, 28, 2, 0.12));
  --shadow-lg: var(--fs-shadow-lg, 0 16px 40px rgba(61, 28, 2, 0.18));
  --shadow-paper: 0 22px 50px rgba(61, 28, 2, 0.18), 0 8px 16px rgba(61, 28, 2, 0.10),
                  inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -1px 0 rgba(123, 63, 0, 0.06);
  --shadow-press: inset 0 2px 4px rgba(61, 28, 2, 0.18);
  --shadow-glow-gold: 0 0 0 4px rgba(229, 168, 48, 0.28), 0 8px 24px rgba(229, 168, 48, 0.34);
  --shadow-glow-green: 0 0 0 4px rgba(45, 80, 22, 0.22), 0 8px 24px rgba(45, 80, 22, 0.30);
  --shadow-focus: 0 0 0 3px var(--gold), 0 0 0 6px rgba(229, 168, 48, 0.28);

  /* ─── Radii ────────────────────────────────────────────────── */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* ─── Motion ───────────────────────────────────────────────── */
  --ease: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 180ms;
  --t-med: 300ms;
  --t-slow: 500ms;

  /* ─── Typography — aligned to Faith Schooling brand ─── */
  --font-display: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --font-heading: 'Playfair Display', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-script: 'Caveat', 'Brush Script MT', cursive;
  --font-child: 'AbcPrint', 'AbcKids', 'AbcTeacher', 'Segoe Print', 'Comic Sans MS', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;

  /* ─── Type Scale ───────────────────────────────────────────── */
  --fs-2xs:  0.6875rem;  /* 11px */
  --fs-xs:   0.75rem;    /* 12px */
  --fs-sm:   0.875rem;   /* 14px */
  --fs-base: 1rem;       /* 16px */
  --fs-lg:   1.125rem;   /* 18px */
  --fs-xl:   1.25rem;    /* 20px */
  --fs-2xl:  1.5rem;     /* 24px */
  --fs-3xl:  1.875rem;   /* 30px */
  --fs-4xl:  2.25rem;    /* 36px */
  --fs-5xl:  3rem;       /* 48px */
  --fs-6xl:  3.75rem;    /* 60px */

  /* ─── Spacing ──────────────────────────────────────────────── */
  --sp-0:  0;
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-7:  2.5rem;
  --sp-8:  3rem;
  --sp-10: 4rem;
  --sp-12: 6rem;

  /* ─── Layout ───────────────────────────────────────────────── */
  --max-w:        1280px;
  --max-w-prose:  68ch;
  --max-w-stage:  900px;
  --gutter:       clamp(16px, 4vw, 48px);

  /* ─── Accessibility Defaults ───────────────────────────────── */
  --a11y-scale:   1;
  --a11y-spacing: 1;
  --a11y-contrast: 1;
}

/* ─── Reduced Motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── High Contrast Mode ─────────────────────────────────────── */
.a11y-high-contrast {
  --paper: #FFFFFF;
  --paper-warm: #FFFFFF;
  --paper-cream: #FFF8E7;
  --ink: #000000;
  --ink-soft: #1A1A1A;
  --ink-mute: #333333;
  --green: #000000;
  --green-rich: #003300;
  --gold-rich: #663300;
}

/* ─── Large Text Mode ────────────────────────────────────────── */
.a11y-large-text {
  --fs-base: 1.25rem;
  --fs-lg:   1.5rem;
  --fs-xl:   1.75rem;
  --fs-2xl:  2rem;
  --fs-3xl:  2.5rem;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: calc(16px * var(--a11y-scale, 1));
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  color: var(--ink);
  background: var(--fs-bg);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.015em;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-base); }

p { color: var(--ink-soft); line-height: 1.65; }
a { color: var(--green-rich); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-rich); }
ul, ol { padding-left: 1.5em; }

::selection { background: var(--gold-pale); color: var(--green); }

/* ─── Atmosphere Layer ───────────────────────────────────────── */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.atmosphere-sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 75% 15%, rgba(229, 168, 48, 0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 30%, rgba(232, 222, 197, 0.5) 0%, transparent 60%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 45%, var(--sky-bottom) 100%);
}
.atmosphere-mist {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 40% at 50% 100%, rgba(255, 251, 241, 0.4), transparent 60%);
}
.atmosphere-hills {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: clamp(140px, 22vh, 280px);
}
