/* Design tokens: good-retire v3 ("quiet luxury"), copied from apps/web/src/styles/tokens at 58dea30.
   Type and space are unchanged apart from dropped good-retire sizes; colour drops the pet, car, road,
   runway and money groups and adds the layer and reader hues. Light is the default; a saved choice wins. */

@font-face {
  font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Type */
  --font-hand: "Bradley Hand", "Segoe Print", "Chalkboard SE", "Comic Sans MS", cursive;   /* system handwriting faces, for scribbled notes */
  --font-headline: "Cheltenham", "ITC Cheltenham", Georgia, "Times New Roman", Times, serif;   /* newspaper headline serif, from the device */
  --fs-headline: clamp(30px, 3.4vw, 44px);
  --font-sans: "Nunito", ui-rounded, "SF Pro Rounded", "Varela Round", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-micro: 10px;
  --fs-caption: 12px;
  --fs-ui: 13px;
  --fs-body: 14px;
  --fs-title: 16px;
  --fs-heading: 20px;
  --fs-reader: 22px;
  --fs-display: 28px;
  --fs-brand: 30px;
  --fs-oneclick: clamp(26px, 3vw, 38px);
  --fs-write: clamp(36px, 4vw, 54px);
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-heavy: 700;
  --lh-tight: 1.2;
  --lh-ui: 1.4;
  --lh-prose: 1.55;
  --ls-label: 0.08em;
  --ls-badge: 0.02em;

  /* Space and shape: the 4 px scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --radius-control: 6px;
  --radius-card: 8px;
  --radius-pill: 999px;
  --bw: 1px;
  --bw-accent: 2px;
  --ring-w: 2px;
  --ring-offset: 2px;
  --size-hit: 40px;
  --size-icon: 18px;
  --size-dot: 10px;
  --size-bar-h: 12px;
  --size-bar-name: 96px;
  --size-note-w: clamp(220px, calc(50vw - 640px), 320px);   /* a sidenote column: the page margin beside the card */
  --size-dialog-w: 360px;
  --size-menu-w: 260px;
  --size-tile-min: 160px;
  --size-text-h: 320px;
  --size-oneclick-h: 120px;
  --rule-h: 32px;          /* ruled paper: one line, and where the margin line stands */
  --margin-x: 52px;
  --page-max: 1200px;
  --measure: 68ch;

  /* Motion */
  --dur-ui: 180ms;
  --dur-slow: 600ms;
  --dur-coach: 360ms;   /* coach.js fades; not zeroed under reduced motion (the owner's decision) */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  color-scheme: light;

  --page: #ffffff;
  --surface-1: #f8f7f4;
  --surface-2: #ffffff;
  --surface-sunken: #efede8;
  --text-primary: #1d1c24;
  --text-secondary: #43414d;
  --text-muted: #5a5865;
  --line: #2a2833;
  --border: rgba(29, 28, 36, 0.10);
  --border-strong: rgba(29, 28, 36, 0.24);
  --hover-wash: rgba(29, 28, 36, 0.045);
  --shadow-pop: 0 1px 2px rgba(29, 28, 36, 0.06), 0 16px 36px -16px rgba(29, 28, 36, 0.28);
  --scrim: rgba(29, 28, 36, 0.32);

  --berry-tint: #f7e8ea;     --berry-solid: #c0606d;     --berry-ink: #8a2233;
  --tangerine-tint: #f7ede0; --tangerine-solid: #cf9456; --tangerine-ink: #7a4710;
  --sunny-tint: #f6f0da;     --sunny-solid: #cfab55;     --sunny-ink: #66500f;
  --leaf-tint: #e6f0e8;      --leaf-solid: #6aa47c;      --leaf-ink: #1d5a36;
  --lagoon-tint: #e1efee;    --lagoon-solid: #55a09f;    --lagoon-ink: #115a59;
  --sky-tint: #e6edf7;       --sky-solid: #6283bd;       --sky-ink: #1d4382;
  --grape-tint: #eee9f5;     --grape-solid: #8a70b4;     --grape-ink: #4a2f84;
  --bubblegum-tint: #f6e8ef; --bubblegum-solid: #c3779b; --bubblegum-ink: #85285a;
  --cocoa-tint: #f0e9e1;     --cocoa-solid: #a07d5a;     --cocoa-ink: #5b3b20;

  --rule-blue: #cfdcf0;
  --rule-red: #e2929b;
  --rubber: #f0a3ad;       /* the eraser's rubber, and its shaded side */
  --rubber-lip: #c9717e;

  --accent: #23468f;
  --accent-text: #23468f;
  --accent-lip: #1a3570;
  --on-accent: #ffffff;
  --focus-ring: #3a62b8;
  --selected-wash: color-mix(in srgb, var(--accent) 9%, transparent);

  --status-good: #1c6b3d;
  --status-warn: #8a4f08;
  --status-bad: #a82238;
  --status-info: #23529f;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --page: #16171b;
  --surface-1: #1e1f25;
  --surface-2: #272930;
  --surface-sunken: #111215;
  --text-primary: #f4f2ee;
  --text-secondary: #d2cfc8;
  --text-muted: #a9a69f;
  --line: #ece8e0;
  --border: rgba(244, 242, 238, 0.12);
  --border-strong: rgba(244, 242, 238, 0.28);
  --hover-wash: rgba(244, 242, 238, 0.06);
  --shadow-pop: 0 1px 2px rgba(0, 0, 0, 0.30), 0 16px 36px -16px rgba(0, 0, 0, 0.80);
  --scrim: rgba(0, 0, 0, 0.56);

  --berry-tint: #35222a;     --berry-solid: #b4505e;     --berry-ink: #f3c4cb;
  --tangerine-tint: #352a1e; --tangerine-solid: #b07a3e; --tangerine-ink: #f2d4ae;
  --sunny-tint: #342e1d;     --sunny-solid: #98792c;     --sunny-ink: #efdfa6;
  --leaf-tint: #1f3026;      --leaf-solid: #4f8a63;      --leaf-ink: #c0e4cc;
  --lagoon-tint: #1b3131;    --lagoon-solid: #3f8786;    --lagoon-ink: #b6e6e4;
  --sky-tint: #1f2a40;       --sky-solid: #4f70a8;       --sky-ink: #c6d8f6;
  --grape-tint: #2a2440;     --grape-solid: #7459a0;     --grape-ink: #dacdf3;
  --bubblegum-tint: #382230; --bubblegum-solid: #a9638a; --bubblegum-ink: #f3c8de;
  --cocoa-tint: #33291f;     --cocoa-solid: #8a6a48;     --cocoa-ink: #e8d3bd;

  --rule-blue: #2c364a;
  --rule-red: #7d434c;
  --rubber: #c9717e;
  --rubber-lip: #8f4853;

  --accent: #8fb0ee;
  --accent-text: #8fb0ee;
  --accent-lip: #6f94d8;
  --on-accent: #10162b;
  --focus-ring: #a9c3f4;
  --selected-wash: color-mix(in srgb, var(--accent) 14%, transparent);

  --status-good: #6ad68e;
  --status-warn: #ffb35c;
  --status-bad: #ff8796;
  --status-info: #8db6ff;
}

/* One fixed hue per finder. The five layers follow plans/web-gui.md; readers share bubblegum.
   Berry stays for problems that are not tied to a finder. */
[data-hue="sky"]       { --hue-tint: var(--sky-tint);       --hue-solid: var(--sky-solid);       --hue-ink: var(--sky-ink); }
[data-hue="lagoon"]    { --hue-tint: var(--lagoon-tint);    --hue-solid: var(--lagoon-solid);    --hue-ink: var(--lagoon-ink); }
[data-hue="grape"]     { --hue-tint: var(--grape-tint);     --hue-solid: var(--grape-solid);     --hue-ink: var(--grape-ink); }
[data-hue="leaf"]      { --hue-tint: var(--leaf-tint);      --hue-solid: var(--leaf-solid);      --hue-ink: var(--leaf-ink); }
[data-hue="tangerine"] { --hue-tint: var(--tangerine-tint); --hue-solid: var(--tangerine-solid); --hue-ink: var(--tangerine-ink); }
[data-hue="sunny"]     { --hue-tint: var(--sunny-tint);     --hue-solid: var(--sunny-solid);     --hue-ink: var(--sunny-ink); }
[data-hue="bubblegum"] { --hue-tint: var(--bubblegum-tint); --hue-solid: var(--bubblegum-solid); --hue-ink: var(--bubblegum-ink); }
[data-hue="cocoa"]     { --hue-tint: var(--cocoa-tint);     --hue-solid: var(--cocoa-solid);     --hue-ink: var(--cocoa-ink); }
[data-hue="berry"]     { --hue-tint: var(--berry-tint);     --hue-solid: var(--berry-solid);     --hue-ink: var(--berry-ink); }
