/* head.css — Kopf der Startseite Painscheri Automobile · Schritt 4 (@hero-engineer), 25.10.2026
   Liest NUR Tokens aus tokens.css. Der Kopf ist themenfest (Bühne): Schrift auf --kalk-fest/--meta-fest, Grund --dunkel-fest.
   Kein poster, kein flächiges Abdunkeln: Verlauf nur hinter der Textecke unten links + schmaler Schleier oben für Logo/Nav.
   Choreo-Startzustände hängen an html.kopf-choreo (wird inline im <head> nur bei prefers-reduced-motion: no-preference gesetzt);
   jede dieser Regeln hat eine CSS-Wache (3,2 s), damit Text nie unsichtbar bleibt, falls JS ausfällt. */

/* ---------- Kopfleiste ---------- */
.kopfleiste {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 var(--rand-leiste);
  color: var(--kalk-fest);
  background: transparent;
  transition:
    background-color var(--t-ui) var(--ease),
    color var(--t-ui) var(--ease),
    box-shadow var(--t-ui) var(--ease);
}
.kopfleiste[data-zustand="hell"] {
  background: var(--grund);
  color: var(--text);
  --logo-fuellung: var(--leit-text);
  box-shadow: 0 1px 0 var(--linie);
}
.kopfleiste__marke {
  display: block;
  line-height: 0;
  flex: none;
}
.kopfleiste__marke:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
.kopfleiste__logo {
  display: block;
  height: 62px; /* sichtbar ≥ 60 px (GESETZ Kap. 4) — viewBox ist auf die Pfade zugeschnitten */
  width: auto;
  aspect-ratio: 1146 / 270;
  overflow: visible;
}
.kopfleiste__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  font: 500 0.95rem/1 var(--font-text);
}

/* ---------- Kopf (Desktop ≥ 900 px: Video füllt die Fläche, Text unten links) ---------- */
.kopf {
  position: relative;
  height: calc(100svh - 0px);
  min-height: 560px;
  background: var(--dunkel-fest);
  color: var(--kalk-fest);
  overflow: hidden;
  isolation: isolate;
}
.kopf__medien {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--dunkel-fest);
  transform-origin: 50% 50%;
}
.kopf__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%; /* Hauptmotiv steht in der Bildmitte (GESETZ Kap. 7) */
  background: var(--dunkel-fest);
}
.kopf__schleier {
  /* nur oben, 180 px: trägt Logo + Navigation über hellem Himmel / Gegenlicht (Clip 3: Sonne oben links) */
  position: absolute;
  inset: 0 0 auto 0;
  height: 180px;
  background: linear-gradient(
    180deg,
    color-mix(in oklch, var(--nacht-fest) 64%, transparent) 0%,
    color-mix(in oklch, var(--nacht-fest) 26%, transparent) 55%,
    transparent 100%
  );
  pointer-events: none;
}
.kopf__verlauf {
  /* nur hinter der Textecke unten links: von unten nach oben auslaufend (60 % Höhe), nach rechts ab 62 rem ausmaskiert —
     oberes Drittel und rechte Seite bleiben unberührt, das Video wird nie flächig abgedunkelt */
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(
    0deg,
    color-mix(in oklch, var(--nacht-fest) 82%, transparent) 0%,
    color-mix(in oklch, var(--nacht-fest) 66%, transparent) 38%,
    color-mix(in oklch, var(--nacht-fest) 30%, transparent) 66%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 62rem, transparent 86rem);
  mask-image: linear-gradient(90deg, #000 0, #000 62rem, transparent 86rem);
  pointer-events: none;
}
.kopf__text {
  position: absolute;
  z-index: 1;
  left: var(--rand);
  right: var(--rand);
  bottom: clamp(2.75rem, 7svh, 5.5rem);
  max-width: 64rem;
}
.kopf__linie {
  display: block;
  width: 3.5rem;
  height: 1px;
  margin: 0 0 1.1rem;
  background: var(--akzent-buehne);
  transform-origin: 0 50%;
}
.kopf__h1 {
  margin: 0;
  font-weight: inherit;
}
.kopf__z1 {
  display: block;
  font: 600 var(--t-z1) / 1.3 var(--font-text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--meta-fest);
}
.kopf__pointe {
  display: block;
  margin: 0.8rem 0 1.15rem;
  font: 600 clamp(2.4rem, 1.1rem + 2.8vw, 3.4rem) / 1.06 var(--font-display);
  letter-spacing: -0.03em;
  word-spacing: 0.08em;
  color: var(--kalk-fest);
  text-wrap: balance;
}
.kopf__pointe strong {
  font-weight: inherit;
  color: var(--akzent-buehne);
}
.kopf__maske {
  /* Wort-Maske: echte Wörter, kein Klon. Unterlänge darf nicht abgeschnitten werden. */
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 0.04em 0.12em;
  margin: 0 -0.04em -0.12em;
}
.kopf__wort {
  display: inline-block;
}
.kopf__z1,
.kopf__beweis {
  text-shadow:
    0 1px 2px color-mix(in oklch, var(--nacht-fest) 55%, transparent),
    0 0 18px color-mix(in oklch, var(--nacht-fest) 45%, transparent);
}
@media (min-width: 900px) {
  .kopf__z1 {
    color: var(--kalk-fest);
  }
  .kopf__beweis {
    color: color-mix(in oklch, var(--kalk-fest) 88%, var(--meta-fest));
  }
}
.kopf__beweis {
  max-width: 34rem;
  margin: 0 0 1.8rem;
  font: 400 1.0625rem / 1.55 var(--font-text);
  color: var(--meta-fest);
}
.kopf__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  padding: 1rem 1.55rem;
  background: var(--akzent);
  color: var(--auf-akzent);
  font: 600 1rem / 1 var(--font-text);
  text-decoration: none;
  border-radius: 2px;
  transition: background-color var(--t-ui) var(--ease);
}
.kopf__cta:hover {
  background: var(--akzent-buehne);
}
.kopf__cta:focus-visible {
  outline: 2px solid var(--kalk-fest);
  outline-offset: 3px;
}
.kopf__cta-pfeil {
  flex: none;
  transition: transform var(--t-ui) var(--ease);
}
.kopf__cta:hover .kopf__cta-pfeil {
  transform: translateX(3px);
}

/* ---------- Kontaktleiste (hell, 0 px bündig unter dem Video) ---------- */
.kontaktleiste {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  background: var(--grund);
  color: var(--text);
  border-bottom: 1px solid var(--linie);
}
.kontaktleiste__zelle {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 48px;
  padding: 1.15rem var(--rand-leiste);
  color: inherit;
  text-decoration: none;
  transition: background-color var(--t-ui) var(--ease);
}
.kontaktleiste__zelle + .kontaktleiste__zelle {
  border-left: 1px solid var(--linie);
}
a.kontaktleiste__zelle:hover {
  background: var(--flaeche);
}
a.kontaktleiste__zelle:focus-visible {
  outline: 2px solid var(--leit-text);
  outline-offset: -2px;
}
.kontaktleiste__icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--leit-text);
}
.kontaktleiste__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.kontaktleiste__text strong {
  font: 600 1rem / 1.25 var(--font-text);
  white-space: nowrap;
}
.kontaktleiste__text span {
  font: 400 var(--fs-2) / 1.35 var(--font-text);
  color: var(--text-leise);
  white-space: nowrap;
}

/* ---------- Unter 900 px: eigenes Bildband, Text mittig darunter, Headline eine Stufe kleiner (GESETZ Kap. 5) ---------- */
@media (max-width: 899.98px) {
  .kopfleiste {
    padding: 0 1.25rem;
  }
  .kopf {
    height: auto;
    min-height: 0;
    padding-top: 80px; /* Kopfleiste steht auf dunklem Grund, das Band beginnt darunter — Motiv wird nicht verdeckt */
  }
  .kopf__medien {
    position: relative;
    inset: auto;
    width: 100%;
    aspect-ratio: 4 / 3; /* 75 % der Bildbreite sichtbar: auch der Van (≈ 65 % breit) bleibt ganz im Bild */
  }
  .kopf__schleier,
  .kopf__verlauf {
    display: none;
  }
  .kopf__text {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    max-width: none;
    padding: 1.9rem 1.25rem 2.4rem;
    text-align: center;
  }
  .kopf__linie {
    margin-inline: auto;
  }
  .kopf__z1 {
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }
  .kopf__pointe {
    font-size: clamp(1.85rem, 7.4vw, 2.4rem);
    margin: 0.7rem 0 1rem;
  }
  .kopf__beweis {
    margin-inline: auto;
    font-size: 1rem;
  }
  .kontaktleiste {
    grid-template-columns: 1fr; /* 3 Zeilen: im 2er-Raster brach „Probefahrt vereinbaren" bei 390 px zweizeilig (Messung 25.10.) */
  }
  .kontaktleiste__zelle {
    padding: 0.85rem 1.25rem;
    gap: 0.75rem;
  }
  .kontaktleiste__zelle + .kontaktleiste__zelle {
    border-left: 0;
    border-top: 1px solid var(--linie);
  }
  .kontaktleiste__text {
    flex: 1;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .kontaktleiste__text strong {
    font-size: 0.97rem;
  }
  .kontaktleiste__text span {
    font-size: 0.8125rem;
    text-align: right;
  }
}

/* ---------- Choreo-Startzustände (nur mit html.kopf-choreo) + Wache ---------- */
@keyframes kopf-wache {
  to {
    opacity: 1;
    transform: none;
  }
}
.kopf-choreo .kopf__wort {
  transform: translateY(112%);
  animation: kopf-wache 1ms linear 3.2s forwards;
}
.kopf-choreo .kopf__linie {
  transform: scaleX(0);
  animation: kopf-wache 1ms linear 3.2s forwards;
}
.kopf-choreo .kopf__z1,
.kopf-choreo .kopf__beweis,
.kopf-choreo .kopf__cta,
.kopf-choreo .kopfleiste {
  opacity: 0;
  animation: kopf-wache 1ms linear 3.2s forwards;
}
/* reduced-motion: nichts versteckt, nichts bewegt — das Kopfvideo läuft trotzdem weiter (GESETZ Kap. 5) */
@media (prefers-reduced-motion: reduce) {
  .kopf__cta,
  .kopf__cta-pfeil,
  .kopfleiste,
  .kontaktleiste__zelle {
    transition: none;
  }
}

