/* Totemphonia v2 · base: tokens, fonts, foundation, chrome. See v2/DESIGN.md. */

@font-face { font-family: 'Literata'; src: url('/assets/fonts/literata-200_900-normal.woff2') format('woff2'); font-weight: 200 900; font-style: normal; font-display: swap; } /* titles (Kilian, 2026-10-21: softer than Newsreader) */
@font-face { font-family: 'Literata'; src: url('/assets/fonts/literata-200_900-italic.woff2') format('woff2'); font-weight: 200 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Host Grotesk'; src: url('/assets/fonts/host-grotesk-300_800-normal.woff2') format('woff2'); font-weight: 300 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'OPTIAuvantGothic-DemiBold'; src: url('/assets/fonts/OPTIAuvantGothic-DemiBold.otf') format('opentype'); font-weight: 600; font-style: normal; font-display: swap; } /* v1 header face */
@font-face { font-family: 'Fragment Mono'; src: url('/assets/fonts/fragment-mono-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Colour: two live variables carry every world. Pages and the scroll driver change only these. */
  --paper: #F1F1F1;
  --ink-0: #121212;
  --ground: var(--paper);
  --ink: var(--ink-0);
  --mix: 66%; /* muted = ink mixed into the ground; colour worlds need 92% to keep AA */
  --muted: color-mix(in srgb, var(--ink) var(--mix), var(--ground));
  --line: color-mix(in srgb, var(--ink) 14%, transparent);

  --w-bolivia: #B29F23;
  --w-colombia: #845053;
  --w-berlin: #6F8F73;
  --w-betlem: #7C97AF;

  --f-voice: 'Literata', 'Iowan Old Style', Georgia, serif;
  --f-use: 'Host Grotesk', ui-sans-serif, system-ui, sans-serif;
  --f-data: 'Fragment Mono', ui-monospace, 'SF Mono', monospace;

  --t-statement: clamp(2.6rem, 1.4rem + 4.6vw, 6.2rem);
  --t-title: clamp(2rem, 1.2rem + 3vw, 4rem);
  --t-body: clamp(1rem, 0.96rem + 0.18vw, 1.0625rem);
  --t-ui: 0.8125rem;
  --t-data: 0.75rem;

  --gutter: clamp(1rem, 0.6rem + 1.6vw, 2.5rem);
  --settle: cubic-bezier(0.16, 1, 0.3, 1);

  --z-content: 1;
  --z-chrome: 50;
  --z-menu: 80;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  background: var(--ground);
  color: var(--ink);
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}
body {
  min-height: 100dvh;
  font-family: var(--f-use);
  font-size: var(--t-body);
  line-height: 1.55;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: inherit; font-size: inherit; text-wrap: balance; }
p { text-wrap: pretty; }
i, em { font-style: italic; }
::selection { background: var(--ink); color: var(--ground); }

:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 4px; }
#main:focus { outline: none; }
.skip {
  position: fixed; left: var(--gutter); top: var(--gutter); z-index: calc(var(--z-menu) + 1);
  padding: 0.55em 0.9em; background: var(--ink); color: var(--ground); font-size: var(--t-ui);
  translate: 0 -200%;
}
.skip:focus-visible { translate: 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.pending { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 1.5 7; vector-effect: non-scaling-stroke; }

/* Lenis */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }

/* ---------- Corner chrome: quiet, never collides with the axis ---------- */
.chrome {
  position: fixed; inset: 0 0 auto; z-index: var(--z-chrome);
  display: flex; justify-content: space-between; align-items: baseline;
  padding: calc(var(--gutter) * 0.8) var(--gutter);
  font-size: var(--t-ui); letter-spacing: 0.01em;
  pointer-events: none;
  /* milky glass, as in v1: the page moves behind the header */
  background: color-mix(in srgb, var(--ground) 4%, transparent);
  -webkit-backdrop-filter: blur(13px) saturate(0.7); backdrop-filter: blur(13px) saturate(0.7);
}
body:has(.place) .chrome { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; } /* the rooms: no glass over the plate (v1) */
.chrome a, .chrome button { pointer-events: auto; position: relative; padding: 0.4rem 0.3rem; margin: -0.4rem -0.3rem; } /* ≥ 24 px targets */
.wordmark { font-family: 'OPTIAuvantGothic-DemiBold', var(--f-use); font-size: 1rem; text-transform: uppercase; letter-spacing: 0; } /* as in v1 */
.chrome__r { display: flex; gap: 1.75rem; align-items: baseline; }
.lang { display: flex; gap: 0.6rem; }
.lang a { color: var(--muted); transition: color 0.3s; }
.lang a[aria-current] { color: var(--ink); }
@media (hover: hover) { .lang a:hover { color: var(--ink); } }
.menu-btn { font-weight: 500; position: relative; }
.sound-btn { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--muted); transition: color 0.3s; }
.sound-btn::before { content: ''; width: 0.5rem; height: 0.5rem; border-radius: 50%; border: 1px solid currentColor; transition: background-color 0.3s, scale 0.5s var(--settle); }
.sound-btn:focus-visible::before { scale: 1.45; }
@media (hover: hover) { .sound-btn:hover::before { scale: 1.45; } } /* the dot swells like a call */
/* While sound is off, the dot breathes and sends a faint ring: there is something to hear here. */
.sound-btn[aria-pressed="false"]::before { animation: tp-breathe 3.2s ease-in-out infinite; }
@keyframes tp-breathe {
  0% { scale: 1; box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  45% { scale: 1.3; background: color-mix(in srgb, currentColor 30%, transparent); }
  70% { box-shadow: 0 0 0 0.45rem transparent; }
  100% { scale: 1; box-shadow: 0 0 0 0 transparent; }
}
.sound-btn[aria-pressed="true"] { color: var(--ink); }
.sound-btn[aria-pressed="true"]::before { background: currentColor; }
.sound-btn:focus-visible { color: var(--ink); }
@media (hover: hover) { .sound-btn:hover { color: var(--ink); } }
.tag { font-family: var(--f-use); font-weight: 500; font-size: max(0.625rem, 0.36em); letter-spacing: 0.06em; vertical-align: 1.05em; margin-left: 0.4em; color: var(--muted); font-style: normal; }
.menu-btn::after, .wordmark::after, .lang a::after, .foot__links a::after, .menu__more a::after {
  content: ''; position: absolute; left: 0.3rem; right: 0.3rem; bottom: 0.2rem; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--settle);
}
.menu-btn:focus-visible::after, .wordmark:focus-visible::after, .lang a:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) { .menu-btn:hover::after, .wordmark:hover::after, .lang a:hover::after { transform: scaleX(1); } }

/* Data: only real measurements are set in mono */
.data { display: flex; flex-wrap: wrap; gap: 0.35rem 1.4rem; font-family: var(--f-data); font-size: var(--t-data); font-variant-numeric: tabular-nums; color: var(--muted); }

/* ---------- Menu: the totem index again, as a dialog ---------- */
.menu {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; border: 0; padding: 0;
  background: var(--paper); color: var(--ink-0);
  z-index: var(--z-menu);
}
.menu::backdrop { background: transparent; }
.menu__in { min-height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: calc(var(--gutter) * 3) var(--gutter) var(--gutter); }
.menu__h { font-family: var(--f-voice); font-size: var(--t-title); font-weight: 300; letter-spacing: -0.02em; }
.menu__list { align-self: center; display: grid; gap: 0.9rem; margin: 2rem 0; }
.menu__entry { display: inline-grid; grid-template-columns: 1.7rem auto; gap: 1rem; align-items: center; padding: 0.15rem 0; }
.menu__name { font-family: var(--f-voice); font-size: clamp(1.35rem, 1.1rem + 1vw, 2rem); font-weight: 300; letter-spacing: -0.01em; }
.menu__entry:focus-visible .menu__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
@media (hover: hover) { .menu__entry:hover .menu__name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; } }
.menu__disc .em { width: 1.7rem; height: 1.7rem; fill: currentColor; }
.menu__members { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; margin: 0.2rem 0 0 2.7rem; font-size: var(--t-ui); color: color-mix(in srgb, var(--ink-0) 62%, var(--paper)); }
.menu__members a { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; }
.menu__members a:focus-visible { color: var(--ink-0); }
@media (hover: hover) { .menu__members a:hover { color: var(--ink-0); } }
.menu .chip .em { fill: currentColor; }
.menu [data-world="bolivia"] .chip { color: var(--w-bolivia); }
.menu [data-world="colombia"] .chip { color: var(--w-colombia); }
.menu [data-world="berlin"] .chip { color: var(--w-berlin); }
.menu [data-world="betlem"] .chip { color: var(--w-betlem); }
.menu__more { display: flex; flex-wrap: wrap; gap: 0.6rem 2rem; font-size: var(--t-ui); }
.menu__more a { position: relative; }
.menu__more a:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) { .menu__more a:hover::after { transform: scaleX(1); } }
.menu__close { position: absolute; top: calc(var(--gutter) * 0.8); right: var(--gutter); font-size: var(--t-ui); font-weight: 500; }

/* ---------- Footer ---------- */
.foot {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem var(--gutter);
  padding: calc(var(--gutter) * 2) var(--gutter) var(--gutter);
  font-size: var(--t-ui);
}
/* the studio's stone, its signature above the name (drawn grain and all, as it is) */
.foot__mark { grid-column: 1; grid-row: 1; width: 3rem; height: auto; margin: 0 0 0.9rem -0.15rem; }
.foot__name { font-family: var(--f-voice); font-size: 1.125rem; grid-column: 1; grid-row: 2; }
.foot__line { color: var(--muted); grid-column: 1; grid-row: 3; }
.foot__links { grid-column: 2; grid-row: 1 / span 3; justify-self: end; align-self: end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem 1.75rem; }
.foot__links a { position: relative; color: var(--muted); transition: color 0.3s; padding: 0.4rem 0.2rem; margin: -0.4rem -0.2rem; }
.foot__links a::after { left: 0; right: 0; bottom: 0.2rem; }
.foot__links a:focus-visible::after { transform: scaleX(1); }
@media (hover: hover) { .foot__links a:hover::after { transform: scaleX(1); } }
.foot__links a:focus-visible { color: var(--ink); }
@media (hover: hover) { .foot__links a:hover { color: var(--ink); } }

@media (max-width: 640px) {
  .chrome__r { gap: 1.1rem; }
  .foot { grid-template-columns: 1fr; }
  .foot__links { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 1rem; }
  .foot__mark { width: 2.6rem; }
  .menu__members { margin-left: 2.7rem; }
}
/* the start page on a phone: Klang sits under the language and the index, so the wordmark keeps its line (Kilian) */
@media (max-width: 520px) {
  .chrome__r:has(.sound-btn) { display: grid; grid-template-columns: auto auto; justify-items: end; align-items: baseline; column-gap: 1.1rem; row-gap: 1rem; }
  .chrome__r .sound-btn { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- Touch (Kilian: "optimized for touch") ----------
   Hover effects live in @media (hover: hover), so a tap never leaves one stuck. Here: no grey flash on a tap, no
   double-tap zoom on links and buttons, a press you can see, and fingertip-tall targets in the header (taller only:
   wider ones would overlap DE and EN). */
html { -webkit-tap-highlight-color: transparent; }
a, button { touch-action: manipulation; }
@media (hover: none) { a:active, button:active { opacity: 0.55; } }
@media (pointer: coarse) { .chrome a, .chrome button { padding-block: 0.65rem; margin-block: -0.65rem; } }

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

/* ---------- Place pages wear paper; their colour marks only the place name and the playing track (Kilian) ---------- */

/* ---------- Page transitions: OFF until verified in a visible browser. ----------
   Headless Chromium (shell and full) stalls rendering after ANY cross-document view transition, even between two bare
   pages, so the emblem → plate morph could not be verified here. Re-enable with: @view-transition { navigation: auto; } */
::view-transition-group(*) { animation-duration: 0.8s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* ---------- Player: brutalist, minimal. v1 pixel icons; a solid bar; nothing else. ---------- */
:root { --bar-h: 4.2rem; }
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-chrome); height: var(--bar-h);
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(1rem, 2.5vw, 2rem); align-items: center;
  padding: 0 var(--gutter); color: var(--ink);
  /* the same milky glass as the header: the sand stays faintly visible behind the bar */
  background: color-mix(in srgb, var(--ground) 4%, transparent);
  -webkit-backdrop-filter: blur(13px) saturate(0.7); backdrop-filter: blur(13px) saturate(0.7);
}
.player[hidden] { display: grid; visibility: hidden; } /* its space stays reserved: nothing above it moves */
.player__toggle { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; margin: -0.4rem; }
/* brutalist and minimal: a solid triangle, two solid bars, square ends */
.player__icon { width: 20px; height: 20px; fill: currentColor; transition: scale 0.4s var(--settle); }
.player__icon .i-pause, .player.is-playing .player__icon .i-play { display: none; }
.player.is-playing .player__icon .i-pause { display: inline; }
.player__toggle:focus-visible .player__icon { scale: 1.17; }
@media (hover: hover) { .player__toggle:hover .player__icon { scale: 1.17; } }
.player__seek {
  --p: 0%; -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer;
}
.player__seek::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / var(--p) 100% no-repeat, linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 1px no-repeat;
}
.player__seek::-moz-range-track {
  height: 10px;
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / var(--p) 100% no-repeat, linear-gradient(var(--ink), var(--ink)) 0 50% / 100% 1px no-repeat;
}
.player__seek::-webkit-slider-thumb { -webkit-appearance: none; width: 2px; height: 22px; margin-top: -6px; background: var(--ink); border: 0; border-radius: 0; }
.player__seek::-moz-range-thumb { width: 2px; height: 22px; background: var(--ink); border: 0; border-radius: 0; }
.player__seek:focus-visible { outline: 1.5px solid var(--ink); outline-offset: 6px; }
.player__time { font-family: var(--f-data); font-size: var(--t-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .player[hidden] { display: none; } } /* its slot is reserved by fixed offsets anyway */
