/* ==========================================================================
   Pyrexia home prototype: design tokens
   Direction A "Ruled Sheet". Semantic tokens only; sections declare a theme
   with data-theme="dark". Product frames (.pf) and phones (.phone) always
   re-declare the light set, because the real product is light.
   ========================================================================== */

:root,
[data-theme="light"],
.pf,
.phone,
.passcard {
  color-scheme: light;

  /* --- colour: page ---------------------------------------------------- */
  --bg: #F5F6F8;            /* page, cool off-white */
  --surface: #FFFFFF;       /* cards, frames */
  --sunken: #ECEEF2;        /* wells, table stripes */
  --ink: #0D1117;           /* headings, body          17.5:1 on --bg */
  --ink-2: #3F4856;         /* second clause, secondary 8.6:1 */
  --ink-3: #5E6878;         /* captions, labels         5.2:1 */
  --line: #D5DAE2;          /* hairline, rails and section rules; decorative only */
  --line-strong: #B8C0CC;   /* dividers inside frames */
  --border-control: #788395;/* inputs, outline buttons  3.5:1 */

  /* --- colour: accent (rationed: links, markers, focus) ----------------- */
  /* One indigo: the page accent is the product's action colour (--app-indigo). */
  --accent: #3005C2;        /* 10.6:1 as text on --bg */
  --accent-hover: #24049A;
  --accent-tint: #EEEBFB;
  --on-accent: #FFFFFF;

  /* --- colour: primary button is ink, not accent ------------------------ */
  --btn-bg: #0D1117;
  --btn-bg-hover: #262D38;
  --btn-fg: #FFFFFF;

  /* --- colour: status set (always icon + word, never colour alone) ------ */
  --ok: #1B7A4B;        --ok-tint: #E4F3EA;        /* green = complete / all clear ONLY */
  --due: #8A5A00;       --due-tint: #FBF0D9;       /* expiring soon */
  --expired: #B42318;   --expired-tint: #FCE9E6;   /* expired */
  --pending: #4A5565;   --pending-tint: #ECEEF2;   /* awaiting / neutral */

  /* --- colour: product skin (inside .pf / .phone only) ------------------ */
  --app-bg: #F6F7FA;
  --app-surface: #FFFFFF;
  --app-ink: #111113;
  --app-ink-2: #555C6B;
  --app-line: #E4E7EE;
  --app-indigo: #3005C2;     /* the product's action colour */
  --app-indigo-tint: #EEEBFB;

  /* --- texture ----------------------------------------------------------- */
  --dot: #AEB6C4;            /* dot-grid dot */
  --dot-pitch: 16px;

  /* --- shadows (frames only; cards have none) ---------------------------- */
  --shadow-frame: 0 6px 22px rgb(13 17 23 / .08), 0 2px 6px rgb(13 17 23 / .05);
  --shadow-float: 0 18px 40px -12px rgb(13 17 23 / .22), 0 4px 10px rgb(13 17 23 / .06);
  --nav-tint: rgb(245 246 248 / .82);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0E14;
  --surface: #121722;
  --sunken: #0E121B;
  --ink: #F1F3F7;           /* 17.4:1 */
  --ink-2: #A4ADBD;         /* 8.6:1 */
  --ink-3: #8E98AA;         /* 6.4:1 */
  --line: rgb(255 255 255 / .10);
  --line-strong: rgb(255 255 255 / .20);
  --border-control: #7C8799;

  --accent: #A49CFF;        /* 8.1:1 */
  --accent-hover: #C2BCFF;
  --accent-tint: rgb(164 156 255 / .14);
  --on-accent: #0B0E14;

  --btn-bg: #F1F3F7;
  --btn-bg-hover: #FFFFFF;
  --btn-fg: #0B0E14;

  --ok: #4CC38A;        --ok-tint: rgb(76 195 138 / .14);
  --due: #F0B429;       --due-tint: rgb(240 180 41 / .14);
  --expired: #FF6B5E;   --expired-tint: rgb(255 107 94 / .14);
  --pending: #A4ADBD;   --pending-tint: rgb(164 173 189 / .12);

  --dot: rgb(255 255 255 / .13);
  --shadow-frame: 0 10px 40px rgb(0 0 0 / .5), 0 2px 6px rgb(0 0 0 / .4);
  --shadow-float: 0 24px 50px -12px rgb(0 0 0 / .7);
  --nav-tint: rgb(11 14 20 / .82);
}

:root {
  /* --- type families ----------------------------------------------------- */
  --font-sans: "Satoshi", "Satoshi Fallback", "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* --- type scale: rem clamp() on a 16px root (min at 375, max at 1440) --- */
  --fs-micro: 0.6875rem;                                    /* 11  mono inside product frames */
  --fs-label: clamp(0.75rem, 0.728rem + 0.094vw, 0.8125rem);/* 12 → 13 mono labels */
  --fs-small: 0.875rem;                                     /* 14 */
  --fs-body: clamp(1rem, 0.978rem + 0.094vw, 1.0625rem);    /* 16 → 17 */
  --fs-lede: clamp(1.125rem, 1.037rem + 0.376vw, 1.375rem); /* 18 → 22 claim paragraphs */
  --fs-h4: clamp(1.0625rem, 1.04rem + 0.094vw, 1.125rem);   /* 17 → 18 */
  --fs-h3: clamp(1.25rem, 1.162rem + 0.376vw, 1.5rem);      /* 20 → 24 */
  --fs-h2: clamp(1.875rem, 1.567rem + 1.315vw, 2.75rem);    /* 30 → 44 */
  --fs-hero: clamp(2.25rem, 1.634rem + 2.629vw, 4rem);      /* 36 → 64 */
  --fs-numeral: clamp(4rem, 1.887rem + 9.014vw, 10rem);     /* 64 → 160 */

  --lh-tight: 1.04;
  --lh-heading: 1.12;
  --lh-body: 1.55;
  --ls-display: -0.03em;
  --ls-heading: -0.02em;
  --ls-label: 0.04em;

  /* --- spacing: 8px base -------------------------------------------------- */
  --s-1: 0.25rem;  /* 4 */
  --s-2: 0.5rem;   /* 8 */
  --s-3: 0.75rem;  /* 12 */
  --s-4: 1rem;     /* 16 */
  --s-5: 1.5rem;   /* 24 */
  --s-6: 2rem;     /* 32 */
  --s-7: 2.5rem;   /* 40 */
  --s-8: 3rem;     /* 48 */
  --s-9: 4rem;     /* 64 */
  --s-10: 5rem;    /* 80 */
  --s-11: 6rem;    /* 96 */
  --s-12: 7rem;    /* 112 */

  /* --- layout -------------------------------------------------------------- */
  --content: 75rem;                                   /* 1200px between the rails */
  --page-pad: clamp(0rem, -1.5rem + 6.4vw, 2rem);     /* gap outside the rails: 0 on phones */
  --rail-pad: clamp(1.25rem, 0.72rem + 2.25vw, 2.5rem);/* 20 → 40 inside the rails */
  --gutter: clamp(1rem, 0.824rem + 0.751vw, 1.5rem);  /* 16 → 24 */
  --section-pad: clamp(4rem, 2.944rem + 4.507vw, 7rem);/* 64 → 112 */
  --nav-h: 4rem;
  --tag-h: 2rem;                                      /* the section tag (base.css) */

  /* --- radii ---------------------------------------------------------------- */
  --r-tag: 4px;
  --r-btn: 6px;
  --r-card: 8px;
  --r-frame: 12px;
  --r-phone: 36px;

  /* --- motion (synthesis section 5) ----------------------------------------- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-inout: cubic-bezier(.65, 0, .35, 1);
  --t-press: 120ms;
  --t-hover: 180ms;
  --t-ui: 260ms;
  --t-reveal: 480ms;
  --t-hero: 800ms;
  --t-theme: 500ms;
  --stagger: 50ms;
  --reveal-rise: 14px;

  /* --- layers ---------------------------------------------------------------- */
  --z-nav: 100;
  --z-dialog: 200;
  --z-review: 300;
}
/* Phones: 40px section padding (the page is long; fifteen sections make this count). */
@media (max-width: 37.49em) {
  :root { --section-pad: 2.5rem; }
}
