/* Hallmark · route: custom (tuned) · genre: modern-minimal · macrostructure: Stat-Led
 * vibe: "cryptographic instrument, late-night, magenta signal"
 * paper: oklch(13% 0.014 340) dark · accent: oklch(70% 0.2 340) magenta
 * display: Instrument Serif · body: system sans · mono: JetBrains Mono
 * axes: dark / roman-serif / chromatic-magenta ~340°
 * nav: N9 edge-aligned · footer: Ft4 dense colophon · enrichment: Tier B hand-built SVG
 * pre-emit critique: P5 H5 E5 S5 R5 V5
 *
 * Dark is the page's own register; light is the same system inverted, not a
 * second design. Every surface, rule and text colour is one semantic token, so
 * the two modes cannot drift apart.
 *
 * The faces are served from this origin. A pool asking people to verify it
 * rather than trust it should not make every visitor's browser announce itself
 * to a font CDN first.
 */

@font-face {
  font-family: "Instrument Serif";
  src: url("./fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("./fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark light;

  /* Every neutral is tinted toward the magenta anchor. Nothing here is a
   * chroma-zero grey, and neither end is pure black or pure white. */
  --color-paper: oklch(13% 0.014 340);
  --color-paper-2: oklch(16.5% 0.016 340);
  --color-ink: oklch(94% 0.008 340);
  --color-ink-2: oklch(80% 0.011 340);
  --color-muted: oklch(60% 0.013 340);

  --color-rule: oklch(26% 0.014 340);
  --color-rule-2: oklch(33% 0.016 340);

  /* One signal, kept under five per cent of any viewport. */
  --color-accent: oklch(70% 0.2 340);
  --color-accent-hover: oklch(76% 0.19 340);
  --color-accent-press: oklch(64% 0.2 340);
  --color-accent-ink: oklch(14% 0.03 340);
  --color-focus: oklch(72% 0.22 340);

  /* The signal as it appears on the dark surfaces, which stay dark in both
   * registers. Keeping it separate is what stops the light mode dropping a
   * paper-tuned accent onto a near-black panel at four to one. */
  --color-signal: oklch(72% 0.2 340);

  /* The instrument and the one banded section. Here they are surfaces lifted
   * off the paper — depth comes from lightness, never from a glow. Six points
   * of L is what separates them; less and the instrument stops reading as the
   * page's focal object. */
  --color-panel: oklch(19.5% 0.018 340);
  --color-panel-sunk: oklch(15% 0.016 340);
  --color-panel-rule: oklch(33% 0.02 340);
  --color-panel-rule-lit: oklch(44% 0.024 340);
  --color-on-panel: oklch(96% 0.008 340);
  --color-on-panel-2: oklch(76% 0.012 340);
  --color-on-panel-3: oklch(54% 0.014 340);

  --color-band: oklch(17.5% 0.017 340);
  --color-band-rule: oklch(31% 0.019 340);
  --color-on-band: oklch(96% 0.008 340);
  --color-on-band-2: oklch(78% 0.012 340);

  --color-shadow: oklch(4% 0.01 340 / 0.5);

  --font-display: "Instrument Serif", ui-serif, Georgia, serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* 4pt scale. */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;
  --space-4xl: 7.5rem;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;
  --text-2xl: 1.875rem;
  --text-3xl: 2.5rem;
  --text-figure: clamp(3.75rem, 11vw + 0.5rem, 8.5rem);

  --rule-hair: 1px;
  --radius-control: 6px;
  --radius-card: 10px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 120ms;
  --dur-base: 220ms;
}

@media (prefers-color-scheme: light) {
  :root {
    --color-paper: oklch(98.5% 0.005 340);
    --color-paper-2: oklch(96% 0.007 340);
    --color-ink: oklch(19% 0.016 340);
    --color-ink-2: oklch(33% 0.014 340);
    --color-muted: oklch(52% 0.014 340);

    --color-rule: oklch(90% 0.008 340);
    --color-rule-2: oklch(83% 0.011 340);

    /* Darker on light paper: the same hue has to carry text contrast here. */
    --color-accent: oklch(53% 0.2 340);
    --color-accent-hover: oklch(48% 0.2 340);
    --color-accent-press: oklch(44% 0.19 340);
    --color-accent-ink: oklch(99% 0.005 340);
    --color-focus: oklch(53% 0.22 340);

    /* On light paper the same two surfaces invert: they become the dark beats
     * that give the page its rhythm, so they go near-black instead. */
    --color-panel: oklch(17% 0.016 340);
    --color-panel-sunk: oklch(13% 0.014 340);
    --color-panel-rule: oklch(28% 0.016 340);
    --color-panel-rule-lit: oklch(40% 0.02 340);

    --color-band: oklch(17% 0.016 340);
    --color-band-rule: oklch(28% 0.016 340);

    --color-shadow: oklch(19% 0.016 340 / 0.08);
  }
}
