/* ==========================================================================
   Samy_DEV — Design tokens · "Swiss grid"
   Pure white, black ink, greys. Sharp corners, hairline rules, left-aligned.
   Light theme by default; dark theme with [data-theme="dark"] on <html>.
   Contrast targets (WCAG 2.2 AA): text ≥ 4.5:1, large text / UI ≥ 3:1.
   ========================================================================== */

/* ---------- Fonts (self-hosted woff2, SIL Open Font License) ---------- */
@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ---------- Colour: light (default) ---------- */
  --c-bg: #ffffff;
  --c-surface: #ffffff;
  --c-sunken: #f3f3f3;      /* placeholders, code, chips */
  --c-ink: #0a0a0a;         /* 19.8:1 on white */
  --c-ink-2: #3d3d3d;       /* 11:1 */
  --c-muted: #6a6a6a;       /* 5.4:1 */
  --c-line: #e4e4e4;        /* hairlines */
  --c-line-strong: #0a0a0a; /* structural rules are black */
  --c-invert-bg: #0a0a0a;
  --c-invert-ink: #ffffff;
  --c-focus: #0a0a0a;
  --c-live: #157f3b;        /* the only hue: a small "now" marker, 5.3:1 */

  --code-bg: #f6f6f6;
  --code-ink: #1a1a1a;
  --code-keyword: #0a0a0a;
  --code-comment: #6a6a6a;  /* 5:1 on code bg */
  --code-string: #444444;
  --code-number: #262626;

  /* ---------- Typography ---------- */
  --f-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

  --t-xs: 0.75rem;                                    /* 12 */
  --t-sm: 0.875rem;                                   /* 14 */
  --t-base: clamp(1rem, 0.97rem + 0.14vw, 1.0625rem); /* 16 → 17 */
  --t-md: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
  --t-lg: clamp(1.25rem, 1.1rem + 0.65vw, 1.75rem);
  --t-xl: clamp(1.75rem, 1.4rem + 1.6vw, 2.75rem);
  --t-2xl: clamp(2.25rem, 1.6rem + 3vw, 4.25rem);
  --t-display: clamp(3.5rem, 0.5rem + 13.6vw, 13rem);  /* the name, full width */

  --tracking-display: -0.065em;
  --tracking-tight: -0.04em;
  --tracking-label: 0.04em;

  /* ---------- Space ---------- */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4rem;
  --s-9: 6rem;
  --s-10: clamp(4.5rem, 3rem + 5vw, 8rem);

  /* ---------- Layout ---------- */
  --w-page: 90rem;   /* 1440 */
  --w-text: 38rem;
  --gutter: clamp(1.25rem, 0.5rem + 3vw, 3.5rem);
  --header-h: 3.5rem;
  --cols: 12;

  /* ---------- Shape ---------- */
  --r: 2px;          /* almost square everywhere */

  /* ---------- Motion ---------- */
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);
  --d-fast: 140ms;
  --d-base: 240ms;
  --d-reveal: 600ms;
  --reveal-shift: 12px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --c-bg: #0a0a0a;
  --c-surface: #0a0a0a;
  --c-sunken: #161616;
  --c-ink: #f5f5f5;         /* 18.1:1 */
  --c-ink-2: #c8c8c8;       /* 11.5:1 */
  --c-muted: #969696;       /* 6.7:1 */
  --c-line: #262626;
  --c-line-strong: #f5f5f5;
  --c-invert-bg: #f5f5f5;
  --c-invert-ink: #0a0a0a;
  --c-focus: #f5f5f5;
  --c-live: #4fd081;

  --code-bg: #121212;
  --code-ink: #e6e6e6;
  --code-keyword: #ffffff;
  --code-comment: #8c8c8c;
  --code-string: #bdbdbd;
  --code-number: #d9d9d9;

  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --d-fast: 0ms;
    --d-base: 0ms;
    --d-reveal: 0ms;
    --reveal-shift: 0px;
  }
}
