@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin-wdth.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Plex Mono";
  src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --night: #0e0f12;
  --on-night: #f3f2ee;
  --on-night-2: #a9adb4;
  --on-night-3: #7d828a;
  --paper: #f3f2ee;
  --ink: #15171c;
  --muted: #50555e;
  --signal: #d2401e;
  --signal-text: #e8573a;
  --glass-fill: rgb(22 24 28 / 0.34);
  --glass-edge: rgb(243 242 238 / 0.16);
  --glass-blur: blur(16px) saturate(1.3);
  --gutter: clamp(20px, 4vw, 56px);
  /* text and touch targets stay clear of the notch and the rounded corners; pictures run to the edge */
  --gutter-l: max(var(--gutter), env(safe-area-inset-left));
  --gutter-r: max(var(--gutter), env(safe-area-inset-right));
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --text: var(--on-night);
  --text-2: var(--on-night-2);
  color-scheme: dark;
}
.is-paper {
  --signal-text: #b23417;
  --text: var(--ink);
  --text-2: var(--muted);
  --glass-fill: rgb(243 242 238 / 0.55);
  --glass-edge: rgb(21 23 28 / 0.12);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--night); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100svh; background: var(--night); color: var(--on-night);
  font-family: var(--font); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--gutter-l); top: -100px; z-index: 20; padding: 10px 16px; border-radius: 999px;
  background: var(--on-night); color: var(--ink); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 16px; }

/* ---------- 3D world ---------- */

.world { position: fixed; inset: 0 0 auto; width: 100%; height: 100lvh; display: none; z-index: 0; }
.gl .world { display: block; }
main, .foot { position: relative; z-index: 1; }

/* Safari 26 paints its status bar and toolbar in the colour of fixed elements along the screen edges; these two
   keys carry the colour of the picture next to them (set by js/world.js), so the bars continue the image.
   Measured on iOS 26.5: under 6 px Safari ignores them, under 12 px it takes their colour once and never updates it. */
.edge { position: fixed; left: 0; right: 0; height: 12px; z-index: 11; pointer-events: none; display: none; }
.edge--top { top: 0; }
.edge--bottom { bottom: 0; }
.gl.edge-keys .edge { display: block; }

/* Glass: blurs the live 3D image behind it */
.glass {
  background: var(--glass-fill);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.1), 0 8px 30px rgb(0 0 0 / 0.18);
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out);
}

/* ---------- HUD ---------- */

.hud {
  position: fixed; inset: 0 0 auto; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) var(--gutter-r) 0 var(--gutter-l); pointer-events: none;
}
.hud > * { pointer-events: auto; }
.pill {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; color: var(--text); text-decoration: none; font: 500 0.875rem/1 var(--font); letter-spacing: 0.01em;
  transition: transform 160ms var(--ease-out), color 400ms var(--ease-out);
}
.pill::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; background: rgb(243 242 238 / 0.08);
  opacity: 0; transition: opacity 200ms var(--ease-out); pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .pill:hover::after { opacity: 1; } }
.pill:active { transform: scale(0.97); }
.hud-logo img { display: block; height: 17px; width: auto; }
.hud-logo .logo-on-paper, .is-paper .hud-logo .logo-on-night { display: none; }
.is-paper .hud-logo .logo-on-paper { display: block; }
.hud-contact .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }

.hud-foot {
  position: fixed; inset: auto 0 0; z-index: 10; display: flex; justify-content: space-between; align-items: end; gap: 16px;
  padding: 0 var(--gutter-r) calc(22px + env(safe-area-inset-bottom)) var(--gutter-l); pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}
.label { margin: 0; font: 500 0.6875rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.beat { display: inline-flex; align-items: center; gap: 7px; }
.beat i {
  display: block; width: 7px; height: 7px; border-radius: 2px; background: color-mix(in srgb, var(--text) 22%, transparent);
  transition: background-color 90ms linear, transform 180ms var(--ease-out);
}
.beat i:first-of-type { margin-left: 6px; }
.beat i.is-on { background: var(--signal); transform: scale(1.3); }

/* ---------- Sections ---------- */

.stage { position: relative; }
/* nothing in the copy may widen the page */
main { overflow-x: clip; }
.stage--hero {
  min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end;
  padding: 104px var(--gutter-r) calc(72px + env(safe-area-inset-bottom)) var(--gutter-l);
}
.stage--strecke { height: 440svh; }
.stage--rechnung { height: 260svh; }
.stage--bereiche { height: 260svh; }
.stage--takt { height: 300svh; }
.stage--grundsatz { height: 240svh; }
.stage--kontakt { height: 170svh; }
.stage-pin {
  position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end; gap: 24px;
  padding: 96px var(--gutter-r) calc(72px + env(safe-area-inset-bottom)) var(--gutter-l);
}

/* the mark as a still drawing when there is no WebGL */
.mark-still {
  display: block; width: min(78vw, 880px); height: auto; margin: 0 auto 8vh;
  fill: none; stroke: var(--on-night); stroke-width: 130; stroke-linejoin: miter; stroke-miterlimit: 4;
}
.mark-still .red { stroke: var(--signal); }
.gl .mark-still { display: none; }

.stage-copy {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 14px; max-width: 40rem; min-width: 0; color: var(--text);
}
.stage-copy > * { margin: 0; max-width: 100%; }
/* pinned copy never runs off the screen: on short screens it scrolls inside itself instead of being cut */
.gl .stage-pin .stage-copy {
  max-height: calc(100svh - 96px - 72px - env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: auto;
  scrollbar-width: none; padding: 6px; margin: -6px;
}
.gl .stage-pin .stage-copy::-webkit-scrollbar { display: none; }
/* a soft local shade keeps the copy readable over the moving scene; it fades out inside the copy's own box */
.gl .stage-copy {
  background: radial-gradient(farthest-side at 42% 56%, color-mix(in srgb, var(--night) 58%, transparent),
    color-mix(in srgb, var(--night) 34%, transparent) 62%, transparent);
}
.gl.is-paper .stage-copy { background: none; }
/* while the world turns between night and paper neither shade fits the ground behind it */
html.gl.is-turning .stage-copy { background: none; }

.word {
  font-weight: 350; font-stretch: 100%; font-size: clamp(2.8rem, 6.6vw, 6.75rem); line-height: 0.92;
  letter-spacing: -0.045em; color: var(--text); text-wrap: balance;
}
.word .ln, .word--statement .ln { display: block; }
.word--hero { font-size: clamp(2.6rem, 5.6vw, 6rem); }
.word--statement { font-size: clamp(2.6rem, 6.2vw, 6.5rem); }
.line { max-width: 34ch; font-size: clamp(1rem, 1.3vw, 1.1875rem); line-height: 1.5; color: var(--text-2); text-wrap: pretty; }
.stage--hero .line { max-width: 44ch; }
.line--small { font-size: 1rem; }
.label + .word { margin-top: -2px; }

/* copy arrives with its section (the page decides which one is on screen) */
.gl .stage-pin .stage-copy, .gl .slab {
  opacity: 0; transform: translateY(18px);
  transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out);
}
.gl .is-active .stage-copy, .gl .is-active .slab { opacity: 1; transform: none; }
.gl .stage-pin .stage-copy:focus-within, .gl .slab:focus-within { opacity: 1; transform: none; }

/* ---------- shared controls ---------- */

button { font: inherit; color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--glass-edge); background: var(--glass-fill); color: var(--text-2);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  font: 500 0.9375rem/1 var(--font); letter-spacing: 0.005em;
  transition: transform 160ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out), background-color 200ms var(--ease-out);
}
.chip[aria-pressed="true"] {
  color: var(--text); border-color: color-mix(in srgb, var(--text) 70%, transparent);
  background: color-mix(in srgb, var(--text) 12%, var(--glass-fill));
}
.chip[aria-pressed="true"]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 2px;
  background: var(--signal); vertical-align: 0.12em;
}
@media (hover: hover) and (pointer: fine) { .chip:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 45%, transparent); } }
.chip:active, .ghost:active, .primary:active, .step-btn:active, .step-head:active { transform: scale(0.97); }
.chooser { display: grid; gap: 10px; margin-top: 6px; }
.chooser-q { margin: 0; font-weight: 500; font-size: 1.0625rem; color: var(--text); }
.hint { margin: 0; font-size: 0.9375rem; color: var(--text-2); }
.hero-foot { margin-top: 10px; text-transform: none; letter-spacing: 0.04em; }
html:not(.js) .chooser { display: none; }

/* secondary actions: underlined words, never filled */
.ghost {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text); font: 500 0.9375rem/1.2 var(--font); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 6px; text-decoration-color: color-mix(in srgb, var(--text) 45%, transparent);
  transition: transform 160ms var(--ease-out), text-decoration-color 200ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .ghost:hover { text-decoration-color: var(--signal); } }
.ghost[aria-disabled="true"] { color: var(--text-2); cursor: default; text-decoration-color: transparent; }
.ghost[aria-disabled="true"]:active { transform: none; }

/* the one filled action of the page; white on #b23417 is 6.2:1 (5.2:1 with the hover veil), on --signal it would drop to 4.1:1 on hover */
.primary {
  position: relative; justify-self: start; display: inline-flex; align-items: center; min-height: 54px; padding: 0 28px;
  border-radius: 999px; background: #b23417; color: #fff; text-decoration: none; font: 600 1.0625rem/1 var(--font); letter-spacing: 0.005em;
  transition: transform 160ms var(--ease-out);
}
.primary::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgb(255 255 255 / 0.1);
  opacity: 0; transition: opacity 200ms var(--ease-out); pointer-events: none;
}
@media (hover: hover) and (pointer: fine) { .primary:hover::after { opacity: 1; } }
.primary:focus-visible { outline-color: var(--on-night); }

/* ---------- 2 · strecke ---------- */

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 0; list-style: none; font-size: 0.9375rem; color: var(--text-2); }
.legend-item { display: inline-flex; align-items: center; gap: 8px; }
.legend-item b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.mark { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--text); }
[data-fate="weg"] > .mark { width: 14px; height: 2px; border-radius: 1px; background: var(--signal-text); }
[data-fate="auto"] > .mark { background: var(--signal); }
.reason { min-height: 3em; max-width: 40ch; font-size: 1rem; line-height: 1.5; color: var(--text); }
.reason:empty { min-height: 3em; }
html:not(.js) .reason { display: none; }

.step-list { display: grid; gap: 6px; padding: 0; list-style: none; }
.step { display: grid; gap: 2px; }
.step-btn {
  position: relative; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; min-height: 44px; padding: 6px 14px;
  border-radius: 12px; border: 1px solid var(--glass-edge); background: var(--glass-fill); cursor: pointer; text-align: left;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  font: 500 0.9375rem/1.2 var(--font); color: var(--text);
  transition: transform 160ms var(--ease-out), color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}
.step-btn::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 2px; border: 1px solid var(--text-2); }
.step-fate { font: 500 0.6875rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.step-reason { font-size: 0.9375rem; line-height: 1.45; color: var(--text-2); padding-left: 15px; }
.step[data-fate="weg"] .step-label { color: var(--signal-text); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.step[data-fate="weg"] .step-btn::before { width: 10px; height: 2px; border: 0; border-radius: 1px; background: var(--signal-text); }
.step[data-fate="auto"] .step-btn::before { border: 0; background: var(--signal); }
.step[data-fate="mensch"] .step-btn::before { border: 0; background: var(--text); }
.step[data-fate="mensch"] .step-btn { border-color: color-mix(in srgb, var(--text) 55%, transparent); }
@media (hover: hover) and (pointer: fine) { .step-btn:hover { border-color: color-mix(in srgb, var(--text) 45%, transparent); } }
/* with JS the reason shows in the line above; the list keeps it for screen readers */
.js .step-reason, .js .step:not(.is-shown) .step-reason { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.note { text-transform: none; letter-spacing: 0.04em; max-width: 40ch; }

/* narrow screens: the stations in the world carry numbers, so the list numbers its steps the same way */
.step-list { counter-reset: schritt; }
.step { counter-increment: schritt; }
@media (max-width: 759px) {
  .step-label::before { content: counter(schritt); margin-right: 0.55em; font: 500 0.75rem/1 var(--mono); color: var(--text-2); }
}

/* with the world on a wide screen the eleven turns carry the labels: the list waits for the keyboard */
@media (min-width: 760px) {
  .gl .step-list:not(:focus-within) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .gl .step-list:focus-within { grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); width: 100%; }
}

/* ---------- 3 · rechnung ---------- */

.sliders { display: grid; gap: 14px; width: min(100%, 30rem); }
.slider { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 12px; }
.slider label { font-size: 1rem; color: var(--text-2); }
.slider output { font: 500 1.125rem/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
input[type="range"] {
  --fill: 0%;
  grid-column: 1 / -1; width: 100%; height: 44px; margin: 0; background: none; cursor: pointer;
  -webkit-appearance: none; appearance: none; touch-action: pan-y;
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(var(--text), var(--text)) 0 / var(--fill) 100% no-repeat, color-mix(in srgb, var(--text) 22%, transparent);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--text) 22%, transparent); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--text); }
/* the grip is 44 px to the finger, 22 px to the eye */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 44px; height: 44px; margin-top: -20px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--text) 0 10px, color-mix(in srgb, var(--text) 30%, transparent) 10.5px 11.5px, transparent 12px);
  transition: transform 160ms var(--ease-out);
}
input[type="range"]::-moz-range-thumb {
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: radial-gradient(circle, var(--text) 0 10px, color-mix(in srgb, var(--text) 30%, transparent) 10.5px 11.5px, transparent 12px);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"]:focus-visible::-webkit-slider-thumb {
  background: radial-gradient(circle, var(--text) 0 10px, transparent 10.5px 12px, var(--signal) 12.5px 14.5px, transparent 15px);
}
input[type="range"]:focus-visible::-moz-range-thumb {
  background: radial-gradient(circle, var(--text) 0 10px, transparent 10.5px 12px, var(--signal) 12.5px 14.5px, transparent 15px);
}
.result { font-size: 1.125rem; color: var(--text); }
.result b { font-weight: 600; font-variant-numeric: tabular-nums; }
[data-hours] { font-variant-numeric: tabular-nums; }

/* ---------- 4 · bereiche and the questions: one list of disclosures ---------- */

.areas, .faq-plate { display: grid; width: min(100%, 34rem); }
.areas details, .faq-plate details { border-top: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.areas details:last-child, .faq-plate details:last-child { border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent); }
.areas summary, .faq-plate summary {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 8px 0;
  cursor: pointer; list-style: none; font-weight: 500; font-size: 1.0625rem; line-height: 1.3; color: var(--text);
}
.areas summary::-webkit-details-marker, .faq-plate summary::-webkit-details-marker { display: none; }
.areas summary::after, .faq-plate summary::after {
  content: "+"; flex: none; font: 400 1.25rem/1 var(--mono); color: var(--text-2); transition: transform 200ms var(--ease-out);
}
details[open] > summary::after { transform: rotate(45deg); }
.areas details > p, .faq-plate details > p { margin: 0 0 14px; max-width: 46ch; color: var(--text-2); line-height: 1.5; }
.areas summary:focus-visible, .faq-plate summary:focus-visible { outline-offset: 2px; border-radius: 4px; }

.film { margin: 2px 0 16px; display: grid; gap: 8px; width: min(100%, 20rem); }
.film video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }
.film figcaption { font-size: 0.875rem; line-height: 1.45; color: var(--text-2); }

/* ---------- 5 · takt ---------- */

.steps { margin: 0; padding: 0; list-style: none; display: grid; width: min(100%, 34rem); }
.steps li { display: grid; }
.step-head {
  display: flex; align-items: baseline; gap: 14px; min-height: 44px; padding: 8px 0; border: 0; background: none; cursor: pointer;
  text-align: left; color: var(--text-2); transition: color 200ms var(--ease-out), transform 160ms var(--ease-out);
}
.step-n { font: 500 0.8125rem/1.6 var(--mono); color: var(--signal-text); min-width: 1.2rem; }
.step-head b { font-weight: 500; font-size: 1.25rem; }
.steps li.is-current .step-head { color: var(--text); }
@media (hover: hover) and (pointer: fine) { .step-head:hover { color: var(--text); } }
.step-text { margin: 0 0 8px; padding-left: calc(1.2rem + 14px); max-width: 44ch; font-size: 1rem; line-height: 1.5; color: var(--text-2); }
.js .steps li:not(.is-current) .step-text { display: none; }

/* ---------- 6 · grundsatz ---------- */

.card { margin-top: 10px; max-width: 34rem; padding: 18px 22px 20px; border-radius: 20px; display: grid; gap: 10px; }
.code { margin: 0; min-height: 1.6em; font: 400 clamp(0.9375rem, 1.3vw, 1.125rem)/1.5 var(--mono); color: var(--text); overflow-wrap: anywhere; }
.code code { font: inherit; }
.code code.is-typing::after { content: "▍"; color: var(--signal); margin-left: 1px; }
.nots-title { margin-top: 10px; }
.nots { display: grid; gap: 4px; padding: 0; list-style: none; font-size: clamp(1.0625rem, 1.4vw, 1.25rem); color: var(--text); }
.nots li::before { content: ""; display: inline-block; width: 12px; height: 2px; margin: 0 12px 0.3em 0; background: var(--signal-text); vertical-align: middle; }

/* ---------- 7 · kontakt ---------- */

.stage--kontakt .stage-pin { align-content: center; }
.slab { justify-self: start; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 16px; max-width: min(100%, 36rem); padding: clamp(24px, 3vw, 40px) clamp(24px, 3.4vw, 44px); border-radius: 28px; color: var(--text); }
.slab > * { margin: 0; }
.slab > .label:first-child { font-size: 0.8125rem; color: var(--text); }
.big { font-weight: 350; font-size: clamp(2.2rem, 4.6vw, 4.5rem); line-height: 0.95; letter-spacing: -0.04em; }
.summary { display: grid; gap: 4px; }
.summary[hidden] { display: none; }
.summary-line { margin: 0; font-size: 1rem; line-height: 1.45; color: var(--text); }
.small { font-size: 0.9375rem; color: var(--text-2); }
.mail { color: var(--text); text-underline-offset: 4px; text-decoration-thickness: 1px; }
.small .mail { display: inline-block; padding: 10px 0; margin: -10px 0; }

.faq { position: relative; padding: 0 var(--gutter-r) 96px var(--gutter-l); }
.faq-plate { width: min(100%, 44rem); padding: clamp(22px, 3vw, 36px) clamp(22px, 3.4vw, 40px); border-radius: 28px; color: var(--on-night); }
.faq-title { margin: 0 0 12px; font: 500 0.8125rem/1.4 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.faq-plate summary, .faq-plate details { color: var(--on-night); border-color: rgb(243 242 238 / 0.14); }
.faq-plate details > p { color: var(--on-night-2); }

/* labels pinned into the 3D scene */
.tags { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.tag3d {
  position: absolute; left: 0; top: 0; translate: -50% -50%; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  font: 500 0.6875rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text);
  background: var(--glass-fill); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  opacity: 0; transition: opacity 300ms var(--ease-out), color 300ms var(--ease-out);
}
.tag3d.is-on { opacity: 1; }
/* aligned to a hairpin instead of centred on a point; on upright phones the turn names lie bare on the ground */
.tag3d--start { translate: 0 -50%; }
.tag3d--end { translate: -100% -50%; }
.tag3d--map {
  padding: 0 2px; background: none; border-color: transparent; text-shadow: 0 0 2px var(--night), 0 0 6px var(--night);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
.tag3d.is-cut { color: var(--signal-text); text-decoration: line-through; }
.tag3d.is-on.is-cut { opacity: 0.85; }

/* labels the visitor can press (strecke turns, bereiche layers): js/world.js renders them as
   <button class="tag3d tag3d--btn" tabindex="-1" data-fate="weg|auto|mensch"> inside the aria-hidden layer.
   Pointer and touch only; keyboard and screen readers use the lists in the copy. The hit area is at least 44 px. */
.tag3d--btn { pointer-events: auto; cursor: pointer; font-family: var(--mono); }
.tag3d--btn::before { content: ""; position: absolute; inset: 50% auto auto 50%; width: max(100%, 44px); height: 44px; translate: -50% -50%; }
.tag3d--btn:not(.is-on) { pointer-events: none; }
.tag3d[data-fate="weg"] { color: var(--signal-text); text-decoration: line-through; }
.tag3d[data-fate="auto"]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 7px; border-radius: 2px; background: var(--signal); vertical-align: 0.1em; }
.tag3d[data-fate="mensch"] { color: var(--on-night); border-color: color-mix(in srgb, var(--on-night) 55%, transparent); }
.tag3d.is-picked { border-color: color-mix(in srgb, var(--text) 70%, transparent); }

/* ---------- Footer ---------- */

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding: 28px var(--gutter-r) calc(72px + env(safe-area-inset-bottom)) var(--gutter-l);
  font: 400 0.75rem/1.5 var(--mono); letter-spacing: 0.04em; color: var(--on-night-3);
  border-top: 1px solid rgb(243 242 238 / 0.08); background: var(--night);
}
.foot p { margin: 0; }
.foot nav { display: flex; gap: 20px; }
.foot a { display: inline-block; min-height: 24px; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .foot a:hover { color: var(--on-night); } }

/* ---------- without WebGL: a plain, readable page ---------- */

html:not(.gl) .stage { height: auto; }
html:not(.gl) .stage-pin { position: static; height: auto; min-height: 0; padding-top: 72px; padding-bottom: 72px; }
html:not(.gl) .tags, html:not(.gl) .hud-foot { display: none; }
html:not(.gl) .stage--hero { min-height: 100svh; }
html:not(.gl) .stage--kontakt .stage-pin { align-content: start; }
html:not(.gl) .faq { padding-top: 0; }
/* the list is the figure here: every step with its fate and, once shown, its reason */
html:not(.gl) .step-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); width: 100%; max-width: 60rem; gap: 10px 16px; }
html:not(.gl) .step.is-shown .step-reason { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
html:not(.gl) .stage-copy { max-width: 60rem; }
html:not(.gl) .stage-copy > .line, html:not(.gl) .stage-copy > .reason { max-width: 44ch; }

/* ---------- Phone: every section a poster, figure above, words below (DESIGN.md, Nachtrag Mobile) ---------- */

@media (max-width: 759px) {
  .stage--hero { padding: 84px var(--gutter-r) calc(60px + env(safe-area-inset-bottom)) var(--gutter-l); }
  .stage-pin { gap: 16px; padding: 84px var(--gutter-r) calc(60px + env(safe-area-inset-bottom)) var(--gutter-l); }
  .gl .stage-pin .stage-copy { max-height: calc(100svh - 84px - 60px - env(safe-area-inset-bottom)); }
  .stage-copy { gap: 12px; max-width: none; }
  .word { font-size: clamp(2.4rem, 11.6vw, 4rem); }
  .word--hero { font-size: clamp(2.2rem, 10.4vw, 3.6rem); }
  .word--statement { font-size: clamp(2.1rem, 10vw, 3.6rem); }
  .line { font-size: 1rem; }
  .chooser { margin-top: 2px; }
  .chip { padding: 0 14px; font-size: 0.875rem; }
  .big { font-size: clamp(2rem, 10vw, 3rem); }
  .stage--kontakt .stage-pin { align-content: end; }
  .slab { justify-self: stretch; }
  .primary { justify-self: stretch; justify-content: center; }
  .faq { padding-bottom: 72px; }
  .faq-plate { padding: 22px 20px; }
  .tag3d { font-size: 0.625rem; padding: 4px 8px; }
  .tag3d--map { padding: 0 2px; }
  .hud-name { display: none; }
  .reason { min-height: 3em; font-size: 0.9375rem; }
  .gl .film { width: min(100%, 15rem); }

  /* upright with the world: the mark needs the room above the copy, so the hero keeps to the essentials */
  .gl .stage--hero .chips {
    flex-wrap: nowrap; width: calc(100% + 12px); margin: 0 -6px; padding: 0 6px 2px;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .gl .stage--hero .chips::-webkit-scrollbar { display: none; }
  .gl .stage--hero .chip { flex: none; }
  .gl .stage--hero .hint, .gl .stage--hero .hero-foot { display: none; }

  /* upright with the world: the eleven steps become one row to swipe, the serpentine keeps the space above */
  .gl .step-list {
    display: flex; gap: 6px; width: calc(100% + 12px); margin: 0 -6px; padding: 0 6px 2px;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .gl .step-list::-webkit-scrollbar { display: none; }
  .gl .step { flex: none; scroll-snap-align: start; }
  .gl .step-btn { padding: 0 12px; font-size: 0.875rem; white-space: nowrap; }
  .gl .step-fate { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- phones with the world: fixed copy, and less of it ---------- */
@media (max-width: 759px) {
  /* Pinned copy is fixed instead of sticky. Safari moves sticky boxes while its toolbar slides and during momentum
     scrolling, which shows as twitching type; a fixed box anchored to the top and sized in svh stays where it is.
     The section keeps its height and only spaces the scroll. */
  .gl .stage:not(.stage--kontakt) .stage-pin {
    position: fixed; top: 0; left: 0; right: 0; height: 100svh; padding-bottom: 58px; pointer-events: none;
  }
  /* The fixed copy is never a scroller of its own: a swipe that starts on the words has to move the page. (Safari
     keeps such a swipe inside a fixed box that can scroll, and the page stands still.) So the copy must fit.
     Only the section on screen takes touches; the others stay readable for screen readers and the keyboard
     (js/page.js brings a section on screen when focus lands in it). */
  .gl .stage:not(.stage--kontakt) .stage-pin .stage-copy { pointer-events: none; max-height: none; overflow: visible; }
  .gl .stage.is-active:not(.stage--kontakt) .stage-pin .stage-copy { pointer-events: auto; }
  /* fixed copies share one place on screen: the old one is gone before the new one shows */
  .gl .stage:not(.stage--kontakt):not(.is-active) .stage-pin .stage-copy { transition: opacity 160ms linear, transform 160ms linear; }
  .gl .stage.is-active:not(.stage--kontakt) .stage-pin .stage-copy {
    transition: opacity 420ms var(--ease-out) 160ms, transform 600ms var(--ease-out) 160ms;
  }
  /* The closing section is not pinned at all on phones: the mark comes back together over an empty screen, then
     the card arrives with the page and leaves with it, and the questions follow. Nothing sticky, nothing to twitch. */
  .gl .stage--kontakt { height: auto; padding-top: 30svh; }
  .gl .stage--kontakt .stage-pin { position: relative; height: 100svh; padding-bottom: 58px; }
  /* the card and the questions scroll past the bottom edge: the fixed footer bar is out of their way */
  html.gl:has(.stage--kontakt.is-active) .hud-foot { opacity: 0; }

  /* shorter sections: one swipe moves the picture a good way (three stations, half the tower) */
  .gl .stage--strecke { height: 300svh; }
  .gl .stage--rechnung, .gl .stage--bereiche, .gl .stage--grundsatz { height: 200svh; }
  .gl .stage--takt { height: 220svh; }

  /* the picture carries the page: the copy keeps to the headline, the one control and one line */
  .gl .stage--hero .line,
  .gl .stage--strecke .line, .gl .stage--strecke .note, .gl .stage--strecke .row,
  .gl .stage--rechnung .line, .gl .stage--rechnung .result ~ .label,
  .gl .stage--bereiche .line, .gl .stage--bereiche .areas ~ .label, .gl .stage--bereiche .film,
  .gl .stage--grundsatz .card { display: none; }
  .gl .reason { min-height: 2.9em; }
}

/* phones held sideways: copy in a left column sized by the height, the figure fills the right */
@media (orientation: landscape) and (max-height: 500px) {
  .stage--hero { padding: 66px var(--gutter-r) calc(48px + env(safe-area-inset-bottom)) var(--gutter-l); }
  .stage-pin { gap: 10px; padding: 66px var(--gutter-r) calc(48px + env(safe-area-inset-bottom)) var(--gutter-l); }
  .gl .stage-pin .stage-copy { max-height: calc(100svh - 66px - 48px - env(safe-area-inset-bottom)); }
  .stage-copy, .stage--hero .stage-copy { gap: 8px; max-width: min(40rem, 46vw); }
  .word { font-size: clamp(1.9rem, 12vh, 3.4rem); }
  .word--hero { font-size: clamp(1.7rem, 10vh, 3rem); }
  .word--statement { font-size: clamp(1.7rem, 9vh, 3rem); }
  .line, .line--small { font-size: 0.9375rem; }
  .card { margin-top: 4px; padding: 12px 16px 14px; }
  .step-head b { font-size: 1.0625rem; }
  .stage--kontakt .stage-pin { align-content: end; }
  .slab { justify-self: start; gap: 10px; padding: 18px 22px; }
  .big { font-size: clamp(1.6rem, 9vh, 2.6rem); }
  .tag3d { font-size: 0.625rem; padding: 4px 8px; }
  .gl .step-list:not(:focus-within) {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .gl .step-list:focus-within { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}

@media (max-width: 759px), (orientation: landscape) and (max-height: 500px) {
  /* the copy lies over the near ground, where loose steps look biggest: its local shade holds more of the night */
  .gl .stage-copy {
    background: radial-gradient(farthest-side at 45% 58%, color-mix(in srgb, var(--night) 74%, transparent),
      color-mix(in srgb, var(--night) 50%, transparent) 62%, transparent);
  }
  /* on paper the copy's local shade turns to paper, so steps lying behind the words never meet the ink */
  .gl.is-paper .stage-copy { background: radial-gradient(farthest-side, color-mix(in srgb, var(--paper) 88%, transparent), transparent); }
  /* the fixed footer bar steps aside for the page footer, which then needs no room for it */
  .at-foot .hud-foot { opacity: 0; }
  .foot { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

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