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

/* --------------------------------------------------
   FONTS
   Hallo-latin.woff2 is a Latin subset (114 KB) of the
   full display font (800 KB). The full file is declared
   first and only loads for characters outside the subset.
   -------------------------------------------------- */

@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;
}


/* --------------------------------------------------
   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;

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

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

  /* width of video, infos, credits, stills (film + still pages) */
  --content-width: min(82vw, 1000px);
  --detail-label-width: 12rem;
  --detail-gap: 2rem;

  --header-top: clamp(8px, 1vw, 16px);
  --z-header: 1000;
  --z-lightbox: 99999;
}


/* --------------------------------------------------
   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;
}

/* labels (INFOS, CREDITS, CV …) are headings for structure only */
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(16px, 1.4vw, 22px);
}

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

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

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

.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;
}


/* --------------------------------------------------
   PAGE LOGOS (fixed bottom)
   project title at the start · name logo at the end
   page-scroll.js toggles .is-scrolled / .is-at-end on <main>
   -------------------------------------------------- */

.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--project {
  color: var(--blue);
  pointer-events: none;
}

.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 (film pages)
   -------------------------------------------------- */

.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 85px;
  z-index: var(--z-header);
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 30px);
  line-height: 1;
  color: var(--blue);
  pointer-events: none;
  animation: scrollHintDance 2.4s ease-in-out infinite;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

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

@keyframes scrollHintDance {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}


/* --------------------------------------------------
   DETAIL ROWS
   label left · content right (film, stills, connect)
   -------------------------------------------------- */

.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 (created by lightbox.js)
   -------------------------------------------------- */

.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;
}


/* --------------------------------------------------
   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 {
    --content-width: calc(100% - 24px);
    --logo-size: clamp(17px, 6vw, 25px);
  }


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

  .site-header {
    position: fixed;
    width: 100%;
    padding: 8px 12px 0;
    overflow: hidden;
  }

  /*
     Das Menü bleibt eine zusammenhängende Zeile.

     Die Schriftgrösse skaliert mit der Viewportbreite,
     sodass die gesamte Navigation ungefähr die gleiche
     Breite wie das Portrait erhält.
  */

  .main-nav {
    display: block;

    width: 100%;
    margin: 0;

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

    font-size: 4.05vw;
    line-height: 1.05;
  }

  .main-nav a {
    display: inline;
    white-space: nowrap;
  }


  /* --------------------------------------------------
     SECOND NAV
     -------------------------------------------------- */

  .film-nav {
    width: 100%;
    margin: 5px auto 0;

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

    font-size: clamp(12px, 3.5vw, 16px);
  }


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

  .page-logo {
    bottom: 18px;
  }


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

  .scroll-hint {
    bottom: 70px;
  }


  /* --------------------------------------------------
     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%;
  }
}


/* --------------------------------------------------
   FLAT LAPTOP DISPLAYS
   -------------------------------------------------- */

@media (min-width: 651px) and (max-height: 850px) {
  :root {
    --content-width: min(74vw, 900px);
  }

  .main-nav {
    font-size: 20px;
  }

  .film-nav {
    font-size: 16px;
  }

  .scroll-hint {
    bottom: 72px;
    font-size: clamp(17px, 1.6vw, 24px);
  }
}

@media (min-width: 651px) and (max-height: 720px) {
  :root {
    --content-width: min(68vw, 820px);
  }

  .main-nav {
    font-size: 19px;
  }

  .film-nav {
    font-size: 15px;
  }

  .scroll-hint {
    bottom: 62px;
    font-size: clamp(16px, 1.4vw, 21px);
  }
}


/* --------------------------------------------------
   TEXT COLLAPSE ("mehr" / "weniger")
   Applied to [data-collapse]; JS adds the toggle only
   when the text is longer than --collapse-lines.
   -------------------------------------------------- */

:root {
  --collapse-lines: 3;
}

/* the inner body carries the clamp (only once JS is present → no dead state) */
.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;
}

/* the toggle sits inside the text block → follows its width and position */
.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;
}
