/* site.css – layout and components for all pages; tokens come from tokens.css.
   Breakpoints: mobile < 760 · tablet 760–1099 · desktop ≥ 1100 · header menu sheet < 1200. */

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--text);
  /* A11Y-02: anchors and focus land below the fixed header (K-1: stage.css adds only the travel) */
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-padding-bottom: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-theme) var(--ease-theme), color var(--dur-theme) var(--ease-theme);
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }

/* Display headings break only at soft hyphens (compound joints). */
h1, h2 {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  text-wrap: balance;
  hyphens: manual;
  overflow-wrap: break-word;
}
h1 { font-size: var(--fs-display); font-weight: var(--fw-display); line-height: var(--lh-display); letter-spacing: var(--ls-display); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-h2); line-height: var(--lh-h2); letter-spacing: var(--ls-h2); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-h3); line-height: var(--lh-h3); letter-spacing: var(--ls-h3); text-wrap: balance; }
h4 { font-size: var(--fs-body); font-weight: 650; line-height: 1.4; }
p, li, dd { text-wrap: pretty; overflow-wrap: break-word; }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--selection-bg); color: var(--selection-fg); }
:focus-visible { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-button);
  background: var(--surface-solid);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ----------------------------------------------------------- typography */

.eyebrow, .label, .chapter-mark, .phase-index, .tag-row {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.chapter-mark { display: flex; align-items: center; gap: var(--space-3); color: var(--text); }
.chapter-mark::before { content: ""; flex: none; width: 24px; height: 1px; background: var(--accent); }
.lead { font-size: var(--fs-lead); font-weight: var(--fw-lead); line-height: var(--lh-lead); }
.meta { color: var(--text-muted); font-size: var(--fs-small); font-weight: var(--fw-small); line-height: var(--lh-small); }
.pre-line { white-space: pre-line; }
.period { color: var(--accent); }

.icon, .arrow {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon { width: 16px; height: 16px; stroke-width: 1.4; }
.arrow {
  --arrow-rot: 0deg;
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  margin-left: 0.4em;
  vertical-align: -0.02em;
  stroke-width: 1.5;
  transform: rotate(var(--arrow-rot));
  transition: transform var(--dur-micro) var(--ease-standard);
}
.arrow--ne { --arrow-rot: -45deg; }
.arrow--s { --arrow-rot: 90deg; }
.arrow--n { --arrow-rot: -90deg; }
a:hover .arrow, a:focus-visible .arrow { transform: rotate(var(--arrow-rot)) translateX(2px); }

/* -------------------------------------------------------------- buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-size: var(--fs-small);
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard), color var(--dur-micro) var(--ease-standard);
}
.button .arrow { margin-left: 0; }
.button--primary { background: var(--accent-strong); color: var(--on-accent); }
.button--primary:hover { background: var(--accent-hover); }
.button--quiet { min-height: 40px; padding: 8px 14px; border-color: var(--border); background: transparent; color: var(--text); font-weight: 600; }
.button--quiet:hover, .motion-toggle:hover { background: var(--surface-2); }

.text-link {
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 650;
  text-decoration: underline 1px var(--line-strong);
  text-underline-offset: 5px;
  transition: color var(--dur-micro) var(--ease-standard);
}
.text-link:hover { color: var(--accent); text-decoration-color: currentColor; text-decoration-thickness: 2px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-5); }

/* ------------------------------------------------------ lists and chips */

.ticks, .chips, .facts, .link-list, .legend__list, .phases ol, .chapters__list, .site-nav ul, .site-footer__legal ul, .station-scale ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ticks { display: grid; gap: var(--space-2); }
.ticks li { position: relative; padding-left: 24px; }
.ticks li::before { content: ""; position: absolute; top: 0.8em; left: 0; width: 12px; height: 1px; background: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-chip);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
}
.link-list { display: grid; gap: var(--space-3); justify-items: start; }

/* registration marks: four 10px hair angles */
.reg-marks, .reg-marks > span { position: absolute; inset: 0; pointer-events: none; }
.reg-marks::before, .reg-marks::after, .reg-marks > span::before, .reg-marks > span::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 0 solid var(--line-strong);
}
.reg-marks::before { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.reg-marks::after { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.reg-marks > span::before { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.reg-marks > span::after { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

/* ---------------------------------------------------------------- panel */

.panel {
  position: relative;
  min-width: 0;
  padding: var(--panel-pad);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-panel);
  background: rgba(var(--surface-rgb), var(--glass-alpha-solid));
  box-shadow: var(--shadow-panel);
  transition: background-color var(--dur-theme) var(--ease-theme), opacity var(--dur-panel) var(--ease-standard), transform var(--dur-panel) var(--ease-standard);
}
@media (min-width: 1100px) and (hover: hover) {
  html:not(.tier-low) .panel {
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  }
}

.panel > * + *, .project > * + * { margin-top: var(--space-4); }
.panel > h2 + *, .panel > h3 + *,
.panel > :is(.ticks, .topics, .actions, .tiers, .run-controls, .legend, .phases, .link-list, .chapters, .author, .contact-list, .quote, .roles),
.project > :is(.ticks, .facts, .screenshot, .link-list), .panel > .chapter-mark + .eyebrow { margin-top: var(--space-5); }

.visual-note {
  margin-top: var(--space-5) !important;
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}
.topics { display: grid; gap: var(--space-3); }

/* the story thread "Risiko bestimmt den Aufwand." – one serif line, S1 and the dev-process intro */
.thesis {
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 1.4375rem;
  font-weight: 420;
  line-height: 1.2;
  letter-spacing: -0.005em;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.panel > * + .thesis { margin-top: var(--space-5); }
.thesis + .scope-note { margin-top: var(--space-3); }
.thesis + .visual-note { margin-top: var(--space-4) !important; }

/* --------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  min-height: var(--header-h); /* A11Y-06: grows, never clips */
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-ui) var(--ease-standard);
}
/* The background sits on a pseudo-element: a backdrop-filter on the header itself would
   make it the containing block of the fixed menu sheet. Opaque unless blurred. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface-solid);
  opacity: 0;
  transition: opacity var(--dur-ui) var(--ease-standard);
}
.header-solid .site-header, .nav-open .site-header { border-bottom-color: var(--hairline); }
.header-solid .site-header::before, .nav-open .site-header::before { opacity: 1; }
@media (min-width: 1100px) and (hover: hover) {
  html.header-solid:not(.tier-low):not(.nav-open) .site-header::before {
    background: rgba(var(--surface-rgb), var(--glass-alpha));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  }
}
.no-js .site-header { position: absolute; }

.site-header__inner, .block, .site-end > * {
  width: min(100% - 2 * var(--margin), var(--container));
  margin-inline: auto;
}
.site-header__inner { display: flex; align-items: center; gap: var(--space-6); min-height: calc(var(--header-h) - 1px); } /* + border */

.wordmark { display: flex; flex: none; flex-direction: column; gap: 3px; color: var(--text); line-height: 1.05; text-decoration: none; }
.wordmark__name { font-family: var(--font-serif); font-size: var(--fs-wordmark); font-weight: var(--fw-wordmark); }
.wordmark__biz {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-wordmark-sub);
  font-weight: var(--fw-wordmark-sub);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-menu, .site-tools { display: flex; align-items: center; }
.site-menu { gap: var(--space-5); margin-left: auto; }
.site-tools { flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2) var(--space-3); }
.site-nav + .site-tools { padding-left: var(--space-5); border-left: 1px solid var(--hairline); }
.site-nav ul { display: flex; gap: var(--space-5); }
.site-nav a {
  display: inline-block;
  padding-block: 8px;
  color: var(--text);
  font-size: var(--fs-small);
  font-weight: 550;
  text-decoration: none;
  text-underline-offset: 6px;
}
.site-nav a:hover { color: var(--accent); text-decoration: underline 1px; }

/* segmented controls: language and colour scheme */
.lang-switch, .theme-switch {
  display: inline-flex;
  gap: 2px;
  min-inline-size: 0;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
}
.lang-switch button, .theme-switch__option {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  min-height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease-standard), color var(--dur-micro) var(--ease-standard);
}
.theme-switch__option { font-family: var(--font-sans); font-size: 0.8125rem; letter-spacing: 0; }
.lang-switch button:hover, .theme-switch__option:hover { color: var(--text); }
/* A11Y-03: accent bar on the active entry */
.lang-switch button[aria-pressed="true"], .theme-switch__option:has(input:checked) { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.theme-switch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.theme-switch__option:has(input:focus-visible) { outline: var(--focus-width) solid var(--focus); outline-offset: var(--focus-offset); }

.motion-toggle, .menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-button);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.motion-toggle { min-height: 34px; background: transparent; font-size: 0.8125rem; transition: background-color var(--dur-micro) var(--ease-standard); }
.motion-toggle__play, .motion-toggle.is-paused .motion-toggle__pause { display: none; }
.motion-toggle.is-paused .motion-toggle__play { display: inline; }

.menu-toggle {
  gap: 10px;
  min-height: 40px;
  margin-left: auto;
  padding: 0 14px;
  background: rgba(var(--surface-rgb), var(--glass-alpha-solid));
  font-size: var(--fs-small);
}
.menu-toggle__icon { position: relative; width: 16px; height: 8px; }
.menu-toggle__icon::before, .menu-toggle__icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: transform var(--dur-ui) var(--ease-standard), top var(--dur-ui) var(--ease-standard);
}
.menu-toggle__icon::before { top: 0; }
.menu-toggle__icon::after { top: calc(100% - 1.5px); }
.nav-open .menu-toggle__icon::before, .nav-open .menu-toggle__icon::after { top: calc(50% - 0.75px); transform: rotate(45deg); }
.nav-open .menu-toggle__icon::after { transform: rotate(-45deg); }

@media (min-width: 1200px) {
  .menu-toggle { display: none !important; }
  /* no "dev-/process" breaks; with text spacing the tools wrap instead */
  .site-nav a { white-space: nowrap; }
}
@media (min-width: 1200px) and (max-width: 1279px) {
  /* one row at 1200 px (DE) */
  .site-header__inner { gap: var(--space-5); }
  .site-menu { gap: 20px; }
  .site-nav + .site-tools { padding-left: 20px; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
  /* compact colour scheme segment: icons only, names stay available to assistive tech */
  .site-header .theme-switch__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .site-header .theme-switch__option { padding: 0 7px; }
  .site-nav ul { gap: 20px; }
}
@media (max-width: 1199px) {
  .js .site-menu {
    position: fixed;
    inset: var(--header-h) 0 auto;
    z-index: 19;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-6);
    height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-4) var(--margin) var(--space-7);
    background: var(--surface-solid);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity var(--dur-ui) var(--ease-standard), transform var(--dur-ui) var(--ease-standard), visibility 0s linear var(--dur-ui);
  }
  .nav-open .site-menu { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
  .nav-open body { overflow: hidden; }
  .js .site-nav ul { flex-direction: column; gap: 0; }
  .js .site-nav li + li { border-top: 1px solid var(--hairline); }
  .js .site-nav a { display: block; padding: 14px 0; font-family: var(--font-serif); font-size: 1.5rem; font-weight: 400; line-height: 1.2; }
  .js .site-tools { justify-content: flex-start; row-gap: var(--space-3); padding: var(--space-5) 0 0; border-top: 1px solid var(--hairline); }
  .js .site-nav + .site-tools { padding-left: 0; border-left: 0; }
  .site-tools .motion-toggle, .site-tools .lang-switch button, .site-tools .theme-switch__option { min-height: 40px; }
  .site-tools .lang-switch button { min-width: 44px; }
  /* without JavaScript the navigation wraps below the wordmark */
  .no-js .site-header__inner { flex-wrap: wrap; row-gap: 4px; padding-block: 12px; }
  .no-js .site-menu { flex-basis: 100%; margin-left: 0; }
  .no-js .site-nav ul { flex-wrap: wrap; gap: 0 var(--space-4); }
  /* PRIV-09: in the flow on reading pages (the home hero reserves the space itself) */
  .no-js.page-doc .site-header { position: relative; }
}
/* A11Y-13: short viewports (320 × 256 reflow, landscape phones) get no permanent bar. The header
   stays fixed and slides away once the page is scrolled; switching it to position:absolute made
   Chrome reset the scroll position on rotation to landscape. Keyboard focus brings it back. */
@media (max-height: 420px) {
  html { scroll-padding-top: 16px; }
  .js.header-solid .site-header:not(:focus-within) { transform: translateY(-100%); }
}

/* ----------------------------------------------- station scale & progress */

.station-scale { display: none; }
@media (min-width: 1100px) {
  .station-scale { position: fixed; top: 50%; right: 18px; z-index: 15; display: block; transform: translateY(-50%); }
  /* A11Y-08: ground under digits and the vertical current name; the scale line stays put */
  .station-scale ol {
    position: relative;
    display: grid;
    margin-right: -16px;
    padding: 14px 16px 14px 8px;
    border-radius: var(--radius-button);
    background: rgba(var(--surface-rgb), 0.85);
  }
  .station-scale ol::before { content: ""; position: absolute; top: 28px; right: 16px; bottom: 28px; width: 1px; background: var(--line); }
  .station-scale a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 28px;
    padding-right: 18px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
  }
  .station-scale a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 0;
    width: 10px;
    height: 1px;
    background: var(--line-strong);
    transition: width var(--dur-ui) var(--ease-standard);
  }
  .station-scale a:hover, .station-scale a[aria-current="location"] { color: var(--accent); }
  .station-scale a[aria-current="location"]::after { width: 16px; height: 2px; margin-top: -0.5px; background: var(--accent); }
  .station-scale__label {
    position: absolute;
    top: 50%;
    right: 44px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: var(--radius-chip);
    background: var(--surface);
    color: var(--text);
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(4px, -50%);
    transition: opacity var(--dur-ui) var(--ease-standard), transform var(--dur-ui) var(--ease-standard);
  }
  /* current station: the name runs along the outer side of the scale like a dimension label */
  .station-scale a[aria-current="location"] .station-scale__label {
    right: -15px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    writing-mode: vertical-rl;
    opacity: 1;
    transform: translateY(-50%) rotate(180deg);
  }
  /* A11Y-05 (1.4.13): opaque, hoverable (::after bridges to the digit), Escape → .is-collapsed
     (K-5). Below 1600 px only the entry under pointer/focus – lead decision against "all labels". */
  .station-scale:not(.is-collapsed) li:is(:hover, :focus-within) .station-scale__label {
    right: 44px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    writing-mode: horizontal-tb;
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
  }
  .station-scale__label::after { content: ""; position: absolute; top: -1px; bottom: -1px; left: 100%; width: 16px; }
}
@media (min-width: 1600px) {
  .station-scale:not(.is-collapsed):is(:hover, :focus-within) .station-scale__label {
    right: 44px;
    padding: 3px 7px;
    border: 1px solid var(--line);
    background: var(--surface);
    writing-mode: horizontal-tb;
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
  }
}

.progress-line { position: fixed; inset: var(--header-h) 0 auto; z-index: 18; display: flex; gap: 2px; height: 2px; pointer-events: none; }
.progress-line span { flex: 1; background: var(--hairline); transition: background-color var(--dur-ui) var(--ease-standard); }
.progress-line span.is-done { background: var(--accent); }
.no-js .progress-line, .nav-open .progress-line { display: none; }
@media (max-height: 420px) { .progress-line { display: none; } }
@media (min-width: 1100px) { .progress-line { display: none; } }

/* ------------------------------------------------------------ 3D stage */

.world { position: fixed; top: 0; left: 0; z-index: 0; width: 100vw; height: 100lvh; overflow: hidden; pointer-events: none; }
.world__canvas, .world__poster, .world__labels { position: absolute; inset: 0; }
.world__canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity var(--dur-canvas-in) var(--ease-once); }
.world-ready .world__canvas { opacity: 1; }
.world-settled .world__canvas { transition-duration: var(--dur-cut-in); }
.world-ready.world-cut .world__canvas { opacity: 0; transition: opacity var(--dur-cut-out) linear; }
.world__poster { transition: opacity var(--dur-canvas-in) var(--ease-once), visibility 0s linear var(--dur-canvas-in); }
.world-ready .world__poster { opacity: 0; visibility: hidden; }
.hero-poster { width: 100%; height: 100%; color: var(--line-strong); }
.hero-poster__grid { color: var(--line-faint); }
.hero-poster__ink { color: var(--accent-strong); }
.hero-poster__mark { color: var(--bg); }
.world__labels { overflow: hidden; pointer-events: none; }
.world-label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 3px 7px;
  border-radius: var(--radius-chip);
  background: rgba(var(--surface-rgb), var(--label-chip-alpha));
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-label-3d);
  font-weight: var(--fw-label-3d);
  line-height: var(--lh-label-3d);
  letter-spacing: var(--ls-label-3d);
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--dur-ui) var(--ease-standard);
}
/* printed fields on the contact card: no chip, the text sits on the paper like the ink */
.world-label[data-variant="print"] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--accent-strong);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
:root[data-theme="dark"] .world-label[data-variant="print"] { color: var(--text); }
.world__leaders { color: var(--text-muted); }
.world-label__leader { transition: opacity var(--dur-ui) var(--ease-standard); }
/* static fallbacks: the drawing scrolls away with the hero */
html:not(.has-webgl) .world { position: absolute; width: 100%; }
.no-webgl .world__canvas, .no-webgl .world__labels { display: none; }

/* --------------------------------------------------------------- layout */

main { position: relative; z-index: 1; display: block; }

.block {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  align-content: start;
}
.block > * { grid-column: 1 / -1; }
.stage-window { display: none; }

.station-figure { margin: 0; }
.station-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius-media); }
.station-figure figcaption { max-width: 60ch; margin-top: var(--space-3); color: var(--text-muted); font-size: var(--fs-small); line-height: var(--lh-small); }
.has-webgl .station-figure { display: none; }

/* Block heights, block padding (the camera's scroll lengths) and the mobile stage windows live in
   stage.css (owner: camera/core), linked after this file. Here: only the panel grid. Portrait
   tablets use the stacked layout (E-9, = STACK_MQ in config/blocks.js). */
@media (min-width: 1100px), (min-width: 760px) and (orientation: landscape) {
  .block > .panel { grid-row: 1; }
  [data-panel="left"] > .panel { grid-column: 1 / span 7; }
  [data-panel="right"] > .panel { grid-column: 6 / span 7; }
  /* without the stage the poster sits above the panel */
  .block > .station-figure { grid-row: 1; margin-bottom: var(--space-6); }
  html:not(.has-webgl) .block > .panel { grid-row: 2; }
}
/* V-04: half the width for the scene on landscape tablets */
@media (min-width: 760px) and (max-width: 1099px) and (orientation: landscape) {
  .has-webgl [data-panel="left"] > .panel { grid-column: 1 / span 6; }
  .has-webgl [data-panel="right"] > .panel { grid-column: 7 / span 6; }
}
@media (min-width: 1100px) {
  [data-panel="left"] > .panel { grid-column: 1 / span 5; }
  [data-panel="right"] > .panel { grid-column: 8 / span 5; }
  .block--dp > .panel { grid-column: 1 / span 4; }
  /* posters sit in the free columns next to the panel */
  html:not(.has-webgl) .block > .panel { grid-row: 1; }
  .block > .station-figure { align-self: center; margin-bottom: 0; }
  [data-panel="left"] > .station-figure { grid-column: 7 / -1; }
  [data-panel="right"] > .station-figure { grid-column: 1 / span 6; }
  .block--dp > .station-figure { grid-column: 6 / -1; align-self: start; }
}
/* ENG-12: without the stage dev-process is a grid – phases in two columns; from 1100 px overview
   and poster left, phases right */
@media (min-width: 1100px), (min-width: 760px) and (orientation: landscape) {
  html:not(.has-webgl) #dev-process {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: var(--space-5) var(--gutter);
    width: min(100% - 2 * var(--margin), var(--container));
    margin: var(--space-9) auto;
  }
  html:not(.has-webgl) #dev-process > .block { width: auto; margin-inline: 0; padding: 0; }
  html:not(.has-webgl) #dev-process > [data-block="dp-0"] { grid-column: 1 / -1; }
  html:not(.has-webgl) #dev-process > .block:not([data-block="dp-0"]) > .panel { grid-column: 1 / -1; }
}
@media (min-width: 1100px) {
  html:not(.has-webgl) #dev-process { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  html:not(.has-webgl) #dev-process > [data-block="dp-0"] { grid-column: 1; grid-row: 1 / span 5; }
  html:not(.has-webgl) #dev-process > .block:not([data-block="dp-0"]) { grid-column: 2; }
  html:not(.has-webgl) #dev-process > [data-block="dp-0"] > .panel { grid-column: 1 / -1; }
  html:not(.has-webgl) #dev-process > [data-block="dp-0"] > .station-figure { grid-row: 2; grid-column: 1 / -1; margin-top: var(--space-5); }
}
/* stacked: full-width panels below an empty stage window (its height: stage.css) */
@media (max-width: 759px), (max-width: 1099px) and (orientation: portrait) {
  .block { display: flex; flex-direction: column; width: auto; margin-inline: 16px; }
  .station-figure { order: -1; margin-bottom: var(--space-5); }
  .block:last-child { padding-bottom: var(--space-8); }
  .panel { box-shadow: none; }
  /* fallback poster fills the hero stage window (height mirrors stage.css; stage.css may override) */
  .world__poster { top: var(--header-h); bottom: auto; height: 48svh; }
}
/* portrait tablets: panels align with the header content (line length) */
@media (min-width: 760px) and (max-width: 1099px) and (orientation: portrait) {
  .block { margin-inline: var(--margin); }
}

/* ----------------------------------------------------------------- hero */

/* .block.station--hero outranks the generic .block padding in stage.css: the hero keeps its own */
.block.station--hero { grid-template-rows: 1fr auto; padding: var(--header-h) 0 0; }
.hero { position: relative; grid-row: 1; align-self: center; padding-block: var(--space-7); container-type: inline-size; }
.hero .reg-marks { inset: 0 -24px; }
.hero__title { margin-top: var(--space-5); }
.hero__person { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-3); margin-top: var(--space-6); }
.hero__name { font-weight: 600; }
.hero__descriptor {
  padding-left: var(--space-3);
  border-left: 1px solid var(--line);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.hero__lead { max-width: 33em; margin-top: var(--space-4); }
@container (max-width: 34rem) {
  .hero__person { flex-direction: column; align-items: flex-start; }
  .hero__descriptor { padding-left: 0; border-left: 0; }
}
.hero .actions { margin-top: var(--space-6); }
/* "Im Bild": what the drawing on the right shows, as a quiet annotation under the CTAs */
.hero-story {
  display: grid;
  gap: 6px;
  max-width: 34em;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--hairline);
}
.hero-story__text { color: var(--text-muted); font-size: var(--fs-small); font-weight: var(--fw-small); line-height: var(--lh-small); }
.hero-note { display: flex; flex-wrap: wrap; grid-row: 2; align-items: baseline; gap: 6px var(--space-4); padding-block: var(--space-5) var(--space-6); }
.hero-note__link { color: var(--text); font-size: var(--fs-small); font-weight: 600; text-decoration: none; text-underline-offset: 5px; }
.hero-note__link:hover { color: var(--accent); text-decoration: underline 1px; }

@media (min-width: 760px) {
  .hero, .hero-note { grid-column: 1 / span 8; }
}
@media (min-width: 1100px) {
  .hero, .hero-note { grid-column: 1 / span 6; }
}
@media (max-width: 759px), (max-width: 1099px) and (orientation: portrait) {
  .hero {
    align-self: stretch;
    padding: var(--panel-pad) var(--panel-pad) calc(var(--panel-pad) + 4px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-panel);
    background: var(--surface-solid);
  }
  .hero .reg-marks { inset: -7px; }
  .hero-note { padding-inline: 2px; }
}
@media (max-width: 399px) {
  .panel, .hero { padding: 20px; }
}

/* ---------------------------------------------------------- dev-process */

.scope-note { padding-left: var(--space-4); border-left: 1px solid var(--line-strong); }
.scope-note, .tiers__row, .run-status, .legend__list li, .phases a, .evidence, .roles__row, .return-note, .chapters__list li {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}
.tiers, .roles { display: grid; gap: var(--space-3); }
.tiers__list { display: grid; gap: var(--space-2); }
.tiers__row, .return-note { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--space-3); }
.tiers__mark { padding-top: 0.3em; }
.notches { display: flex; gap: 3px; }
.notches i { width: 2px; height: 11px; background: var(--line); }
.notches[data-tier="1"] i:nth-child(-n+1), .notches[data-tier="2"] i:nth-child(-n+2), .notches[data-tier="3"] i { background: var(--accent); }

.run-controls { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.run-controls:not(:has(> :not([hidden]))) { display: none; }
.run-controls .motion-toggle { min-height: 44px; padding: 0 16px; font-size: var(--fs-small); }
.run-button__stop, .run-button__replay,
.run-button:is([data-run-state="playing"], [data-run-state="ended"]) .run-button__play { display: none; }
.run-button[data-run-state="playing"] .run-button__stop, .run-button[data-run-state="ended"] .run-button__replay { display: inline; }
.run-status { color: var(--text-muted); }
.run-status:empty { margin-top: 0; } /* stays rendered: a live region must exist before it speaks */

details > summary { display: flex; align-items: center; gap: var(--space-3); list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-left: auto;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-2px) rotate(45deg);
  transition: transform var(--dur-ui) var(--ease-standard);
}
details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }

.legend, .chapters { border-block: 1px solid var(--hairline); }
.legend > summary, .chapters > summary {
  min-height: 44px;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.legend__list { display: grid; gap: var(--space-3); padding-bottom: var(--space-4); }
.legend__list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: var(--space-3); }
/* 24 × 16 glyphs drawn like the scene: 1.25-px strokes in currentColor */
.legend__glyph {
  width: 24px;
  height: 16px;
  margin-top: 0.15em;
  color: var(--line-strong);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.legend__marks { fill: currentColor; stroke: none; }
.legend__dashed { stroke-dasharray: 2 1.6; }
.legend__ring, .legend__arc { stroke: var(--finding); }
.legend__wedge { fill: var(--finding); stroke: none; }
.legend__arc { stroke-dasharray: 2.4 2; }

.phases > .label { margin-bottom: var(--space-3); }
.phases ol { border-top: 1px solid var(--hairline); }
.phases li { border-bottom: 1px solid var(--hairline); }
.phases a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-2);
  padding: 10px 0;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.phases a:hover { color: var(--accent); }
.phases__num, .roles dt, .quote figcaption, .contact-list dt, .portrait figcaption, .signature, .chapters__list li::before {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.phases__num, .phase-index__num, .roles dt { color: var(--accent); }
.phase-index__cmd { text-transform: none; letter-spacing: 0.02em; }

.evidence { padding-left: var(--space-4); border-left: 2px solid var(--gate-pass); color: var(--text-muted); }
.roles__row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: var(--space-3); }
.roles dt, .quote figcaption, .contact-list dt, .portrait figcaption, .signature { text-transform: uppercase; }
.roles dt { padding-top: 0.2em; }

.quote, .subsection { padding-top: var(--space-5); border-top: 1px solid var(--hairline); }
.quote blockquote {
  font-family: var(--font-serif);
  font-size: var(--fs-quote);
  font-weight: var(--fw-quote);
  line-height: var(--lh-quote);
  letter-spacing: var(--ls-quote);
  font-optical-sizing: auto;
}
.quote__line { display: block; }
.quote figcaption { margin-top: var(--space-3); color: var(--text-muted); }
.return-note__glyph { width: 18px; height: 18px; margin-top: 0.1em; fill: none; stroke: var(--finding); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.subsection > * + * { margin-top: var(--space-3); }

/* ------------------------------------------------------------- workshop */

.project .eyebrow { color: var(--accent); }
.panel > .lead + .project { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--hairline); }
.project__lead { font-weight: 550; }
.project__text { font-weight: var(--fw-body); }
.project__sub { color: var(--text-muted); font-weight: 450; }
.tag-row { font-size: 0.75rem; letter-spacing: 0.05em; }
.facts { border-top: 1px solid var(--hairline); }
.facts li { padding: 7px 0; border-bottom: 1px solid var(--hairline); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.45; }
.screenshot img { width: 100%; border: 1px solid var(--hairline); border-radius: var(--radius-media); }
/* workshop panels stay short (owner: ≤ ~70 % of the viewport at 1440 × 900) */
.panel--ws > h2 + .lead { margin-top: var(--space-3); }
.panel--ws > .lead + .project { margin-top: 18px; padding-top: 18px; }
.panel--ws .project > * + * { margin-top: var(--space-3); }
.panel--ws .project > h3 { margin-top: var(--space-2); }
.panel--ws .project > :is(.ticks, .facts, .screenshot, .link-list, .project__foot) { margin-top: var(--space-4); }
.ticks--compact { gap: 5px; }
.ticks--compact li { padding-left: 20px; font-size: 0.875rem; line-height: 1.52; }
.ticks--compact li::before { top: 0.78em; width: 10px; }
.project__foot { display: grid; gap: var(--space-3); }
.panel--ws .tag-row { font-size: 0.6875rem; letter-spacing: 0.04em; }
.link-list--row { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
/* on desktop the whiteboard in the scene shows the same screenshot (reduced motion too: ws-3 has
   its own static frame); without WebGL it stays here */
@media (min-width: 1100px) {
  .has-webgl .panel--ws .screenshot { display: none; }
}

/* ------------------------------------------------------ article teaser */

.chapters__list { display: grid; gap: 6px; padding-bottom: var(--space-4); counter-reset: chapter; }
.chapters__list li { display: grid; grid-template-columns: 30px minmax(0, 1fr); counter-increment: chapter; }
.chapters__list li::before { content: counter(chapter, decimal-leading-zero); padding-top: 0.2em; color: var(--accent); letter-spacing: 0; }
.chapters__list a { color: var(--text); text-decoration: none; }
.chapters__list a:hover { color: var(--accent); text-decoration: underline 1px; }

/* ------------------------------------------------------ approach, contact */

.author { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4) var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--hairline); }
.portrait { width: min(200px, 100%); }
.portrait img { width: 100%; aspect-ratio: 1; border: 1px solid var(--hairline); border-radius: var(--radius-media); background: var(--surface-2); }
.portrait figcaption { margin-top: var(--space-2); color: var(--text-muted); }
.signature { flex: 1 1 12em; padding-bottom: 1.6em; color: var(--text); }
.signature__role { display: block; color: var(--text-muted); }

.panel--contact .reg-marks { inset: -8px; }
/* E-7: e-mail primary, LinkedIn a quiet secondary link, no phone */
.panel--contact .actions .text-link { color: var(--text-muted); font-weight: 600; text-decoration-color: var(--line); }
.panel--contact .actions .text-link:hover { color: var(--accent); text-decoration-color: currentColor; }
.contact-list { display: grid; border-top: 1px solid var(--hairline); }
.contact-list__row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}
.contact-list dt { color: var(--text-muted); }
.contact-list a { color: var(--text); font-weight: 600; text-decoration-color: var(--line-strong); text-underline-offset: 5px; }
.contact-list a:hover { color: var(--accent); text-decoration-color: currentColor; }

/* --------------------------------------------------------------- footer */

.site-end {
  position: relative;
  z-index: 2;
  padding-block: var(--space-6) var(--space-7);
  border-top: 1px solid var(--hairline);
  background: var(--surface-solid);
  transition: background-color var(--dur-theme) var(--ease-theme);
}
.preferences details { max-width: 44rem; }
.preferences summary { min-height: 44px; font-size: var(--fs-small); font-weight: 650; }
.preferences summary::after { margin-left: var(--space-3); }
.preferences__content { display: grid; gap: var(--space-3); padding: var(--space-2) 0 var(--space-4); font-size: var(--fs-small); line-height: var(--lh-small); }
.preferences__remember { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 32px; font-weight: 600; cursor: pointer; }
.preferences__remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent-strong); }
.preferences__notice, .preferences__status { max-width: 62ch; color: var(--text-muted); }
.preferences__status:empty { display: none; }
.preferences__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--hairline);
  color: var(--text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-small);
}
.preferences[hidden] + .site-footer { margin-top: 0; padding-top: 0; border-top: 0; }
.site-footer__legal ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.site-footer__legal a { display: inline-block; padding-block: 4px; color: var(--text); font-weight: 600; text-decoration: none; text-underline-offset: 5px; }
.site-footer__legal a:hover { color: var(--accent); text-decoration: underline 1px; }

/* ---------------------------------------------------------------- states */

@media (prefers-reduced-motion: no-preference) {
  .js .block:not(.station--hero) > .panel {
    opacity: 0;
    transform: translateY(12px);
    animation: panel-safety 1ms linear 2s forwards; /* panels appear even if site.js never runs */
  }
  .js.reveal-ready .block > .panel { animation: none; }
  .js .block > .panel.is-revealed { opacity: 1; transform: none; }
}
@keyframes panel-safety { to { opacity: 1; transform: none; } }

:is(.world-static, .no-webgl) :is([data-world-run], [data-motion-toggle]) { display: none !important; }

@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .panel, html:not(.tier-low) .panel, html.header-solid:not(.tier-low):not(.nav-open) .site-header::before {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .panel, .hero, .site-header::before, .site-menu, .site-end, .menu-toggle, .station-scale ol, .station-scale__label, .world-label {
    background: Canvas !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .panel, .button, .motion-toggle, .menu-toggle { border: 1px solid CanvasText; }
  .ticks li::before, .chapter-mark::before, .progress-line span.is-done { background: CanvasText; }
  /* A11Y-07: empty notches as stubs – GrayText can be near CanvasText (HC White #600000) */
  .notches { align-items: flex-end; height: 11px; }
  .notches i { height: 3px; background: GrayText; }
  .notches[data-tier="1"] i:nth-child(-n+1), .notches[data-tier="2"] i:nth-child(-n+2), .notches[data-tier="3"] i { height: 11px; background: CanvasText; }
  .lang-switch button[aria-pressed="true"], .theme-switch__option:has(input:checked) {
    forced-color-adjust: none;
    background: Highlight;
    color: HighlightText;
    box-shadow: none;
  }
}

@media print {
  .world, .site-header, .station-scale, .progress-line, .stage-window, .station-figure,
  .preferences, .run-controls, .run-status, .skip-link, .reg-marks { display: none !important; }
  html, body { background: #fff; color: #000; }
  .block, .station--hero { display: block; width: auto; min-height: 0 !important; margin: 0; padding: 0 0 18pt !important; }
  .panel, .hero {
    padding: 0;
    border: 0;
    background: none !important;
    box-shadow: none;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .hero__title { font-size: 36pt; }
  .site-end { padding: 12pt 0 0; background: none; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; font-weight: 400; }
}
