/* seite.css · NULLGRAD (Vollbau): Grundlagen, Kopfzeile, Station 1 und 2. Stationen 3 bis 8 stehen in stationen.css, die Güsse in guesse.css.
 * Schrift und Abstände nur aus den Variablen (SCHRIFT.md). Eine Uhr für die Seite: --p (0 bis 1) kommt von bewegung.js am Element .reise,
 * daraus --s (Scrollweg in Bildschirmhöhen) und je Guss ein --t1 bis --t6 (Beginn und Länge in svh stehen unten). */

@font-face { font-family: "Sora"; src: url(../fonts/sora.woff2) format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Onest"; src: url(../fonts/onest.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

/* Temperatur als echte Zahl, die CSS herunterzählen kann (Kopfzeile) */
@property --grad { syntax: "<integer>"; inherits: true; initial-value: 32; }

:root {
  color-scheme: dark;
  /* Schrift-Ordnung (SCHRIFT.md) */
  --g-wort:  clamp(3.5rem, min(13vw, 20svh), 14rem);
  --g-zahl:  clamp(5rem, min(18vw, 28svh), 20rem);
  --g-zeile: clamp(2rem, min(5vw, 9svh), 5rem);
  --g-ueber: clamp(1.5rem, 2.3vw, 2.375rem);
  --g-lead:  clamp(1.125rem, 1.4vw, 1.4375rem);
  --g-text:  clamp(1.0625rem, 1.05vw, 1.1875rem);
  --g-klein: 1rem;
  --schrift-display: "Sora", system-ui, "Segoe UI", sans-serif;
  --schrift-text: "Onest", system-ui, "Segoe UI", sans-serif;
  /* Abstände */
  --a1: 8px; --a2: 16px; --a3: 24px; --a4: 40px; --a5: 64px; --a6: 104px; --a7: 168px;
  /* Farben, je Station hart gesetzt (die Seite kühlt ab) */
  --espresso: #17100B; --braun: #3A2416; --milchkaffee: #6B4A33; --beige: #D9CDBE; --latte: #F2E9DD; --milch: #FFFFFF; --milchhaut: #E3D2BC; --eis: #3DB7E8;
  --grund: var(--espresso); --grund-2: var(--braun);
  --text: var(--latte); --text-2: var(--beige); --text-3: var(--beige);
  --linie: #3A2416; --akzent: var(--eis); --auf-akzent: var(--espresso);
  --kopf-hoehe: 72px;
  --dh: 67svh;                       /* Höhe der Dose in Station 1 und (Bildtafel-Regel 8) in Station 7 */
  --dr: 17vw;                        /* Abstand der Dose vom rechten Rand */
  --dmy: calc(94svh - var(--dh) / 2);  /* Mitte der Dose von oben (Station 7 stellt die gefrorene Dose genau dorthin) */
  --aus: cubic-bezier(0.16, 1, 0.3, 1);
}
html { background: var(--espresso); scroll-padding-top: calc(var(--kopf-hoehe) + var(--a2)); }
body { font-family: var(--schrift-text); font-size: var(--g-text); line-height: 1.6; background: var(--espresso); color: var(--text); }

/* ---------- Eine Uhr für die Reise (Stationen 1 bis 7): Beginn der sechs Güsse in svh Scrollweg, jeder Guss dauert 35 svh */
.reise, .kopfzeile {
  --s: calc(var(--p, 1) * (var(--hoehe, 770) - 100));
  --t1: clamp(0, calc((var(--s) - 40) / 35), 1);
  --t2: clamp(0, calc((var(--s) - 130) / 35), 1);
  --t3: clamp(0, calc((var(--s) - 230) / 35), 1);
  --t4: clamp(0, calc((var(--s) - 335) / 35), 1);
  --t5: clamp(0, calc((var(--s) - 440) / 35), 1);
  --t6: clamp(0, calc((var(--s) - 545) / 35), 1);
}
.reise { --hoehe: 770; --p: 1; --t: var(--t1); }                       /* ohne Skript und in der ruhigen Fassung steht alles im Endzustand */
html.js .reise, html.js .kopfzeile { --p: 0; }

/* ---------- Kopfzeile: Wortmarke, Menü, Temperaturanzeige (32 auf 0, erreicht 0 mit Guss 6), Knopf */
.kopfzeile { gap: var(--a3); padding-block: var(--a1); isolation: isolate; }
.kopfzeile::before, .kopfzeile::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transition: opacity 0.4s ease; }
.kopfzeile::before { background: linear-gradient(to bottom, rgba(23, 16, 11, 0.78), rgba(23, 16, 11, 0)); }
.kopfzeile::after { background: linear-gradient(to bottom, rgba(242, 233, 221, 0.9), rgba(242, 233, 221, 0)); opacity: 0; }
.kopfzeile.hell { --text: var(--espresso); --text-2: var(--braun); --grund: var(--latte); --linie: #BFAE98; --akzent: var(--espresso); }
.kopfzeile.fest { background-color: rgba(242, 233, 221, 0.96); box-shadow: 0 1px 0 #BFAE98; }   /* nach der Reise läuft Text unter der Kopfzeile durch: dann bekommt sie einen festen Grund */
.kopfzeile.fest::before, .kopfzeile.fest::after { opacity: 0; }
.kopfzeile.hell::before { opacity: 0; }
.kopfzeile.hell::after { opacity: 1; }
.marke, .menue a, .anzeige { transition: color 0.4s ease; }
.marke { font-family: var(--schrift-display); font-weight: 800; font-size: var(--g-text); letter-spacing: 0.02em; color: var(--text); }
.menue a { font-family: var(--schrift-text); font-size: var(--g-klein); font-weight: 500; color: var(--text-2); }
.anzeige {
  --grad: calc(32 - 4 * var(--t1) - 12 * var(--t2) - 4 * var(--t3) - 4 * var(--t4) - 4 * var(--t5) - 4 * var(--t6));
  counter-reset: g var(--grad);
  min-width: 3.4ch; text-align: right; font-family: var(--schrift-display); font-weight: 700; font-size: var(--g-lead); line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--eis);
}
.anzeige::before { content: counter(g) "°"; }
.kopfzeile.hell .anzeige { color: var(--espresso); }
.anzeige.heiss { filter: url(#hitze); }
.kopfzeile .knopf { font-family: var(--schrift-display); font-weight: 700; font-size: var(--g-klein); }
.knopf { font-family: var(--schrift-display); font-weight: 700; font-size: var(--g-text); background: var(--eis); color: var(--espresso); }
@media (hover: hover) and (pointer: fine) { .knopf:hover { box-shadow: 0 0 0 3px var(--espresso), 0 0 0 5px var(--eis); } }   /* Ring statt Leuchten */
.svg-filter { position: absolute; width: 0; height: 0; overflow: hidden; }
.menue-knopf { font-family: var(--schrift-text); font-size: var(--g-klein); font-weight: 500; color: var(--text); border-color: var(--text-2); }

/* ---------- Reise: Stationen 1 bis 7. Grundform = untereinander (ohne Skript, ruhige Fassung); mit Bewegung angeheftet. */
.reise { position: relative; }
.rahmen { position: relative; }
.st { position: relative; height: 100svh; min-height: 30rem; overflow: clip; isolation: isolate; }   /* eigener Stapel je Station: z-index im Inneren wirkt nie auf die Nachbarstation (auch nicht, wenn die Maske nach dem Guss wegfällt) */
.st1 { background: var(--espresso); }
.neu { color: var(--text); }
.saum { display: none; }
.anker-sprung { scroll-margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  html.js .reise { height: calc(var(--hoehe) * 1svh); }
  html.js .rahmen { position: sticky; top: 0; height: 100svh; overflow: clip; }
  html.js .st { position: absolute; inset: 0; height: auto; min-height: 0; }
  html.js .saum { display: block; }
  html.js .weg { visibility: hidden; content-visibility: hidden; }  /* Stationen, die gerade nicht im Bild sind, zeichnet und berechnet der Browser nicht (Intel: halbiert die Stilberechnung beim Scrollen) */
  /* Startbild ohne Springen: bis das Skript das erste Mal gezeichnet hat, ist nur der erste Bildschirm sichtbar */
  html.js:not(.bereit) .neu, html.js:not(.bereit) .saum, html.js:not(.bereit) .schleier { visibility: hidden; }
  html.js:not(.bereit) .wort, html.js:not(.bereit) .dose, html.js:not(.bereit) .dunst { opacity: 0; }
  html.bereit .wort, html.bereit .dose { animation: auf 0.9s var(--aus) backwards; }
  @keyframes auf { from { opacity: 0; scale: 0.97; } }
}
@media (prefers-reduced-motion: reduce), (scripting: none) {
  .neu, .saum, .neu .kern { -webkit-mask: none; mask: none; }
  .neu { opacity: 1; }
}
html:not(.js) .neu { -webkit-mask: none; mask: none; opacity: 1; }
html:not(.js) .anzeige { display: none; }

/* ---------- Station 1 · 32° (Weg in svh nur bis 80, damit nichts davonläuft) */
.st1 { --s1: clamp(0, var(--s), 80); }
.wort {
  position: absolute; left: var(--kante); bottom: 10svh; margin: 0; padding-right: 0.05em; white-space: nowrap; user-select: none; pointer-events: none;
  font-family: var(--schrift-display); font-weight: 800; font-size: var(--g-wort); line-height: 0.95; letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
  color: transparent; -webkit-text-fill-color: transparent;
  background-color: #A8866C;
  background-image: url(../bilder/wolke-wort-1200.webp);   /* Wolkenfoto: Schwarz schon als helles Milchkaffee gerechnet, Weiß bleibt Weiß (kein Mischmodus) */
  background-repeat: no-repeat; background-size: 230% auto;
  /* die Wolke treibt in den Buchstaben: mit dem Scroll nach rechts und oben, mit der Maus dagegen */
  background-position: clamp(0%, calc(6% + var(--s1) * 1.05% - var(--mx, 0) * 14%), 100%) clamp(0%, calc(34% + var(--s1) * 0.55% - var(--my, 0) * 9%), 100%);
  -webkit-background-clip: text; background-clip: text;
  translate: calc(var(--mx, 0) * -6px) calc(var(--my, 0) * -3px - var(--s1) * 0.08svh);
  will-change: translate;
}
.dunst { position: absolute; right: 4vw; bottom: 0; width: 56vw; height: 92svh; pointer-events: none; opacity: 0.34;
  -webkit-mask-image: radial-gradient(closest-side, #000 35%, transparent 100%); mask-image: radial-gradient(closest-side, #000 35%, transparent 100%);
  translate: calc(var(--mx, 0) * -26px) calc(var(--my, 0) * -12px + var(--s1) * 0.14svh); will-change: translate; }
.dunst img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.dose {
  position: absolute; right: var(--dr); bottom: 6svh; height: var(--dh); aspect-ratio: 716 / 1513; pointer-events: none;
  translate: calc(var(--mx, 0) * 16px) calc(var(--my, 0) * 8px - var(--s1) * 0.22svh);
  will-change: translate;
}
.dose-bild { width: 100%; height: 100%; display: block; }
/* 366 · Lichtkante: ein schmaler Streifen wandert mit der Maus über die Dose (nur Form der Dose, kein Mischmodus) */
.licht, .etikett { position: absolute; pointer-events: none; }
.licht {
  inset: 0; --lx: calc(30% + var(--mx, 0) * 32%);
  background: linear-gradient(104deg, rgba(255, 255, 255, 0) calc(var(--lx) - 9%), rgba(255, 255, 255, 0.5) var(--lx), rgba(255, 255, 255, 0) calc(var(--lx) + 4%));
  -webkit-mask: url(../bilder/dose-716.webp) center / 100% 100% no-repeat; mask: url(../bilder/dose-716.webp) center / 100% 100% no-repeat;
}
/* 101 · Etikett schimmert zur Maus: Eisblau und Weiß über dem Aufdruck, an den Seiten ausgeblendet */
.etikett {
  left: 13%; width: 74%; top: 46%; height: 21%; --sx: calc(50% + var(--mx, 0) * 70%);
  background: linear-gradient(112deg, rgba(61, 183, 232, 0) calc(var(--sx) - 26%), rgba(61, 183, 232, 0.24) calc(var(--sx) - 6%), rgba(255, 255, 255, 0.34) var(--sx), rgba(61, 183, 232, 0.18) calc(var(--sx) + 8%), rgba(61, 183, 232, 0) calc(var(--sx) + 28%));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent), linear-gradient(0deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent), linear-gradient(0deg, transparent, #000 30%, #000 70%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
/* Vordergrund: schmaler, weicher Milchschleier am unteren Rand (deckt nie zu) */
.schleier { position: absolute; left: -6%; bottom: 0; width: 112%; height: 11svh; overflow: clip; pointer-events: none; opacity: 0.5; translate: calc(var(--mx, 0) * 26px) calc(var(--s1) * -0.12svh); will-change: translate; }
.schleier img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; filter: blur(9px); scale: 1.1; -webkit-mask-image: linear-gradient(to top, #000 25%, transparent); mask-image: linear-gradient(to top, #000 25%, transparent); }

.kopftext { position: absolute; left: var(--kante); top: calc(var(--kopf-hoehe) + var(--a4)); width: min(52vw, 46rem); opacity: clamp(0, calc(1 - var(--t1) * 5), 1); }   /* die Milch löst den Text auf, ehe die Wolke ihn erreicht */
.k-oben, .k-unten { display: block; }
.titel { font-family: var(--schrift-display); font-weight: 700; font-size: var(--g-zeile); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.unterzeile { max-width: 34rem; margin-top: var(--a2); font-size: var(--g-lead); font-weight: 500; line-height: 1.45; color: var(--text); }
.beleg { margin-top: var(--a2); font-size: var(--g-klein); color: var(--text-2); }
.handlung { margin-top: var(--a3); display: block; }
.beruhigung { margin-top: var(--a2); font-size: var(--g-klein); color: var(--text-2); max-width: 30rem; }

/* ---------- Station 2 · 28° (Weg 38 bis 167 svh) */
.st2 { --s2: clamp(38, var(--s), 167); background: var(--braun); }
.foto { position: absolute; inset: 0 0 0 10vw; width: 90vw; height: 100%; object-fit: cover; object-position: 72% 50%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%); mask-image: linear-gradient(90deg, transparent, #000 22%); scale: calc(1 + (var(--s2) - 38) * 0.0007); will-change: scale; }
.abdunkeln { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23, 16, 11, 0.86) 0%, rgba(23, 16, 11, 0.6) 36%, rgba(23, 16, 11, 0) 68%); }
.zahl { position: absolute; right: var(--kante); bottom: 4svh; margin: 0; font-family: var(--schrift-display); font-weight: 800; font-size: var(--g-zahl); line-height: 0.9; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--latte); opacity: 0.16; user-select: none; pointer-events: none; translate: 0 calc((var(--s2) - 130) * 0.1svh); }
.st2 .zahl { will-change: translate; }
.text2 { position: absolute; left: var(--kante); top: calc(var(--kopf-hoehe) + var(--a6)); width: min(44vw, 40rem); }
.text2 h2 { font-family: var(--schrift-display); font-weight: 700; font-size: var(--g-zeile); line-height: 1.05; letter-spacing: -0.02em; text-wrap: balance; }
.text2 p { margin-top: var(--a3); max-width: 32rem; font-size: var(--g-text); color: var(--text); }
/* vierte Ebene vorn: dunkler, unscharfer Asphalt- und Dunststreifen am unteren Rand mit eigenem Tempo; lässt die Mitte (Hand und Dose) frei */
.vorn {
  position: absolute; left: -5vw; bottom: 0; width: 110vw; height: 9svh; pointer-events: none;
  background: url(../bilder/vorn-1600.webp) center bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(0deg, #000 40%, transparent), linear-gradient(90deg, #000 0%, #000 34%, transparent 46%, transparent 76%, #000 90%, #000 100%);
  mask-image: linear-gradient(0deg, #000 40%, transparent), linear-gradient(90deg, #000 0%, #000 34%, transparent 46%, transparent 76%, #000 90%, #000 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect;
  translate: calc((var(--s2) - 38) * -0.05vw) calc((var(--s2) - 38) * -0.015svh);
  will-change: translate;
}

/* ---------- Flache Fenster (640 × 440 und ähnlich) */
@media (max-height: 560px) and (orientation: landscape) {
  :root { --kopf-hoehe: 56px; --dh: 66svh; --dr: 8vw; --dmy: calc(95svh - var(--dh) / 2); }
  .kopftext { top: calc(var(--kopf-hoehe) + var(--a1)); width: min(50vw, 46rem); }
  .unterzeile, .beleg { display: none; }
  .handlung { margin-top: var(--a2); }
  .beruhigung { margin-top: var(--a1); }
  .wort { bottom: 6svh; }
  .dose { bottom: 5svh; }
  .text2 { top: calc(var(--kopf-hoehe) + var(--a3)); width: min(47vw, 40rem); }
  .text2 p { margin-top: var(--a2); }
  .text2 .klein { display: none; }
}

/* ---------- Handy (375 × 812): eigener Zuschnitt */
@media (max-width: 900px) and (orientation: portrait) {
  :root { --kopf-hoehe: 64px; --dh: 44svh; --dr: 4vw; --dmy: 50svh; }
  .kopfzeile { gap: var(--a1); }
  .kopfzeile .knopf--klein { padding: 0 var(--a2); }
  .menue-knopf { padding: 0 var(--a1); min-width: 0; }
  .anzeige { min-width: 2.6ch; }
  .kopftext { display: contents; }
  .k-oben, .k-unten { opacity: clamp(0, calc(1 - var(--t1) * 5), 1); }
  .k-oben { position: absolute; left: var(--kante); right: var(--kante); top: calc(var(--kopf-hoehe) + var(--a1)); }
  .k-unten { position: absolute; left: var(--kante); right: var(--kante); bottom: var(--a3); }
  .unterzeile { margin-top: var(--a1); }
  .beleg { margin-top: 0; }
  .handlung { margin-top: var(--a1); }
  .beruhigung { margin-top: var(--a1); }
  .dose { bottom: auto; top: 28svh; }
  .wort { bottom: auto; top: 54svh; }
  .schleier { height: 8svh; }
  .dunst { width: 100%; right: 0; height: 56svh; bottom: 18svh; }
  .foto { inset: 0; width: 100%; -webkit-mask-image: none; mask-image: none; object-position: 61% 50%; }
  .abdunkeln { background: linear-gradient(180deg, rgba(23, 16, 11, 0.86) 0%, rgba(23, 16, 11, 0.55) 45%, rgba(23, 16, 11, 0) 80%); }
  .text2 { right: var(--kante); width: auto; top: calc(var(--kopf-hoehe) + var(--a3)); }
  .zahl { bottom: 6svh; }
  .vorn { height: 8svh; }
}

/* ---------- Ruhige Fassung und ohne Skript: nichts bewegt sich */
@media (prefers-reduced-motion: reduce) {
  .anzeige { display: none; }
  .kopftext, .k-oben, .k-unten { opacity: 1; }
  .dose, .dunst, .wort, .schleier, .foto, .zahl, .vorn { translate: none; scale: none; will-change: auto; animation: none; }
}
html:not(.js) .dose, html:not(.js) .dunst, html:not(.js) .wort, html:not(.js) .schleier, html:not(.js) .foto, html:not(.js) .zahl, html:not(.js) .vorn { translate: none; scale: none; }
html:not(.js) .kopftext, html:not(.js) .k-oben, html:not(.js) .k-unten { opacity: 1; }

/* Ohne Bewegung wechselt die Kopfzeile ihre Farbe nicht: sie bekommt einen festen dunklen Grund, damit sie über den hellen Stationen lesbar bleibt */
@media (prefers-reduced-motion: reduce) { .kopfzeile::before { background: rgba(23, 16, 11, 0.94); } }
html:not(.js) .kopfzeile::before { background: rgba(23, 16, 11, 0.94); }

/* Bestellen bleibt auch am Handy in der Kopfzeile (Kaufknopf fest, Bildtafel-Regel 7); grund.css blendet ihn dort sonst aus */
@media (max-width: 860px) { .kopfzeile .knopf--klein { display: inline-flex; } }
