*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  --fg: var(--ink); --fg-soft: var(--ink-soft); --fg-mute: var(--ink-mute); --line: var(--hair);
  background: var(--ivory);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  transition: color 1.6s var(--ease-inout);
}
body[data-theme="dark"] {
  --fg: var(--on-dark); --fg-soft: var(--on-dark-soft); --fg-mute: var(--on-dark-mute); --line: var(--hair-dark);
  background: var(--graphite);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 1px solid var(--bronze); outline-offset: 4px; }
body[data-theme="dark"] :focus-visible { outline-color: var(--champagne); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Bühne */
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
body:not(.is-ready) main, body:not(.is-ready) .topbar { opacity: 0; }
main, .topbar { transition: opacity 1.4s var(--ease-inout); }

/* Kopf */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--top) + env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}
.brand {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--fg); text-decoration: none;
  font-size: 11px; font-weight: 400; letter-spacing: .44em; text-transform: uppercase;
  transition: color 1.6s var(--ease-inout);
}
.brand svg { width: 30px; height: 30px; color: var(--bronze); transition: color 1.6s; }
body[data-theme="dark"] .brand svg { color: var(--champagne); }

/* Typografie-Bausteine */
.kicker {
  margin: 0;
  font-family: var(--sans); font-weight: 400; font-size: 11px;
  letter-spacing: .4em; text-transform: uppercase; color: var(--fg-soft);
}
.kicker--lg { font-size: clamp(13px, 1.25vw, 18px); font-weight: 300; letter-spacing: .36em; line-height: 1.75; color: var(--fg); }

/* Fallback ohne WebGL: CSS-Hintergründe + Körnung */
.grain-fallback { display: none; }
body.no-webgl .grain-fallback {
  display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.no-webgl #stage { display: none; }
body.no-webgl { background: radial-gradient(ellipse at 50% 32%, #fffdf8 0%, #f4ede1 38%, #e6dac4 100%); }
body.no-webgl[data-state="understood"], body.no-webgl[data-state="emergence"] { background: radial-gradient(ellipse at 50% 45%, #6b5c4b 0%, #2f2924 45%, #141210 100%); }
body.no-webgl[data-state="reveal"] { background: linear-gradient(180deg, #16130f 0%, #6d553b 48%, #e9c48e 64%, #3a2f25 66%, #0e0c0a 100%); }

.noscript { position: fixed; inset: auto 0 40px; text-align: center; font-family: var(--serif); font-size: 20px; }

