/* =====================================================================================================
   LUNARIA DESIGN TOKENS — the single authoritative value system for the website.
   Every colour, space, radius, shadow, glow, duration and width used anywhere in wwwroot/css MUST come
   from here. Pages never hard-code a subtly different copy of these values (owner addendum §8).
   Mirrors the Figma "Lunaria Web" token set when that file exists; CSS is the source of truth until then.
   ===================================================================================================== */

:root {
  /* ---- Colour: surfaces ----------------------------------------------------------------------- */
  --color-bg: #0b1022;            /* deep midnight navy — page background */
  --color-bg-deep: #05081a;       /* deeper band at the bottom of the sky / footer */
  --color-surface: rgb(18 24 48 / 72%);         /* glass panel */
  --color-surface-raised: rgb(30 38 72 / 84%);  /* hovered / elevated panel, dropdowns */
  --color-surface-solid: #141a36; /* non-translucent fallback (reduced-transparency, tooltips) */
  --color-surface-menu: rgb(20 27 54 / 96%);   /* dropdowns / popovers over busy art: near-opaque for contrast */
  --color-border: rgb(178 192 226 / 18%);          /* silver hairline */
  --color-border-highlight: rgb(142 222 255 / 48%); /* focused / active hairline (moonlight) */

  /* ---- Colour: text ---------------------------------------------------------------------------- */
  --color-text: #eaf0ff;
  --color-text-muted: #a9b4d3;
  --color-text-faint: #7d89ad;
  --color-text-on-primary: #061126;
  --color-text-on-gold: #2b1f08;

  /* ---- Colour: brand --------------------------------------------------------------------------- */
  --color-primary: #74d8ff;       /* moonlight blue / aqua magic */
  --color-primary-strong: #3dbcf2;
  --color-primary-soft: rgb(116 216 255 / 14%);
  --color-secondary: #c9b6f3;     /* lavender */
  --color-secondary-soft: rgb(201 182 243 / 14%);
  --color-accent: #f3b6d6;        /* soft pink — sparingly */
  --color-accent-soft: rgb(243 182 214 / 14%);
  --color-gold: #e9c97d;          /* restrained pale gold — highlights, #1 rank */
  --color-gold-strong: #d4a94a;
  --color-gold-soft: rgb(233 201 125 / 16%);
  --color-silver: #c7d0e6;        /* #2 rank, borders */
  --color-bronze: #d39a6a;        /* #3 rank */

  /* ---- Colour: semantic ------------------------------------------------------------------------ */
  --color-success: #6fe0a8;
  --color-success-soft: rgb(111 224 168 / 16%);
  --color-warning: #f2c76b;
  --color-warning-soft: rgb(242 199 107 / 16%);
  --color-error: #ff7f93;
  --color-error-soft: rgb(255 127 147 / 16%);
  --color-info: var(--color-primary);
  --color-info-soft: var(--color-primary-soft);

  /* ---- Typography ------------------------------------------------------------------------------ */
  --font-body: "Nunito", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Marcellus", "Palatino Linotype", "Book Antiqua", Georgia, serif; /* short headings + brand only */
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.75rem;     /* 12 */
  --fs-sm: 0.875rem;    /* 14 */
  --fs-base: 1rem;      /* 16 */
  --fs-md: 1.125rem;    /* 18 */
  --fs-lg: 1.25rem;     /* 20 */
  --fs-xl: 1.5rem;      /* 24 */
  --fs-2xl: clamp(1.75rem, 1.4rem + 1.2vw, 2.125rem);
  --fs-3xl: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  --fs-display: clamp(2.5rem, 1.8rem + 3.2vw, 4.25rem);

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.6;

  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-black: 800;

  --tracking-caps: 0.08em;
  --tracking-display: 0.02em;

  /* ---- Spacing scale (4px base) ---------------------------------------------------------------- */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* ---- Radii ----------------------------------------------------------------------------------- */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* ---- Shadows (depth) ------------------------------------------------------------------------- */
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 30%), 0 2px 8px rgb(3 6 20 / 35%);
  --shadow-md: 0 6px 20px rgb(3 6 20 / 45%);
  --shadow-lg: 0 18px 50px rgb(3 6 20 / 55%);
  --shadow-inset: inset 0 1px 0 rgb(255 255 255 / 6%);

  /* ---- Glows (magic) --------------------------------------------------------------------------- */
  --glow-primary: 0 0 0 1px rgb(116 216 255 / 35%), 0 0 24px rgb(116 216 255 / 28%);
  --glow-primary-soft: 0 0 18px rgb(116 216 255 / 18%);
  --glow-secondary: 0 0 22px rgb(201 182 243 / 28%);
  --glow-gold: 0 0 0 1px rgb(233 201 125 / 45%), 0 0 26px rgb(233 201 125 / 30%);
  --glow-focus: 0 0 0 3px rgb(116 216 255 / 55%);

  /* ---- Blur / glass ---------------------------------------------------------------------------- */
  --glass-blur: 14px;
  --glass-saturate: 140%;

  /* ---- Motion ---------------------------------------------------------------------------------- */
  --dur-fast: 120ms;
  --dur-base: 220ms;
  --dur-slow: 420ms;
  --dur-ambient: 14s;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.3, 0.64, 1);

  /* ---- Layout widths --------------------------------------------------------------------------- */
  --w-content: 1200px;   /* default content column */
  --w-wide: 1440px;      /* wide tables / market */
  --w-narrow: 720px;     /* forms, articles */
  --w-text: 72ch;        /* measure */
  --gutter: clamp(1rem, 2vw, 2rem);
  --nav-height: 72px;

  /* ---- Z layers -------------------------------------------------------------------------------- */
  --z-sky: -2;
  --z-scrim: -1;
  --z-content: 1;
  --z-nav: 100;
  --z-dropdown: 110;
  --z-overlay: 200;
  --z-toast: 300;

  color-scheme: dark;
}

/* Breakpoints (media queries cannot read custom properties — these are the canonical values):
     --bp-sm  480px   phones landscape / large phones (375 / 430 are the tested phone widths)
     --bp-md  768px   tablet
     --bp-lg  1024px  small laptop — primary nav switches to full bar here
     --bp-xl  1440px  desktop
     --bp-2xl 1920px  large desktop
     --bp-uw  2560px  ultrawide (3440 tested too) — content stays capped at --w-content / --w-wide */

/* Reduced transparency: fall back to solid surfaces, no blur. */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --color-surface: var(--color-surface-solid);
    --color-surface-raised: #1b2346;
    --glass-blur: 0px;
  }
}
