/* ==================================================
   GLOBAL
   fonts · base · header · page logos · lightbox
   ================================================== */


/* --------------------------------------------------
   FONTS
   -------------------------------------------------- */

@font-face {
  font-family: "MainMenu";
  src: url("../fonts/Hallo.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "MainMenu";
  src: url("../fonts/Hallo-latin.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+0100-017F, U+2010-2027, U+2190-2199, U+20AC, U+2022;
}

@font-face {
  font-family: "Schreibe";
  src: url("../fonts/Schreibe.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/*
 * "TypoCool" — used only by the optional project-title-in-header
 * feature (.project-name, see film.css). Not loaded/preloaded
 * anywhere else and doesn't replace any existing typography.
 */
@font-face {
  font-family: "TypoCool";
  src: url("../fonts/Typo_cool.woff2") format("woff2"),
       url("../fonts/Typo_cool.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}


/* --------------------------------------------------
   DESIGN TOKENS
   -------------------------------------------------- */

:root {
  --blue:  #0000ff;
  --black: #000000;
  --white: #ffffff;
  --grey:  #888888;
  --rule:  rgba(0, 0, 255, 0.18);

  --font-display: "MainMenu", sans-serif;
  --font-text:    "Schreibe", sans-serif;
  --font-serif:   "Times New Roman", Times, serif;
  --font-title:   "TypoCool", sans-serif;

  --text-size:  clamp(14px, 1.1vw, 18px);
  --label-size: clamp(14px, 1.15vw, 19px);
  --logo-size:  clamp(18px, 1.7vw, 26px);

  --gutter: 20px;
  --radius: 12px;

  --content-width: min(72vw, 900px);
  --gallery-gap-default: 16px;

  --detail-label-width: 12rem;
  --detail-gap: 2rem;

  --header-top: clamp(8px, 1vw, 16px);

  /* Stable fallback until header-effects.js measures the rendered header. */
  --available-top: 80px;

  --z-header: 1000;
  --z-lightbox: 99999;

  --collapse-lines: 3;
}


/* --------------------------------------------------
   BASE
   -------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--white);
  color: var(--blue);
  font-family: var(--font-serif);
  font-size: var(--text-size);
}

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

img {
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

h1,
h2 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}


/* --------------------------------------------------
   HEADER
   -------------------------------------------------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;

  z-index: var(--z-header);

  padding:
    var(--header-top)
    clamp(12px, 3vw, 40px)
    0;

  text-align: center;
  line-height: 1.05;
}

.main-nav {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: clamp(18px, 1.7vw, 26px);

  white-space: nowrap;
  word-spacing: var(--nav-spacing, 0);
}

.main-nav a {
  color: var(--black);
  text-decoration: none;
}

.main-nav a:hover {
  color: var(--grey);
}

.main-nav a.active {
  color: var(--blue);
}


/* --------------------------------------------------
   FLAME TOGGLE
   -------------------------------------------------- */

.flame-toggle {
  position: static;

  display: inline-block;
  vertical-align: baseline;

  margin: 0 0 0 0.12em;
  padding: 0;

  border: 0;
  background: transparent;

  font-family: inherit;
  font-size: 0.82em;
  line-height: 1;

  cursor: pointer;

  transition:
    opacity 0.2s ease,
    filter 0.2s ease;
}

.flame-toggle:hover {
  opacity: 0.5;
}

.flame-toggle.is-off {
  opacity: 0.25;
  filter: grayscale(1);
}


/* --------------------------------------------------
   FILM NAV / PROJEKTBAUM
   -------------------------------------------------- */

.film-nav {
  max-width: 760px;
  margin: 7px auto 0;

  font-family: var(--font-text);
  font-size: var(--label-size);
}

.film-nav a {
  color: var(--blue);
  text-decoration: none;
}

.film-nav a:hover,
.film-nav a.active {
  font-style: italic;
}

.film-nav span {
  margin: 0 0.25em;
}

/*
.film-nav a.is-visited {
  color: var(--blue);
}

.film-nav a.is-visited::after {
  content: " ✓";
}

.film-nav a.active.is-visited::after {
  content: "";
}
*/


/* --------------------------------------------------
   PROJECT NAME (optional, Panel-controlled)
   Sits directly below the project tree — or directly
   below the main navigation when the tree is hidden,
   since it's simply the next line in the same header,
   never a separately positioned element.
   -------------------------------------------------- */

.project-name {
  margin: 6px auto 0;
  max-width: min(90vw, 760px);

  overflow-wrap: break-word;

  font-family: var(--font-title);
  font-size: clamp(13px, 1.1vw, 17px);
  line-height: 1.2;

  color: var(--blue);
}


/* --------------------------------------------------
   PAGE LOGOS
   -------------------------------------------------- */

.page-logo {
  position: fixed;

  left: 50%;
  bottom: 24px;

  transform: translateX(-50%);

  z-index: var(--z-header);

  padding: 0 var(--gutter);

  text-align: center;
  white-space: nowrap;

  font-family: var(--font-display);
  font-size: var(--logo-size);
  line-height: 0.95;

  text-decoration: none;

  transition:
    opacity 0.5s ease,
    visibility 0s linear 0s;
}

.page-logo,
.page-logo * {
  white-space: nowrap;
}

.page-logo--project {
  color: var(--blue);
  pointer-events: auto;
  cursor: pointer;
}

.page-logo--name {
  color: var(--black);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.6s ease,
    visibility 0s linear 0.6s;
}

main.is-scrolled .page-logo--project {
  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.5s ease,
    visibility 0s linear 0.5s;
}

main.is-at-end .page-logo--name {
  opacity: 1;
  visibility: visible;

  transition:
    opacity 0.6s ease,
    visibility 0s;
}


/* --------------------------------------------------
   SCROLL HINT
   -------------------------------------------------- */

.scroll-hint {
  position: fixed;

  left: 50%;
  bottom: 70px;

  z-index: calc(var(--z-header) + 10);

  display: block;

  margin: 0;
  padding: 0;

  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: normal;
  line-height: 1;

  color: var(--blue);

  opacity: 1;
  visibility: visible;

  pointer-events: auto;
  cursor: pointer;

  animation:
    scrollHintDance
    2.4s
    ease-in-out
    infinite;

  transition:
    opacity 0.6s ease,
    visibility 0s linear 0.6s;
}


/*
 * Nach dem Scrollen verschwindet der Pfeil
 * wie bisher.
 */

main.is-scrolled .scroll-hint {
  opacity: 0;
  visibility: hidden;
}


/*
 * START + PHOTO BLOCKS
 *
 * Beim neuen PhotoSlider muss der Pfeil
 * im ersten Viewport sichtbar bleiben.
 */

.start-page:not(.is-scrolled) .start-scroll-hint {
  display: block;
  opacity: 1;
  visibility: visible;
}


/*
 * INFO and the scroll arrow are real <button>s (keyboard reachable). Strip the
 * browser's button styling so they look exactly like the former <div>s.
 */
button.page-logo--project,
button.scroll-hint {
  box-sizing: content-box;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  letter-spacing: normal;
  word-spacing: normal;
  text-transform: none;
  text-indent: 0;
  text-shadow: none;
}

button.page-logo--project:focus-visible,
button.scroll-hint:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 6px;
}


@keyframes scrollHintDance {

  0%,
  100% {
    transform: translate(-50%, 0);
  }

  50% {
    transform: translate(-50%, 7px);
  }

}


/* --------------------------------------------------
   DETAIL ROWS
   -------------------------------------------------- */

.detail-row {
  display: grid;

  grid-template-columns:
    var(--detail-label-width)
    1fr;

  gap: var(--detail-gap);

  align-items: start;

  margin-bottom: 3rem;
}

.detail-label {
  font-weight: bold;
}

.detail-content {
  min-width: 0;
}

.detail-text {
  font-family: var(--font-text);
}

.detail-text p {
  margin: 0 0 1em;
}

.detail-text p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------
   DEFAULT / ERROR PAGE
   -------------------------------------------------- */

.default-page {
  width: var(--content-width);

  margin: 0 auto;

  padding:
    140px
    0
    140px;

  font-family: var(--font-text);
}


/* --------------------------------------------------
   LIGHTBOX
   -------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;

  z-index: var(--z-lightbox);

  display: none;

  align-items: center;
  justify-content: center;

  padding: 12px;

  background: var(--white);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-image {
  max-width: 100%;
  max-height: calc(100dvh - 24px);

  width: auto;
  height: auto;

  object-fit: contain;
}

.lightbox-caption {
  position: fixed;

  left: 12px;
  right: 60px;
  bottom: 12px;

  font-family: var(--font-text);
  font-size: clamp(13px, 1vw, 16px);

  color: var(--blue);
}

.lightbox-caption:empty {
  display: none;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;

  padding: 0;

  border: 0;
  background: transparent;
}

.lightbox-close {
  top: 10px;
  right: 12px;

  z-index: 2;

  padding: 5px;

  font-family: Arial, sans-serif;
  font-size: 28px;
  line-height: 1;

  color: #999999;
}

.lightbox-prev,
.lightbox-next {
  top: 0;
  bottom: 0;

  width: 10%;

  font-size: 0;
}

.lightbox-prev {
  left: 0;
  cursor: w-resize;
}

.lightbox-next {
  right: 0;
  cursor: e-resize;
}

.lightbox-open {
  overflow: hidden;
}

.lightbox-open .site-header,
.lightbox-open .page-logo,
.lightbox-open .scroll-hint {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}


/* --------------------------------------------------
   TEXT COLLAPSE
   -------------------------------------------------- */

.js .text-collapse-body.is-clamped {
  display: -webkit-box;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--collapse-lines);
  line-clamp: var(--collapse-lines);

  overflow: hidden;
}

.js .text-collapse-body.is-clamped.is-open {
  display: block;

  -webkit-line-clamp: none;
  line-clamp: none;

  overflow: visible;
}

.text-collapse-toggle {
  display: block;

  margin-top: 6px;
  padding: 0;

  border: 0;
  background: transparent;

  font-family: var(--font-text);
  font-size: 0.85em;

  color: var(--blue);

  text-decoration: underline;
  text-underline-offset: 2px;
}

.text-collapse-toggle:hover {
  font-style: italic;
}


/* ==================================================
   FLAMMEN FOOTER
   ================================================== */

.footer-flames {
  position: fixed;

  left: 0;
  bottom: 50px;

  width: 100%;
  height: 150px;

  z-index: 900;

  pointer-events: none;

  background: transparent;
  overflow: visible;

  /* Flammen erscheinen erst am Seitenende, zusammen mit dem Namen-Logo
     (siehe main.is-at-end in page-scroll.js). */
  opacity: 0;
  visibility: visible;

  /* Nur die Deckkraft wird animiert (kein visibility-Wechsel am Ende); die
     Ebene bekommt eine eigene GPU-Schicht, damit beim Ausblenden nichts
     flackert. */
  transition: opacity 0.6s ease;
  will-change: opacity;
  transform: translateZ(0);
}

/* Desktop: Flammen immer über die volle Browserbreite.
   Überschreibt Inline-Werte (left / Breite) aus früheren Versionen, falls
   eine ältere, gecachte Seite sie noch setzt. */
@media (min-width: 651px) {
  .footer-flames {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    max-width: none !important;
  }
}

/* Alle anderen Seiten (Desktop): Flammen ca. 20 px höher als zuvor und
   zusätzlich 10 px angehoben (Spitzen bei ca. 212 px, tiefste Stelle bei
   ca. 91 px über dem unteren Rand). Die Projekt-Übersicht überschreibt das
   mit ihren eigenen Werten weiter unten. */
@media (min-width: 651px) {
  body .footer-flames {
    bottom: 60px;
    height: 173px;
  }

  body .footer-flames svg {
    height: 173px;
  }
}

/* Projekt-Übersicht: Flammen angehoben und 25 % höher, damit die Filterleiste
   komplett unter der Flammenlinie liegt (Filter-Oberkante ca. 129 px über dem
   unteren Rand, tiefste Flammenstelle ca. 143 px). Nur Desktop, nur Übersicht. */
@media (min-width: 651px) {
  main.works2-page ~ .footer-flames {
    bottom: 109px;
    height: 187.5px;
  }

  main.works2-page ~ .footer-flames svg {
    height: 187.5px;
  }
}

main.is-at-end ~ .footer-flames {
  opacity: 1;
  visibility: visible;

  transition: opacity 0.6s ease;
}

body:has(main.is-at-end) .footer-flames {
  opacity: 1;
  visibility: visible;

  transition: opacity 0.6s ease;
}


/* --------------------------------------------------
   FLAMMEN SVG
   -------------------------------------------------- */

.footer-flames svg {
  position: relative;

  z-index: 1;

  display: block;

  width: 100%;
  height: 150px;

  overflow: visible;
}


/* --------------------------------------------------
   FLAMMEN FÜLLUNG
   -------------------------------------------------- */

.flame-fill {
  fill: rgba(60, 79, 220, 0.157);
  stroke: none;
}


/* --------------------------------------------------
   BLAUE FLAMMENLINIE
   -------------------------------------------------- */

.flame-line {
  fill: none;

  stroke: var(--blue);
  stroke-width: 2;

  stroke-linecap: round;
  stroke-linejoin: round;

  vector-effect: non-scaling-stroke;
}


/* --------------------------------------------------
   MOTION
   -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

}


/* --------------------------------------------------
   TABLET
   -------------------------------------------------- */

@media (max-width: 900px) {

  :root {
    --detail-label-width: 9rem;
    --detail-gap: 1.5rem;
  }

}


/* ==================================================
   MOBILE
   ================================================== */

@media (max-width: 650px) {

  :root {
    --mobile-media-gutter: 12px;
    --content-width: calc(100% - (2 * var(--mobile-media-gutter)));

    /* Safe zones used by the Home first viewport.
       Header is two wrapped menu rows on mobile; bottom space protects
       the scroll hint / project logo. */
    --mobile-header-safe: 132px;
    --mobile-bottom-safe: 92px;
    --available-top: 92px;
  }


  /* -----------------------------------------------
     HEADER
     ----------------------------------------------- */

  .site-header {
    position: fixed;

    width: 100%;

    padding:
      8px
      12px
      0;

    overflow: visible;
  }


  .main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;

  width: 100%;
  max-width: 100%;

  margin: 0 auto;
  padding: 0 12px;

  font-family: var(--font-display);
  font-size: clamp(18px, 5.6vw, 28px);
  line-height: 1.1;

  text-align: center;
  white-space: normal;

  column-gap: 0.4em;
row-gap: 0;
}

.main-nav a {
  display: inline-block;
  flex: 0 0 auto;

  white-space: nowrap;
}

/* Nach dem zweiten Menüpunkt neue Zeile */
.main-nav a:nth-of-type(2)::after {
  content: "";
}

/* Zweite Zeile erzwingen */
.main-nav a:nth-of-type(3) {
  break-before: always;
}


  /* -----------------------------------------------
     FLAME BUTTON MOBILE
     ----------------------------------------------- */

  .flame-toggle {
    position: absolute;

    top: 7px;
    right: 10px;

    display: block;

    margin: 0;
    padding: 0;

    font-size: 15px;
    line-height: 1;

    z-index: 2;
  }


  /* -----------------------------------------------
     PROJECT NAV
     ----------------------------------------------- */

  .film-nav {
    /* Mobile project tree: three project titles per row, maximum two rows.
       The markup alternates project links and separator spans, so a
       five-column grid gives us: title · title · title on each row. */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;

    width: 100%;
    max-width: calc(100vw - 24px);

    margin: 5px auto 0;
    padding: 0;

    text-align: center;
    white-space: nowrap;

    /* May shrink on very narrow phones so all three titles remain visible. */
    font-size: clamp(8px, 3vw, 16px);
    line-height: 1.15;
    column-gap: 0;
    row-gap: 0.08em;
  }

  .film-nav a {
    min-width: 0;
    white-space: nowrap;
  }

  .film-nav span {
    margin: 0 0.22em;
    white-space: nowrap;
  }

  /* The separator after title 3 would otherwise sit at the end of row 1. */
  .film-nav span:nth-of-type(3) {
    display: block;
    flex: 0 0 100%;
    width: 100%;
    height: 0;
    margin: 0;
    font-size: 0;
    line-height: 0;
  }


  /* -----------------------------------------------
     PAGE LOGO
     ----------------------------------------------- */

  .page-logo {
  bottom: 18px;
  width: max-content;
  max-width: calc(100vw - 24px);

  font-size: clamp(18px, 5.6vw, 28px);

  white-space: nowrap;
}


  /* -----------------------------------------------
     SCROLL HINT
     ----------------------------------------------- */

  .scroll-hint {
    bottom: 64px;
    font-size: clamp(18px, 5.6vw, 28px);
  }


  /* -----------------------------------------------
     DETAILS
     ----------------------------------------------- */

  .detail-row {
    display: block;
    margin-bottom: 2.5rem;
  }

  .detail-label {
    margin-bottom: 12px;
  }


  /* -----------------------------------------------
     LIGHTBOX
     ----------------------------------------------- */

  .lightbox {
    padding: 8px;
  }

  .lightbox-image {
    max-height: calc(100dvh - 16px);
  }

  .lightbox-close {
    top: 8px;
    right: 10px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 15%;
  }


  /* -----------------------------------------------
     FLAMMEN MOBILE
     ----------------------------------------------- */

  .footer-flames {
    bottom: 45px;

    width: 180%;
    height: 150px;

    overflow: visible;
  }

  .footer-flames svg {
    display: block;

    width: 100%;
    height: 150px;

    overflow: visible;
  }

  .flame-line {
    stroke-width: 1.5;
  }

}


/* ==================================================
   DARK / GREY — BOTTOM LOGOS
   ================================================== */

body.stills-theme-black .page-logo--project,
body.stills-theme-black .page-logo--name,
body.stills-theme-grey .page-logo--project,
body.stills-theme-grey .page-logo--name {
  color: #fff;
}


/* ==================================================
   HEADER — "Not pinned" (Design Panel)
   Default is unchanged: the header stays fixed/pinned.
   Selecting "Not pinned" puts it back into normal flow,
   so it scrolls away with the page and needs no extra
   spacing logic — nothing else on the page currently
   reserves room for the fixed header, so there is
   nothing to adjust when it becomes static.
   ================================================== */

body.header-not-pinned .site-header {
  position: static;
}


/* ==================================================
   SITE FOOTER (Design Panel, off by default)
   Only rendered at all when "Footer anzeigen" is on —
   these rules never apply to the default appearance.
   ================================================== */

.site-footer {
  padding: 40px var(--gutter) calc(var(--gutter) + 20px);

  font-family: var(--font-text);
  font-size: var(--label-size);
  color: var(--grey);
}

.footer-identity {
  margin: 0 0 20px;
}

.footer-logo {
  /*
   * inline-block (not block + margin:auto) so the logo follows
   * .site-footer's own text-align setting (left/center/right)
   * exactly like the copyright/links text already does, instead
   * of always forcing itself back to center.
   */
  display: inline-block;
  margin: 0 0 12px;

  width: auto;
  max-width: 200px;
  max-height: 90px;

  height: auto;
}

.footer-designation {
  margin: 0;

  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.85em;
}

.footer-custom-title {
  margin: 0.15em 0 0;
}

.footer-copyright {
  margin: 0 0 0.4em;
}

.footer-links {
  margin: 0;
}

.footer-links a {
  color: var(--grey);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--blue);
}

.footer-links span {
  margin: 0 0.25em;
}


@media (max-width: 700px) {

  .site-footer {
    padding: 28px 12px calc(12px + 16px);
    font-size: min(3.2vw, 15px);
  }

}

/* ==================================================
   HEADER BACKDROP BLUR — FIXED VIEWPORT LAYER

   Independent from .site-header. JS writes the ACTUAL rendered bottom
   edge of the complete header (including .film-nav / project tree) into
   --header-blur-bottom. The blur layer then reaches from viewport top
   through that boundary and fades out below it.
   ================================================== */

:root {
  --header-blur-bottom: 0px;
  --header-blur-tail: 40px;
  --header-blur-strength: 12px;
}

/* DESKTOP */
@media (min-width: 651px) {
  :root {
    --header-blur-tail: 10px;
  }
}

/* MOBILE */
@media (max-width: 650px) {
  :root {
    --header-blur-tail: 35px;
  }
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: calc(var(--header-blur-bottom) + var(--header-blur-tail));

  z-index: calc(var(--z-header) - 1);
  pointer-events: none;

  -webkit-backdrop-filter: blur(var(--header-blur-strength));
  backdrop-filter: blur(var(--header-blur-strength));

  -webkit-mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 var(--header-blur-bottom),
    rgba(0,0,0,.96) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .18),
    rgba(0,0,0,.78) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .40),
    rgba(0,0,0,.48) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .62),
    rgba(0,0,0,.18) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .84),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    #000 0,
    #000 var(--header-blur-bottom),
    rgba(0,0,0,.96) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .18),
    rgba(0,0,0,.78) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .40),
    rgba(0,0,0,.48) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .62),
    rgba(0,0,0,.18) calc(var(--header-blur-bottom) + var(--header-blur-tail) * .84),
    transparent 100%
  );
}

body.header-not-pinned::before,
body.lightbox-open::before {
  display: none;
}

/* ==================================================
   MOBILE — FLAMES COMPLETELY DISABLED
   ================================================== */

@media (max-width: 650px) {
  .footer-flames,
  .flame-toggle {
    display: none !important;
  }
}

/* ==================================================
   HEADER BLUR — ONE CONTINUOUS NAVIGATION BLOCK
   ================================================== */

/* Disable the old full-width viewport blur. */
body::before,
body.header-smart::before,
body.header-smart.header-smart-hidden::before {
  display: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Compact complete navigation block, 10px below viewport top. */
.site-header {
  width: max-content;
  max-width: calc(100vw - 30px);
  left: 0;
  right: 0;
  top: 10px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 10px;
  transform: translate3d(0, 0, 0);
  isolation: isolate;
}

/* No individual blur boxes. */
.site-header .main-nav a,
.site-header .main-nav button,
.site-header .film-nav a,
.site-header .film-nav span,
.site-header .project-name,
.site-header .nav-page-title,
.site-header .nav-title {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* One continuous translucent blur pill with a 15px outer fade. */
.site-header::before {
  content: "";
  position: absolute;
  inset: -15px;
  z-index: -1;
  pointer-events: none;
  border-radius: 9999px;
  opacity: 0.62;

  -webkit-backdrop-filter: blur(var(--header-blur-strength));
  backdrop-filter: blur(var(--header-blur-strength));

  -webkit-mask-image:
    linear-gradient(to bottom,
      transparent 0,
      #000 15px,
      #000 calc(100% - 15px),
      transparent 100%),
    linear-gradient(to right,
      transparent 0,
      #000 15px,
      #000 calc(100% - 15px),
      transparent 100%);
  -webkit-mask-composite: source-in;

  mask-image:
    linear-gradient(to bottom,
      transparent 0,
      #000 15px,
      #000 calc(100% - 15px),
      transparent 100%),
    linear-gradient(to right,
      transparent 0,
      #000 15px,
      #000 calc(100% - 15px),
      transparent 100%);
  mask-composite: intersect;
}

@media (max-width: 650px) {
  .site-header {
    width: max-content;
    max-width: calc(100vw - 24px);
    top: 10px;
    padding: 5px 8px;
  }

  .main-nav {
    padding-left: 0;
    padding-right: 0;
  }
}


/* ==================================================
   HEADER — SMART STICKY
   Exactly one state transition:
   down = slide upward out of viewport
   up   = slide downward back in
   ================================================== */

body.header-smart .site-header {
  transform: translate3d(0, 0, 0);
  transition: transform 420ms cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

body.header-smart.header-smart-hidden .site-header {
  transform: translate3d(0, calc(-100% - 40px), 0);
}

@media (prefers-reduced-motion: reduce) {
  body.header-smart .site-header {
    transition: none;
  }
}


/* SMART STICKY — MOBILE: calmer hide motion */
@media (max-width: 650px) {
  body.header-smart .site-header {
    transition: transform 520ms cubic-bezier(.22, .61, .36, 1);
  }

  body.header-smart.header-smart-hidden .site-header {
    transition-duration: 720ms;
  }
}


/* HEADER BLUR — MOBILE FINAL GEOMETRY
   Blur is clipped exactly at the bottom edge of MAIN NAV.
   No backdrop-filter area exists in the row below. */
@media (max-width: 650px) {
  .site-header::before {
    display: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .site-header .main-nav {
    position: relative;
    z-index: 0;
    isolation: isolate;
  }

  .site-header .main-nav::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;

    /* extra room only above + sideways; bottom stops at nav edge */
    top: -10px;
    left: -12px;
    right: -12px;
    bottom: 0;

    border-radius: 18px 18px 8px 8px;
    opacity: .58;

    -webkit-backdrop-filter: blur(var(--header-blur-strength));
    backdrop-filter: blur(var(--header-blur-strength));

    /* Fade happens INSIDE the nav block, not underneath it. */
    -webkit-mask-image:
      linear-gradient(to bottom,
        transparent 0,
        #000 9px,
        #000 calc(100% - 8px),
        transparent 100%),
      linear-gradient(to right,
        transparent 0,
        #000 10px,
        #000 calc(100% - 10px),
        transparent 100%);
    -webkit-mask-composite: source-in;

    mask-image:
      linear-gradient(to bottom,
        transparent 0,
        #000 9px,
        #000 calc(100% - 8px),
        transparent 100%),
      linear-gradient(to right,
        transparent 0,
        #000 10px,
        #000 calc(100% - 10px),
        transparent 100%);
    mask-composite: intersect;
  }
}

/* ==================================================
   HEADER BLUR — V3 COMPACT CONTENT-BOUND BOX
   Final override: no mask/fade halo. The box follows the rendered
   header content and ends 10px below it. Panel-driven title sizes
   naturally change the header's rendered height.
   ================================================== */

/* The header itself must not reserve invisible space below its last line. */
.site-header {
  padding-bottom: 0 !important;
  isolation: isolate;
}

/* Disable the old viewport blur. */
body::before,
body.header-smart::before,
body.header-smart.header-smart-hidden::before {
  display: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* One restrained blur surface around the complete rendered header. */
.site-header::before {
  display: block !important;
  content: "" !important;
  position: absolute;
  top: -6px;
  left: -12px;
  right: -12px;
  bottom: -10px;
  z-index: -1;
  pointer-events: none;

  border-radius: 5px;
  opacity: .48;
  background: rgba(255,255,255,.08);

  -webkit-backdrop-filter: blur(var(--header-blur-strength));
  backdrop-filter: blur(var(--header-blur-strength));

  /* Important: no mask. The old mask created a visible lower halo
     that made the box appear much deeper than its actual geometry. */
  -webkit-mask-image: none !important;
  mask-image: none !important;
  -webkit-mask-composite: initial !important;
  mask-composite: initial !important;
}

/* Never create a second blur surface around the main navigation. */
.site-header .main-nav::before {
  display: none !important;
  content: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 650px) {
  .site-header {
    padding-bottom: 0 !important;
  }

  .site-header::before {
    display: block !important;
    top: -6px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 5px;
  }
}

/* ==================================================
   HEADER BLUR — V5 SOFT VERTICAL EDGE
   Keeps the compact content-bound box.
   Blur is strongest through the centre band:
   - upward fade starts around the centre of the category/main-nav title
   - downward fade starts around the centre of the project title
   The physical box edge therefore becomes visually transparent.
   ================================================== */

.site-header::before {
  display: block !important;
  content: "" !important;
  position: absolute;

  /* Keep the successful compact geometry. */
  top: -14px;
  left: -12px;
  right: -12px;
  bottom: -14px;

  z-index: -1;
  pointer-events: none;
  border-radius: 4px;
  opacity: .52;
  background: rgba(255,255,255,.06);

  -webkit-backdrop-filter: blur(var(--header-blur-strength));
  backdrop-filter: blur(var(--header-blur-strength));

  /*
   * Vertical mask:
   * 0% / 100% = fully invisible at the box edges.
   * ~30%       = approximately the middle of the category/main-nav line.
   * ~70%       = approximately the middle of the lowest/project-title line.
   *
   * The broad opaque centre keeps navigation legible while both physical
   * horizontal edges disappear. Percentages make this follow panel-driven
   * project-title sizes because the pseudo-element grows with the header.
   */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,.18) 10%,
    rgba(0,0,0,.55) 20%,
    #000 30%,
    #000 70%,
    rgba(0,0,0,.55) 82%,
    rgba(0,0,0,.18) 92%,
    transparent 100%
  ) !important;

  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0,0,0,.18) 10%,
    rgba(0,0,0,.55) 20%,
    #000 30%,
    #000 70%,
    rgba(0,0,0,.55) 82%,
    rgba(0,0,0,.18) 92%,
    transparent 100%
  ) !important;

  -webkit-mask-composite: initial !important;
  mask-composite: initial !important;
}

/* Keep the old mobile-only main-nav blur disabled: one surface only. */
.site-header .main-nav::before {
  display: none !important;
  content: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

@media (max-width: 650px) {
  .site-header::before {
    top: -14px;
    left: -10px;
    right: -10px;
    bottom: -14px;
    border-radius: 4px;
  }
}

/* ==================================================
   ROUNDED VIDEO — GLOBAL HAIRLINE FIX
   Prevents black 1px/subpixel edges around rounded
   Vimeo/YouTube/native video embeds.
   ================================================== */

.media-rounded .video-container {
  overflow: hidden;
  border-radius: var(--radius);
  background: transparent;
  -webkit-clip-path: inset(0 round var(--radius));
  clip-path: inset(0 round var(--radius));
}

.media-rounded .video-container iframe,
.media-rounded .video-container video {
  display: block;
  border: 0;
}

/* ==================================================
   MEDIAMIX / PROJECT DETAILS — MOBILE
   Header blur continues below complete navigation.
   Credits keep role + name side by side.
   ================================================== */

@media (max-width: 650px) {

  /* Keep the complete mobile header visually protected below its final line. */
  body:has(.mediamix-page) .site-header::before {
    bottom: -22px;
  }

  /* Project Details credits: role | name, also on mobile. */
  .project-details__credits .project-details__row {
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }

  .project-details__credits .project-details__row dt,
  .project-details__credits .project-details__row dd {
    min-width: 0;
    margin: 0;
  }
}

/* ==================================================
   MEDIAMIX — MOBILE FINAL ALIGNMENT
   1. Preview hero left-aligned with page content
   2. Navigation sits above the preview with clear space
   3. Credits retain desktop grouping; first 3 entries are
      controlled by the existing Project Details collapse JS
   ================================================== */

@media (max-width: 650px) {

  /* Preview film: left edge follows the mobile page gutter.
     Do not use the older 100vw/50vw centering trick here. */
  body:has(.mediamix-page) .media-video--hero {
    width: calc(100vw - (2 * var(--mobile-media-gutter))) !important;
    max-width: none !important;
    margin-left: var(--mobile-media-gutter) !important;
    margin-right: var(--mobile-media-gutter) !important;

    /* Fixed navigation remains clearly above the preview. */
    margin-top: var(--mobile-header-safe) !important;
  }

  body:has(.mediamix-page) .media-video--hero .video-container {
    width: 100% !important;
    max-width: none !important;
  }

  /* Header must always remain visually above the preview video. */
  body:has(.mediamix-page) .site-header {
    z-index: calc(var(--z-header) + 20);
  }

  /* Credits: same role/name grouping as desktop.
     The existing collapse logic still decides that exactly
     three credit rows are visible before "mehr". */
  body:has(.mediamix-page) .project-details__credits .project-details__row {
    display: grid;
    grid-template-columns: minmax(105px, 38%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }
}

/* ==================================================
   DARK / INVERTED MODE — COLOR OVERRIDES ONLY
   Background black · text white · hover grey · active blue.
   Media/layout/spacing remain untouched.
   ================================================== */
body.stills-theme-black { background: var(--black); color: var(--white); }

body.stills-theme-black .main-nav a,
body.stills-theme-black .film-nav a,
body.stills-theme-black .film-nav span,
body.stills-theme-black .project-name,
body.stills-theme-black .nav-page-title,
body.stills-theme-black .nav-title,
body.stills-theme-black .page-logo,
body.stills-theme-black .page-logo *,
body.stills-theme-black .scroll-hint,
body.stills-theme-black .detail-row,
body.stills-theme-black .detail-label,
body.stills-theme-black .detail-content,
body.stills-theme-black .detail-text,
body.stills-theme-black .default-page,
body.stills-theme-black .text-collapse-toggle,
body.stills-theme-black .site-footer,
body.stills-theme-black .footer-designation,
body.stills-theme-black .footer-custom-title,
body.stills-theme-black .footer-copyright,
body.stills-theme-black .footer-links,
body.stills-theme-black .footer-links a { color: var(--white); }

body.stills-theme-black .main-nav a:hover,
body.stills-theme-black .film-nav a:hover,
body.stills-theme-black .page-logo:hover,
body.stills-theme-black .text-collapse-toggle:hover,
body.stills-theme-black .footer-links a:hover { color: var(--grey); }

body.stills-theme-black .main-nav a.active,
body.stills-theme-black .film-nav a.active { color: var(--blue); }

body.stills-theme-black .lightbox { background: var(--black); }
body.stills-theme-black .lightbox-caption { color: var(--white); }
body.stills-theme-black .site-header::before { background: rgba(0,0,0,.10); }

/* ==================================================
   VIDEO BLOCK — FULLSCREEN/HERO DARK MODE
   Panel option on a Full Width → Hero video block.
   Color overrides only: layout/media geometry remain unchanged.
   ================================================== */

body.video-hero-dark {
  background: var(--black);
  color: var(--white);
}

body.video-hero-dark .site-header,
body.video-hero-dark .main-nav,
body.video-hero-dark .film-nav,
body.video-hero-dark .film-nav span,
body.video-hero-dark .project-name,
body.video-hero-dark .nav-page-title,
body.video-hero-dark .nav-title,
body.video-hero-dark .page-logo,
body.video-hero-dark .page-logo *,
body.video-hero-dark .scroll-hint,
body.video-hero-dark .detail-row,
body.video-hero-dark .detail-label,
body.video-hero-dark .detail-content,
body.video-hero-dark .detail-text,
body.video-hero-dark .project-details,
body.video-hero-dark .project-details *,
body.video-hero-dark .media-title,
body.video-hero-dark .media-video-subtitle,
body.video-hero-dark .text-collapse-toggle,
body.video-hero-dark .site-footer,
body.video-hero-dark .footer-designation,
body.video-hero-dark .footer-custom-title,
body.video-hero-dark .footer-copyright,
body.video-hero-dark .footer-links,
body.video-hero-dark .footer-links a {
  color: var(--white);
}

body.video-hero-dark .main-nav a,
body.video-hero-dark .film-nav a,
body.video-hero-dark .page-logo a {
  color: var(--white);
}

body.video-hero-dark .main-nav a:hover,
body.video-hero-dark .film-nav a:hover,
body.video-hero-dark .page-logo a:hover,
body.video-hero-dark .text-collapse-toggle:hover,
body.video-hero-dark .footer-links a:hover,
body.video-hero-dark .project-details a:hover {
  color: var(--grey);
}

body.video-hero-dark .main-nav a.active,
body.video-hero-dark .film-nav a.active,
body.video-hero-dark .main-nav .active > a,
body.video-hero-dark .film-nav .active > a {
  color: var(--blue);
}

body.video-hero-dark .lightbox {
  background: var(--black);
}

body.video-hero-dark .lightbox-caption {
  color: var(--white);
}

body.video-hero-dark .site-header::before {
  background: rgba(0,0,0,.10);
}

/* VIDEO FULLSCREEN DARK MODE — PREVIEW VIDEO TITLES BLUE */
body.video-hero-dark .media-video--hero .media-video-hero-title,
body.video-hero-dark .media-video--hero .media-video-hero-subtitle {
  color: var(--blue);
}


/* ==================================================
   RESPONSIVE / HEADER STABILITY — FINAL OVERRIDES
   One geometry model across desktop, 13", tablet and mobile.
   ================================================== */

.site-header {
  box-sizing: border-box;
  max-width: calc(100vw - 24px);
  contain: layout style;
}

body.header-smart .site-header {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 13-inch / compact desktop: retain one-line navigation but reduce its
   footprint before it can collide with viewport edges. */
@media (min-width: 901px) and (max-width: 1280px) {
  .site-header {
    max-width: calc(100vw - 32px);
  }

  .main-nav {
    font-size: clamp(16px, 1.55vw, 19px);
  }
}

/* Tablet: allow the main navigation to wrap naturally instead of relying on
   a desktop nowrap row that can overflow at intermediate widths. */
@media (min-width: 651px) and (max-width: 900px) {
  .site-header {
    width: max-content;
    max-width: calc(100vw - 24px);
  }

  .main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: baseline;
    max-width: calc(100vw - 48px);
    white-space: normal;
    column-gap: .32em;
    row-gap: .08em;
    font-size: clamp(16px, 2.35vw, 20px);
  }

  .main-nav a,
  .main-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

@media (max-width: 650px) {
  .site-header {
    width: max-content;
    max-width: calc(100vw - 20px);
    padding-left: 8px;
    padding-right: 8px;
  }

  .main-nav {
    max-width: calc(100vw - 36px);
    padding-left: 0;
    padding-right: 0;
  }
}
