@font-face { font-family: Archivo; src: url(assets/archivo.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: Geist; src: url(assets/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --canvas: #f6f5f2;
  --green: #133b37;
  --ink: #26352f;
  --muted: #425850;
  --peach: #e4bfa5;
  --line: #c8cec5;
  --gutter: clamp(24px, 3.125vw, 64px);
  --header: 88px;
  --edge: var(--gutter); /* gemeinsame Flucht aller Inhalte; ab 1600px zentrierte 1500px-Spalte */
  --copy: min(38vw, 560px);
  color-scheme: light;
}
@media (min-width: 1600px) { :root { --edge: max(var(--gutter), calc((100vw - 1500px) / 2)); } }

* { box-sizing: border-box; }
html { scrollbar-color: var(--line) var(--canvas); } /* Kein sanftes Scrollen: Menüsprünge sollen nicht die Raumsequenz durchspielen */
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 17px/1.6 Geist, sans-serif; -webkit-font-smoothing: antialiased; }
::selection { background: var(--green); color: var(--canvas); }
a { color: var(--green); text-underline-offset: 6px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; }
img { max-width: 100%; height: auto; display: block; }

.skip { position: absolute; left: var(--edge); top: -60px; background: var(--green); color: var(--canvas); padding: 10px 16px; z-index: 20; }
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10; height: var(--header);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--edge); background: var(--canvas);
}
.logo img { width: 190px; filter: url(#brand-green); }
.site-header nav { display: flex; align-items: center; gap: clamp(16px, 2.2vw, 36px); font-weight: 500; font-size: 16px; }
.site-header nav a:not(.action) { text-decoration: none; padding: 8px 0; }
.site-header nav a:not(.action):hover { text-decoration: underline; text-decoration-color: var(--peach); text-decoration-thickness: 2px; }

.action {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
  background: var(--green); color: var(--canvas); text-decoration: none; font-weight: 500;
  transition: background-color .2s ease-out;
}
.action:hover { background: #0d2c29; }
.link { font-weight: 500; text-decoration: underline; text-decoration-color: var(--peach); text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--green); }

/* Typography */
h1, h2 { font-family: Archivo, Geist, sans-serif; color: var(--green); margin: 0 0 28px; text-wrap: balance; }
h1 { font-size: clamp(44px, 4.6vw, 76px); font-weight: 700; line-height: 1.03; letter-spacing: -0.035em; }
h1 span { display: block; font-weight: 500; }
h2 { font-size: clamp(34px, 3.3vw, 54px); font-weight: 600; line-height: 1.06; letter-spacing: -0.03em; }
.copy p { margin: 0 0 18px; max-width: 34em; color: var(--muted); }
.copy .lead { font-size: clamp(19px, 1.4vw, 22px); line-height: 1.5; color: var(--ink); }
.outcome { font-family: Archivo, Geist, sans-serif; font-weight: 600; font-size: clamp(20px, 1.55vw, 25px) !important; line-height: 1.35; color: var(--green) !important; padding-top: 18px; border-top: 1px solid var(--line); margin-top: 30px !important; }
.field { font-size: 14px !important; font-weight: 500; letter-spacing: 0.01em; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; margin-top: 36px; }

/* Static document (default, mobile, reduced motion, no JS) */
.stage { display: none; }
.chapter { padding: 72px var(--edge); border-top: 1px solid var(--line); scroll-margin-top: var(--header); }
.chapter--intro { border-top: 0; padding-top: 32px; }
.chapter .still {
  margin-top: 36px; width: 100%; max-width: 1100px;
  /* Bildkanten weich auslaufen lassen, der generierte Grund weicht leicht vom Seitenton ab */
  --fade: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: var(--fade); -webkit-mask-composite: source-in; mask-image: var(--fade); mask-composite: intersect;
}
.chapter--close { padding-bottom: 96px; }



@media (min-width: 900px) {
  .chapter { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 5%; align-items: center; }
  .chapter .still { margin-top: 0; }
}
@media (max-width: 720px) {
  :root { --header: 68px; }
  .logo img { width: 150px; }
  .site-header nav a:not(.action) { display: none; }
  .site-header .action { padding: 10px 14px; font-size: 15px; }
}

/* Live sequence: wide, tall windows with motion allowed (set by app.js) */
.live .stage {
  display: block; position: fixed; z-index: 1; top: var(--header); left: 0;
  width: 100%; height: calc(100vh - var(--header));
}
.live .stage canvas, .live .stage-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live .stage-fallback { visibility: hidden; }
/* Bildränder weich auslaufen lassen, damit keine Kante zur Seite entsteht */
.live .stage {
  --fade: linear-gradient(to bottom, transparent, #000 3%, #000 97%, transparent);
  -webkit-mask-image: var(--fade); mask-image: var(--fade);
}
/* Lesbarkeit: hinter der Textspalte liegt das Haus zusätzlich heller (Kontrast im Prüfskript gemessen) */
.live .stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to right, rgb(246 245 242 / .8) 0, rgb(246 245 242 / .8) calc(var(--copy) + var(--edge)), rgb(246 245 242 / 0) calc(var(--copy) + var(--edge) + var(--gutter) + 6vw));
}
.live.no-canvas .stage-fallback { visibility: visible; }
.live .chapter { scroll-margin-top: 0; display: block; position: relative; z-index: 2; width: calc(var(--copy) + var(--edge) + var(--gutter)); border-top: 0; padding: 0 var(--gutter) 0 var(--edge); }
.live .chapter .still { display: none; }
.live .chapter .copy { position: sticky; top: var(--header); min-height: calc(100vh - var(--header)); display: flex; flex-direction: column; justify-content: center; padding: 48px 0 120px; }
.live .chapter[data-room]:not([data-room=""]) { height: 220vh; }
.live .chapter--intro { height: 140vh; }
.live .chapter--close { height: 160vh; }
.live .live .live /* Niedrige Fenster: Einstieg und Aktion bleiben im ersten Bildschirm */
@media (max-height: 820px) {
  .live .chapter .copy { padding: 24px 0 72px; }
  .live h1 { font-size: clamp(38px, 7vh, 58px); margin-bottom: 20px; }
  .live h2 { font-size: clamp(30px, 5.6vh, 44px); }
  .live .copy .lead { font-size: 18px; }
  .live .actions { margin-top: 24px; }
}

/* Scroll-Hinweis: runder Pfeil, während der Haus-Sequenz immer sichtbar; Text nur im Einstieg.
   Wippt dreimal (unter 5 s, WCAG 2.2.2) und erneut nach einer Scrollpause (Klasse .nudge aus sections.js). */
.scroll-hint {
  position: fixed; z-index: 4; left: var(--edge); bottom: 24px;
  display: inline-flex; align-items: center; gap: 14px; color: var(--green); text-decoration: none;
  font-size: 14px; font-weight: 500; transition: opacity .35s ease-out, visibility .35s;
}
.scroll-arrow {
  display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 50%;
  background: rgb(246 245 242 / .85); transition: border-color .2s ease-out, background-color .2s ease-out;
}
.scroll-arrow svg { width: 20px; height: 20px; }
.scroll-hint:hover .scroll-arrow { border-color: var(--green); background: var(--canvas); }
.scroll-label { color: var(--muted); }
.past-intro .scroll-label { opacity: 0; visibility: hidden; transition: opacity .3s ease-out, visibility .3s; }
.in-sections .scroll-hint { opacity: 0; visibility: hidden; }
html:not(.live).past-intro .scroll-hint { opacity: 0; visibility: hidden; } /* ruhige Fassung: nur über dem Einstieg */
.nudge .scroll-arrow svg { animation: scroll-nudge 1.1s cubic-bezier(.33, 0, .2, 1) 3; }
@keyframes scroll-nudge { 0%, 100% { transform: none; } 45% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .nudge .scroll-arrow svg { animation: none; } }
@media (max-width: 720px) { .scroll-hint { left: auto; right: var(--edge); bottom: 18px; } .scroll-label { display: none; } }
/* Niedrige Fenster: Hinweis rechts unten, damit er die Einstiegsaktion nicht berührt */
@media (max-height: 820px) { .live .scroll-hint { left: auto; right: var(--edge); bottom: 20px; } .live .scroll-label { display: none; } }

/* Arbeitsfelder-Menü: klappt unter der Kopfzeile auf, Haus zeigt den Raum zum markierten Feld */
.fields-toggle { display: inline-flex; align-items: center; gap: 6px; }
.fields-toggle svg { width: 16px; height: 16px; transition: transform .2s ease-out; }
.fields-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.fields-menu {
  position: fixed; z-index: 9; top: var(--header); left: 0; right: 0;
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 5%; align-items: center;
  padding: 28px var(--edge) 36px; background: var(--canvas); border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px rgb(19 59 55 / .35);
}
.fields-menu[hidden] { display: none; }
.fields-house { position: relative; overflow: hidden; border-radius: 3px; }
.fields-house img { width: 100%; height: auto; }
.fields-spot {
  position: absolute; left: var(--x, 0); top: var(--y, 0); width: var(--w, 100%); height: var(--h, 100%);
  box-shadow: 0 0 0 200vmax rgb(246 245 242 / 0); transition: all .25s ease-out; pointer-events: none;
}
.fields-house.is-focused .fields-spot { box-shadow: 0 0 0 200vmax rgb(246 245 242 / .62); }
.fields-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.fields-list a { display: block; padding: 16px 0; border-top: 1px solid var(--line); text-decoration: none; }
.fields-list strong { display: block; font: 600 19px/1.25 Archivo, sans-serif; color: var(--green); letter-spacing: -0.01em; }
.fields-list span { display: block; margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.fields-list a:hover strong, .fields-list a:focus-visible strong { text-decoration: underline; text-decoration-color: var(--peach); text-decoration-thickness: 2px; text-underline-offset: 5px; }
@media (max-width: 900px) {
  .fields-menu { grid-template-columns: 1fr; padding-top: 12px; max-height: calc(100vh - var(--header)); overflow-y: auto; }
  .fields-house { display: none; }
  .fields-list { grid-template-columns: 1fr; }
}
@media (max-width: 720px) { .site-header nav a.fields-toggle { display: inline-flex; } }
@media (prefers-reduced-motion: reduce) { .fields-spot, .fields-toggle svg { transition: none; } }
/* Sehr niedrige Fenster: zweiter Einstiegsabsatz entfällt, damit die Aktion im ersten Bildschirm bleibt */
@media (max-height: 760px) {
  .live .chapter--intro .copy > p:not(.lead) { display: none; }
  .live .chapter .copy { padding: 16px 0 56px; }
}
/* Schmale Kopfzeile: Logo, Arbeitsfelder und Anfrage passen in eine Zeile */
.site-header .action { white-space: nowrap; }
@media (max-width: 720px) {
  .site-header { gap: 12px; }
  .site-header nav { gap: 14px; }
  .logo img { width: 124px; }
  .site-header .action { padding: 9px 12px; font-size: 14px; }
  .site-header nav a.fields-toggle { font-size: 15px; }
}
@media (max-width: 360px) { .site-header .action { display: none; } }

/* Raumangabe, Aktion und passendes Projekt je Kapitel */
.field .count { display: inline-block; margin-right: 12px; font-variant-numeric: tabular-nums; color: var(--green); font-weight: 600; }
.room-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-top: 22px !important; }
.room-links .text-link { display: inline-flex; align-items: center; gap: 14px; font-size: 15px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--peach); padding-bottom: 6px; color: var(--green); }
.room-links .text-link svg { width: 16px; height: 16px; }
.room-links .related { font-size: 14px; color: var(--muted); text-decoration-color: var(--line); }
.room-links .related:hover { color: var(--green); text-decoration-color: var(--peach); }
.site-header .language { display: inline-flex; align-items: baseline; gap: 5px; font-size: 14px; letter-spacing: .04em; padding: 8px 0; color: var(--muted); }
.site-header .language .lang-current { color: var(--green); font-weight: 600; }
@media (max-width: 720px) { .site-header nav .language a { display: inline; } }
@media (max-height: 820px) { .live .room-links { margin-top: 14px !important; } .live .outcome { margin-top: 20px !important; padding-top: 12px; } }
.site-header .logo { flex: none; } /* Logo nie zusammendrücken */
@media (max-width: 420px) { .logo img { width: 112px; } .site-header nav { gap: 10px; } .site-header .action { padding: 8px 10px; font-size: 13px; } }
.label-short { display: none; }
@media (max-width: 420px) {
  .site-header .label-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } /* für Screenreader bleibt der volle Text */
  .site-header .label-short { display: inline; }
}
@media (max-width: 480px) { .site-header .language { gap: 5px; font-size: 13px; } .logo img { width: 100px; } .site-header .language > span[aria-hidden] { display: none; } .site-header nav { gap: 8px; } }
.site-header nav .language a { padding: 0; line-height: inherit; }
