/* Artemis II · Rekonstruktion · Layout und Komponenten (Tokens in tokens.css) */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: auto; }
body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 370;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }

.skip {
  position: fixed; left: var(--space-md); top: var(--space-md); z-index: 100;
  padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper);
  transform: translateY(-200%); text-decoration: none;
}
.skip:focus-visible { transform: none; }

/* --------------------------------------------------------------- Schrift */
.h2 {
  font-family: var(--font-display);
  font-weight: 420;
  font-size: var(--text-2xl);
  line-height: 1.04;
  letter-spacing: -0.012em;
  margin: 0 0 var(--space-md);
  font-variation-settings: "opsz" 72;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}
.h2--big { font-size: var(--text-3xl); }
.h3 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: var(--text-xl);
  line-height: 1.12;
  margin: 0 0 var(--space-sm);
  font-variation-settings: "opsz" 36;
  text-wrap: balance;
}
.lead {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.3;
  font-weight: 380;
  margin: 0;
  font-variation-settings: "opsz" 36;
  text-wrap: pretty;
}
.body { margin: 0 0 var(--space-md); max-width: 52ch; text-wrap: pretty; color: var(--color-muted); }
.body:last-child { margin-bottom: 0; }
.credit { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.01em; color: var(--color-neutral); margin: 0; }
.launch__credit, .entry__credit, .entry__photo figcaption, .hero__credit { color: var(--color-muted); text-shadow: 0 1px 10px var(--color-halo-text); }

/* --------------------------------------------------------------- Kopf */
.mast {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--space-md) var(--gutter);
  pointer-events: none;
}
.mast > * { pointer-events: auto; }
.mast__mark {
  font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500;
  text-decoration: none; letter-spacing: 0.01em; white-space: nowrap;
}
.mast__lang {
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em;
  background: none; border: var(--rule); border-radius: var(--radius-sm);
  padding: 0.35rem 0.6rem; min-height: 2rem; cursor: pointer; white-space: nowrap;
  transition: border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out);
}
.mast__lang:hover { border-color: var(--color-ink); }
.mast__lang:active { transform: translateY(1px); }

/* --------------------------------------------------------------- Bühne */
.stage {
  position: fixed; inset: 0 0 auto 0; width: 100%; height: 100lvh; z-index: 0;
  opacity: 0; transition: opacity 0ms; pointer-events: none;
}
.stage-fallback {
  position: fixed; inset: 0 0 auto 0; height: 100lvh; z-index: 0; opacity: 0; pointer-events: none;
  background-size: cover; background-position: center;
  transition: opacity var(--dur-long) var(--ease-in-out);
}
main { position: relative; z-index: 1; }

/* Seitliche Abdunklung für Lesbarkeit über der 3D-Welt */
.world::before {
  content: ""; position: sticky; top: 0; display: block; height: 100svh; margin-bottom: -100svh;
  background: linear-gradient(90deg, var(--color-scrim) 0%, var(--color-scrim-0) 42%, var(--color-scrim-0) 58%, var(--color-scrim) 100%);
  pointer-events: none;
  opacity: 0.85;
}

/* --------------------------------------------------------------- Telemetrie */
.hud {
  position: fixed; left: var(--gutter); bottom: max(var(--space-lg), env(safe-area-inset-bottom)); z-index: 30;
  font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5;
  font-variant-numeric: tabular-nums; color: var(--color-muted);
  min-width: 17rem; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-long) var(--ease-out);
}
.hud.is-on { opacity: 1; }
.hud__day { color: var(--color-ink); margin-bottom: var(--space-xs); letter-spacing: 0.02em; }
.hud__day b { color: var(--color-accent-ink); font-weight: 500; }
.hud__list { margin: 0; display: grid; gap: 0.1rem; }
.hud__row { display: flex; justify-content: space-between; gap: var(--space-lg); border-top: 1px solid var(--color-rule-soft); padding-top: var(--space-2xs); }
.hud__row dt { color: var(--color-neutral); }
.hud__row dd { margin: 0; color: var(--color-ink); }
.hud__row[hidden] { display: none; }
.hud__status { margin: var(--space-xs) 0 0; color: var(--color-accent-ink); min-height: 1.5em; }

/* --------------------------------------------------------------- Kapitelleiste */
.rail {
  position: fixed; right: var(--gutter); bottom: max(var(--space-lg), env(safe-area-inset-bottom)); z-index: 30;
  opacity: 0; transition: opacity var(--dur-long) var(--ease-out); display: none;
}
.rail.is-on { opacity: 1; }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-lg); }
.rail a {
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-neutral);
  text-decoration: none; white-space: nowrap; padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
.rail a:hover { color: var(--color-ink); }
.rail a[aria-current="true"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }

/* --------------------------------------------------------------- Beschriftungen */
.labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
.label {
  position: absolute; left: 0; top: 0;
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted);
  white-space: nowrap; opacity: 0; transform: translate(-200px, -200px);
  padding-left: 0.9rem;
}
.label::before { content: ""; position: absolute; left: 0; top: 50%; width: 0.6rem; height: 1px; background: var(--color-rule); }
.label--orion { color: var(--color-accent-ink); }
.label--flip { padding-left: 0; padding-right: 0.9rem; }
.label--flip::before { left: auto; right: 0; }

/* --------------------------------------------------------------- Eröffnung */
.hero { position: relative; min-height: 100svh; display: grid; align-items: end; overflow: hidden; isolation: isolate; }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% 60%; z-index: -2; background: var(--color-paper); }
.hero__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--color-scrim-0) 35%, var(--color-shade) 70%, var(--color-paper) 100%); }
.hero__inner {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg);
  padding: var(--space-3xl) var(--gutter) var(--space-2xl);
}
.hero__title {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(2.75rem, 12.5vw, 13rem); white-space: nowrap;
  line-height: 0.86; letter-spacing: -0.03em; margin: 0;
  font-variation-settings: "opsz" 72; overflow-wrap: anywhere; min-width: 0;
}
.hero__lead { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.3; margin: 0; max-width: 30ch; font-weight: 380; }
.hero__note { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted); margin: 0; max-width: 46ch; }
.hero__credit { position: absolute; right: var(--gutter); top: 4.2rem; }
@media (min-width: 60rem) {
  .hero__inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: end; column-gap: var(--space-2xl); }
  .hero__title { grid-column: 1 / -1; }
  .hero__lead { grid-column: 1; }
  .hero__note { grid-column: 2; align-self: end; }
}

/* --------------------------------------------------------------- Crew */
.crew { padding: var(--space-3xl) var(--gutter); background: var(--color-paper); }
.crew__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
.crew__photo { margin: 0; }
.crew__photo img { width: 100%; height: auto; }
.crew__photo figcaption { margin-top: var(--space-xs); }
.crew__list { margin: var(--space-xl) 0 0; display: grid; gap: 0; }
.crew__person { border-top: var(--rule); padding: var(--space-md) 0; display: grid; gap: var(--space-2xs); }
.crew__person dt { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2xs) var(--space-md); }
.crew__name { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.1; }
.crew__role { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-accent-ink); white-space: nowrap; }
.crew__person dd { margin: 0; color: var(--color-muted); max-width: 46ch; }
@media (min-width: 60rem) {
  .crew__grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-2xl); align-items: start; }
  .crew__photo { position: sticky; top: var(--space-2xl); }
}

/* --------------------------------------------------------------- Start */
.launch { position: relative; height: 560svh; background: var(--color-paper); }
.launch__sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.launch__seq { width: 100%; height: 100%; }
.launch__sticky::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, var(--color-shade) 0%, var(--color-scrim-0) 22%, var(--color-scrim-0) 40%, var(--color-scrim) 92%),
    linear-gradient(90deg, var(--color-shade) 0%, var(--color-scrim-0) 55%);
}
.launch__clock {
  position: absolute; right: var(--gutter); top: 4.5rem; z-index: 2;
  display: grid; justify-items: end; gap: var(--space-2xs);
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted);
}
.launch__clock output { font-size: var(--text-2xl); color: var(--color-ink); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.launch__beats { position: absolute; inset: auto var(--gutter) var(--space-2xl) var(--gutter); z-index: 2; }
.launch__credit { position: absolute; left: var(--gutter); top: 4.4rem; z-index: 2; max-width: 30ch; }

.pbeat { position: absolute; left: 0; bottom: 0; max-width: 34rem; opacity: 0; will-change: opacity, transform; }
.pbeat .body { color: var(--color-ink); }

/* --------------------------------------------------------------- 3D-Kapitel */
.world { position: relative; height: calc(var(--len) * 1svh); }
.beat {
  position: absolute; left: 0; right: 0;
  top: calc(var(--at) * (100% - 100svh)); height: 100svh;
  display: flex; align-items: center; padding: var(--space-2xl) var(--gutter);
  pointer-events: none; margin: 0;
}
.beat--right { justify-content: flex-end; }
@media (min-width: 48rem) {
  /* Platz für die Telemetrie unten links */
  .beat { padding-top: 5rem; padding-bottom: 12rem; }
}
.beat__box { max-width: 30rem; pointer-events: auto; text-shadow: 0 1px 18px var(--color-halo-text); }
.beat--photo .beat__box { max-width: min(30rem, 100%); }
.beat--photo img { width: 100%; height: auto; border: var(--rule); }
.beat--photo figcaption { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); }

.stat { margin: 0 0 var(--space-xs); display: flex; align-items: baseline; gap: var(--space-xs); }
.stat__n { font-family: var(--font-display); font-size: var(--text-3xl); line-height: 0.95; letter-spacing: -0.02em; font-variant-numeric: tabular-nums lining-nums; }
.stat__u { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-accent-ink); }

.spec__list { margin: var(--space-md) 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-lg); }
.spec__list div { border-top: var(--rule); padding: var(--space-xs) 0; }
.spec__list dt { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-neutral); }
.spec__list dd { margin: 0; font-family: var(--font-display); font-size: var(--text-xl); font-variant-numeric: tabular-nums lining-nums; }

.reveal-btn {
  margin-top: var(--space-sm); background: none; border: 0; padding: 0.4rem 0; min-height: 2.75rem;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; color: var(--color-accent-ink);
  text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px;
  cursor: pointer; white-space: nowrap;
  transition: color var(--dur-micro) var(--ease-out), text-decoration-color var(--dur-micro) var(--ease-out);
}
.reveal-btn:hover { color: var(--color-ink); }
.reveal-btn:active { transform: translateY(1px); }
.reveal-btn:disabled { opacity: 0.5; cursor: default; }

/* --------------------------------------------------------------- Originalfoto über der Rekonstruktion */
.photo-overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center;
  background: var(--color-overlay); padding: var(--space-2xl) var(--gutter);
  opacity: 0; transition: opacity var(--dur-long) var(--ease-out);
}
.photo-overlay.is-open { opacity: 1; }
.photo-overlay[hidden] { display: none; }
.photo-overlay__fig { margin: 0; max-width: min(1400px, 100%); }
.photo-overlay__fig img { max-height: 76svh; width: auto; margin: 0 auto; }
.photo-overlay__fig figcaption { margin-top: var(--space-sm); color: var(--color-muted); font-size: var(--text-sm); }
.photo-overlay__close {
  position: absolute; top: var(--space-md); right: var(--gutter);
  background: none; border: var(--rule); border-radius: var(--radius-sm);
  padding: 0.5rem 0.8rem; min-height: 2.75rem; cursor: pointer; white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--text-xs);
}
.photo-overlay__close:hover { border-color: var(--color-ink); }

/* --------------------------------------------------------------- Galerie */
.gallery { position: relative; padding: var(--space-3xl) var(--gutter); background: var(--color-paper); }
.gallery__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); margin-top: var(--space-xl); }
.gallery__item { margin: 0; }
.gallery__item img { width: 100%; height: auto; }
.gallery__item figcaption { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--color-muted); max-width: 52ch; }
.gallery > .credit { margin-top: var(--space-xl); }
@media (min-width: 48rem) {
  .gallery__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-xl) var(--space-lg); }
  .gallery__item { grid-column: span 3; }
  .gallery__item--wide { grid-column: 1 / -1; }
}
@media (min-width: 75rem) {
  .gallery__item--wide { grid-column: 1 / span 4; grid-row: span 2; }
  .gallery__item:nth-child(2) { grid-column: 5 / span 2; }
  .gallery__item:nth-child(3) { grid-column: 5 / span 2; }
  .gallery__item:nth-child(4) { grid-column: 1 / span 3; }
  .gallery__item:nth-child(5) { grid-column: 4 / span 3; }
}

/* --------------------------------------------------------------- Wiedereintritt */
.entry { position: relative; height: 420svh; background: var(--color-paper); }
.entry__sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; }
.entry__video { width: 100%; height: 100%; object-fit: cover; object-position: 65% 40%; }
.entry__sticky::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(180deg, var(--color-shade) 0%, var(--color-scrim-0) 22%, var(--color-scrim-0) 40%, var(--color-scrim) 92%), linear-gradient(90deg, var(--color-shade) 0%, var(--color-scrim-0) 55%); pointer-events: none; }
.entry__readout {
  position: absolute; right: var(--gutter); top: 4.5rem; z-index: 2; display: grid; justify-items: end; gap: var(--space-2xs);
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-muted);
}
.entry__readout output { font-size: var(--text-2xl); color: var(--color-ink); font-variant-numeric: tabular-nums; line-height: 1; }
.entry__beats { position: absolute; inset: auto var(--gutter) var(--space-2xl) var(--gutter); z-index: 3; }
.entry__credit { position: absolute; left: var(--gutter); top: 4.5rem; z-index: 2; max-width: 30ch; }
.entry__photo {
  position: absolute; inset: 0; margin: 0; z-index: 1; opacity: 0;
  display: grid; place-items: center; background: var(--color-paper);
}
.entry__photo img { height: 100%; width: 100%; object-fit: cover; object-position: 50% 30%; }
.entry__photo figcaption { position: absolute; left: var(--gutter); top: 4.4rem; z-index: 3; }

/* --------------------------------------------------------------- Bilanz */
.ledger { padding: var(--space-3xl) var(--gutter); background: var(--color-paper); }
.ledger__table { width: 100%; max-width: 64rem; border-collapse: collapse; margin-top: var(--space-xl); font-variant-numeric: tabular-nums lining-nums; }
.ledger__table th, .ledger__table td { border-top: var(--rule); padding: var(--space-md) 0; vertical-align: baseline; }
.ledger__table th { text-align: left; font-weight: 400; color: var(--color-muted); font-size: var(--text-base); padding-right: var(--space-lg); }
.ledger__table td { text-align: right; font-family: var(--font-display); font-size: var(--text-xl); }
.ledger > .credit { margin-top: var(--space-md); }
@media (max-width: 39.99rem) {
  .ledger__table, .ledger__table tbody, .ledger__table tr { display: block; }
  .ledger__table tr { border-top: var(--rule); padding: var(--space-sm) 0; }
  .ledger__table th, .ledger__table td { display: block; border: 0; padding: 0; text-align: left; }
}

/* --------------------------------------------------------------- Ausblick */
.next { padding: var(--space-3xl) var(--gutter) var(--space-2xl); background: var(--color-paper); display: grid; gap: var(--space-lg); }
.next__statement {
  font-family: var(--font-display); font-size: var(--text-3xl); line-height: 1.04; letter-spacing: -0.015em;
  margin: 0; max-width: 20ch; font-weight: 400; text-wrap: balance;
}
.next__body { max-width: 52ch; }

/* --------------------------------------------------------------- Kolophon */
.colophon { position: relative; z-index: 1; background: var(--color-paper-2); padding: var(--space-2xl) var(--gutter); font-size: var(--text-sm); }
.colophon__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-xl); }
.colophon__by { margin: 0 0 var(--space-xs); }
.colophon__by a { text-underline-offset: 0.25em; }
.colophon__note { margin: 0; color: var(--color-muted); max-width: 52ch; }
.colophon__h { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; color: var(--color-neutral); margin: 0 0 var(--space-sm); letter-spacing: 0.04em; }
.colophon__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2xs); }
.colophon__list a { color: var(--color-muted); text-underline-offset: 0.25em; text-decoration-color: var(--color-rule); }
.colophon__list a:hover { color: var(--color-ink); text-decoration-color: currentColor; }
@media (min-width: 60rem) { .colophon__grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); } }

/* --------------------------------------------------------------- Breite Bildschirme */
@media (min-width: 70rem) {
  .rail { display: block; }
}

/* --------------------------------------------------------------- Mobil */
@media (max-width: 47.99rem) {
  .hud { left: var(--space-md); right: var(--space-md); top: 3.3rem; bottom: auto; min-width: 0; font-size: 0.6875rem; line-height: 1.35; }
  .hud__day { margin-bottom: var(--space-2xs); }
  .hud__list { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--space-sm); }
  .hud__row { display: block; padding-top: 0.2rem; }
  .hud__row dd { white-space: nowrap; }
  .hud__row:nth-child(2), .hud__row:nth-child(5) { display: none; }
  .hud__status { margin-top: var(--space-2xs); }
  .world::before { background: linear-gradient(180deg, var(--color-scrim-0) 40%, var(--color-scrim) 100%); }
  .beat { align-items: flex-end; padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom)); }
  .beat--right { justify-content: flex-start; }
  .launch__clock, .entry__readout { top: auto; bottom: auto; top: 3.6rem; }
  .launch__clock output, .entry__readout output { font-size: var(--text-xl); }
  .entry__credit { top: auto; bottom: 50svh; }
  .hero__credit { top: auto; bottom: var(--space-sm); left: var(--gutter); right: var(--gutter); }
  .hero__lead { font-size: var(--text-lg); }
}

/* --------------------------------------------------------------- Ohne JS / ohne Bewegung */
html:not(.js) .pbeat { position: static; opacity: 1; margin-bottom: var(--space-lg); }
html:not(.js) .launch, html:not(.js) .entry { height: auto; }
html:not(.js) .launch__sticky, html:not(.js) .entry__sticky { position: relative; height: auto; }
html:not(.js) .launch__beats, html:not(.js) .entry__beats { position: relative; inset: auto; padding: var(--space-xl) var(--gutter); }

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

/* --------------------------------------------------------------- Abgleich mit dem Originalfoto */
.match {
  position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: var(--color-paper);
}
.match img { width: 100%; height: 100%; object-fit: cover; }
.match__tag {
  position: absolute; left: var(--gutter); top: 4.4rem;
  font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink);
  white-space: nowrap; text-shadow: 0 1px 12px var(--color-halo-text);
}
