/* Sven Jungmann — design tokens. v2.
   Production: licensed Berkeley Mono for `--mono`, served locally from /fonts.
   Source Serif 4 also served locally (variable font, latin + latin-ext subsets). */

@font-face {
  font-family: 'Berkeley Mono';
  src: url('../fonts/BerkeleyMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Berkeley Mono';
  src: url('../fonts/BerkeleyMono-Oblique.otf') format('opentype');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Berkeley Mono';
  src: url('../fonts/BerkeleyMono-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Berkeley Mono';
  src: url('../fonts/BerkeleyMono-Bold-Oblique.otf') format('opentype');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

/* Source Serif 4 — variable font (opsz 8..60, wght 200..900). Same file used
   for all weights we declare. Two subsets: latin covers everyday EN copy;
   latin-ext covers the diacritics we need for DE/FR. */
@font-face {
  font-family: 'Source Serif 4';
  src: url('../fonts/SourceSerif4-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  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: 'Source Serif 4';
  src: url('../fonts/SourceSerif4-latin-ext.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  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 {
  color-scheme: light;

  /* Surfaces */
  --paper:    #F6F5F2;  /* page background, warm off-white */
  --ink:      #0B0E12;  /* primary text and rules, graphite */

  /* Ink at opacity — use these, not separate greys */
  --ink-90:   rgba(11, 14, 18, 0.92);
  --ink-80:   rgba(11, 14, 18, 0.80);
  --ink-60:   rgba(11, 14, 18, 0.60);
  --ink-40:   rgba(11, 14, 18, 0.40);
  --ink-20:   rgba(11, 14, 18, 0.20);
  --ink-10:   rgba(11, 14, 18, 0.10);
  --ink-05:   rgba(11, 14, 18, 0.05);

  /* Signal — reserved for spec-marking work only. Keep total inked area <2% of any page. */
  --signal:   #E94E1B;

  /* Illustration register only — appears inside essay illustrations, never in UI chrome. */
  --buttery:  #E2B856;

  /* Typography. Mono: licensed Berkeley Mono (local, /fonts). Body: Source Serif 4 (Google Fonts build substitute for Tiempos Text). */
  --mono:     'Berkeley Mono', 'JetBrains Mono', ui-monospace, monospace;
  --body:     'Source Serif 4', 'Tiempos Text', Georgia, 'Times New Roman', serif;

  /* Spacing — 8px baseline, no values outside these increments */
  --space-1:  8px;
  --space-2:  16px;
  --space-3:  24px;
  --space-4:  32px;
  --space-5:  48px;
  --space-6:  64px;
  --space-7:  96px;
  --space-8:  128px;

  /* Page */
  --page-max: 1120px;
  --read-max: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.65;
  font-feature-settings: 'kern', 'liga';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html { scroll-behavior: smooth; }

::selection { background: var(--signal); color: var(--paper); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 1px;
}

img { max-width: 100%; display: block; }

/* Reveal-on-enter — used by js/reveal.js. Honours prefers-reduced-motion. */
.reveal {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
              transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
