/* ==========================================================================
   MJF Tragwerk – Grundgerüst (dunkle Produktseiten-Optik)
   Aufbau: 1. Design-Tokens  2. Basis  3. Typografie  4. Bausteine
           5. Navigation  6. Sektionen  7. Galerien  8. Footer  9. Animation
   Farben, Abstände und Schriftgrößen zentral über die Tokens anpassen.
   ========================================================================== */

/* ---------- 1. Design-Tokens ---------- */
/* Schrift Inter, selbst gehostet (Lizenz: fonts/Inter-LICENSE.txt) */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Farben – warmes, dunkles Grundthema mit Holzton als Akzent */
  --color-bg: #0b0a09;
  --color-surface: #161412;
  --color-surface-2: #1d1a17;
  --color-border: #2f2a25;
  --color-text: #f2eee8;
  --color-text-muted: #9d958a;
  --color-link: #e6b277;
  --color-accent: #d9954a;
  --color-accent-hover: #e6a763;
  --color-on-accent: #1a1208;
  --color-error: #ff6b5a;
  --color-nav: rgba(16, 14, 12, 0.82);
  --color-chip: rgba(26, 23, 20, 0.94);
  --color-chip-hover: rgba(40, 35, 30, 0.96);

  /* Typografie: Inter (Variable, SIL Open Font License), selbst gehostet unter fonts/ */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --container: 980px;
  --container-wide: 1260px;
  --gutter: 22px;
  --nav-height: 52px;
  --radius-l: 14px;
  --radius-m: 10px;
  --radius-s: 6px;
  --section-space: clamp(88px, 13vw, 180px);

  --ease: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Heller Bereich (Kontakt, Footer): gleiche Bausteine, andere Farben */
.theme-light {
  --color-bg: #f2eee8;
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-border: #d9d1c6;
  --color-text: #211c17;
  --color-text-muted: #6d645b;
  --color-link: #98551a;
  --color-error: #c4321f;
  background: var(--color-bg);
  color: var(--color-text);
}

/* ---------- 2. Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  -webkit-text-size-adjust: 100%;
  background: var(--color-bg);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.022em;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ul, dl, dd, figure, address { margin: 0; padding: 0; }
ul { list-style: none; }
address { font-style: normal; }
a { color: var(--color-link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-link) 70%, transparent);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-s);
  background: var(--color-text); color: var(--color-bg);
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: calc(var(--container-wide) + 2 * var(--gutter)); }

/* ---------- 3. Typografie ---------- */
.eyebrow {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 18px;
}

.headline-xl {
  font-size: clamp(48px, 9.5vw, 104px);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.headline-l {
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.headline-m {
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

/* Fließtext wie auf der Referenz: grau und halbfett, Hervorhebungen in Weiß */
.body-l {
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.38;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text-muted);
  text-wrap: pretty;
}
.body-l em, .body-l strong { font-style: normal; color: var(--color-text); }

/* ---------- 4. Bausteine ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px;
  padding: 11px 22px;
  border: 0; border-radius: var(--radius-m);
  background: var(--color-accent); color: var(--color-on-accent);
  font: inherit; font-size: 17px; line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--color-accent-hover); text-decoration: none; }
.btn:active { transform: scale(0.97); }
.btn--small { min-height: 28px; padding: 5px 13px; font-size: 12px; letter-spacing: 0; font-weight: 600; border-radius: var(--radius-s); }

.link-arrow { font-size: clamp(15px, 1.8vw, 17px); white-space: nowrap; }
.link-arrow::after {
  content: "›";
  display: inline-block;
  margin-left: 0.3em;
  transition: transform 0.2s var(--ease);
}
.link-arrow:hover::after { transform: translateX(3px); }

/* Bildfläche – zeigt einen Platzhalter, solange die Datei fehlt (js/main.js) */
.media { position: relative; overflow: hidden; background: var(--color-surface); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.is-empty {
  background:
    radial-gradient(120% 90% at 70% 20%, #2a2a2d 0%, transparent 60%),
    linear-gradient(160deg, #1d1d1f, #0b0b0c);
}
.media.is-empty::before {
  content: "Bild: " attr(data-file);
  position: absolute; top: 20px; left: 24px;
  font-size: 13px; letter-spacing: 0;
  color: #6e6e73;
}

/* ---------- 5. Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-height);
  background: var(--color-nav);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.nav.is-scrolled { border-bottom-color: var(--color-border); }

.nav__inner {
  display: flex; align-items: center; gap: 28px;
  height: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.nav__brand {
  display: flex; flex-direction: column; justify-content: center;
  margin-right: auto;
  color: var(--color-text);
  line-height: 1.1;
}
.nav__brand:hover { text-decoration: none; }
.nav__name { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.nav__sub { font-size: 11px; letter-spacing: 0; color: var(--color-text-muted); margin-top: 2px; }

.nav__links { display: flex; gap: 28px; }
.nav__links a {
  font-size: 12px; letter-spacing: -0.01em;
  color: var(--color-text); opacity: 0.8;
  transition: opacity 0.2s var(--ease);
}
.nav__links a:hover { opacity: 1; text-decoration: none; }

.nav__toggle {
  display: none;
  position: relative;
  width: 44px; height: 44px; margin: 0 -12px 0 -16px;
  border: 0; background: none; cursor: pointer;
}
.nav__toggle span {
  position: absolute; left: 13px;
  width: 18px; height: 1.5px;
  background: var(--color-text);
  transition: transform 0.3s var(--ease);
}
.nav__toggle span:first-child { top: 18px; }
.nav__toggle span:last-child { top: 25px; }
.nav.is-open .nav__toggle span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- 6. Sektionen ---------- */
.section { padding-block: var(--section-space); }
.section--tight { padding-top: clamp(48px, 7vw, 96px); }

/* Hero */
.hero { padding-top: clamp(40px, 6vw, 72px); }
.hero__text { text-align: center; }
/* Logo-Animation: erst zeichnet sich die Kontur nach, dann blenden MJF und „Tragwerk" ein */
.logo-anim {
  --draw: 2.4s;                      /* Dauer des Nachzeichnens */
  display: block;
  height: clamp(200px, 30vh, 300px);
  width: auto;
  margin: 0 auto clamp(28px, 4vw, 48px);
  color: var(--color-text);
}
.logo-anim__line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: logo-draw var(--draw) cubic-bezier(0.65, 0, 0.35, 1) 0.3s forwards;
}
.logo-anim__letters {
  opacity: 0;
  animation: logo-fade 0.9s var(--ease) calc(var(--draw) + 0.3s) forwards;
}

@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-fade { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .logo-anim__line { animation: none; stroke-dashoffset: 0; }
  .logo-anim__letters { animation: none; opacity: 1; }
}

.theme-light .eyebrow { color: var(--color-link); }

.hero__eyebrow {
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 18px;
}
.hero__media {
  width: min(100%, 1680px);
  margin: clamp(32px, 5vw, 64px) auto 0;
  aspect-ratio: 16 / 8;
  background: #000;
}
/* weicher Übergang ins Schwarz, wie bei einer Produktbühne */
.hero__media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, #000 0%, transparent 18%, transparent 62%, #000 100%),
    linear-gradient(to right, #000 0%, transparent 12%, transparent 88%, #000 100%);
}

/* Geteilte Bühne: zwei gleich große Flächen nebeneinander (Video | CAD-Modell) */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.split__media {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
}
.split figcaption {
  max-width: 420px;
  margin-top: 20px;
  font-size: 17px; line-height: 1.4; font-weight: 600;
  color: var(--color-text-muted);
}
.split figcaption strong { color: var(--color-text); font-weight: inherit; }

/* Pläne: vollständig zeigen statt beschneiden */
.media--plan { background: #000; }
.media--plan img { object-fit: contain; }
.media--light { background: #fff; }

/* 3D-Modell in einer Bildfläche (js/model.js) */
.model { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity 0.8s var(--ease); }
.model.is-ready { opacity: 1; }

/* Ausschnitt für Video und Modell im Vergleich (gleiche Werte wie data-crop am Modell) */
.media--crop { --crop-x: 40%; --crop-y: 60%; --crop-zoom: 1.6; }

/* Video in einer Bildfläche, mit Pause-Knopf unten rechts */
/* Ausschnitt: --crop-x/-y = Bildmitte (Anteil der Fläche), --crop-zoom = Vergrößerung. Ohne Angabe: keine Vergrößerung. */
.media video {
  display: block; width: 100%; height: 100%; object-fit: cover;
  transform-origin: var(--crop-x, 50%) var(--crop-y, 50%);
  transform: translate(calc(50% - var(--crop-x, 50%)), calc(50% - var(--crop-y, 50%))) scale(var(--crop-zoom, 1));
}
.media-toggle {
  position: absolute; right: 16px; bottom: 16px;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(30, 26, 22, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.media-toggle:hover { background: rgba(52, 45, 38, 0.92); }
/* Symbol: zwei Balken (Pause) bzw. Dreieck (Abspielen) */
.media-toggle::before {
  content: ""; position: absolute; top: 12px; left: 13px;
  width: 10px; height: 12px;
  border-inline: 3px solid #fff;
}
.media-toggle.is-paused::before {
  left: 14px; width: 0; height: 0;
  border-block: 6px solid transparent;
  border-left: 10px solid #fff; border-right: 0;
}

/* Textblock einer Sektion: zentriert, große Überschrift, grauer Absatz */
.story { text-align: center; }
.story .body-l { max-width: 760px; margin: clamp(20px, 3vw, 32px) auto 0; }

/* Kennzahlen-Raster */
.stats__head { text-align: center; margin-top: clamp(88px, 12vw, 160px); }
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(40px, 6vw, 72px) 24px;
  margin-top: clamp(40px, 6vw, 72px);
  text-align: center;
}
.stat { display: flex; flex-direction: column; align-items: center; }
.stat--below { flex-direction: column-reverse; }
.stat dt { font-size: clamp(13px, 1.4vw, 15px); font-weight: 600; color: var(--color-text); }
.stat dd {
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

/* Leitsatz */
.statement { text-align: center; padding-top: 0; }
.statement p { max-width: 900px; margin-inline: auto; }

/* Kontakt: nur Kontaktdaten, zentriert */
.contact { text-align: center; }
.contact__details {
  margin-top: clamp(32px, 5vw, 56px);
  display: grid; justify-content: center; gap: 28px;
}
.contact__details span {
  display: block; margin-bottom: 4px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.contact__details p { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.35; }
.contact__mail {
  font-size: clamp(24px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em;
  text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 6px;
}

/* ---------- 7. Galerien (horizontal wischbar) ---------- */
.gallery-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(24px, 3.5vw, 44px);
}

.gallery { margin-top: clamp(40px, 6vw, 80px); }
.gallery-head + .gallery { margin-top: 0; }

.gallery__track {
  --edge: max(var(--gutter), calc((100% - var(--container-wide)) / 2));
  position: relative;
  display: flex; gap: 20px;
  overflow-x: auto;
  padding-inline: var(--edge);
  scroll-padding-inline: var(--edge);
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track > * { scroll-snap-align: start; }

.gallery__controls {
  display: flex; gap: 14px;
  max-width: calc(var(--container-wide) + 2 * var(--gutter));
  margin: 28px auto 0;
  padding-inline: var(--gutter);
}
.gallery__controls--center { justify-content: center; }
.gallery__controls--end { justify-content: flex-end; }

/* Punkte-Navigation */
.dots {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-m);
  background: rgba(30, 26, 22, 0.78);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.dots button {
  width: 8px; height: 8px; padding: 0;
  border: 0; border-radius: 2px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: width 0.4s var(--ease), background-color 0.3s var(--ease);
}
.dots button[aria-current="true"] { width: 40px; background: var(--color-accent); }

/* Pfeil-Navigation */
.paddle {
  width: 40px; height: 40px; padding: 0 0 3px;
  border: 0; border-radius: 50%;
  background: rgba(30, 26, 22, 0.78);
  color: #fff;
  font: 600 24px/1 var(--font-sans);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.paddle:hover { background: rgba(52, 45, 38, 0.92); }
.paddle:disabled { opacity: 0.35; cursor: default; }


/* ---------- Leistungen: Bühne mit Auswahl (Aufbau wie der Design-Abschnitt der Referenz) ---------- */
.viewer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 330px) 1fr;
  gap: clamp(16px, 2.4vw, 32px);
  align-items: end;
  margin-top: clamp(48px, 7vw, 96px);
  padding-top: clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--color-border);
}
.viewer__stage {
  position: relative;
  grid-column: 2; grid-row: 1;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: #000;
}
.viewer__item {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.viewer__item.is-active { opacity: 1; visibility: visible; }
.viewer__item img, .viewer__item canvas { width: 100%; height: 100%; }

.viewer__chips {
  grid-column: 1; grid-row: 1;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px;
  counter-reset: chip;
  z-index: 1;
}
/* Auswahl: nummerierte Rechtecke wie Positionen auf einem Plan; die aktive Position trägt einen Holzton-Balken */
.chip {
  position: relative;
  display: block;
  width: 100%;
  padding: 14px 18px 14px 16px;
  border: 1px solid var(--color-border); border-radius: var(--radius-m);
  background: var(--color-chip);
  color: var(--color-text);
  font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -0.012em; text-align: left;
  cursor: pointer;
  overflow: hidden;
  counter-increment: chip;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.chip:hover { background: var(--color-chip-hover); }
.chip::before {                                   /* Balken links */
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--color-accent);
  transform: scaleY(0); transform-origin: 50% 0;
  transition: transform 0.4s var(--ease);
}
.chip.is-active { border-color: color-mix(in srgb, var(--color-accent) 55%, var(--color-border)); }
.chip.is-active::before { transform: scaleY(1); }
.chip__head { display: flex; align-items: baseline; gap: 14px; }
.chip__icon {                                      /* Positionsnummer */
  flex: none; min-width: 22px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
  transition: color 0.3s var(--ease);
}
.chip__icon::before { content: counter(chip, decimal-leading-zero); }
.chip.is-active .chip__icon { color: var(--color-accent); }
.chip__text {
  display: block;
  max-height: 0; opacity: 0;
  margin: 0; padding-left: 36px;
  font-size: 15px; line-height: 1.4; font-weight: 400; letter-spacing: -0.005em;
  color: var(--color-text-muted);
  overflow: hidden;
  transition: max-height 0.5s var(--ease), opacity 0.4s var(--ease), margin 0.4s var(--ease);
}
.chip.is-active .chip__text { max-height: 220px; opacity: 1; margin-top: 8px; }
/* dünner Fortschrittsbalken des automatischen Wechsels */
.chip::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--color-accent);
  transform: scaleX(0); transform-origin: 0 50%;
}
.chip.is-active.is-timing::after { animation: chip-progress var(--interval, 5s) linear forwards; }
.viewer.is-paused .chip.is-active::after { animation-play-state: paused; }
@keyframes chip-progress { to { transform: scaleX(1); } }

.viewer__more { text-align: center; margin-top: clamp(32px, 4vw, 56px); }
.pill-link {                                       /* Verweis als Umrissfläche mit Pfeil */
  display: inline-flex; align-items: center; gap: 14px;
  padding: 13px 20px 13px 22px;
  border: 1px solid var(--color-border); border-radius: var(--radius-m);
  color: var(--color-text);
  font-size: 17px; font-weight: 600; letter-spacing: -0.012em;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.pill-link:hover { border-color: var(--color-accent); background: var(--color-chip); text-decoration: none; }
.pill-link__icon { position: relative; width: 18px; height: 12px; }
.pill-link__icon::before, .pill-link__icon::after {
  content: ""; position: absolute; background: var(--color-accent);
}
.pill-link__icon::before { left: 0; top: 5.5px; width: 17px; height: 1.6px; }
.pill-link__icon::after {
  right: 0; top: 2px; width: 7px; height: 7px; background: none;
  border-top: 1.6px solid var(--color-accent); border-right: 1.6px solid var(--color-accent);
  transform: rotate(45deg);
}
.pill-link:hover .pill-link__icon { transform: translateX(3px); }
.pill-link__icon { transition: transform 0.3s var(--ease); }

/* Highlight-Karte: Text links, Bild rechts, feine Kontur */
.hl-card {
  flex: 0 0 100%;
  display: grid; grid-template-columns: 0.8fr 1.4fr;
  height: clamp(440px, 46vw, 640px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-l);
  overflow: hidden;
  background: #000;
}
.hl-card__text {
  align-self: end;
  padding: clamp(28px, 4vw, 56px);
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.hl-card__text strong { font-weight: inherit; }
.hl-card__media { height: 100%; min-height: 0; }

/* Bühne der Schwerpunkte: zwei Hochformat-Fotos (4:5) nebeneinander, vorab auf die Bauwerke zugeschnitten */
.mosaic { position: absolute; inset: 0; display: grid; gap: 6px; background: #000; }
.mosaic--1 { grid-template-columns: 1fr; }
.mosaic--2 { grid-template-columns: 1fr 1fr; }
.mosaic img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; }

/* ---------- 8. Footer ---------- */
.footer {
  border-top: 1px solid var(--color-border);
  padding-block: 20px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.footer__inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
}
.footer nav { display: flex; gap: 20px; }
.footer a { color: var(--color-text); opacity: 0.8; }

/* Unterseiten (Impressum, Datenschutz) */
.legal { padding-block: clamp(56px, 8vw, 100px); min-height: 60vh; }
.legal .container { max-width: calc(760px + 2 * var(--gutter)); }
.legal h1 { margin-bottom: 40px; font-size: clamp(30px, 8vw, 56px); overflow-wrap: anywhere; hyphens: auto; }
.legal h2 { font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -0.015em; margin: 40px 0 10px; }
.legal h3 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 8px; }
.legal p { color: var(--color-text-muted); margin-bottom: 14px; }
.legal p strong { color: var(--color-text); font-weight: 600; }
.legal a { text-decoration: underline; text-underline-offset: 3px; }
.legal hr { border: 0; border-top: 1px solid var(--color-border); margin: 44px 0 8px; }
.legal__source { font-size: 13px; margin-top: 32px; }

/* ---------- 9. Animation ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .dots button, .viewer__item, .chip, .chip__text, .chip__icon, .chip::before, .pill-link__icon { transition: none; }
  .chip.is-active.is-timing::after { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
}

@media (max-width: 734px) {
  :root { --gutter: 16px; --radius-l: 22px; }

  .nav__toggle { display: block; }
  .nav__links {
    /* absolute statt fixed: der backdrop-filter der Leiste wäre sonst der Bezugsrahmen */
    position: absolute; top: 100%; left: 0; right: 0;
    height: calc(100vh - var(--nav-height));
    height: calc(100dvh - var(--nav-height));
    flex-direction: column; gap: 0;
    padding: 24px var(--gutter);
    background: #000;
    opacity: 0; visibility: hidden;
    transition: opacity 0.3s var(--ease), visibility 0.3s;
  }
  .nav.is-open { background: #000; }
  .nav.is-open .nav__links { opacity: 1; visibility: visible; }
  .nav__links a {
    padding: 14px 0;
    font-size: 28px; font-weight: 600; letter-spacing: -0.02em;
    opacity: 1;
  }

  .hero__media { aspect-ratio: 4 / 3; }
  .hero__media::after {
    background: linear-gradient(to bottom, #000 0%, transparent 15%, transparent 70%, #000 100%);
  }

  .split { grid-template-columns: 1fr; gap: 36px; }

  .hl-card {
    flex-basis: 92%;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    height: auto;
  }
  .hl-card__text { align-self: start; }
  .hl-card__media { height: auto; aspect-ratio: auto; position: relative; min-height: 200px; }
  .hl-card__media::before { content: ""; display: block; padding-top: 75%; }
  .hl-card__media > img, .hl-card__media > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

  .viewer { grid-template-columns: 1fr; align-items: stretch; }
  .viewer__chips { grid-column: 1; grid-row: 1; }
  /* Höhe über ein Platzhalterelement statt über aspect-ratio: Safari lässt eine Raster-Fläche, deren Inhalt nur
     absolut positioniert ist, sonst auf Höhe 0 zusammenfallen (Bilder im Hochformat unsichtbar). */
  .viewer__stage { grid-column: 1; grid-row: 2; aspect-ratio: auto; align-self: start; min-height: 220px; }
  .viewer__stage::before { content: ""; display: block; padding-top: 62.5%; }
  .gallery-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .gallery__track { gap: 12px; }


  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
}
