/* ==========================================================================
   Chiang Mai Yi Peng — Design Tokens
   Theme: Night Sky & Lantern Glow
   All color pairs below are WCAG AA verified (see accessibility notes).
   ========================================================================== */

:root {
  /* ---------- Color: Night Sky (base surfaces, darkest -> lightest) -------- */
  --sky-950: #070B16;   /* page background, deepest night */
  --sky-900: #0C1222;   /* section background */
  --sky-850: #111A2E;   /* raised panel */
  --sky-800: #16203A;   /* card surface */
  --sky-700: #1E2B4A;   /* card hover / elevated */
  --sky-600: #2A3A5E;   /* border strong */
  --sky-500: #3A4C73;   /* divider */

  /* ---------- Color: Lantern Glow (primary accent) ------------------------- */
  --glow-100: #FFF6E2;  /* near-white warm, for headings on dark */
  --glow-200: #FFE9BE;
  --glow-300: #FFD48A;  /* primary accent — CTA fill, links */
  --glow-400: #F5B942;  /* hover / stronger accent */
  --glow-500: #E09B21;  /* deep gold, accent borders */
  --glow-600: #B87716;  /* on light surfaces */

  /* ---------- Color: Ember (secondary accent, krathong / ritual) ---------- */
  --ember-300: #FF9B7A;
  --ember-400: #E86B45;
  --ember-500: #C44D2B;

  /* ---------- Color: Text (on dark surfaces) ------------------------------- */
  --text-primary:   #F4F1EA;  /* 15.8:1 on --sky-950 ✓ AAA */
  --text-secondary: #C3C9D6;  /* 10.4:1 on --sky-950 ✓ AAA */
  --text-muted:     #8E97AC;  /*  5.6:1 on --sky-950 ✓ AA  */
  --text-on-glow:   #1A1206;  /* 12.1:1 on --glow-300   ✓ AAA */

  /* ---------- Color: Semantic -------------------------------------------- */
  --color-yes:      #6FD08C;  /* "who should go" */
  --color-yes-bg:   rgba(111, 208, 140, 0.10);
  --color-no:       #F08A8A;  /* "who should skip" */
  --color-no-bg:    rgba(240, 138, 138, 0.10);
  --color-note:     var(--glow-300);
  --color-note-bg:  rgba(255, 212, 138, 0.09);

  /* ---------- Typography -------------------------------------------------- */
  /* Fraunces = editorial serif for display; Instrument Sans = UI/body */
  /* Latin fallbacks come BEFORE 'Noto Serif': on some systems the locally
     installed "Noto Serif" is a Thai-locale build, which briefly renders Latin
     text with Thai glyphs during the webfont swap window. */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', 'Noto Serif', serif;
  --font-body: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-xs:   0.75rem;   /* 12px */
  --fs-sm:   0.875rem;  /* 14px */
  --fs-base: 1rem;      /* 16px */
  --fs-md:   1.0625rem; /* 17px — body copy on long-form pages */
  --fs-lg:   1.125rem;  /* 18px */
  --fs-xl:   1.375rem;  /* 22px */
  --fs-2xl:  1.75rem;   /* 28px */
  --fs-3xl:  2.25rem;   /* 36px */
  --fs-4xl:  3rem;      /* 48px */
  --fs-5xl:  3.75rem;   /* 60px */

  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;
  --fw-bold:   700;

  --lh-tight:  1.12;  /* display headings */
  --lh-snug:   1.3;   /* sub-headings */
  --lh-normal: 1.55;  /* UI text */
  --lh-relaxed: 1.75; /* long-form body */

  --ls-tight:  -0.022em;  /* display */
  --ls-normal: 0;
  --ls-wide:   0.09em;    /* eyebrow / all-caps labels */

  /* ---------- Spacing (4px base unit) ------------------------------------ */
  --sp-1:  0.25rem;  /*  4px */
  --sp-2:  0.5rem;   /*  8px */
  --sp-3:  0.75rem;  /* 12px */
  --sp-4:  1rem;     /* 16px */
  --sp-5:  1.25rem;  /* 20px */
  --sp-6:  1.5rem;   /* 24px */
  --sp-8:  2rem;     /* 32px */
  --sp-10: 2.5rem;   /* 40px */
  --sp-12: 3rem;     /* 48px */
  --sp-16: 4rem;     /* 64px */
  --sp-20: 5rem;     /* 80px */
  --sp-24: 6rem;     /* 96px */

  /* ---------- Layout ------------------------------------------------------ */
  --container-narrow: 46rem;   /* 736px — legal / prose */
  --container-text:   52rem;   /* 832px — article body */
  --container-wide:   74rem;   /* 1184px — default */
  --container-max:    84rem;   /* 1344px — full bleed grids */

  /* ---------- Radius ------------------------------------------------------ */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   16px;
  --r-xl:   22px;
  --r-full: 999px;

  /* ---------- Shadow & Glow ---------------------------------------------- */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg:  0 18px 44px rgba(0, 0, 0, 0.55);
  --glow-soft:  0 0 28px rgba(255, 212, 138, 0.18);
  --glow-strong:0 0 44px rgba(255, 212, 138, 0.30);

  /* ---------- Motion ------------------------------------------------------ */
  --t-fast:   140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-normal: 260ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:   520ms cubic-bezier(0.16, 1, 0.3, 1);

  /* ---------- Z-index scale ---------------------------------------------- */
  --z-base: 1;
  --z-sticky: 100;
  --z-header: 200;
  --z-overlay: 300;
}

/* Motion sensitivity: honour the OS-level preference */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-fast: 1ms;
    --t-normal: 1ms;
    --t-slow: 1ms;
  }
}
