/* Design tokens: two themes, both from Guy's logo colours (sage, grey,
   lavender). :root is the light theme; the dark theme applies with
   [data-theme="dark"] (the header toggle, remembered in localStorage) only:
   the site stays light even when the computer is in dark mode. The head script sets
   data-theme before first paint. Every colour on the site comes from here
   (check_site.py enforces it), except the logo SVG and the candle swatches. */
:root {
  /* Logo reference colours (logo/mystic_roots_logo.svg). */
  --logo-sage: #9a9e8d;
  --logo-sage-light: #c7cbbc;
  --logo-grey: #676861;         /* the wordmark: logo only, never body text */
  --logo-lavender: #cdbbd8;
  --logo-lavender-mid: #8e74a6;
  --logo-purple: #785889;       /* the tagline: logo only */
  --logo-purple-deep: #6e5288;

  /* ----- Light theme (default): white, dark grey, sage, lavender ----- */
  color-scheme: light;
  --bg: #ffffff;                /* white page, like the book cover */
  --bg-alt: #f4f6f1;            /* the palest sage bands (readings, shop) */
  --wash-sage: transparent;   /* soft sage washes */
  --bg-deep: #f8f9f6;
  --panel: #ffffff;
  --panel-soft: #fafbf8;
  --text: #3a3b37;              /* dark grey: 11.4:1 on white */
  --text-soft: #5c5d58;         /* 6.8:1 on white */
  --sage: #585d4c;              /* sage kickers: 6.9:1 on white */
  --sage-dim: #62665a;          /* 5.9:1 on white */
  --link: var(--logo-purple-deep);          /* 7.2:1 on white */
  --focus: var(--logo-purple-deep);
  --sage-light: var(--logo-sage);           /* primary buttons */
  --on-accent: #1f201c;                     /* 6.0:1 on --logo-sage */
  --plum: var(--logo-lavender-mid);         /* decoration only */
  --plum-light: var(--logo-lavender-mid);
  --plum-bright: var(--logo-lavender-mid);  /* small stars and separators */
  --glow-plum: transparent;     /* no glows in the daylight look */
  --glow-plum-soft: transparent;
  --glow-sage: transparent;
  --hairline: color-mix(in srgb, var(--logo-sage) 55%, transparent);
  --hairline-sage: var(--logo-sage);
  --hairline-strong: var(--logo-sage);
  --veil: color-mix(in srgb, var(--bg) 86%, transparent);   /* translucent header */
  --veil-strong: color-mix(in srgb, var(--bg) 95%, transparent);
  --star: transparent;
  --star-opacity: 0;
  --grain-opacity: 0;
  --home-header-veil: 1;
  /* Hero: the moonlit scene in both themes, so the heading is light on a dark
     sage-charcoal veil. The page around it stays white. */
  --shade: #1f221d;
  --hero-text: #f4f4f1;         /* 15:1 on --shade */
  --hero-accent: #c7cbbc;
  /* Silver dawn: heroes that have a light-theme version (.scroll-hero--dawn)
     use a pale veil and dark heading in the light theme. */
  --dawn-shade: #f6f5f1;
  --dawn-text: #2c2d29;         /* 13:1 on --dawn-shade */
  --dawn-accent: #4f5444;       /* 7.4:1 on --dawn-shade */
  --line-lavender: #b6a3c8;     /* the second, lavender "foil" line (decoration only) */
  --smoke-blend: normal;
  --smoke-filter: none;
}

/* ----- Dark theme: chosen with the toggle ----- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --line-lavender: var(--logo-lavender);
  --bg: #252a23;                /* sage-charcoal */
  --bg-alt: #2d3429;            /* lifted sage-charcoal (shop band) */
  --bg-deep: #1d201b;
  --panel: #30372c;
  --panel-soft: #2a3027;
  --text: #f1f1ee;              /* 14:1 on --bg */
  --text-soft: #c9cac4;         /* 9.6:1 on --bg */
  --sage: #b4b8a7;              /* 7.9:1 on --bg */
  --sage-dim: #a3a796;          /* 6.6:1 on --bg */
  --link: var(--logo-lavender);             /* 8.9:1 on --bg */
  --focus: var(--logo-lavender);
  --sage-light: var(--logo-sage-light);     /* primary buttons */
  --on-accent: #252a23;
  --plum: var(--logo-lavender-mid);
  --plum-light: #b39fc9;
  --plum-bright: var(--logo-lavender);
  --glow-plum: transparent;
  --glow-plum-soft: transparent;
  --glow-sage: transparent;
  --hairline: color-mix(in srgb, var(--logo-sage) 28%, transparent);
  --hairline-sage: color-mix(in srgb, var(--logo-sage) 34%, transparent);
  --hairline-strong: color-mix(in srgb, var(--logo-sage) 58%, transparent);
  --veil: color-mix(in srgb, var(--bg) 82%, transparent);
  --veil-strong: color-mix(in srgb, var(--bg) 94%, transparent);
  --star: transparent;
  --star-opacity: 0;
  --grain-opacity: 0;
  --home-header-veil: 0;
  --logo-ink: #ffffff;          /* the whole logo in white on dark surfaces */
  --wash-sage: color-mix(in srgb, var(--logo-sage) 12%, transparent);
  --shade: #1b1e19;
  --hero-text: #f4f4f1;
  --hero-accent: #c7cbbc;
  --smoke-blend: normal;
  --smoke-filter: none;
}



:root {
  /* Candle colour swatches (candle-magic table only; decorative, never text). */
  --candle-white: #f4f1ea;
  --candle-black: #111;
  --candle-red: #b3261e;
  --candle-pink: #e7a1b8;
  --candle-orange: #e07b28;
  --candle-yellow: #e8c547;
  --candle-green: #3f8f4f;
  --candle-blue: #3b6fb6;
  --candle-purple: #7a4a9e;
  --candle-brown: #7a5133;
  --candle-silver: #c0c4cc;
  --candle-gold: #c9a227;

  /* Readings stages (Tarot Picker, Crystal Finder), their door cards and the
     "Save as image" pictures: always a night scene, in both themes, like the
     hero imagery. Plain hex so the share-image canvas can read them too. */
  --stage-bg: #283024;          /* deep sage */
  --stage-bg-2: #36412f;        /* lifted sage */
  --stage-text: #f2eff5;        /* 16:1 on --stage-bg */
  --stage-soft: #cdc6d4;        /* 11:1 on --stage-bg */
  --stage-sage: #c7cbbc;        /* 11.5:1 on --stage-bg */
  --stage-lavender: #cdbbd8;    /* links and focus: 10.5:1 on --stage-bg */
  --stage-plum: #8e74a6;        /* decoration only */
  --stage-on-accent: #1d1e1a;   /* text on --stage-sage buttons: 11:1 */
  --stage-hairline: color-mix(in srgb, var(--stage-lavender) 24%, transparent);
  --stage-hairline-strong: color-mix(in srgb, var(--stage-sage) 55%, transparent);
  --stage-glow: color-mix(in srgb, var(--stage-sage) 18%, transparent);
  --stage-glow-soft: color-mix(in srgb, var(--stage-lavender) 10%, transparent);
  --stage-panel: color-mix(in srgb, var(--stage-text) 5%, transparent);

  /* Type. Cinzel Decorative: logo, page H1s and the hero headline only. */
  --font-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-heading: "Cinzel", Georgia, serif;
  --font-body: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-ui: Montserrat, system-ui, sans-serif;
  --tracking-caps: 0.14em;

  --step--1: 0.95rem;
  --step-0: 1.15rem;
  --step-1: 1.35rem;
  --step-2: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  --step-3: clamp(2rem, 1.2rem + 3.6vw, 3.25rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 3rem;
  --space-5: clamp(4rem, 3rem + 4vw, 7rem);   /* between home sections */
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);

  --measure: 37rem;             /* about 68-72 characters of EB Garamond at --step-0 */
  --wrap: 75rem;                /* content grid: 1200px */
  --wrap-narrow: 46rem;

  /* Radii. Arches: horizontal 50% and a vertical % chosen per aspect ratio.
     4:5 is a true round arch (vertical % = 50% x width / height); 16:9 is a
     lower, segmental arch so wide images keep their sky. */
  --r-sm: 6px;
  --r: 12px;
  --r-pill: 999px;
  --line: var(--logo-sage);     /* the fine "foil" linework (rings, rules, frames) */
  --r-img: 6px;                 /* every image frame: square, slightly rounded */
  --arch-4x5: var(--r-img);
  --arch-16x9: var(--r-img);
  --arch-panel: var(--r-img);
  --arch-soft: var(--r-img);

  --header-h: 4.75rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
/* Big monitors (1600px and wider): a wider grid for the header, sections,
   sign-up band and footer. Reading columns keep --measure (about 37rem). */
@media (min-width: 100rem) {
  :root { --wrap: 88rem; }
}

/* Readings stages in the light theme: white paper with fine sage and lavender
   lines, like the book cover (the dark theme keeps the night scene above).
   Plain hex so the share-image canvas can read them too. */
:root:not([data-theme="dark"]) {
  --stage-bg: #ffffff;
  --stage-bg-2: #fafbf8;
  --stage-text: #3a3b37;        /* 11.4:1 on white */
  --stage-soft: #5c5d58;        /* 6.8:1 */
  --stage-sage: #585d4c;        /* kickers and buttons: 6.9:1 */
  --stage-lavender: #6e5288;    /* links and focus: 7.2:1 */
  --stage-plum: #b6a3c8;        /* decoration only */
  --stage-on-accent: #ffffff;   /* white text on --stage-sage buttons: 6.9:1 */
  --stage-hairline: #d6d8cf;
  --stage-hairline-strong: #9a9e8d;
  --stage-glow: transparent;
  --stage-glow-soft: transparent;
  --stage-panel: #fafbf8;
}
