/* =====================================================================
   THE SELECT — design tokens
   Palette is fixed; components only ever read the semantic layer
   (--bg, --bg-2, --fg, --fg-2, --rule, --accent ...), which is remapped
   per [data-theme="paper" | "film"].
   ===================================================================== */

:root {
  /* ---- palette ---- */
  --paper: #EDEBE4;
  --paper-2: #E2DFD6;
  --ink: #0E0E0C;
  --ink-2: #56544E;
  --line: rgba(14, 14, 12, .16);
  --blue: #1F35FF;
  --blue-on-dark: #7C89FF;
  --red: #FF3B1F;          /* red pencil: marks on top of solid blue */
  --film: #0F0F0E;
  --film-2: #1A1A18;
  --on-film: #EDEBE4;
  --on-film-2: #A09D94;
  --line-on-film: rgba(237, 235, 228, .18);

  /* ---- type ---- */
  --font-display: 'Inter Tight', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-body: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --font-hand: 'Reenie Beanie', 'Segoe Print', 'Bradley Hand', cursive;

  --display-weight: 700;        /* .t-xl / .t-l / .t-800 use 800 */
  --display-lh: .9;
  --display-ls: -.045em;        /* large sizes; .t-s and below: -.03em */
  --display-ls-s: -.03em;
  --hand-scale: 1;              /* Caveat (uk) is optically larger */

  --fs-body: clamp(17px, 1.05vw + 11px, 20px);
  --fs-small: 15px;
  --fs-label: clamp(11px, .2vw + 10px, 12px);
  --fs-lead: clamp(24px, 2.6vw, 40px);
  --fs-hand: calc(clamp(28px, 2.4vw, 40px) * var(--hand-scale));
  --fs-d-xl: clamp(56px, 16vw, 300px);
  --fs-d-l: clamp(44px, 8.6vw, 148px);
  --fs-d-m: clamp(34px, 5.2vw, 86px);
  --fs-d-s: clamp(24px, 2.6vw, 44px);

  /* ---- space ---- */
  --gutter: clamp(16px, 2.5vw, 40px);
  --section-pad: clamp(96px, 14vw, 220px);
  --col-gap: clamp(12px, 1.6vw, 24px);
  --cols: 12;
  --nav-h: 64px;
  --hair: 1px;

  /* ---- motion ---- */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-snap: cubic-bezier(.7, 0, .2, 1);
  --t-fast: .25s;
  --t-med: .5s;
  --t-slow: .9s;

  /* ---- grid overlay ---- */
  --grid-line: rgba(128, 126, 120, .13);

  /* ---- layers ---- */
  --z-grid: 2;
  --z-grain: 90;
  --z-nav: 100;
  --z-menu: 110;
  --z-preview: 80;
  --z-cursor: 200;
}

@media (max-width: 767px) {
  :root { --cols: 4; --nav-h: 56px; }
}

/* Ukrainian: Caveat for handwriting, scaled to match Reenie Beanie */
:root:lang(uk) {
  --font-hand: 'Caveat', 'Segoe Print', cursive;
  --hand-scale: .85;
}

/* ---- semantic layer ---- */
:root,
[data-theme="paper"] {
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --rule: var(--line);
  --accent: var(--blue);          /* blue text / strokes */
  --accent-fill: var(--blue);     /* solid blue surfaces */
  --on-accent: var(--paper);      /* text on solid blue */
  --veil: rgba(237, 235, 228, .88);
  /* inverted set (hover wipes) */
  --inv-bg: var(--ink);
  --inv-fg: var(--paper);
  --inv-fg-2: #B5B2A9;
  --inv-rule: rgba(237, 235, 228, .22);
  --inv-accent: var(--blue-on-dark);
  --disc: var(--ink);
}

[data-theme="film"] {
  --bg: var(--film);
  --bg-2: var(--film-2);
  --fg: var(--on-film);
  --fg-2: var(--on-film-2);
  --rule: var(--line-on-film);
  --accent: var(--blue-on-dark);
  --accent-fill: var(--blue);
  --on-accent: var(--paper);
  --veil: rgba(15, 15, 14, .86);
  --inv-bg: var(--paper);
  --inv-fg: var(--ink);
  --inv-fg-2: var(--ink-2);
  --inv-rule: var(--line);
  --inv-accent: var(--blue);
  --disc: #050504;
}
