/* =========================================================
   paulkrischker.ch — Redesign
   Work-first Dokumentar-Portfolio · modern & schlicht
   ========================================================= */

/* Sanfter nativer Seitenübergang (Chrome/Edge; andere Browser ignorieren dies folgenlos) */
@view-transition {
  navigation: auto;
}

:root {
  --bg:          #fafafa;   /* exakt das Weiss des Logos */
  --fg:          #1a1a18;   /* Fast-Schwarz */
  --fg-soft:     #33322f;   /* Fliesstext */
  --muted:       #6f6e69;   /* gedämpfter Text */
  --line:        #e6e6e6;   /* Hairline */
  --line-strong: #cfcfcf;   /* betonte Linie / Hover */
  --tile:        #ececec;   /* Platzhalter-Kachel (Stills) */
  --accent:      #1a1a18;   /* Akzent = monochrom */
  --max:         1180px;
  --font:        "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- i18n (DE/EN) ---------- */
html[data-lang="de"] .lang-en { display: none; }
html[data-lang="en"] .lang-de { display: none; }
/* Ohne JavaScript wird data-lang nie gesetzt → Standard Deutsch,
   sonst erscheint jeder Text doppelt (DE + EN direkt hintereinander). */
html:not([data-lang]) .lang-en { display: none; }

/* Nur für Screenreader / SEO sichtbar (visuell versteckt) */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

/* ---------- Header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  padding: 26px clamp(20px, 5vw, 56px);
  max-width: var(--max); margin: 0 auto;
}
/* Logo wird beschnitten (das PNG hat viel Rand), damit die Schrift gross & lesbar ist.
   Der #fafafa-Rand des PNGs ist auf dem gleichfarbigen Seitenhintergrund unsichtbar. */
.logo { display: block; height: 28px; width: 290px; overflow: hidden; }
.logo img { display: block; height: 96px; width: auto; margin: -34px 0 0 -12px; }

/* Sprach-Umschalter (jetzt im Footer, auf Desktop und Mobile) */
.lang-switch {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; letter-spacing: 0.08em;
  border: 0.5px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 9px;
}
.lang-switch button {
  background: none; border: 0; padding: 0 2px;
  color: var(--muted); letter-spacing: inherit;
  display: inline-block;
  transition: color .18s ease, transform .15s ease;
}
.lang-switch button:active { transform: scale(.9); }
.lang-switch button:hover { color: var(--fg); }
.lang-switch button.is-active { color: var(--fg); font-weight: 500; }
.lang-switch span { color: var(--line-strong); }

/* ---------- Filter-Reiter + „Über mich" auf einer Zeile ---------- */
.subnav {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 14px 0 30px;
  border-bottom: 0.5px solid var(--line);
}
.filters {
  display: flex; flex-wrap: wrap; gap: clamp(18px, 4vw, 30px);
}
.nav-about {
  display: inline-block;
  font-size: 0.78rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em;
  white-space: nowrap;
  transition: color .18s ease, transform .15s ease;
}
.nav-about:hover { color: var(--fg); }
.nav-about:active { transform: scale(.95); }
.filter-tab {
  background: none; border: 0; padding: 4px 0;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  position: relative;
  transition: color .18s ease, transform .15s ease;
}
.filter-tab:active { transform: scale(.95); }
.filter-tab::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 1px; background: var(--fg);
  transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.filter-tab:hover { color: var(--fg); }
.filter-tab.is-active { color: var(--fg); }
.filter-tab.is-active::after { transform: scaleX(1); }
.filter-tab.is-hidden { display: none; }

/* ---------- Projekt-Raster ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(18px, 2.4vw, 28px);
  padding: 44px 0 12px;
}
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
.card { display: block; }
.card.is-hidden { display: none; }
/* Schneller Kreuz-Blend beim Filterwechsel (nur während is-fading aktiv) —
   bewusst als eigene, spezifischere Regel, damit sie die .reveal-Transition
   (Fade + Slide-up beim Einblenden, siehe unten) nicht überschreibt. */
.grid.is-fading .card { opacity: 0; transition: opacity .28s ease; }

/* Still-only im Ruhezustand; Name erscheint beim Hover */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--tile);
  overflow: hidden;
  border-radius: 4px;
  transition: box-shadow .4s ease;
}
.card:hover .thumb,
.card:focus-visible .thumb { box-shadow: 0 20px 44px -22px rgba(20,20,18,.4); }
.thumb-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .6s cubic-bezier(.2,.6,.2,1);
}
.card:hover .thumb-img,
.card:focus-visible .thumb-img { transform: scale(1.04); }

.card-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 22px;
  background: linear-gradient(to top,
    rgba(20,20,18,.66) 0%, rgba(20,20,18,.18) 46%, rgba(20,20,18,0) 78%);
  opacity: 0;
  transition: opacity .4s ease;
}
.card:hover .card-overlay,
.card:focus-visible .card-overlay { opacity: 1; }

.card-title {
  margin: 0; color: #fff;
  font-size: 0.9rem; font-weight: 500; line-height: 1.3;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.card-meta {
  margin-top: 6px; color: rgba(255,255,255,.72);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Touch-Geräte ohne Hover: Name dauerhaft sichtbar */
@media (hover: none) {
  .card-overlay { opacity: 1; }
}

/* ---------- Projekt-Detailseite ---------- */
.page-nav {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  padding: 14px 0 30px;
  border-bottom: 0.5px solid var(--line);
}
.back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.85rem; color: var(--muted);
  transition: color .18s ease, transform .15s ease;
}
.back:hover { color: var(--fg); }
.back:active { transform: scale(.96); }

.project { padding-top: 0; padding-bottom: 10px; }
.project-title {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  font-weight: 500; letter-spacing: -0.015em; line-height: 1.08;
  margin: 20px 0 16px; max-width: 16ch;
}
/* Lange Titel (>30 Zeichen) bekommen kleinere Schrift + breitere Zeilen,
   damit die Zeilenzahl über alle Projektseiten ähnlicher wird
   (sonst brechen sie bei max-width:16ch über 3+ Zeilen um). */
.project-title--long {
  font-size: clamp(1.4rem, 3.4vw, 2.2rem);
  max-width: 26ch;
}
.project-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 0.88rem; color: var(--muted);
  padding-bottom: 30px;
}
/* Echtes YouTube-Fenster: eingebettetes iframe mit nativer Steuerung */
.video {
  position: relative; aspect-ratio: 16 / 9;
  background: #000;
  border: 0.5px solid var(--line);
  border-radius: 12px; overflow: hidden; margin: 36px 0;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Platzhalter-Hero (Projekt ohne fertiges Video): Bild statt iframe im gleichen Rahmen */
.video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-note {
  position: absolute; left: 16px; bottom: 16px;
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: #fff; background: rgba(20,20,18,.6);
  padding: 6px 12px; border-radius: 999px;
}

.synopsis { max-width: 62ch; }
.synopsis p { color: var(--fg-soft); }

.gallery-label {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 48px 0 14px;
}
/* BTS-Video: eigener Block unter „Entstehung", bewusst deutlich kleiner
   als der Hauptfilm (der bleibt gross im Vordergrund). */
.video.video-bts {
  max-width: 460px; margin: 8px 0 30px; border-radius: 10px;
}

/* Bilder im natürlichen Seitenverhältnis, nichts wird beschnitten.
   BTS-Galerie bewusst kleinteiliger (schmalere Spalten → kompaktere Sektion).
   Grid statt CSS-Multicolumn: column-width liess bei manchen Bildanzahlen/Breiten
   eine komplett leere Spalte am rechten Rand entstehen (Chrome-Balance-Bug bei
   column-fill: balance, das überzählige Spalten reserviert, aber nicht füllt). */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: start;
  gap: 14px; margin: 0 0 44px;
}
/* Einheitliches Galerie-Format über ALLE Projekte: feste 3:4-Kacheln (wie MUSE),
   object-fit: cover macht jedes Bild gleich hoch — unabhängig von Quellgrösse/EXIF.
   Neue BTS-Bilder fügen sich dadurch automatisch ins gleiche Raster ein. */
.gallery img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
  margin: 0; border-radius: 8px; border: 0.5px solid var(--line);
}
/* Mobile: BTS-Bilder in zwei schmalen Spalten statt einer grossen. */
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

.credits {
  margin: 44px 0; padding: 26px 0;
}
.credits h2 {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 0 0 10px;
}
.credits p { margin: 0; font-size: 1rem; }
.credits .credits-sub { margin-top: 22px; }

.prevnext {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 20px 0 10px; font-size: 0.9rem;
}
.prevnext a { display: inline-block; color: var(--muted); transition: color .18s ease, transform .15s ease; }
.prevnext a:hover { color: var(--fg); }
.prevnext a:active { transform: scale(.97); }
.prevnext .disabled { opacity: 0; pointer-events: none; }

/* ---------- About ---------- */
.about { padding-top: 0; padding-bottom: 20px; }
.about-grid {
  display: grid; grid-template-columns: 320px 1fr;
  gap: clamp(30px, 5vw, 64px); align-items: start;
}
.portrait {
  aspect-ratio: 4 / 5; background: var(--tile);
  border: 0.5px solid var(--line); border-radius: 12px; overflow: hidden;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.about h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 500;
  letter-spacing: -0.01em; margin: 0 0 22px; line-height: 1.15;
}
.about-bio p { max-width: 60ch; color: var(--fg-soft); margin: 0 0 18px; }
.about-block { margin: 40px 0; }
.about-block h2 {
  font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500; margin: 0 0 14px;
}
.clients {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  color: var(--fg); font-size: 1rem; margin: 0; padding: 0; list-style: none;
}
.contact-row { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.contact-row a { border-bottom: 1px solid var(--line-strong); transition: border-color .2s ease; }
.contact-row a:hover { border-color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 80px;
  border-top: 0.5px solid var(--line);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 20px; padding-top: 34px; padding-bottom: 34px;
}
.foot-copy { font-size: 0.82rem; color: var(--muted); }

/* ---------- Sanftes Einblenden beim Scrollen (nur unterhalb der Startansicht, siehe script.js) ---------- */
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }
/* Verhindert ein sichtbares Aufblitzen/Ausblenden, wenn .reveal per JS gesetzt wird,
   während das Element schon sichtbar ist (Projekt-Raster, siehe script.js) */
.reveal.reveal-instant { transition: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: 14px; }
  .about-grid { grid-template-columns: 1fr; }
  .portrait { max-width: 300px; }
  .project-title { max-width: none; }
  .project-title--long { max-width: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
