/* Hallmark · genre: editorial/poster · macrostructure: Poster Wall (Marquee Hero + Catalogue tiles) · theme: custom
 * vibe: "street poster wall, loud slogans, square blocks" (Tanel 18.10: bibi-plakatite temaatika, kosmos hüljatud)
 * paper oklch(15% 0.006 165) · accent oklch(88% 0.2 160) mint · display Anybody 900 condensed + mono Space Mono
 * axes: dark / display-condensed / chromatic-green · enrichment: L2 layered mark + Press + horizon (motion-2026) · nav: N9 edge-aligned · footer: Ft5 statement
 */
@font-face { font-family: 'Anybody'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 50% 150%; src: url('/assets/fonts/anybody-latin-wdth-normal.woff2') format('woff2-variations'); 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: 'Anybody'; font-style: normal; font-display: swap; font-weight: 100 900; font-stretch: 50% 150%; src: url('/assets/fonts/anybody-latin-ext-wdth-normal.woff2') format('woff2-variations'); 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; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/space-mono-latin-400-normal.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: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/space-mono-latin-ext-400-normal.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; }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/space-mono-latin-700-normal.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; }

:root {
  color-scheme: dark;

  --color-paper: oklch(15% 0.006 165);
  --color-paper-2: oklch(19% 0.008 165);
  --color-ink: oklch(97% 0.006 165);
  --color-ink-2: oklch(82% 0.01 165);
  --color-ink-3: oklch(68% 0.012 165);
  --color-dark: oklch(15% 0.006 165);
  --color-accent: oklch(88% 0.2 160);
  --color-rule: oklch(97% 0.006 165 / 0.14);
  --color-accent-deep: oklch(66% 0.16 160);
  --color-hz: oklch(88% 0.2 160 / 0.55);
  --color-focus: var(--color-accent);

  /* Poster tiles: each project in its own brand colour (sampled from the live sites 18.10) */
  --tile-pihi: oklch(74% 0.18 52);
  --tile-pihi-ink: var(--color-dark);
  --tile-bibi: oklch(64% 0.25 2);
  --tile-bibi-ink: var(--color-dark);
  --tile-koolitarkus: oklch(52% 0.26 306);
  --tile-koolitarkus-ink: var(--color-ink);
  --tile-numi: oklch(84% 0.1 352);
  --tile-numi-ink: var(--color-dark);
  --tile-hup: oklch(93% 0.035 85);
  --tile-hup-ink: var(--color-dark);
  --tile-hup-dot: oklch(62% 0.2 28);
  --tile-vallalised: oklch(42% 0.2 322);
  --tile-vallalised-ink: var(--color-ink);

  --font-display: 'Anybody', 'Arial Narrow', sans-serif;
  --font-body: 'Anybody', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --stretch-display: 62%;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: clamp(1.5rem, 1rem + 2vw, 2.25rem);
  --text-2xl: clamp(2.5rem, 1.25rem + 5vw, 5rem);
  --text-tile: clamp(3rem, 1rem + 6.4vw, 6.75rem);
  --text-display: clamp(4rem, 1rem + 9vw, 10rem);

  --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: 4rem;
  --space-4xl: 6rem;
  --space-5xl: 8rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 60ch;
  --page: 90rem;
  --border: 3px;
  --strip-h: 3.5rem; /* trükiriba height: sticky offsets and scroll padding */

  /* Motion (R7): smooth easings for the press and settle, stepped ones for the print moves (stamp, cut, register) */
  --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);
  --ease-press: cubic-bezier(0.22, 0.9, 0.12, 1);
  --ease-step3: steps(3);
  --ease-step4: steps(4);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-stamp: 160ms;
  --dur-cut: 290ms;
  --dur-press: 700ms;
  --dur-tick: 48s;
}

/* xqaw.ee page styles: poster wall. Tokens live in tokens.css (concatenated before this file at build). */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--strip-h) + var(--space-sm)); }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-style: normal; overflow-wrap: anywhere; min-width: 0; }
p, dl, ul { margin: 0; }
a { color: inherit; text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--color-accent); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
::selection { background: var(--color-accent); color: var(--color-dark); }

.skip { position: absolute; left: var(--space-md); top: -100px; z-index: 50; background: var(--color-accent); color: var(--color-dark); padding: var(--space-xs) var(--space-md); font-family: var(--font-mono); }
.skip:focus { top: var(--space-md); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--gutter), var(--page)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.02em; }
.nums { font-variant-numeric: tabular-nums; }

/* The display voice: heavy, condensed, uppercase, tight but clear of Estonian diacritics */
.shout {
  font-family: var(--font-display);
  font-weight: 900;
  font-stretch: var(--stretch-display);
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.005em;
  word-spacing: 0.12em;
}

.page { position: relative; z-index: 1; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Press (R13): each word goes once from wide and thin to the display cut. One word per line box, so a word
   changing width never moves another one (no layout shift, R14); the wide first frames are clipped by the hero. */
.press-in .w { display: block; inline-size: max-content; }

/* Square label button: the bibi-poster "AVA KAART" chip, in xqaw mint */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; white-space: nowrap;
  background: var(--color-accent); color: var(--color-dark);
  border: var(--border) solid var(--color-accent);
  padding: var(--space-xs) var(--space-md);
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.chip:hover { background: transparent; color: var(--color-accent); }
.chip:active { transform: translateY(1px); }
.chip:disabled { opacity: 0.5; cursor: not-allowed; }
.chip[data-state='success'] { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-dark); }
.chip[data-state='error'] { background: transparent; color: var(--color-ink); border-color: var(--color-ink); }

/* ── Top bar ─────────────────────────────────────── */
.top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding-block: var(--space-lg); }
.top-logo { display: block; width: 7rem; }
.top > nav { margin-left: auto; }
.top-logo .logo-hole { fill: var(--color-paper); }
.top-nav { display: flex; align-items: center; gap: var(--space-xs) var(--space-lg); flex-wrap: wrap; justify-content: flex-end; list-style: none; padding: 0; }
.top-nav a { text-decoration: none; text-transform: uppercase; white-space: nowrap; display: inline-block; padding-block: var(--space-2xs); }
.top-nav a:hover { color: var(--color-accent); }
.top-nav .lang { border: 2px solid var(--color-ink); padding: 0 var(--space-xs); }
.top-nav .lang:hover { border-color: var(--color-accent); }

/* Shortcut opener: hidden (but in place) until main.js can open the dialog */
.kb-open {
  visibility: hidden; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; flex: none;
  border: 2px solid var(--color-ink); background: transparent; color: var(--color-ink); font-weight: 700; font-size: var(--text-base); cursor: pointer;
}
.js .kb-open { visibility: inherit; } /* inherit: inside the hidden strip it stays hidden and unfocusable */
.kb-open:hover { border-color: var(--color-accent); color: var(--color-accent); }
.kb-open:active { translate: 0 1px; }
.kbd-hint { display: none; }
@media (pointer: fine) { .kbd-hint { display: inline-block; } }
kbd { font-family: var(--font-mono); font-size: 0.85em; font-weight: 700; border: 2px solid currentColor; padding: 0 0.35em; line-height: 1.3; }

/* ── Trükiriba (R34) ─────────────────────────────── */
.strip {
  position: fixed; inset: 0 0 auto; z-index: 20; height: var(--strip-h); overflow: clip;
  display: flex; align-items: stretch; background: var(--color-paper); border-bottom: var(--border) solid var(--color-ink);
  visibility: hidden; transform: translateY(-100%);
}
.strip.is-on { visibility: visible; transform: none; }
.strip > * { display: flex; align-items: center; }
.strip-logo { padding-inline: var(--gutter) var(--space-md); flex: none; border-right: var(--border) solid var(--color-ink); }
.strip-logo svg { width: 5rem; }
.patches { flex: 1; min-width: 0; align-items: stretch; }
.patch {
  --c: var(--color-paper-2); --fg: var(--color-dark);
  position: relative; flex: 1 1 0; min-width: 0.9rem; background: var(--c); color: var(--fg); text-decoration: none;
  display: flex; align-items: center; padding-inline: var(--space-xs);
}
.patch .kbd-hint { font-size: 0.75rem; border-width: 1.5px; }
/* The active patch widens over its neighbours as an overlay, so the strip never re-lays out while scrolling */
.patch span {
  position: absolute; inset: 0 auto 0 0; z-index: 1; display: flex; align-items: center; padding-inline: var(--space-sm);
  background: var(--c); color: var(--fg); white-space: nowrap; font-family: var(--font-mono); font-weight: 700; font-size: var(--text-xs);
  text-transform: uppercase; letter-spacing: 0.04em; opacity: 0; transform: scaleX(0.4); transform-origin: 0 50%; pointer-events: none;
}
.patch:nth-child(n + 4) span { inset: 0 0 0 auto; transform-origin: 100% 50%; }
.patch[aria-current='true'] span, .patch:focus-visible span { opacity: 1; transform: none; }
@media (hover: hover) { .patch:hover span { opacity: 1; transform: none; } }
.patch:focus-visible { outline-offset: -5px; outline-color: var(--fg); z-index: 2; }
.patch--pihi { --c: var(--tile-pihi); --fg: var(--tile-pihi-ink); }
.patch--bibi { --c: var(--tile-bibi); --fg: var(--tile-bibi-ink); }
.patch--koolitarkus { --c: var(--tile-koolitarkus); --fg: var(--tile-koolitarkus-ink); }
.patch--numi { --c: var(--tile-numi); --fg: var(--tile-numi-ink); }
.patch--hup { --c: var(--tile-hup); --fg: var(--tile-hup-ink); }
.patch--vallalised { --c: var(--tile-vallalised); --fg: var(--tile-vallalised-ink); }
.strip-link { gap: var(--space-xs); padding-inline: var(--space-md); text-transform: uppercase; text-decoration: none; border-left: var(--border) solid var(--color-ink); white-space: nowrap; }
.strip-link:hover { color: var(--color-accent); }
.strip .kb-open { display: grid; align-self: center; margin-inline: var(--space-sm); width: 2.25rem; height: 2.25rem; }
.strip-pct { justify-content: center; min-width: 4.25rem; padding-inline: var(--space-sm); border-left: var(--border) solid var(--color-ink); color: var(--color-accent); font-weight: 700; }
/* Doc pages: the header itself is the strip, sticky from the start */
.top--strip {
  position: sticky; top: 0; z-index: 20; height: var(--strip-h); padding: 0 0 0 var(--gutter);
  background: var(--color-paper); border-bottom: var(--border) solid var(--color-ink);
}
.top--strip .top-logo { width: 6rem; }
.top--strip nav { margin-left: auto; }
.top--strip .strip-pct { display: flex; align-items: center; align-self: stretch; }

/* ── Shortcut poster (R35) ───────────────────────── */
.kb {
  width: min(100% - 2 * var(--gutter), 30rem); padding: var(--space-xl); border: var(--border) solid var(--color-accent);
  background: var(--color-paper); color: var(--color-ink);
}
.kb::backdrop { background: oklch(15% 0.006 165 / 0.8); }
.kb h2 { font-size: var(--text-xl); margin-bottom: var(--space-lg); }
.kb-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-sm) var(--space-lg); align-items: center; margin-bottom: var(--space-xl); }
.kb-list dd { margin: 0; text-transform: uppercase; }
.kb-switch { display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; margin-bottom: var(--space-lg); text-transform: uppercase; cursor: pointer; }
.kb-switch input { width: 1.375rem; height: 1.375rem; margin: 0; accent-color: var(--color-accent); }
/* .stamp.stamp--float: must beat the later .stamp rule (absolute in the press box) */
.stamp.stamp--float { position: fixed; top: 45%; z-index: 30; }

/* ── Hero poster ─────────────────────────────────── */
.hero { position: relative; overflow: clip; padding-block: var(--space-3xl) var(--space-5xl); }
.hero h1 { font-size: var(--text-display); position: relative; z-index: 1; }
.hero h1 .hot { color: var(--color-accent); display: block; }
.hero-foot { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg) var(--space-2xl); margin-top: var(--space-2xl); }
.hero-foot p { max-width: 38ch; color: var(--color-ink-2); }

/* L2 Kihid (R15-R18): 13 stacked copies of the mark, each its own compositor layer. The static offset below is
   the no-JS and reduced-motion form (45 degrees, 5 px depth); main.js overrides transform per layer. */
.l2 {
  position: absolute; right: 0; top: 50%; translate: 0 -50%;
  width: min(48%, 44rem); aspect-ratio: 1030 / 672; container-type: inline-size; pointer-events: none;
}
.l2-layer {
  --k: 0; --l2-fill: var(--color-paper); --l2-line: var(--color-accent-deep);
  position: absolute; inset: 0; will-change: transform;
  transform: translate3d(calc(var(--k) * -0.96cqw), calc(var(--k) * 0.96cqw), 0);
}
.l2-layer:last-child { --l2-fill: var(--color-accent); --l2-line: var(--color-dark); }
.l2-layer svg { width: 100%; height: 100%; overflow: visible; }
.l2-layer use { fill: var(--l2-fill); color: var(--color-paper); stroke: var(--l2-line); stroke-width: 5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.l2-layer:nth-last-child(2) { --k: 1; } .l2-layer:nth-last-child(3) { --k: 2; } .l2-layer:nth-last-child(4) { --k: 3; }
.l2-layer:nth-last-child(5) { --k: 4; } .l2-layer:nth-last-child(6) { --k: 5; } .l2-layer:nth-last-child(7) { --k: 6; }
.l2-layer:nth-last-child(8) { --k: 7; } .l2-layer:nth-last-child(9) { --k: 8; } .l2-layer:nth-last-child(10) { --k: 9; }
.l2-layer:nth-last-child(11) { --k: 10; } .l2-layer:nth-last-child(12) { --k: 11; } .l2-layer:nth-last-child(13) { --k: 12; }

/* Live strip (R20): static rows without JS or with reduced motion; one looping line otherwise. The line layout
   keys off (scripting: enabled) so it is in place from the first paint, and only the animation waits for main.js. */
.ticker { display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--color-accent); color: var(--color-dark); border-block: var(--border) solid var(--color-ink); }
.ticker-view { overflow: clip; min-width: 0; }
.ticker-row { display: flex; flex-wrap: wrap; list-style: none; padding: 0; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.ticker-row + .ticker-row { display: none; }
.ticker-row { padding-inline: calc(var(--gutter) - var(--space-lg)); }
.ticker-row li { padding: var(--space-sm) var(--space-lg); white-space: nowrap; }
.ticker-row b { font-family: var(--font-display); font-weight: 900; font-stretch: var(--stretch-display); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ticker-pause {
  display: none; align-items: center; gap: var(--space-xs); min-width: 44px; padding: 0 var(--space-md);
  border: 0; border-left: var(--border) solid var(--color-ink); background: var(--color-dark); color: var(--color-accent);
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer;
}
.ticker-pause::before { content: ''; width: 0.7em; height: 0.8em; border-inline: 0.22em solid currentColor; }
.ticker-pause[aria-pressed='true'] { background: var(--color-ink); color: var(--color-dark); }
.ticker-pause[aria-pressed='true']::before { border: 0; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.ticker-pause[aria-pressed='false']:hover { color: var(--color-ink); }
.ticker-pause:focus-visible { outline-offset: -6px; }

/* ── Poster wall ─────────────────────────────────── */
.wall { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); list-style: none; padding: 0; }
.tile { --bg: var(--color-paper-2); --ink: var(--color-ink); --i: 0; --tilt: 7deg; position: relative; }
.tile-in {
  position: relative; background: var(--bg); color: var(--ink);
  aspect-ratio: 1 / 1;
  display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-lg);
  padding: clamp(var(--space-lg), 3vw, var(--space-2xl));
  overflow: hidden;
}
.tile:nth-child(2) { --i: 1; --tilt: -7deg; } .tile:nth-child(3) { --i: 2; } .tile:nth-child(4) { --i: 3; --tilt: -7deg; }
.tile:nth-child(5) { --i: 4; } .tile:nth-child(6) { --i: 5; --tilt: -7deg; }
/* Selection takes the poster colours (P1); a visited project gets a square proof mark in its colour (P3). */
.tile ::selection { background: var(--ink); color: var(--bg); }
.tile-links .chip::after { content: ''; width: 0.55em; height: 0.55em; margin-left: 0.6em; background-color: transparent; }
.tile-links .chip:visited::after { background-color: var(--bg); }
.tile--pihi { --bg: var(--tile-pihi); --ink: var(--tile-pihi-ink); }
.tile--bibi { --bg: var(--tile-bibi); --ink: var(--tile-bibi-ink); }
.tile--koolitarkus { --bg: var(--tile-koolitarkus); --ink: var(--tile-koolitarkus-ink); }
.tile--numi { --bg: var(--tile-numi); --ink: var(--tile-numi-ink); }
.tile--hup { --bg: var(--tile-hup); --ink: var(--tile-hup-ink); }
.tile--vallalised { --bg: var(--tile-vallalised); --ink: var(--tile-vallalised-ink); }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); }
.tile-tag { border: 2px solid currentColor; padding: 0 var(--space-xs); text-transform: uppercase; }
.tile h3 { font-size: var(--text-tile); align-self: center; position: relative; z-index: 0; }
/* Hover and keyboard focus (R23): crop and registration marks, the slogan slips off register in mint, the mascot lifts. */
.tile h3::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1; color: var(--color-accent); opacity: 0; }
.marks {
  position: absolute; inset: var(--space-sm); pointer-events: none; opacity: 0; color: var(--ink);
  background:
    linear-gradient(currentColor, currentColor) 0 14px / 12px 2px no-repeat, linear-gradient(currentColor, currentColor) 14px 0 / 2px 12px no-repeat,
    linear-gradient(currentColor, currentColor) right 0 top 14px / 12px 2px no-repeat, linear-gradient(currentColor, currentColor) right 14px top 0 / 2px 12px no-repeat,
    linear-gradient(currentColor, currentColor) 0 calc(100% - 14px) / 12px 2px no-repeat, linear-gradient(currentColor, currentColor) 14px 100% / 2px 12px no-repeat,
    linear-gradient(currentColor, currentColor) right 0 bottom 14px / 12px 2px no-repeat, linear-gradient(currentColor, currentColor) right 14px bottom 0 / 2px 12px no-repeat;
}
.marks::after {
  content: ''; position: absolute; left: 50%; top: 0; width: 14px; height: 14px; translate: -50% 0;
  border: 2px solid currentColor; border-radius: 50%;
  background: linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat, linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
}
.tile:focus-within .marks { opacity: 1; }
.tile:focus-within h3::before { opacity: 1; translate: 4px 3px; }
.tile:focus-within .tile-art { rotate: -7deg; scale: 1.07; }
@media (hover: hover) and (pointer: fine) {
  .tile:hover .marks { opacity: 1; }
  .tile:hover h3::before { opacity: 1; translate: 4px 3px; }
  .tile:hover .tile-art { rotate: -7deg; scale: 1.07; }
}
.tile-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-lg); align-items: end; }
.tile-copy { display: grid; gap: var(--space-sm); }
.tile-text { font-size: var(--text-base); max-width: 34ch; }
.tile-stat { font-weight: 700; }
.tile-stat .n { display: inline-block; text-align: right; }
.tile-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin-top: var(--space-2xs); }
.tile .chip { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tile .chip:hover { background: transparent; color: var(--ink); }
.tile a:focus-visible { outline-color: var(--ink); }
.tile-social { text-transform: uppercase; display: inline-block; padding-block: var(--space-2xs); }
.tile-art { width: clamp(6.5rem, 12vw, 10.5rem); height: auto; object-fit: contain; }
.tile-status { display: inline-flex; align-items: center; gap: var(--space-xs); border: var(--border) solid var(--ink); padding: var(--space-xs) var(--space-sm); white-space: nowrap; font-weight: 700; }
.tile-status-dot { width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--tile-hup-dot); }

/* bibi tabloo (R3, R27): the iframe is added by main.js near the viewport; until then the box is reserved and
   the link below it works on its own. A slatted shutter over the box opens with scroll (never on the iframe). */
.live { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: end; padding-block: var(--space-4xl) 0; }
.live-head { display: grid; gap: var(--space-sm); }
.live-head p { color: var(--color-ink-2); text-transform: uppercase; }
.live-head h2 { font-size: var(--text-display); color: var(--tile-bibi); overflow-wrap: anywhere; min-width: 0; }
.live-box { display: grid; gap: var(--space-xs); justify-items: start; }
.live-slot { position: relative; width: 360px; max-width: 100%; height: 570px; border: var(--border) solid var(--tile-bibi); background: var(--color-dark); overflow: clip; view-timeline: --slot block; }
.live-slot::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateY(-101%);
  background: repeating-linear-gradient(180deg, oklch(26% 0.01 165) 0 18px, oklch(18% 0.008 165) 18px 22px);
}
.live-frame { display: block; width: 100%; height: 100%; border: 0; }
.live-link { text-transform: uppercase; display: inline-block; padding-block: var(--space-2xs); }

/* Mint tape (R26): torn edges are a static clip-path; the tape and the heading drift apart with scroll. */
.band { padding-block: var(--space-4xl) var(--space-xl); overflow-x: clip; }
.band h2 { font-size: var(--text-2xl); color: var(--color-accent); }
.tape {
  margin: var(--space-lg) 0 0 -6%; width: 112%; rotate: -2deg; padding: var(--space-md) 8% var(--space-md) 16%;
  background: var(--color-accent); color: var(--color-dark);
  clip-path: polygon(0 8%, 3% 0, 6% 9%, 9% 1%, 12% 7%, 100% 0, 100% 100%, 97% 92%, 94% 100%, 91% 93%, 88% 100%, 0 100%);
}
.tape span { display: inline-block; white-space: nowrap; font-size: clamp(1.25rem, 0.8rem + 2vw, 2.5rem); }
.wall-note { margin-top: var(--space-md); color: var(--color-ink-3); }

/* ── Sections ─────────────────────────────────────── */
.section { padding-block: var(--space-4xl); }
.section-title { font-size: var(--text-2xl); margin-bottom: var(--space-2xl); }

.rules { list-style: none; padding: 0; border-bottom: var(--border) solid var(--color-ink); }
.rules li {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-md) var(--space-2xl);
  align-items: center; padding-block: var(--space-xl);
}
/* S1 (R25): the rule line is drawn with scroll; the lead word is stamped on once, with a sharp 3 px mint offset. */
.rules li::before { content: ''; position: absolute; inset: 0 0 auto; height: var(--border); background: var(--color-ink); transform-origin: 0 50%; }
.rules .shout { display: inline-block; justify-self: start; font-size: clamp(2.25rem, 1rem + 4vw, 4.5rem); text-shadow: 3px 3px 0 var(--color-accent); transform-origin: 30% 60%; }
.rules p { color: var(--color-ink-2); max-width: 44ch; }

.press { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: var(--space-md); align-items: stretch; }
.press > .boilerplate:first-child { display: flex; flex-direction: column; }
.press > .boilerplate:first-child .chip { margin-top: auto; align-self: flex-start; }
.press h3 { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-sm); }
.boilerplate { position: relative; border: var(--border) solid var(--color-ink); padding: var(--space-xl); }
/* S5 (R29): a successful copy stamps "Kopeeritud" over the text */
.stamp {
  position: absolute; left: 50%; top: 42%; translate: -50% -50%; rotate: -4deg; pointer-events: none; white-space: nowrap;
  color: var(--color-accent); border: 4px solid var(--color-accent); padding: var(--space-2xs) var(--space-md);
  font-size: clamp(1.75rem, 1rem + 2vw, 2.75rem); background: oklch(15% 0.006 165 / 0.88);
}
.stamp[hidden] { display: none; }
.boilerplate p { margin-bottom: var(--space-lg); max-width: var(--measure); }
.press-side { display: grid; gap: var(--space-xl); align-content: start; }
.press > .press-side { border-color: transparent; } /* same box size as the boilerplate, no visible line (Tanel 18.10) */
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2xs) var(--space-lg); }
.facts dt { color: var(--color-ink-3); }
.facts dd { margin: 0; }
.downloads { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-md); }
.downloads a { display: grid; justify-items: center; gap: var(--space-2xs); text-decoration: none; }
.dl-thumb { display: grid; place-items: center; width: 4.5rem; height: 4.5rem; border: 2px solid var(--color-ink); padding: var(--space-xs); transition: border-color var(--dur-fast) var(--ease-out); }
.dl-thumb--dark { background: var(--color-paper); }
.dl-thumb--light { background: var(--color-ink); }
.dl-thumb img { width: 100%; height: 100%; object-fit: contain; }
.downloads a:hover .dl-thumb, .downloads a:focus-visible .dl-thumb { border-color: var(--color-accent); }
.dl-type { font-weight: 700; }

.mail { display: inline-grid; font-size: var(--text-2xl); text-transform: none; text-decoration: none; }
/* S4 (R28): the address is cut in two halves that click together; the top half is a copy hidden from AT and selection */
.mail > span { grid-area: 1 / 1; }
.mc-a { clip-path: inset(0 0 50% 0); user-select: none; }
.mc-b { clip-path: inset(50% 0 -0.3em 0); text-decoration: underline var(--color-accent) 0.08em; text-underline-offset: 0.2em; }
.contact-legal { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: end; margin-top: var(--space-2xl); }
.contact-links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); }

.site-footer { padding-block: var(--space-3xl) var(--space-2xl); }
.statement { font-size: var(--text-display); margin-bottom: var(--space-xl); transform-origin: 0 100%; }
/* S6 (R30): the page lifts off the footer. The footer is pulled up under the page and slides down as fast as the
   page scrolls, so it stands still while uncovered; a transform, because a sticky footer counts as on screen
   (it became the LCP element and font swaps in it added CLS 0.13-0.24, measured 24.10). */
main { position: relative; z-index: 1; background: var(--color-paper); border-bottom: var(--border) solid var(--color-ink); }
.site-footer { z-index: 0; background: var(--color-paper-2); }
.footer-line { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-lg); color: var(--color-ink-3); }
.footer-line a { white-space: nowrap; display: inline-block; padding-block: var(--space-2xs); }
/* Build stamp (R36) */
.build-stamp { display: flex; flex-wrap: wrap; gap: var(--space-2xs) 0; margin-top: var(--space-sm); color: var(--color-ink-3); }
.build-stamp span { padding-right: var(--space-sm); margin-right: var(--space-sm); border-right: 2px solid var(--color-rule); white-space: nowrap; }
.build-stamp span:last-child { border-right: 0; }

/* Horizon (R37): a plane of lines tilted into the distance behind the footer. Transform and opacity only. */
.site-footer { position: relative; overflow: clip; view-timeline: --foot block; min-height: min(56svh, 40rem); display: grid; align-content: end; }
.foot-in { position: relative; z-index: 1; }
/* The plane stops above the small footer text, so no line crosses it (contrast) */
.hz { position: absolute; inset: 0 0 calc(var(--space-2xl) + 4.5rem); perspective: 380px; perspective-origin: 50% 30%; pointer-events: none; }
.hz-plane {
  position: absolute; left: -80%; right: -80%; bottom: 0; height: 150%; overflow: hidden;
  transform-origin: 50% 100%; transform: rotateX(70deg);
  mask-image: linear-gradient(to top, #000 0%, rgb(0 0 0 / 0.55) 35%, transparent 92%);
}
.hz-lines { position: absolute; inset: 0 0 -56px; background: repeating-linear-gradient(to top, var(--color-hz) 0 2px, transparent 2px 56px); }

/* Plain document pages (privacy, 404) */
.doc { padding-block: var(--space-2xl) var(--space-4xl); }
.doc h1 { font-size: var(--text-2xl); margin-bottom: var(--space-md); }
.doc .updated { color: var(--color-ink-3); margin-bottom: var(--space-2xl); }
.doc section { max-width: var(--measure); margin-bottom: var(--space-xl); }
.doc h2 { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-xs); }
.doc p { color: var(--color-ink-2); }
.doc p + p { margin-top: var(--space-sm); }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 48rem) {
  .strip-logo, .strip .kbd-hint { display: none; }
  .strip-link { padding-inline: var(--space-xs); font-size: var(--text-xs); letter-spacing: 0; }
  .strip-pct { min-width: 3rem; padding-inline: var(--space-xs); }
  .patch { min-width: 0; padding-inline: 0; }
  .strip .kb-open { margin-inline: var(--space-xs); }
  .top-nav.mono { font-size: var(--text-xs); }
  .top-logo { width: 5.5rem; }
  /* Phone header: two fixed rows (logo and ?, then the links on one line), so a font swap never re-wraps it (CLS) */
  .top:not(.top--strip) { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--space-sm); padding-block: var(--space-md); }
  .top:not(.top--strip) > nav { grid-column: 1 / -1; grid-row: 2; margin-left: 0; }
  .top:not(.top--strip) .top-nav { flex-wrap: nowrap; justify-content: flex-start; gap: var(--space-md); }
  .top-nav { gap: var(--space-2xs) var(--space-md); }
  .hero { padding-block: var(--space-lg) var(--space-4xl); }
  /* L2 on a phone: in the flow above the slogan, 7 layers (1 + 6) */
  .l2 { position: relative; top: auto; translate: none; width: min(80%, 22rem); margin: 0 0 var(--space-xl) auto; }
  .l2-layer:nth-child(-n + 6) { display: none; }
  .wall { grid-template-columns: minmax(0, 1fr); }
  .tile-in { aspect-ratio: auto; min-height: 30rem; }
  .rules li, .press, .contact-legal { grid-template-columns: minmax(0, 1fr); }
  .live { grid-template-columns: minmax(0, 1fr); }
  .section { padding-block: var(--space-3xl); }
}
/* Card deck on phones (R22): only where a whole poster fits on screen and motion is welcome (main.js sets is-deck
   after measuring); otherwise the plain list. Order, focus and screen readers keep using the DOM order. */
@media (max-width: 44rem) and (min-height: 620px) and (prefers-reduced-motion: no-preference) {
  .wall.is-deck { gap: 34svh; }
  .wall.is-deck .tile { position: sticky; top: calc(var(--strip-h) + var(--i) * 12px); scroll-margin-top: calc(var(--i) * 12px - var(--space-sm)); }
}
@media (max-width: 30rem) {
  .facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .facts dd { margin-bottom: var(--space-xs); }
  .tile-foot { grid-template-columns: minmax(0, 1fr); }
  .tile-art { width: 7rem; justify-self: end; }
  .downloads { gap: var(--space-sm); flex-wrap: nowrap; }
  .dl-thumb { width: 3.5rem; height: 3.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .chip { transition: none; }
  .chip:active { transform: none; }
}

/* ── Motion (R8): every keyframe use lives here, so reduced motion leaves a static, complete page ── */
@media (prefers-reduced-motion: no-preference) {
  /* Smooth only after load (a page opened at #anchor lands there at once) and not while tabbing (focus is never
     left off screen during a scroll animation, WCAG 2.4.11) */
  html.is-ready:not(.is-kbd) { scroll-behavior: smooth; }

  .press-in .w { animation: press var(--dur-press) var(--ease-press) both; }
  .press-in .d1 { animation-delay: 90ms; }
  .press-in .d2 { animation-delay: 180ms; }
  .press-in .d3 { animation-delay: 270ms; }
  @keyframes press {
    0% { font-stretch: 150%; font-weight: 180; }
    70% { font-stretch: 54%; font-weight: 900; }
    86% { font-stretch: 65%; }
    100% { font-stretch: 62%; font-weight: 900; }
  }
}
/* Everything else moves only with JS on: without JS the one CSS Press is the only motion (Olekumaatriks) */
@media (prefers-reduced-motion: no-preference) and (scripting: enabled) {
  /* Focus (P1, R31): the ring arrives as two plates and locks into register in three steps */
  :focus-visible { animation: register 140ms var(--ease-step3) both; }
  @keyframes register { from { box-shadow: 7px 6px 0 0 var(--color-ink); outline-offset: 9px; } to { box-shadow: 0 0 0 0 transparent; } }

  .tile h3::before { transition: opacity var(--dur-fast) linear, translate 260ms var(--ease-out); }
  .marks { transition: opacity 160ms linear; }
  .tile-art { transition: rotate 300ms var(--ease-out), scale 300ms var(--ease-out); }

  /* S1: rows that start below the fold are armed by main.js and stamped once when they arrive */
  .rules li.is-armed .shout { opacity: 0; }
  .rules li.is-stamped .shout { animation: stamp 260ms var(--ease-step4) both; }
  @keyframes stamp { from { transform: scale(1.35) rotate(-6deg); opacity: 0; } 50% { opacity: 1; } to { transform: none; opacity: 1; } }

  /* S4 hover: the halves slip out of register for a moment */
  .mail:hover .mc-a { animation: slip-a 240ms var(--ease-step3); }
  .mail:hover .mc-b { animation: slip-b 240ms var(--ease-step3); }
  @keyframes slip-a { 50% { transform: translateX(-5px); } }
  @keyframes slip-b { 50% { transform: translateX(5px); } }

  .strip { transition: transform 260ms var(--ease-out), visibility 0s linear 260ms; }
  .strip.is-on { transition: transform 260ms var(--ease-out), visibility 0s; }
  .patch span { transition: opacity var(--dur-fast) linear, transform 200ms var(--ease-step3); }
  .kb[open] { animation: sheet-in var(--dur-stamp) var(--ease-step4) both; }
  @keyframes sheet-in { from { opacity: 0; transform: scale(1.08) rotate(3deg); } }

  /* Page and language changes (R32): the new page cuts in from the left in four print steps */
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  ::view-transition-old(root) { animation: none; }
  ::view-transition-new(root) { animation: cut-in var(--dur-cut) var(--ease-step4) both; }
  @keyframes cut-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0); } }

  @supports (animation-timeline: view()) {
    .hz { animation: hz-in linear both; animation-timeline: --foot; animation-range: entry 0% cover 45%; }
    .hz-plane { animation: hz-rise linear both; animation-timeline: --foot; animation-range: entry 0% cover 50%; }
    .hz-lines { animation: hz-flow linear both; animation-timeline: --foot; animation-range: entry 0% exit 100%; }
    @keyframes hz-in { from { opacity: 0; } to { opacity: 1; } }
    @keyframes hz-rise { from { transform: rotateX(89deg); } to { transform: rotateX(70deg); } }
    @keyframes hz-flow { from { transform: translateY(-56px); } to { transform: translateY(0); } }

    /* Wall (R21): each poster is pasted on as it arrives, desktop only (the phone has the deck) */
    @media (min-width: 44.01rem) {
      .tile-in { animation: paste linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
      @keyframes paste { from { transform: translateY(22%) rotate(var(--tilt)) scale(1.07); } to { transform: none; } }
    }
    .rules li::before { animation: rule-draw linear both; animation-timeline: view(); animation-range: entry 10% entry 80%; }
    @keyframes rule-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    .tape { animation: tape-pull linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    .band h2 { animation: tape-counter linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
    @keyframes tape-pull { from { translate: -10% 0; } to { translate: 6% 0; } }
    @keyframes tape-counter { from { translate: 6% 0; } to { translate: -6% 0; } }
    .live-slot::after { animation: shutter linear both; animation-timeline: --slot; animation-range: entry 30% cover 45%; }
    @keyframes shutter { from { transform: translateY(0); } to { transform: translateY(-101%); } }
    .live-head h2 { animation: cut-in var(--ease-step4) both; animation-timeline: view(); animation-range: entry 20% entry 70%; }
    .mc-a { animation: cut-a var(--ease-step3) both; animation-timeline: view(); animation-range: entry 40% entry 100%; }
    .mc-b { animation: cut-b var(--ease-step3) both; animation-timeline: view(); animation-range: entry 40% entry 100%; }
    @keyframes cut-a { from { transform: translateX(-14%); } }
    @keyframes cut-b { from { transform: translateX(14%); } }
    .site-footer.is-under { animation: lift linear both; animation-timeline: --foot; animation-range: entry 0% entry 100%; }
    @keyframes lift { from { transform: translateY(-100%); } to { transform: none; } }
    .statement { animation: last-press linear both; animation-timeline: --foot; animation-range: entry 40% cover 50%; }
    @keyframes last-press { from { transform: scaleY(1.2); } to { transform: none; } }
  }
}
@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .ticker-track { display: flex; width: max-content; }
  .ticker-row { flex-wrap: nowrap; padding-inline: 0; }
  .ticker-row li { border-right: 2px solid oklch(15% 0.006 165 / 0.35); }
  .ticker-row + .ticker-row { display: flex; }
  .ticker-pause { display: flex; visibility: hidden; }
  .js .ticker-pause { visibility: visible; }
  .js .ticker-track { animation: tick var(--dur-tick) linear infinite; }
  .ticker-track:hover, .ticker:focus-within:not(.is-playing) .ticker-track, .ticker.is-paused .ticker-track { animation-play-state: paused; }
  @keyframes tick { to { transform: translateX(-50%); } }
}
