/* NOIR Detailing – Demo. Ein Scroll-Film auf einer Bühne.
   Zwei Modi: html.film (GSAP läuft, Bühne klebt, Ebenen überblenden)
   und der Grundzustand (ohne JS / reduzierte Bewegung): Standbild-
   Sektionen untereinander. Der Grundzustand muss allein vollständig sein. */

@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../assets/fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}

:root {
  --grund: #050608;
  --flaeche: #0B0D12;
  --text: #F2F2F0;
  --text-2: #9A9FA8;
  /* Akzent aus den Lackpixeln von master.png: hellste Metallic-Flocken
     #3463A1 (Farbton 214–218°), auf lesbare Helligkeit angehoben.
     --lack = 90. Perzentil der Lackfläche. */
  --akzent: #6F98D6;
  --lack: #122240;
  --linie: rgb(242 242 240 / 0.14);

  --schrift: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --sperrung: 0.08em;
  --rand: clamp(1.25rem, 4.5vw, 4rem);
  --gross: clamp(2.5rem, 8.2vw, 8.75rem);
  --mittel: clamp(1.35rem, 3vw, 2.6rem);

  /* Bildausschnitt: im Hochformat nach rechts, damit Rad und Front im Bild bleiben */
  --pos-x: 50%;
  --pos-y: 50%;
  color-scheme: dark;
}
@media (orientation: portrait) {
  :root { --pos-x: 60%; }
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--grund); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-weight: 400;
  font-size: clamp(1rem, 0.35vw + 0.9rem, 1.125rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }

.visuell-versteckt {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 100;
  background: var(--text); color: var(--grund); padding: .6rem 1rem;
  text-decoration: none; font-weight: 500;
}
.skip:focus { top: 1rem; }

/* ---------- Kopf ---------- */
.kopf {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; justify-content: space-between; align-items: center;
  padding: clamp(1rem, 2.4vw, 2rem) var(--rand);
  pointer-events: none;
}
.kopf > * { pointer-events: auto; }
.marke { display: inline-flex; align-items: center; text-decoration: none; }
.marke-bild { height: clamp(44px, 4.4vw, 62px); width: auto; }
/* nicht display:none – ein lazy-Bild lädt sonst nie und meldet nie onload */
.marke:not(.hat-logo) .marke-bild { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.marke.hat-logo .wortmarke { display: none; }
.wortmarke { display: inline-flex; flex-direction: column; line-height: 1; text-transform: uppercase; }
.wortmarke b { font-weight: 500; font-size: 1.2rem; letter-spacing: .34em; }
.wortmarke span { font-size: .58rem; letter-spacing: .62em; color: var(--text-2); margin-top: .45em; }

.menue-knopf {
  display: inline-flex; align-items: center; gap: .8rem;
  font: 500 .75rem/1 var(--schrift); letter-spacing: .24em; text-transform: uppercase;
  color: var(--text); background: none; border: 0; padding: .75rem 0 .75rem .75rem; cursor: pointer;
}
.menue-striche { position: relative; width: 26px; height: 8px; }
.menue-striche::before, .menue-striche::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transition: transform .35s ease;
}
.menue-striche::before { top: 0; }
.menue-striche::after { bottom: 0; }
.menue-knopf[aria-expanded="true"] .menue-striche::before { transform: translateY(3.5px) rotate(20deg); }
.menue-knopf[aria-expanded="true"] .menue-striche::after { transform: translateY(-3.5px) rotate(-20deg); }

.menue {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center;
  padding: 6rem var(--rand) 3rem;
  background: rgb(5 6 8 / 0.97);
  opacity: 0; transition: opacity .4s ease;
}
.menue.offen { opacity: 1; }
.menue ul { list-style: none; margin: 0; padding: 0; }
.menue a {
  display: inline-block; text-decoration: none; text-transform: uppercase;
  font-size: clamp(1.9rem, 5.4vw, 4.4rem); letter-spacing: var(--sperrung); line-height: 1.25;
  color: var(--text-2); transition: color .25s ease;
}
.menue a:hover, .menue a:focus-visible { color: var(--text); }

/* ---------- Typografie der Kapitel ---------- */
.schlagzeile {
  font-weight: 400; font-size: var(--gross); line-height: .98;
  letter-spacing: var(--sperrung); text-transform: uppercase;
}
.schlagzeile > span { display: block; }
.schlagzeile .leise { font-size: var(--mittel); line-height: 1.2; color: var(--text-2); margin-top: .7em; }
.schlagzeile.klein { font-size: var(--mittel); }
.unterzeile { margin-top: 1.4rem; color: var(--text-2); letter-spacing: .04em; }
.absatz {
  max-width: 34rem; margin-top: 1.6rem; color: var(--text-2);
  padding-left: 1.1rem; border-left: 1px solid var(--akzent);
}
.scroll-hinweis {
  margin-top: 2.6rem; font-size: .7rem; letter-spacing: .3em; text-transform: uppercase; color: var(--text-2);
  display: flex; align-items: center; gap: 1rem;
}
.scroll-hinweis::after { content: ""; width: 3rem; height: 1px; background: var(--linie); }

/* ---------- Grundzustand: Standbild-Sektionen ---------- */
.buehne {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: minmax(100svh, auto);
}
.rahmen, .texte, .ebene-lack { display: contents; }
.ebene, .medium, .text { grid-column: 1; grid-row: var(--zeile); }
.ebene, .medium { position: relative; overflow: hidden; }
.medium, .medium picture { height: 100%; }
.ebene picture { display: block; height: 100%; }
.bild, .schaum-video, .loop-video {
  width: 100%; height: 100%; object-fit: cover; object-position: var(--pos-x) var(--pos-y);
}
.schaum-video, .loop-video, .schleier, .wischkante { display: none; }
.ebene::after, .medium::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgb(5 6 8 / .92) 0%, rgb(5 6 8 / .55) 30%, transparent 60%);
}
.text {
  position: relative; z-index: 2; align-self: end;
  padding: 0 var(--rand) clamp(3rem, 9vh, 6rem);
}
.js:not(.film) .text { opacity: 0; transform: translateY(1.5rem); transition: opacity 1s ease, transform 1s ease; }
.js:not(.film) .text.sichtbar { opacity: 1; transform: none; }

/* ---------- Film-Modus ---------- */
html.film .film { position: relative; height: var(--filmhoehe, 740vh); }
html.film .buehne {
  display: block; position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden;
}
html.film .rahmen, html.film .ebene-lack.wach { display: block; }
html.film .rahmen { position: absolute; inset: 0; }
html.film .ebene, html.film .medium { position: absolute; inset: 0; }
html.film .ebene::after, html.film .medium::after { display: none; }
html.film .schaum-video { display: block; position: absolute; inset: 0; opacity: 0; transition: opacity .3s linear; }
html.film .schaum-video.bereit { opacity: 1; }

/* Ebenen, die JS noch nicht geweckt hat: display:none, damit ihre
   lazy-Bilder nicht sofort mit der Bühne laden. */
html.film .ebene[data-weck]:not(.wach) { display: none; }
html.film [data-ebene="lack"], html.film [data-ebene="innen"], html.film .perlen { opacity: 0; }

/* Enthüllung: weiche Wischkante von oben nach unten, 120 px unscharf */
html.film [data-ebene="sauber"] {
  --wisch: 0;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(var(--wisch) * (100% + 120px) - 120px), transparent calc(var(--wisch) * (100% + 120px)));
  mask-image: linear-gradient(to bottom, #000 calc(var(--wisch) * (100% + 120px) - 120px), transparent calc(var(--wisch) * (100% + 120px)));
  will-change: transform;
}
/* Lichtsaum an der Wasserfront */
html.film .wischkante {
  display: block; position: absolute; left: 0; right: 0; height: 140px; pointer-events: none;
  top: calc(var(--wisch, 0) * (100% + 120px) - 130px);
  background: linear-gradient(to bottom, transparent, rgb(200 215 245 / .07) 55%, rgb(220 230 250 / .11) 80%, transparent);
  mix-blend-mode: screen; opacity: 0;
}

html.film .schleier { display: block; position: absolute; inset: 0; background: var(--flaeche); opacity: 0; }

html.film .texte { display: block; position: absolute; inset: 0; pointer-events: none; }
html.film .texte::before {
  /* Lesbarkeit links unten – kein flächiges Overlay über das ganze Bild */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 70% at 0% 100%, rgb(5 6 8 / .82) 0%, rgb(5 6 8 / .45) 40%, transparent 70%);
}
html.film .text {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: 0 var(--rand) clamp(2.5rem, 9vh, 6.5rem);
  opacity: 0; visibility: hidden;
}
html.film .text-held { opacity: 1; visibility: visible; }

/* Hochformat: Film in einem Bildfenster oben, Text darunter im Dunkeln */
@media (orientation: portrait) {
  html.film .rahmen {
    top: 6svh; bottom: auto; height: 64svh;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 70%, transparent 100%);
  }
  html.film .texte::before { background: linear-gradient(to top, rgb(5 6 8 / .9) 0%, transparent 45%); }
  html.film .text { padding-bottom: max(2rem, 6svh); }
  :root { --gross: clamp(2.3rem, 11.5vw, 4.5rem); --mittel: clamp(1.15rem, 5vw, 1.6rem); }
  .absatz { font-size: .95rem; margin-top: 1.1rem; }
  .schlagzeile .leise { margin-top: .5em; }
}

/* ---------- Leistungen ---------- */
.leistungen { background: var(--flaeche); padding: clamp(6rem, 16vh, 11rem) var(--rand); min-height: 100svh; display: flex; align-items: center; }
.leistungen-innen { width: 100%; max-width: 72rem; margin: 0 auto; }
.pakete { list-style: none; margin: clamp(2.5rem, 6vh, 4rem) 0 0; padding: 0; border-bottom: 1px solid var(--linie); }
.paket {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem;
  padding: 1.8rem 0; border-top: 1px solid var(--linie);
}
.paket h3 { font-weight: 500; font-size: 1.05rem; letter-spacing: .14em; text-transform: uppercase; }
.paket p { color: var(--text-2); max-width: 36rem; }
.paket .preis { color: var(--text-2); font-size: .9rem; letter-spacing: .06em; }
.paket .preis b { color: var(--text); font-weight: 500; font-size: 1.35rem; letter-spacing: .02em; margin-left: .3em; }
@media (min-width: 900px) {
  .paket { grid-template-columns: 17rem minmax(0, 1fr) 10rem; gap: 2.5rem; align-items: baseline; padding: 2.2rem 0; }
  .paket .preis { text-align: right; }
}
.hinweis { margin-top: 1.8rem; font-size: .85rem; color: var(--text-2); }

/* ---------- Abschluss ---------- */
.schluss { position: relative; background: var(--flaeche); }
.schluss-buehne { position: relative; min-height: 100svh; overflow: hidden; display: grid; place-items: center; }
.schluss-bild { position: absolute; inset: 0; }
.schluss-bild picture { display: block; height: 100%; }
.schluss-bild::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, var(--flaeche) 0%, transparent 22%),
    radial-gradient(60% 55% at 50% 50%, rgb(5 6 8 / .6) 0%, transparent 100%);
}
.schluss-inhalt {
  position: relative; z-index: 1; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: clamp(1.8rem, 5vh, 3rem);
  padding: 7rem var(--rand) 5rem;
}
.schluss-marke .marke-bild { height: clamp(150px, 24vw, 300px); }
.schluss-marke .wortmarke { align-items: center; }
.schluss-marke .wortmarke b { font-size: clamp(2.6rem, 8vw, 6rem); letter-spacing: .3em; margin-right: -.3em; }
.schluss-marke .wortmarke span { font-size: clamp(.7rem, 1.4vw, 1rem); letter-spacing: .9em; margin-right: -.9em; }
.knopf {
  display: inline-block; text-decoration: none; text-transform: uppercase;
  font-weight: 500; font-size: .82rem; letter-spacing: .26em;
  padding: 1.15rem 2.4rem; border: 1px solid rgb(242 242 240 / .6);
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
.knopf:hover, .knopf:focus-visible { background: var(--text); color: var(--grund); border-color: var(--text); }
.daten { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem 4rem; margin: 0; font-size: .9rem; color: var(--text-2); }
.daten dt { font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--text); margin-bottom: .4rem; }
.daten dd { margin: 0; }

html.film .schluss { height: 180vh; }
html.film .schluss-buehne { position: sticky; top: 0; height: 100vh; min-height: 0; }
html.film .schluss-bild { will-change: transform; }

/* ---------- Fuß ---------- */
.fuss {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
  padding: 2rem var(--rand); background: var(--grund);
  font-size: .78rem; letter-spacing: .06em; color: var(--text-2);
  border-top: 1px solid var(--linie);
}
.fuss a { margin-left: 1.5rem; text-decoration: none; }
.fuss a:first-child { margin-left: 0; }
.fuss a:hover { color: var(--text); }

/* ---------- Unterseiten ---------- */
.seite { max-width: 44rem; margin: 0 auto; padding: 9rem var(--rand) 6rem; min-height: 80vh; }
.seite h1 { font-weight: 400; font-size: var(--mittel); letter-spacing: var(--sperrung); text-transform: uppercase; }
.seite p { margin-top: 1.2rem; color: var(--text-2); }
.seite .demo { color: var(--text); border-left: 1px solid var(--akzent); padding-left: 1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js:not(.film) .text { transition: opacity .6s ease !important; transform: none; }
}
