/* ==========================================================================
   Bold Medien — Startseite
     1. Schriften, animierbare Eigenschaften, Tokens
     2. Grundzustand: die fertige Seite (ohne Scroll-Timelines, Reduced Motion)
     3. Build-Choreografie: Module fliegen ein, werden abgelegt, Drop, Leben
     4. Arbeiten seitwaerts
     5. Mobil
   ========================================================================== */

/* --- 1. Schriften, Eigenschaften, Tokens --------------------------------- */

@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("/fonts/inter-tight-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Bricolage Grotesque"; src: url("/fonts/bricolage-grotesque-var.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

/* Zaehler fuer "Module abgelegt 04 / 09" und der Lebendigkeitsgrad der Seite */
@property --placed { syntax: "<integer>"; inherits: true; initial-value: 9; }
@property --life   { syntax: "<number>";  inherits: true; initial-value: 1; }

:root {
  --ink: #080807;
  --ink-2: #121110;
  --paper: #F3EFE8;
  --muted: #8A8580;
  --line: #26241F;
  --signal: #FF4A17;

  --f-text: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --edge: clamp(1.25rem, 4vw, 4rem);
  --ease: cubic-bezier(.16, 1, .3, 1);

  /* Arbeiten: Kartenbreite, Abstand, Innenrand, Anzahl */
  --cw: min(56vw, 52rem, 88dvh);
  --gap: 3vw;
  --pad: var(--edge);
  --n: 7;
}

/* --- 2. Grundzustand: die fertige Seite ---------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); color: var(--paper); -webkit-font-smoothing: antialiased; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; font-family: var(--f-text); line-height: 1.55; overflow-x: clip; }
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; border-radius: 3px; }

.skip { position: fixed; left: 1rem; top: -4rem; z-index: 60; background: var(--paper); color: var(--ink); padding: .6rem 1rem; border-radius: 4px; text-decoration: none; font-weight: 500; }
.skip:focus-visible { top: 1rem; }

/* Module sind im Grundzustand einfach ihr Inhalt */
.mod, .mod-in { position: relative; }
.mod-line, .mod-line > .mod-in { display: block; }
.hero-copy > .mod { width: fit-content; }
.chrome, .canvas, .intro, .scan, .hud { display: none; }

/* Navigation */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: 1.1rem var(--edge);
}
.topbar::before {
  content: ""; position: absolute; inset: 0 0 -2rem; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(8 8 7 / .8), transparent);
}
.brand { font-size: 1rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.brand b { font-weight: 600; }
.brand i { font-style: normal; color: var(--signal); }
.mod-nav { margin-left: auto; }
.topbar nav { display: flex; gap: 2rem; font-size: .9rem; }
.topbar nav a { color: rgb(243 239 232 / .7); text-decoration: none; transition: color .3s; }
.topbar nav a:hover { color: var(--paper); }
.btn {
  display: inline-block; font-size: .88rem; text-decoration: none; white-space: nowrap;
  border: 1px solid rgb(243 239 232 / .3); border-radius: 99px; padding: .45rem 1.05rem;
  transition: background-color .3s, color .3s, border-color .3s;
}
.btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* Hero */
.build { position: relative; }
.build-pin { position: relative; height: 100dvh; min-height: 36rem; overflow: clip; }
.page { position: absolute; inset: 0; }
.m-bg, .m-bg > .mod-in { position: absolute; inset: 0; }
.bg { position: absolute; inset: 0; }
.bg img { width: 100%; height: 100%; object-fit: cover; }
.bg-grau { opacity: 0; }
.bg-farbe { opacity: .6; }
.bg-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--ink) 0%, rgb(8 8 7 / .55) 45%, rgb(8 8 7 / .25) 100%),
    radial-gradient(120% 80% at 50% 0%, transparent, rgb(8 8 7 / .9) 85%);
}
.hero-copy { position: absolute; left: var(--edge); right: var(--edge); bottom: 7dvh; z-index: 2; }
.eyebrow { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 2rem; }
.hero-title {
  font-size: clamp(2.4rem, 6.8vw, 7.4rem); line-height: .94; letter-spacing: -.035em; font-weight: 500;
  display: flex; flex-direction: column; align-items: flex-start;
}
.hero-title em {
  font-family: var(--f-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em;
  color: color-mix(in oklab, var(--signal) calc(var(--life) * 100%), #a19b94);
}
.hero-foot {
  display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-end; justify-content: space-between;
  margin-top: 2.5rem; padding-top: 1.8rem; border-top: 1px solid var(--line);
}
.lead { max-width: 30rem; color: var(--muted); text-wrap: pretty; }
.down { display: inline-flex; align-items: center; gap: .8rem; font-size: .9rem; text-decoration: none; }
.down-ring { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1px solid rgb(243 239 232 / .25); transition: translate .5s var(--ease), border-color .3s; }
.down:hover .down-ring { translate: 0 .25rem; border-color: var(--signal); }

/* Story: im Grundzustand ein Standbild mit allen Kapiteln untereinander */
.story { position: relative; }
.story-pin { position: relative; }
.story-video { width: 100%; aspect-ratio: 16 / 9; max-height: 80dvh; object-fit: cover; }
.story-shade, .dots { display: none; }
.chapters { padding: 4rem var(--edge); display: grid; gap: 3.5rem; max-width: 52rem; }
.ch-no { display: block; font-family: var(--f-serif); color: var(--signal); font-size: 1.3rem; margin-bottom: 1rem; }
.chapter h2 { font-size: clamp(2rem, 4.8vw, 4.4rem); line-height: 1.02; letter-spacing: -.03em; font-weight: 500; text-wrap: balance; }
.chapter p { margin-top: 1.2rem; color: var(--muted); max-width: 34ch; }

/* Laufband */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 1.4rem 0; }
.marquee-track { display: flex; width: max-content; gap: 2.5rem; }
.marquee-track span { display: flex; align-items: center; gap: 2.5rem; font-size: clamp(1.1rem, 2.4vw, 1.9rem); letter-spacing: -.01em; color: var(--muted); white-space: nowrap; }
.marquee-track span::after { content: ""; width: .4rem; height: .4rem; border-radius: 50%; background: var(--signal); }

/* Arbeiten im Grundzustand: normales Raster */
.work { padding: 8rem var(--edge) 6rem; }
.work-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin-bottom: 3.5rem; }
.work-head h2 { font-size: clamp(2rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -.03em; font-weight: 500; max-width: 12ch; }
.work-head p { max-width: 28rem; color: var(--muted); }
.track { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr)); gap: 3.5rem 2.2rem; }
.card { position: relative; }
.meta { margin-top: 1.1rem; display: grid; grid-template-columns: auto 1fr; column-gap: .9rem; row-gap: .1rem; align-items: baseline; }
.meta .no { font-family: var(--f-serif); color: var(--signal); font-size: 1.15rem; grid-row: span 3; }
.meta h3 { font-size: 1.15rem; font-weight: 500; letter-spacing: -.01em; }
.meta p { color: var(--muted); font-size: .9rem; }
.meta a { font-size: .9rem; text-decoration: none; border-bottom: 1px solid var(--line); width: fit-content; transition: color .3s, border-color .3s; }
.meta a:hover { color: var(--signal); border-color: var(--signal); }

/* Vorschaufenster: jede Karte eine eigene kleine Website in Container-Einheiten */
.pv { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; border: 1px solid var(--line); container-type: size; isolation: isolate; transition: translate .6s var(--ease); }
.card:hover .pv { translate: 0 -.4rem; }
.tag {
  position: absolute; right: .7rem; bottom: .7rem; z-index: 5;
  font-family: var(--f-mono); font-size: .66rem; letter-spacing: .04em;
  background: rgb(8 8 7 / .78); color: var(--paper); border: 1px solid rgb(243 239 232 / .16);
  padding: .2rem .55rem; border-radius: 99px;
}
.pv-shot img { width: 100%; height: 100%; object-fit: cover; }

/* Nordwerk — Fine Dining: hell, ruhig, Serife */
.pv-nordwerk { background: #F2ECE2; color: #1F1B16; }
.nw-nav { position: absolute; top: 6cqh; left: 6cqw; right: 6cqw; display: flex; justify-content: space-between; align-items: center; font-size: 1.5cqw; letter-spacing: .14em; text-transform: uppercase; }
.nw-logo { font-family: var(--f-serif); font-size: 3.2cqw; letter-spacing: .02em; text-transform: none; }
.nw-copy { position: absolute; left: 6cqw; bottom: 11cqh; width: 52cqw; }
.nw-kick { font-size: 1.4cqw; letter-spacing: .16em; text-transform: uppercase; opacity: .55; }
.nw-title { font-family: var(--f-serif); font-size: 8.4cqw; line-height: .95; margin-top: 2.5cqh; }
.nw-title em { color: #8C5A3C; }
.nw-link { display: inline-block; margin-top: 4cqh; font-size: 1.5cqw; border-bottom: 1px solid currentColor; padding-bottom: .4cqh; }
.nw-img { position: absolute; right: 6cqw; top: 17cqh; bottom: 11cqh; width: 30cqw; height: auto; object-fit: cover; filter: sepia(.25) saturate(.8) contrast(1.05); }

/* Fuoco — Pizzeria: laut, rot, riesige Schrift */
.pv-fuoco { background: #D5321E; color: #FFE7A1; }
.fu-title {
  position: absolute; left: -1.5cqw; top: -2cqh; z-index: 1;
  font-family: var(--f-display); font-weight: 800; font-variation-settings: "wght" 800;
  font-size: 30cqw; line-height: .8; letter-spacing: -.07em; text-transform: uppercase;
}
.fu-video { position: absolute; left: 5cqw; bottom: 16cqh; z-index: 2; width: 46cqw; height: 42cqh; object-fit: cover; border-radius: 2cqw; border: .6cqw solid #FFE7A1; }
.fu-sticker {
  position: absolute; right: 8cqw; top: 38cqh; z-index: 3; width: 18cqw; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center; text-align: center;
  background: #FFE7A1; color: #D5321E; rotate: -14deg;
  font-family: var(--f-display); font-weight: 700; font-size: 1.9cqw; line-height: 1.05; text-transform: uppercase;
  box-shadow: 0 1cqw 0 #111;
}
.fu-strip { position: absolute; left: 0; right: 0; bottom: 0; height: 12cqh; z-index: 3; background: #111; display: flex; align-items: center; overflow: hidden; white-space: nowrap; font-family: var(--f-display); font-weight: 700; font-size: 3cqw; text-transform: uppercase; }
.fu-strip span { padding-left: 2cqw; }

/* Atlas — Cocktailbar: dunkelgruen, Messing, Bogenfenster */
.pv-atlas {
  background: #0E2823; color: #EDE3C8;
  background-image: repeating-linear-gradient(90deg, rgb(200 165 90 / .07) 0 1px, transparent 1px 6cqw);
}
.at-arch { position: absolute; right: 8cqw; top: 10cqh; bottom: 0; width: 34cqw; border-radius: 17cqw 17cqw 0 0; overflow: hidden; border: .5cqw solid #C8A55A; border-bottom: 0; }
.at-arch img { width: 100%; height: 100%; object-fit: cover; }
.at-copy { position: absolute; left: 7cqw; top: 50%; translate: 0 -50%; width: 44cqw; }
.at-kick { font-size: 1.4cqw; letter-spacing: .22em; text-transform: uppercase; color: #C8A55A; }
.at-title { font-family: var(--f-serif); font-style: italic; font-size: 16cqw; line-height: .9; color: #C8A55A; margin-top: 1cqh; }
.at-lines { font-size: 1.5cqw; border-top: 1px solid rgb(200 165 90 / .45); padding-top: 2.5cqh; margin-top: 3cqh; opacity: .85; }

/* Koji — Izakaya: Washi-Papier, roter Kreis, senkrechte Schrift */
.pv-koji {
  background: #EEE9DE; color: #161412;
  background-image: linear-gradient(rgb(0 0 0 / .05) 1px, transparent 1px);
  background-size: 100% 10cqh;
}
.kj-sun { position: absolute; right: 16cqw; top: 15cqh; width: 28cqw; aspect-ratio: 1; border-radius: 50%; background: #C3202B; }
.kj-vert { position: absolute; right: 6cqw; top: 11cqh; writing-mode: vertical-rl; font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; font-size: 4.4cqw; letter-spacing: .35em; }
.kj-copy { position: absolute; left: 7cqw; bottom: 12cqh; }
.kj-title { font-family: var(--f-serif); font-size: 12cqw; line-height: .9; }
.kj-sub { font-size: 1.5cqw; letter-spacing: .22em; text-transform: uppercase; margin-top: 1.5cqh; }
.kj-box { display: inline-block; margin-top: 3.5cqh; border: 1px solid currentColor; padding: 1.2cqh 2.4cqw; font-size: 1.5cqw; }

/* Form & Faktor — Cafe: Salbei und Rose, weiche Formen */
.pv-form { background: #D6E0CD; color: #2D3B2A; }
.ff-blob { position: absolute; right: 6cqw; top: 10cqh; width: 42cqw; height: 76cqh; overflow: hidden; background: #F1C7BD; border-radius: 48% 52% 60% 40% / 45% 40% 60% 55%; }
.ff-blob img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: multiply; }
.ff-title { position: absolute; left: 6cqw; top: 12cqh; font-family: var(--f-display); font-weight: 600; font-variation-settings: "wght" 600; font-size: 11cqw; line-height: .88; letter-spacing: -.045em; }
.ff-pills { position: absolute; left: 6cqw; bottom: 12cqh; display: flex; flex-wrap: wrap; gap: 1.2cqw; max-width: 44cqw; }
.ff-pills span { background: #F1C7BD; border-radius: 99px; padding: 1.2cqh 2.6cqw; font-size: 1.8cqw; }

/* Kontaktkarte */
.pv-cta { background: var(--ink-2); display: flex; flex-direction: column; justify-content: flex-end; gap: 3cqh; padding: 7cqw; }
.cta-kick { font-family: var(--f-mono); font-size: 1.5cqw; color: var(--signal); }
.cta-title { font-size: 8cqw; line-height: 1; letter-spacing: -.035em; font-weight: 500; text-wrap: balance; }
.cta-mail { font-size: 2.2cqw; text-decoration: none; border-bottom: 1px solid var(--signal); width: fit-content; }

/* Ablauf */
.process { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3rem 2rem; padding: 10rem var(--edge); border-top: 1px solid var(--line); }
.process-head { grid-column: 1 / 5; }
.process-head h2 { font-size: clamp(2rem, 4.8vw, 4rem); line-height: 1; letter-spacing: -.03em; font-weight: 500; }
.process-head p { margin-top: 1.5rem; color: var(--muted); max-width: 22rem; }
.steps { grid-column: 5 / 13; }
.steps li { display: grid; grid-template-columns: 3.5rem 12rem 1fr; gap: .5rem 1.5rem; padding: 2rem 0; border-top: 1px solid var(--line); }
.st-no { font-family: var(--f-serif); color: var(--signal); font-size: 1.5rem; line-height: 1; }
.steps h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -.01em; }
.steps p { color: var(--muted); max-width: 30rem; }

/* Kontakt */
.contact { position: relative; padding: 16dvh var(--edge) 12dvh; overflow: clip; }
.contact::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 60% at 50% 100%, rgb(255 74 23 / .16), transparent); }
.contact-kick { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 2rem; }
.contact h2 { font-size: clamp(2.6rem, 8vw, 7rem); line-height: .95; letter-spacing: -.035em; font-weight: 500; max-width: 13ch; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 3rem 4rem; margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem 1.5rem; }
.field { display: grid; gap: .5rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.field label span { text-transform: none; letter-spacing: 0; opacity: .7; margin-left: .3rem; }
.field input, .field textarea {
  font: inherit; font-size: 1.05rem; color: var(--paper); background: transparent;
  border: 0; border-bottom: 1px solid rgb(243 239 232 / .25); border-radius: 0;
  padding: .55rem 0; resize: vertical; transition: border-color .3s;
}
.field textarea { min-height: 6rem; }
.field input::placeholder, .field textarea::placeholder { color: rgb(138 133 128 / .7); }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--signal); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.2rem 2rem; margin-top: .5rem; }
.form-note { font-size: .82rem; color: var(--muted); max-width: 26rem; }
.form-note a { color: var(--paper); }
.submit {
  font: inherit; font-size: .95rem; cursor: pointer; color: var(--ink); background: var(--paper);
  border: 0; border-radius: 99px; padding: .85rem 1.6rem; transition: background-color .3s, translate .4s var(--ease);
}
.submit:hover { background: var(--signal); }
.submit:hover span { display: inline-block; translate: .2rem 0; }
.contact-alt { display: grid; align-content: start; gap: .8rem; }
.contact-alt p { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 800px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .form { grid-template-columns: 1fr; }
}
.contact-mail { font-family: var(--f-serif); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 2.2rem); text-decoration: underline 1px; text-underline-offset: .18em; transition: color .4s; }
.contact-mail:hover { color: var(--signal); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 2rem var(--edge); border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); content-visibility: auto; contain-intrinsic-size: auto 5rem; }
.foot nav { display: flex; gap: 1.5rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--paper); }

/* Zeitbasierte Eigenbewegung: Laufband und die lebenden Vorschaufenster */
@media (prefers-reduced-motion: no-preference) {
  .marquee-track { animation: slide 38s linear infinite; }
  .fu-strip span { animation: slide 14s linear infinite; display: inline-block; }
  .fu-sticker { animation: wobble 5s ease-in-out infinite; }
  .nw-img, .at-arch img, .ff-blob img { animation: drift 16s ease-in-out infinite alternate; }
  .kj-sun { animation: breathe 7s ease-in-out infinite; }
  .ff-blob { animation: morph 12s ease-in-out infinite alternate; }
}
@keyframes slide   { to { translate: -50% 0; } }
@keyframes wobble  { 50% { rotate: -6deg; scale: 1.05; } }
@keyframes drift   { from { scale: 1.02; } to { scale: 1.12; translate: 2% -2%; } }
@keyframes breathe { 50% { scale: 1.06; } }
@keyframes morph   { to { border-radius: 58% 42% 45% 55% / 55% 60% 40% 45%; } }

/* ==========================================================================
   3. Build-Choreografie
   Timeline --build = die gepinnte Strecke des Hero (Prozent davon):
      0–11   Intro "So bauen wir Websites fuer Restaurants und Bars."
      8–43   Module fliegen ein (vorne, links, rechts, oben, unten) und werden
             lose abgelegt: schraeg, schwebend, mit Schatten
     46–58   Drop: alles rastet mit Aufprall ein, Etiketten werden "fixiert"
     55–61   Scanlinie ueber die ganze Seite
     58–72   Leben: Modulrahmen verschwinden, Farbe, Licht, Akzent
     72–100  die fertige Seite steht
   Jedes Modul traegt seine eigenen Bereiche als --a (Anflug) und --d (Drop).
   Zwei verschachtelte Elemente, damit sich Anflug und Drop nicht ueberschreiben:
   .mod-in fliegt von aussen zur Ablage, .mod faellt von der Ablage an den Platz.
   ========================================================================== */

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    :root {
      --r-life: contain 58% contain 72%;
    }
    body { timeline-scope: --build, --work; }

    .build { height: 650dvh; view-timeline: --build block; }
    .build-pin {
      position: sticky; top: 0;
      animation: life linear both;
      animation-timeline: --build; animation-range: var(--r-life);
    }
    .topbar {
      animation: life linear both;
      animation-timeline: --build; animation-range: var(--r-life);
    }
    .topbar::before { animation: fade-in linear both; animation-timeline: --build; animation-range: var(--r-life); }

    /* Werkstatt-Ebene */
    .canvas, .intro, .scan, .hud, .chrome { display: block; }
    .canvas {
      position: absolute; inset: 0; pointer-events: none;
      background:
        radial-gradient(circle, rgb(243 239 232 / .13) 1px, transparent 1.5px) 0 0 / 28px 28px,
        var(--ink);
      animation: canvas linear both;
      animation-timeline: --build; animation-range: contain 2% contain 70%;
    }
    .canvas-label { position: absolute; right: var(--edge); bottom: 1.4rem; font-family: var(--f-mono); font-size: .7rem; color: #6f6c67; }

    .intro {
      position: absolute; inset: 0; z-index: 30; display: grid; align-content: center;
      padding: 0 var(--edge); pointer-events: none;
      animation: intro-out linear both;
      animation-timeline: --build; animation-range: contain 4% contain 11%;
    }
    .intro-kicker { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .06em; color: var(--muted); margin-bottom: 1.6rem; }
    .intro-title { font-size: clamp(2.6rem, 7.4vw, 7.6rem); line-height: .95; letter-spacing: -.04em; font-weight: 500; max-width: 13ch; text-wrap: balance; }
    .intro-sub { margin-top: 1.6rem; color: var(--muted); font-size: clamp(1rem, 1.4vw, 1.2rem); }
    .intro-cue { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; margin-top: 2.2rem; border-radius: 50%; border: 1px solid rgb(243 239 232 / .25); animation: bob 1.8s ease-in-out infinite; }

    /* --- Module ---------------------------------------------------------- */
    .mod {
      animation: mod-drop linear both;
      animation-timeline: --build; animation-range: var(--d);
    }
    .mod-in {
      display: block; isolation: isolate;
      animation: mod-arrive linear both;
      animation-timeline: --build; animation-range: var(--a);
    }
    .topbar .mod-in { display: inline-block; }

    /* Der Modulrahmen: Flaeche, Kontur, Etikett, vier Anfasser, Schatten */
    .chrome {
      position: absolute; inset: -.6em -.8em; z-index: -1; pointer-events: none;
      border: 1px solid rgb(243 239 232 / .42); border-radius: 8px;
      background: rgb(22 21 19 / .78);
      animation: fade-out linear both;
      animation-timeline: --build; animation-range: var(--r-life);
    }
    .chrome::after {
      content: ""; position: absolute; inset: 0; border-radius: inherit;
      box-shadow: 0 50px 90px -24px rgb(0 0 0 / .95), 0 18px 30px -12px rgb(0 0 0 / .7);
      animation: shadow-land linear both;
      animation-timeline: --build; animation-range: var(--d);
    }
    .chrome i { position: absolute; width: 7px; height: 7px; background: var(--ink); border: 1px solid var(--paper); }
    .chrome i:nth-of-type(1) { left: -4px; top: -4px; }
    .chrome i:nth-of-type(2) { right: -4px; top: -4px; }
    .chrome i:nth-of-type(3) { left: -4px; bottom: -4px; }
    .chrome i:nth-of-type(4) { right: -4px; bottom: -4px; }
    .tab {
      position: absolute; left: -1px; bottom: calc(100% + 5px);
      font: 500 .66rem/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
      background: var(--paper); color: var(--ink); padding: .32em .6em; border-radius: 3px;
    }
    /* Beim Einrasten wechselt das Etikett: altes aus, "fixiert" an */
    .tab:not(.ok) {
      animation: tab-old linear both;
      animation-timeline: --build; animation-range: var(--d);
    }
    .tab.ok {
      background: var(--signal); color: var(--ink);
      animation: tab-ok linear both;
      animation-timeline: --build; animation-range: var(--d);
    }
    .hero-title .chrome { inset: .02em -.25em; }
    /* Oben am Rand: Etiketten der Navigation unter die Module statt darueber */
    .topbar .tab { bottom: auto; top: calc(100% + 6px); }
    .hero-title .tab { font-size: .66rem; letter-spacing: .04em; }

    /* Hintergrundbild als grosse Bildkarte */
    .m-bg .chrome { inset: 0; border-radius: 12px; }
    .m-bg .tab { left: 1.2rem; top: 1.2rem; bottom: auto; }
    .bg-grau { opacity: .85; animation: fade-out linear both; animation-timeline: --build; animation-range: var(--r-life); }
    .bg-farbe, .bg-shade { animation: fade-in linear both; animation-timeline: --build; animation-range: var(--r-life); }
    .bg img { animation: kenburns linear both; animation-timeline: --build; animation-range: contain 58% contain 100%; }

    /* Aufprall der ganzen Seite, Scanlinie, Anzeige */
    .page { animation: thud linear both; animation-timeline: --build; animation-range: contain 50% contain 59%; }
    .scan {
      position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 25; pointer-events: none;
      background: var(--signal); box-shadow: 0 0 24px 4px rgb(255 74 23 / .55);
      animation: scan linear both;
      animation-timeline: --build; animation-range: contain 55% contain 61%;
    }
    .hud {
      position: absolute; left: var(--edge); bottom: 1.4rem; z-index: 35; margin: 0;
      font-family: var(--f-mono); font-size: .72rem; letter-spacing: .04em; color: var(--paper);
      min-width: 16rem; height: 1.2em;
    }
    .hud > span { position: absolute; left: 0; top: 0; white-space: nowrap; }
    .placed::after { counter-reset: n var(--placed); content: counter(n, decimal-leading-zero); }
    .hud-a { animation: hud-a linear both, count linear both; animation-timeline: --build, --build; animation-range: contain 6% contain 47%, contain 8% contain 43%; }
    .hud-b { color: var(--signal); animation: hud-b linear both; animation-timeline: --build; animation-range: contain 44% contain 60%; }
    .hud-c { display: inline-flex; align-items: center; gap: .5em; animation: hud-c linear both; animation-timeline: --build; animation-range: contain 58% contain 80%; }
    .hud-c i { width: .5em; height: .5em; border-radius: 50%; background: var(--signal); animation: breathe 1.6s ease-in-out infinite; }

    /* --- Keyframes ------------------------------------------------------- */
    @keyframes life    { from { --life: 0; } to { --life: 1; } }
    @keyframes count   { from { --placed: 0; } to { --placed: 9; } }
    @keyframes fade-in  { from { opacity: 0; } }
    @keyframes fade-out { to { opacity: 0; } }
    @keyframes bob { 50% { translate: 0 .35rem; } }

    @keyframes canvas { 0% { opacity: 0; } 12% { opacity: 1; } 84% { opacity: 1; } 100% { opacity: 0; } }
    @keyframes intro-out { to { opacity: 0; translate: 0 -8dvh; scale: .96; } }

    /* Anflug: von aussen bis zur Ablage. Bremst am Ende ab. */
    @keyframes mod-arrive {
      0% {
        translate: var(--fx, 0px) var(--fy, 0px); scale: var(--fs, 1); rotate: var(--fr, 0deg); opacity: 0;
        animation-timing-function: cubic-bezier(.12, .7, .2, 1);
      }
      25%  { opacity: 1; }
      100% { translate: 0 0; scale: 1; rotate: 0deg; opacity: 1; }
    }
    /* Drop: von der schraegen Ablage an den festen Platz — mit Aufprall */
    @keyframes mod-drop {
      0%   { translate: calc(var(--lx, 0px) * var(--k-lx, 1)) var(--ly, 0px); rotate: var(--lr, 0deg); scale: var(--ls, 1.035); animation-timing-function: cubic-bezier(.6, 0, .9, .4); }
      68%  { translate: 0 0; rotate: 0deg; scale: .965; animation-timing-function: cubic-bezier(.2, .9, .3, 1.2); }
      100% { translate: 0 0; rotate: 0deg; scale: 1; }
    }
    @keyframes shadow-land { 0% { opacity: 1; } 68% { opacity: .15; } 100% { opacity: .25; } }
    @keyframes tab-ok  { 0% { opacity: 0; } 72% { opacity: 0; } 100% { opacity: 1; } }
    @keyframes tab-old { 0% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }

    @keyframes thud { 0% { scale: 1; } 55% { scale: .985; } 75% { scale: 1.004; } 100% { scale: 1; } }
    @keyframes scan { 0% { translate: 0 0; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { translate: 0 100dvh; opacity: 0; } }
    @keyframes kenburns { from { scale: 1; } to { scale: 1.07; } }

    @keyframes hud-a { 0% { opacity: 0; } 8% { opacity: 1; } 90% { opacity: 1; } 100% { opacity: 0; } }
    @keyframes hud-b { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
    @keyframes hud-c { 0% { opacity: 0; } 20% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }

    /* --- 4. Arbeiten seitwaerts ------------------------------------------ */
    .work { height: 560dvh; padding: 0; view-timeline: --work block; }
    .work-pin {
      position: sticky; top: 0; height: 100dvh; overflow: clip;
      display: grid; grid-template-rows: auto 1fr; align-content: start;
      padding-top: 11dvh;
    }
    .work-head { padding-inline: var(--pad); margin-bottom: 3dvh; }
    .track {
      display: flex; gap: var(--gap); padding-inline: var(--pad);
      grid-template-columns: none; align-items: start;
      will-change: transform;
      animation: work-x linear both;
      animation-timeline: --work; animation-range: contain 0% contain 100%;
    }
    .card { flex: 0 0 var(--cw); }
    @keyframes work-x {
      to { translate: calc(-1 * (var(--n) * var(--cw) + (var(--n) - 1) * var(--gap) + 2 * var(--pad) - 100vw)) 0; }
    }

    /* Ablauf und Kontakt: leichtes Auftauchen beim Hereinscrollen */
    .steps li, .contact h2, .contact-grid {
      animation: rise linear both;
      animation-timeline: view(); animation-range: entry 0% entry 60%;
    }
    @keyframes rise { from { opacity: .15; translate: 0 2.5rem; } }

    /* --- 5. Mobil -------------------------------------------------------- */
    @media (max-width: 700px) {
      /* Schmaler Tisch: seitliche Ablage-Versaetze auf ein Drittel */
      :root { --k-lx: .3; }
      .mod-nav { display: none; }
      .work { height: auto; padding: 7rem 0 4rem; }
      .work-pin { position: static; height: auto; padding-top: 0; display: block; overflow: visible; }
      .track {
        animation: none; will-change: auto;
        overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
        padding-bottom: 1rem; gap: 4vw;
      }
      .card { flex: 0 0 84vw; scroll-snap-align: center; }
    }
  }
}

/* Story im lebenden Modus (von main.js gesetzt): Film klebt, Kapitel wechseln */
html.story-live .story { height: 340dvh; }
html.story-live .story-pin { position: sticky; top: 0; height: 100dvh; overflow: clip; }
html.story-live .story-video { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; }
html.story-live .story-shade {
  display: block; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to right, var(--ink) 0%, rgb(8 8 7 / .55) 42%, transparent 75%),
    linear-gradient(to top, rgb(8 8 7 / .8) 0%, transparent 40%, rgb(8 8 7 / .45) 100%);
}
html.story-live .chapters { position: absolute; inset: 0; display: block; max-width: none; padding: 0 var(--edge); }
html.story-live .chapter { position: absolute; left: var(--edge); top: 50%; width: min(40rem, 84vw); translate: 0 -50%; opacity: 0; will-change: opacity, transform; }
html.story-live .chapter:first-child { opacity: 1; }
html.story-live .dots { display: flex; flex-direction: column; gap: .8rem; position: absolute; right: var(--edge); top: 50%; translate: 0 -50%; }
html.story-live .dots li { width: 2rem; height: 1px; background: rgb(243 239 232 / .25); transform-origin: right; transition: background-color .4s, scale .5s var(--ease); }
html.story-live .dots li.on { background: var(--signal); scale: 1.6 1; }

@media (max-width: 700px) {
  .topbar nav { display: none; }
  .bg img { object-position: 74% 50%; }   /* im Hochformat den Lichtstreifen der Tuer zeigen */
  .hero-foot { flex-direction: column; align-items: flex-start; }
  .process { padding-block: 6rem; }
  .process-head, .steps { grid-column: 1 / -1; }
  .steps li { grid-template-columns: 2.5rem 1fr; }
  .steps p { grid-column: 2; }
  html.story-live .story-shade { background: linear-gradient(to top, var(--ink) 0%, rgb(8 8 7 / .45) 55%, rgb(8 8 7 / .6) 100%); }
  html.story-live .chapter { top: auto; bottom: 12dvh; translate: 0 0; }
  html.story-live .dots { display: none; }
}
