/* ==========================================================================
   Southline. — Basis
   Reset, Typografie, Grain, Header, Footer, Buttons, Hilfsklassen.
   Wird von allen Seiten geladen (index, impressum, datenschutz).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset (bewusst knapp)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Fallback ohne JS. Mit Lenis (Klasse .lenis) übernimmt Lenis das Glätten. */
  scroll-behavior: smooth;
  /* Anker-Sprünge landen nicht unter dem fixierten Header */
  scroll-padding-top: var(--header-h);
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--fg);
  /* Grundschrift = Oswald (wird ohnehin geladen). Würde hier Inter stehen, lädt der
     Browser Inter (48 KB) schon wegen unsichtbarer Leerzeichen im HTML — auch wenn
     kein sichtbarer Text Inter nutzt. Fließtext bekommt Inter gezielt (siehe unten). */
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Fließtext-Elemente → Fließtext-Schrift (--font-body) */
p,
dd,
blockquote,
figcaption,
.legal__body {
  font-family: var(--font-body);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  text-transform: uppercase;
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--fg);
  color: var(--bg);
}

/* --------------------------------------------------------------------------
   Fokus — immer sichtbar für Tastatur-Nutzer
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Ziel-Abschnitte von Ankerlinks bekommen per JS den Fokus — ohne Rahmen um die ganze Sektion */
[tabindex="-1"]:focus {
  outline: none;
}

/* Skip-Link: erscheint nur bei Tastatur-Fokus */
/* Lenis (Smooth Scrolling) — Regeln aus lenis.css, hier eingebettet (spart eine Anfrage) */
html.lenis {
  scroll-behavior: auto;
}

html.lenis,
html.lenis body {
  height: auto;
}

.lenis:not(.lenis-autoToggle).lenis-stopped {
  overflow: clip;
}

.lenis.lenis-smooth iframe {
  pointer-events: none;
}

.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--fg);
  color: var(--bg);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500; /* gleicher Schnitt wie .label → keine zusätzliche Schriftdatei */
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: none;
}

/* --------------------------------------------------------------------------
   Grain-Overlay
   An:  <html class="grain">   (Standard)
   Aus: Klasse entfernen oder --grain-opacity: 0 in tokens.css
   Statische SVG-Noise-Kachel → wird einmal gerendert, kostet kaum Leistung.
   -------------------------------------------------------------------------- */
.grain body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* --------------------------------------------------------------------------
   Layout-Hilfen
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Mono-Label: Ort, Nummern, kleine englische Akzente */
.label,
.label p {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.muted {
  color: var(--fg-muted);
}

/* Sichtbar markierte Platzhalter — bis echte Inhalte da sind.
   Suche im Code nach „[“ bzw. nach der Klasse „ph“, um alle zu finden. */
.ph {
  opacity: 0.8;
}

/* --------------------------------------------------------------------------
   Wortmarke „Southline.“
   -------------------------------------------------------------------------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
  line-height: 1;
}

.wordmark__dot {
  color: var(--accent); /* einziges Akzent-Detail */
}

/* --------------------------------------------------------------------------
   Textlinks mit Hover
   -------------------------------------------------------------------------- */
.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color var(--dur-fast) ease-out;
}

.link:hover {
  color: var(--hover);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 950; /* über Grain (900) und Hero (901) */
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background-color 300ms ease-out, border-color 300ms ease-out;
}

/* Wird per JS gesetzt, sobald man aus dem Hero scrollt */
.site-header.is-solid,
.site-header--solid {
  background-color: var(--bg);
  border-bottom-color: var(--line);
}

.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-header .wordmark {
  font-size: 1.375rem;
  /* Großzügige Klickfläche ohne optische Änderung */
  padding-block: var(--space-3);
}

/* „Production Studio“ — exakt in der Bildschirmmitte, unabhängig von Logo/Navigation */
.site-header__inner {
  position: relative;
}

.site-header__tagline {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display-sm);
  white-space: nowrap;
  pointer-events: none;
}

/* Auf dem Handy ist zwischen Logo und Navigation kein Platz */
@media (max-width: 767px) {
  .site-header__tagline {
    display: none;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-2);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display-sm);
  transition: color var(--dur-fast) ease-out;
}

.site-nav__link:hover {
  color: var(--hover);
}

/* Sprachumschalter (DE / EN) — durch eine feine Linie von der Navigation getrennt */
.site-nav__lang {
  position: relative;
  margin-left: var(--space-1);
  padding-left: var(--space-3);
}

.site-nav__lang::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 1em;
  translate: 0 -50%;
  border-left: 1px solid var(--line);
}

/* Sehr schmale Handys: Navigation etwas enger, damit alles in eine Zeile passt */
@media (max-width: 380px) {
  .site-header .site-nav {
    gap: 0;
  }

  .site-header .site-nav__link {
    padding-inline: 5px;
  }

  .site-header .site-nav__lang {
    padding-left: var(--space-2);
  }

  .site-header .icon-link {
    width: 38px;
  }
}

.icon-link {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transition: color var(--dur-fast) ease-out;
}

.icon-link:hover {
  color: var(--hover);
}

.icon-link svg {
  width: 20px;
  height: 20px;
}

@media (min-width: 768px) {
  .site-header .wordmark {
    font-size: 1.625rem;
  }

  .site-nav {
    gap: var(--space-3);
  }
}

/* --------------------------------------------------------------------------
   Button — flach, kantig, invertiert beim Hover
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-5);
  border: 1px solid currentColor;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--tracking-display-sm);
  line-height: 1;
  transition: background-color var(--dur-fast) ease-out, color var(--dur-fast) ease-out;
  touch-action: manipulation;
}

.button:hover {
  background-color: var(--fg);
  color: var(--bg);
}

/* Pfeil als SVG (Oswald hat kein Pfeil-Zeichen → würde aus einer Ersatzschrift kommen und schief sitzen) */
.button__arrow {
  flex: none;
  width: 0.75em;
  height: 1em;
  transition: transform var(--dur-fast) ease-out;
}

.button:hover .button__arrow {
  transform: translateY(3px);
}

/* --------------------------------------------------------------------------
   Consent-Banner (js/consent.js) — schlichte Leiste unten, im Stil der Seite:
   Schwarz, feine Linie, Mono-Label, Inter-Text, zwei gleichwertige Buttons.
   -------------------------------------------------------------------------- */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 960; /* über Header (950) und Hero */
  background-color: var(--bg);
  color: var(--fg);
  border-top: 1px solid var(--line);
  /* Start-Verzögerung: 0 beim Öffnen über „Cookie Settings“,
     beim ersten Besuch erst nach der Hero-Animation (siehe .consent--initial) */
  --consent-delay: 0ms;
}

.consent--initial {
  --consent-delay: 1100ms;
}

/* Start-Animation: Leiste gleitet von unten herein,
   danach blenden Text und Buttons leicht versetzt auf.
   Bei „Bewegung reduzieren“ erscheint alles sofort (globale Regel unten). */
.consent.is-open {
  animation: consent-slide-in 750ms var(--ease-out) var(--consent-delay) both;
}

.consent.is-open .consent__copy,
.consent.is-open .consent__actions {
  animation: consent-fade-up 600ms var(--ease-out) both;
}

.consent.is-open .consent__copy {
  animation-delay: calc(var(--consent-delay) + 250ms);
}

.consent.is-open .consent__actions {
  animation-delay: calc(var(--consent-delay) + 380ms);
}

/* Schließ-Animation nach „Accept“ / „Decline“:
   1. gewählter Button füllt sich (Bestätigung), Text bleibt reinweiß
   2. nach kurzer Pause gleitet die Leiste nach unten raus (schneller als rein) */
.consent.is-closing {
  pointer-events: none;
  animation: consent-slide-out 450ms cubic-bezier(0.55, 0, 1, 0.45) 280ms both;
}

.consent.is-closing .consent__button.is-chosen {
  background-color: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

@keyframes consent-slide-out {
  from { transform: none; }
  to { transform: translateY(100%); }
}

@keyframes consent-slide-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

@keyframes consent-fade-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: none; }
}

.consent__inner {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-5);
}

.consent__copy {
  display: grid;
  gap: var(--space-2);
  max-width: var(--text-max);
}

.consent__text {
  font-size: var(--text-small);
  line-height: 1.55;
}

/* Gleich große, gleichwertige Buttons — keine Hervorhebung von „Accept“ */
.consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.consent__button {
  justify-content: center;
  min-width: 9rem;
}

@media (min-width: 768px) {
  .consent__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--space-7);
  }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: var(--space-7) var(--space-5);
  overflow: hidden;
}

.site-footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4) var(--space-6);
  color: var(--fg-muted);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap; /* bricht nur um, wenn der Platz nicht reicht (sehr schmale Handys) */
  column-gap: var(--space-5);
}

.site-footer__legal a,
.site-footer__consent {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color var(--dur-fast) ease-out;
}

/* „Cookie Settings“ ist ein Button, sieht aber exakt aus wie die Footer-Links */
.site-footer__consent {
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}

.site-footer__legal a:hover,
.site-footer__consent:hover {
  color: var(--hover);
}

/* Große Wortmarke als Abschluss — rein dekorativ */
.site-footer__mark {
  margin-top: var(--space-7);
  font-size: clamp(4rem, 22vw, 20rem);
  line-height: 0.9;
  margin-bottom: -0.06em;
  text-transform: none;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Scroll-Einblenden (dezent). Greift nur, wenn JS läuft (Klasse .js),
   und nie bei „Bewegung reduzieren“.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1.25rem);
    transition:
      opacity var(--dur-reveal) var(--ease-out),
      transform var(--dur-reveal) var(--ease-out);
    transition-delay: var(--reveal-delay, 0ms);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* Banner ohne Verzögerung und ohne Bewegung */
  .consent.is-open,
  .consent.is-open * {
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Rechtliche Unterseiten (impressum.html, datenschutz.html)
   -------------------------------------------------------------------------- */
.legal {
  padding-top: calc(var(--header-h) + var(--section-y) * 0.6);
  padding-bottom: var(--section-y);
}

.legal__title {
  font-size: var(--text-h2);
  margin-top: var(--space-4);
  margin-bottom: var(--space-7);
}

.legal__body {
  display: grid;
  gap: var(--space-5);
  max-width: var(--text-max);
  font-size: var(--text-body);
  line-height: var(--leading-body);
}

/* Deutsch: Platz für Umlaut-Punkte bei umbrechenden Überschriften (siehe sections.css) */
:lang(de) .legal__title,
:lang(de) .legal__body h2 {
  line-height: 1.1;
}

.legal__body h2 {
  font-size: var(--text-h3);
  margin-top: var(--space-6);
}

.legal__body h2:first-of-type {
  margin-top: 0;
}

.legal__body p + p {
  margin-top: calc(-1 * var(--space-2));
}

/* Aufzählungen in Rechtstexten (global sind Listen ohne Punkte) */
.legal__body ul {
  display: grid;
  gap: var(--space-1);
  padding-left: 1.25em;
  list-style: square;
}

.legal__body li::marker {
  color: var(--fg-muted);
}

.legal__body strong {
  font-weight: 600;
}

/* Lange Links (z. B. E-Mail) dürfen auf schmalen Handys umbrechen */
.legal__body a {
  overflow-wrap: anywhere;
}
