/* ============================================================
   Oliver Nimz Photography — Global Styles
   ============================================================ */

/* Cormorant Garamond — lokal gehostet */
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../assets/fonts/CormorantGaramond-normal-latin-ext.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: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url('../assets/fonts/CormorantGaramond-normal-latin.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;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('../assets/fonts/CormorantGaramond-italic-latin-ext.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: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 400;
  font-display: swap;
  src: url('../assets/fonts/CormorantGaramond-italic-latin.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;
}

/* Playfair Display — lokal gehostet (nur Raster-Titel/Untertitel) */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/PlayfairDisplay-normal-latin-ext.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: 'Playfair Display';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/PlayfairDisplay-normal-latin.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;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/PlayfairDisplay-italic-latin-ext.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: 'Playfair Display';
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url('../assets/fonts/PlayfairDisplay-italic-latin.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;
}

/* Arapey — lokal gehostet (testweise, nur Raster-Titel/Untertitel; nur Gewicht 400) */
@font-face {
  font-family: 'Arapey';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/Arapey-normal-latin.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 {
  --black:  #0a0a0a;
  --white:  #ffffff;
  --warm:   #f5f0eb;
  --muted:  #888888;
  --accent: #c8a96e;
  --nav-h:  70px;

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-display: 'Arapey', 'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-ui:    system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);

  /* Theme tokens — Light Mode (Default) */
  --t-bg:          #f7f4f0;
  --t-bg-alt:      #f0ece6;
  --t-bg-surface:  #ece8e2;
  --t-text:        #1a1a1a;
  --t-text-muted:  #6b6460;
  --t-border:      rgba(30,20,10,0.08);
  --t-border-mid:  rgba(30,20,10,0.13);
  --t-nav-bg:      rgba(247,244,240,0.93);
  --t-logo-filter: brightness(0);
  --t-lb-backdrop: rgba(240,236,230,0.90);
  --t-lb-card:     #f7f4f0;
  --t-lb-info:     #f0ece6;
  --t-scrollbar:    rgba(30,20,10,0.15);
  --t-nav-scrolled: #6b6460;
}

[data-theme="dark"] {
  --t-bg:          #0a0a0a;
  --t-bg-alt:      #0f0f0f;
  --t-bg-surface:  #111111;
  --t-text:        #ffffff;
  --t-text-muted:  #888888;
  --t-border:      rgba(255,255,255,0.06);
  --t-border-mid:  rgba(255,255,255,0.07);
  --t-nav-bg:      rgba(10,10,10,0.92);
  --t-logo-filter: brightness(0) invert(1);
  --t-lb-backdrop: rgba(0,0,0,0.88);
  --t-lb-card:     #0d0d0d;
  --t-lb-info:     #111111;
  --t-scrollbar:    rgba(255,255,255,0.15);
  --t-nav-scrolled: rgba(255,255,255,0.75);
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a, button, [role="button"] { cursor: none; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--t-bg);
  color: var(--t-text);
  font-family: var(--font-serif);
  overflow-x: hidden;
  cursor: none;
  transition: background 0.35s ease, color 0.35s ease;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Custom Cursor ──────────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--white);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s var(--ease-out), opacity 0.3s;
  mix-blend-mode: difference;
}

.cursor-follower {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.35s var(--ease-out), width 0.3s var(--ease-out), height 0.3s var(--ease-out), opacity 0.3s;
  mix-blend-mode: difference;
}

.cursor.expanded { transform: translate(-50%, -50%) scale(2); opacity: 0.5; }
.cursor-follower.expanded { width: 50px; height: 50px; }

@media (hover: none), (pointer: coarse) {
  .cursor, .cursor-follower { display: none; }
  body, a, button, [role="button"] { cursor: auto; }
}

/* ── CUSTOM_CURSOR_OFF ──────────────────────────────────────────
   Stilisierter Cursor ist deaktiviert — die Seite nutzt den Standard-Cursor
   des Systems. Der komplette Cursor-Code (CSS oben, HTML in index.html,
   JS in js/main.js) bleibt unangetastet erhalten.

   Reaktivieren:
   1. diesen Block entfernen oder auskommentieren
   2. in js/main.js  CUSTOM_CURSOR = false  →  true  setzen              */
.cursor, .cursor-follower { display: none !important; }
*, *::before, *::after { cursor: auto !important; }
a, button, [role="button"], label, summary,
.hamburger, .portfolio-item, .lb-thumb-cell,
.lb2-thumb, .lb2-nav, .lb2-close, .lb2-nsfw-btn, .nsfw-cover--thumb {
  cursor: pointer !important;
}
/* Kindelemente ausdrücklich mitnehmen: die *-Regel oben greift DIREKT auf ihnen und schlägt
   damit den geerbten Wert des Elternelements. Ohne diese Regel zeigt das <img> in einer
   Portfolio-Kachel den Standardpfeil statt der Hand. */
a *, button *, [role="button"] *, label *, summary *,
.hamburger *, .portfolio-item *, .lb-thumb-cell *,
.lb2-thumb *, .lb2-nav *, .lb2-close *, .lb2-nsfw-btn *, .nsfw-cover--thumb * {
  cursor: pointer !important;
}
/* Ausnahme: die gesperrte Arbeitsart-Box ist bewusst nicht anklickbar. */
.pf-work-item.is-locked, .pf-work-item.is-locked * { cursor: default !important; }
/* ── /CUSTOM_CURSOR_OFF ─────────────────────────────────────── */

/* ── Navigation ─────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: background 0.5s var(--ease-out), backdrop-filter 0.5s;
}

.site-header.scrolled {
  background: var(--t-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  align-items: center;
}

.nav-logo-text {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #0a0a0a;
  opacity: 0.9;
  line-height: 1;
  transition: color 0.3s, opacity 0.3s;
}

.nav-logo-sep {
  margin: 0 4px;
  font-weight: 900;
  opacity: 1;
}

.nav-logo:hover .nav-logo-text { opacity: 1; }

.site-header.scrolled .nav-logo-text       { color: var(--t-nav-scrolled); }
.site-header.scrolled .nav-logo:hover .nav-logo-text { color: var(--t-text); }

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #0a0a0a;
  transition: color 0.3s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: #0a0a0a;
  transition: width 0.35s var(--ease-out), background 0.3s;
}

.nav-link:hover { color: #0a0a0a; }
.nav-link:hover::after { width: 100%; }

/* When nav bar is visible (scrolled) — switch to theme-aware colors */
.site-header.scrolled .nav-link       { color: var(--t-nav-scrolled); }
.site-header.scrolled .nav-link:hover { color: var(--t-text); }
.site-header.scrolled .nav-link::after { background: var(--t-nav-scrolled); }

/* ── Hamburger ──────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 1px;
  background: #0a0a0a;
  transition: transform 0.35s var(--ease-out), opacity 0.3s, background 0.35s ease;
  transform-origin: center;
}

.site-header.scrolled .hamburger span { background: var(--t-nav-scrolled); }

/* Nav passt sich dem aktuellen Slideshow-Bild an (nur solange nicht gescrollt) */
.site-header:not(.scrolled).nav-on-dark .nav-link,
.site-header:not(.scrolled).nav-on-dark .nav-link:hover { color: #ffffff; }
.site-header:not(.scrolled).nav-on-dark .nav-link::after { background: #ffffff; }
.site-header:not(.scrolled).nav-on-dark .nav-logo-text { color: #ffffff; }
.site-header:not(.scrolled).nav-on-dark .theme-toggle { color: #ffffff; }
.site-header:not(.scrolled).nav-on-dark .hamburger span { background: #ffffff; }

/* Transition-Dauer synchron zum Crossfade während Bildwechsel */
.site-header.nav-theme-active:not(.scrolled) .nav-logo-text {
  transition: color var(--nav-theme-t, 2s) ease-in-out, opacity 0.3s;
}
.site-header.nav-theme-active:not(.scrolled) .nav-link,
.site-header.nav-theme-active:not(.scrolled) .nav-link:hover {
  transition: color var(--nav-theme-t, 2s) ease-in-out;
}
.site-header.nav-theme-active:not(.scrolled) .nav-link::after {
  transition: background var(--nav-theme-t, 2s) ease-in-out, width 0.35s var(--ease-out);
}
.site-header.nav-theme-active:not(.scrolled) .theme-toggle {
  transition: color var(--nav-theme-t, 2s) ease-in-out, opacity 0.3s;
}
.site-header.nav-theme-active:not(.scrolled) .hamburger span {
  transition: background var(--nav-theme-t, 2s) ease-in-out, transform 0.35s var(--ease-out), opacity 0.3s;
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile Menu ────────────────────────────────────────────── */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--t-bg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.open {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: var(--t-text);
  font-size: 24px;
  cursor: none;
  opacity: 0.6;
  transition: opacity 0.3s;
}

.mobile-menu-close:hover { opacity: 1; }

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.mobile-nav-link {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--t-text-muted);
  transition: color 0.3s;
}

.mobile-nav-link:hover { color: var(--t-text); }

/* ── Animations — Scroll Reveal ─────────────────────────────── */
.reveal,
.reveal-left,
.reveal-right,
.fade-up {
  opacity: 0;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.reveal         { transform: translateY(40px); }
.reveal-left    { transform: translateX(-60px); }
.reveal-right   { transform: translateX(60px); }
.fade-up        { transform: translateY(30px); }

.reveal.visible,
.reveal-left.visible,
.reveal-right.visible,
.fade-up.visible {
  opacity: 1;
  transform: translate(0);
}

/* Stagger delays via data-delay */
[data-delay="1"] { transition-delay: 0.1s; }
[data-delay="2"] { transition-delay: 0.2s; }
[data-delay="3"] { transition-delay: 0.3s; }

/* Hero animations on load */
.fade-up        { animation: none; } /* overridden by JS class */
.delay-1        { transition-delay: 0.2s; }
.delay-2        { transition-delay: 0.4s; }
.delay-3        { transition-delay: 0.8s; }

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: 100svh;
  min-height: 600px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-slides {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--kv-crossfade, 1s) ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform-origin: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.75) 0%,
    rgba(0,0,0,0.25) 50%,
    rgba(0,0,0,0.15) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 60px 80px;
  max-width: 900px;
}

.hero-eyebrow {
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 9vw, 8rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 0.95;
  margin-bottom: 16px;
  color: #ffffff;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.05em;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  right: 60px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.hero-scroll-hint span {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  writing-mode: vertical-rl;
}

.scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 0.8; transform: scaleY(0.7); }
}

/* Pfeil-Variante des Pulsierens — fuer den mittig liegenden Indikator.
   Die Drehung um 45 Grad steckt im Keyframe, weil eine Animation ein
   statisches transform sonst nur waehrend ihrer Laufzeit ueberschreibt. */
@keyframes scrollNudge {
  0%, 100% { opacity: 0.45; transform: rotate(45deg) translate(0, 0); }
  50%      { opacity: 0.85; transform: rotate(45deg) translate(2px, 2px); }
}

/* ── HERO_PORTRAIT ──────────────────────────────────────────────
   About-Bild im Keyvisual, untere rechte Ecke — diagonal gegenueber
   dem Titel. Nur Desktop, d.h. genau solange die Nav nicht auf
   Hamburger umschaltet (Umschaltpunkt: max-width: 900px).
   Groesse skaliert per clamp() proportional zum Viewport, wie .hero-title.
   Rollback: diesen Block entfernen und den Markup-Block HERO_PORTRAIT
   in index.html loeschen. */
.hero-portrait { display: none; }

@media (min-width: 901px) {
  .hero-portrait {
    display: block;
    position: absolute;
    right: 60px;
    bottom: 80px;
    z-index: 2;
    width: clamp(200px, 16vw, 260px);
  }

  /* HERO_PORTRAIT_LINKS — drei Links links vom Bild, rechtsbuendig, Typo wie
     die Hero-Eyebrow. Erscheinen beim Hover ueber das Portrait (Hover an einem
     Kind setzt :hover auch am Container, obwohl die Links ausserhalb seiner
     Box liegen).
     Die drei Abstaende zur Bildkante sind einzeln einstellbar. Gemessen wird ab
     der linken Kante des Bild-QUADRATS; der Kreis liegt bei den aeusseren Zeilen
     weiter innen, deshalb braucht die Mittelzeile etwas mehr Abstand.
     Faustformel fuer den Mehrabstand der Mittelzeile:
         r - Wurzel(r^2 - dy^2)      r = halbe Bildbreite, dy = Zeilenversatz
     Bei 200-260px Bildbreite und 30px Zeilenabstand sind das rund 9-12px —
     mehr laesst LINKEDIN sichtbar zu weit weg stehen. */
  .hero-portrait {
    --hpl-abstand-1: 14px;   /* INSTAGRAM — oben, nahe an der Rundung   */
    --hpl-abstand-2: 25px;   /* LINKEDIN  — Mitte, ca. 11px mehr        */
    --hpl-abstand-3: 14px;   /* E-MAIL    — unten, nahe an der Rundung  */
    --hpl-zeilenabstand: 30px;
  }

  .hero-portrait-links {
    position: absolute;
    right: 100%;             /* rechte Kante der Spalte = linke Bildkante */
    top: 50%;
    transform: translateY(-50%);   /* senkrecht auf Bildmitte */
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--hpl-zeilenabstand);
    text-align: right;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s var(--ease-out);
  }

  .hero-portrait:hover .hero-portrait-links,
  .hero-portrait:focus-within .hero-portrait-links {
    opacity: 1;
    pointer-events: auto;
  }

  .hpl {
    font-family: var(--font-ui);
    font-size: 14px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    transform: translateX(14px);
    transition: color 0.3s, opacity 0.45s var(--ease-out),
                transform 0.55s var(--ease-out);
  }

  .hpl:hover { color: #ffffff; }

  /* Der Buchstabenabstand haengt rechts als Leerraum am letzten Zeichen —
     -0.25em holt ihn zurueck, damit der optische Abstand dem Wert entspricht. */
  .hpl-1 { margin-right: calc(var(--hpl-abstand-1) - 0.25em); }
  .hpl-2 { margin-right: calc(var(--hpl-abstand-2) - 0.25em); }
  .hpl-3 { margin-right: calc(var(--hpl-abstand-3) - 0.25em); }

  /* Leicht versetztes Einlaufen von rechts, von oben nach unten. */
  .hero-portrait:hover .hpl,
  .hero-portrait:focus-within .hpl { transform: translateX(0); }
  .hero-portrait:hover .hpl-2,
  .hero-portrait:focus-within .hpl-2 { transition-delay: 0.06s; }
  .hero-portrait:hover .hpl-3,
  .hero-portrait:focus-within .hpl-3 { transition-delay: 0.12s; }

  /* Klickbar: springt zur Kontakt-Sektion (Smooth-Scroll aus js/main.js,
     greift automatisch fuer jedes a[href^="#"]). */
  .hero-portrait-link {
    display: block;
    border-radius: 50%;
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  }

  .hero-portrait-link:hover { transform: scale(1.04); }

  .hero-portrait-link:focus-visible {
    outline: 2px solid rgba(255,255,255,0.8);
    outline-offset: 6px;
  }

  .hero-portrait-img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 50%;
  }

  /* Scroll-Indikator weicht dem Portrait aus: horizontal, mittig an der
     unteren Kante des Keyvisuals. Kein transform auf dem Element selbst —
     .fade-up.visible setzt transform: translate(0) und wuerde ein
     translateX(-50%) ueberschreiben; darum links/rechts 0 + Zentrierung. */
  .hero-scroll-hint {
    left: 0;
    right: 0;
    bottom: 28px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
  }

  .hero-scroll-hint span { writing-mode: horizontal-tb; }

  /* Der senkrechte Strich ergibt in der Zeile keinen Sinn — hier stattdessen
     ein minimalistischer Pfeil nach unten (zwei Rahmenkanten, um 45 Grad
     gedreht), der sanft nach unten nickt. */
  .hero-scroll-hint .scroll-line {
    width: 7px;
    height: 7px;
    margin-bottom: 4px;
    background: none;
    border-right: 1px solid rgba(255,255,255,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.45);
    animation-name: scrollNudge;
  }
}

/* ── Section Shared ─────────────────────────────────────────── */
.section-label {
  display: block;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.section-label--light { color: rgba(255,255,255,0.5); }

.section-header {
  text-align: center;
  padding: 0 40px 60px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.02em;
  color: var(--t-text);
}

/* ── PORTFOLIO_FILTER ───────────────────────────────────────────
   Dezente Pill-Leiste unter „Ausgewählte Arbeiten". Sichtbar nur, wenn
   portfoliofilter.json "enabled": true liefert (gepflegt in admin-tags.php) —
   sonst bleibt der Container [hidden] und die Seite ist unverändert.
   Ausschliesslich bestehende Tokens → Dark Mode zieht automatisch mit. */
.pf-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}
.pf-filter[hidden] { display: none; }

/* Erklaersatz zum gesetzten Filter. [hidden] => display:none: ohne Text (oder bei „All")
   nimmt die Zeile KEINEN Platz ein, das Raster bleibt exakt an derselben Stelle. */
.pf-note {
  max-width: 62ch;
  margin: 16px auto 0;
  font-family: var(--font-ui);
  /* --pf-note-size wird aus portfoliofilter.json ("hinweisGroesse", gepflegt in
     admin-tags.php) gesetzt; der Fallback hier gilt, solange nichts hinterlegt ist.
     Bewusst OHNE Mobile-Override — die eingestellte Grösse gilt auf allen Bildschirmen. */
  font-size: var(--pf-note-size, 12px);
  line-height: 1.65;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--t-text-muted);
  opacity: 0.85;
}
.pf-note[hidden] { display: none; }

/* Arbeitsart-Auswahl (Commissioned / Personal) — eigene Kästchen statt Browser-Checkboxen,
   damit Rahmen, Häkchen und Laufweite zur Pill-Leiste darüber passen. Nur Design-Tokens,
   also zieht der Dark Mode automatisch mit. [hidden] => display:none, kein Platzhalter. */
.pf-work {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 26px;
  margin-top: 16px;
}
.pf-work[hidden] { display: none; }

.pf-work-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 2px;
  border: 0;
  background: none;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: color 0.3s ease, opacity 0.3s ease;
}
.pf-work-box {
  position: relative;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 1px solid var(--t-border-mid);
  border-radius: 2px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
/* Häkchen: gedrehte Ecke aus zwei Rahmenkanten — kein Icon, keine Grafik. */
.pf-work-box::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 0.5px;
  width: 3px;
  height: 7px;
  border: solid var(--accent);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) scale(0.5);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.pf-work-item.is-on { color: var(--t-text); }
.pf-work-item.is-on .pf-work-box {
  border-color: var(--accent);
  background: rgba(200, 169, 110, 0.10);
}
.pf-work-item.is-on .pf-work-box::after { opacity: 1; transform: rotate(45deg) scale(1); }
.pf-work-item:hover:not(.is-locked) { color: var(--t-text); }
.pf-work-item:hover:not(.is-locked) .pf-work-box { border-color: var(--accent); }
/* Gesperrt = das Abwählen würde das Raster leeren. Sichtbar, aber ohne Aufforderung. */
.pf-work-item.is-locked { cursor: default; opacity: 0.5; }
.pf-work-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.pf-tag {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;   /* Anzeige immer gross — unabhängig vom gespeicherten Label */
  line-height: 1;
  padding: 10px 18px;
  border: 1px solid var(--t-border-mid);
  border-radius: 999px;
  background: transparent;
  color: var(--t-text-muted);
  cursor: pointer;
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.pf-tag:hover { border-color: var(--accent); color: var(--t-text); }
.pf-tag.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(200, 169, 110, 0.10);
}
.pf-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Sanftes Fade beim Umschalten: ausblenden → Spalten neu verteilen → einblenden.
   Kein Positions-Morph — die Neuanordnung passiert „unter" dem Fade. */
.portfolio-grid { transition: opacity 0.3s var(--ease-out); }
.portfolio-grid.pf-fading { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .portfolio-grid { transition: none; }
  .portfolio-grid.pf-fading { opacity: 1; }
}
/* /PORTFOLIO_FILTER */

/* ── Portfolio ──────────────────────────────────────────────── */
/* Masonry-Layout-Werte (Spalten/Abstand/Seitenrand/Max-Breite) kommen als
   CSS-Custom-Properties aus gallery-layout.json (gesetzt in index.html).
   Die Fallbacks hier entsprechen exakt der bisherigen Optik. */
.portfolio {
  padding: 120px var(--pf-pad, 0px) 80px;
  background: var(--t-bg);
}

/* Echte Spalten-Container (Flexbox), KEIN CSS-Multicol. Die Verteilung erfolgt
   zählerbasiert per JS (Bild k → Spalte k % cols) — identisch zur Admin-Vorschau
   in admin-settings.php. CSS-Multicol balanciert nach Höhe und würde die in der
   Admin-Seite festgelegte Reihenfolge NICHT 1:1 abbilden. */
.portfolio-grid {
  display: flex;
  gap: var(--pf-gap, 3px);
  align-items: flex-start;
  max-width: var(--pf-maxw, none);
  margin: 0 auto;
}

.portfolio-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--pf-gap, 3px);
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  background: var(--t-bg-surface);
  width: 100%;
  container-type: inline-size; /* Bezug für cqw-Schriftskalierung von Titel/Untertitel */
}

.portfolio-link {
  display: block;
  width: 100%;
}

.portfolio-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.7s var(--ease-out);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s var(--ease-out);
}

.portfolio-overlay--kein-bg { background: transparent; }

/* Textverankerung im Vorschaubild (statt vertikal zentriert) — per project.json steuerbar. */
.portfolio-overlay--oben  { align-items: flex-start; padding-top: 1.5rem; }
.portfolio-overlay--unten { align-items: flex-end; padding-bottom: 1.5rem; }

.portfolio-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .3em;
}

.portfolio-num {
  font-family: var(--font-display);
  /* responsive Default (skaliert mit Kachelbreite) × Per-Projekt-Faktor (titelGroesseImGrid, Default 1 = 100%) */
  font-size: calc(clamp(1.25rem, 7cqw, 3rem) * var(--pf-num-scale, 1));
  font-weight: 400;
  font-style: normal;
  color: rgba(255,255,255,0.7);
}

.portfolio-sub {
  font-family: var(--font-display);
  font-size: calc(clamp(0.7rem, 4cqw, 1.45rem) * var(--pf-sub-scale, 1));
  font-weight: 400;
  font-style: normal;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.03em;
}

.portfolio-item:hover .portfolio-img    { transform: scale(1.05); }
.portfolio-item:hover .portfolio-overlay { opacity: 1; }

.portfolio-grid-thumbs {
  position: absolute;
  display: flex;
  flex-wrap: wrap;          /* 4–5 Thumbs brechen um statt über die Bildkante hinaus abgeschnitten zu werden */
  align-content: flex-end;  /* Reihen sammeln sich am unteren Rand (bottom-anker) */
  /* left/right=0, padding, justify-content, bottom, gap per JS aus gridVorschau gesetzt */
}

.portfolio-grid-thumb {
  display: none;
  flex-shrink: 0;
  object-fit: cover;
}

.portfolio-grid-thumb.loaded { display: block; }

/* ── About ──────────────────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 80svh;
  background: var(--warm) !important;
  color: var(--black) !important;
  overflow: hidden;
}

.about-portrait {
  position: relative;
  overflow: hidden;
}

.about-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.about-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 80px 80px 70px;
  max-width: 600px;
}

.about-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  color: var(--black);
  margin-bottom: 30px;
}

.about-divider {
  width: 40px;
  height: 1px;
  background: var(--black);
  opacity: 0.3;
  margin-bottom: 30px;
}

.about-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.8;
  color: #333;
  margin-bottom: 20px;
}

.about-text--italic {
  font-style: italic;
  color: #666;
  font-size: 0.95rem;
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(0,0,0,0.15);
}

.about-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.about-meta-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.about-meta-value {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 400;
  color: var(--black);
}

/* ── Kunden ─────────────────────────────────────────────────── */
.kunden {
  padding: 120px 0;
  background: var(--t-bg-alt);
}

.kunden-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  padding: 0 40px;
}

.kunden-item {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow: hidden;
}

.kunden-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.kunden-item:hover .kunden-logo { transform: scale(1.08); }

/* ── Kontakt ────────────────────────────────────────────────── */
.kontakt {
  position: relative;
  min-height: 90svh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #ffffff !important;
}

.kontakt-bg {
  position: absolute;
  inset: 0;
}

.kontakt-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.kontakt-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
}

.kontakt-inner {
  position: relative;
  z-index: 2;
  display: grid;
  /* Spiegelverkehrt zur alten Fassung: links Text, rechts Portrait. */
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 80px;
  padding: 80px;
  max-width: 1320px;
  width: 100%;
}

.kontakt-portrait {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.kontakt-portrait-img {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  border-radius: 50%;
}

.kontakt-content {
  text-align: left;
}

/* KONTAKT_REVEAL — Die Einblendung laeuft auf den KINDERN, nicht auf
   .kontakt-content selbst. Grund: solange ein Vorfahr opacity < 1 hat, bildet
   er einen "backdrop root" — der backdrop-filter der .kontakt-card filtert
   dann ins Leere und der Blur sprang erst nach Ende der 0.9s-Transition an
   (sichtbar in Chrome und Edge). Die eigene opacity eines Elements stoert
   seinen backdrop-filter dagegen nicht.
   NICHT brechen: .kontakt-content darf keine opacity-/filter-Animation
   bekommen, solange die Karte backdrop-filter nutzt. */
.kontakt-content.reveal-left {
  opacity: 1;
  transform: none;
  transition: none;
}

.kontakt-content.reveal-left > * {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.kontakt-content.reveal-left.visible > * {
  opacity: 1;
  transform: translate(0);
}

.kontakt-title {
  font-family: var(--font-serif);
  font-size: clamp(2.5rem, 4vw, 4.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  margin-bottom: 20px;
}

.kontakt-tagline {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-bottom: 50px;
}

.kontakt-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 44px 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transform: translateZ(0);
}

.kontakt-info {
  display: flex;
  flex-direction: column;
  gap: 24px;
  text-align: left;
}

.kontakt-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.kontakt-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
}

.kontakt-value {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--white);
  transition: color 0.3s;
}

a.kontakt-value:hover { color: var(--accent); }

/* Mehrere Links in einer Zeile (Social): Trenner dezenter als die Links. */
.kontakt-value a { color: inherit; transition: color 0.3s; }
.kontakt-value a:hover { color: var(--accent); }

.kontakt-trenner {
  color: rgba(255,255,255,0.35);
  margin: 0 0.5em;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  background: var(--t-bg);
  border-top: 1px solid var(--t-border-mid);
  padding: 30px 40px;
}

.footer-inner {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-copy {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--t-text-muted);
  opacity: 0.6;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-link {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--t-text-muted);
  opacity: 0.6;
  transition: color 0.3s, opacity 0.3s;
}

.footer-link:hover { color: var(--t-text); opacity: 1; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .kunden-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-content { padding: 0 30px 60px; }
  .hero-scroll-hint { right: 30px; bottom: 25px; }

  /* Spaltenzahl mobil wird per JS reduziert (currentCols); Lese-Reihenfolge bleibt gleich. */

  .kontakt-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 60px 30px;
  }

  /* Gestapelt bleibt das Portrait oben — die Spiegelung gilt nur horizontal. */
  .kontakt-portrait { justify-content: center; order: -1; }

  .kontakt-portrait-img { max-width: 280px; }

  .kontakt-card { padding: 30px 24px; }

  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
}

@media (max-width: 740px) {
  .kunden-grid { grid-template-columns: repeat(3, 1fr); padding: 0 20px; }
}

@media (max-width: 580px) {
  .nav { padding: 0 20px; }

  .hero-title { font-size: clamp(2.8rem, 14vw, 5rem); }

  .portfolio { padding: 80px 0 40px; }
  .portfolio-grid, .portfolio-col { gap: 2px; }

  .section-header { padding: 0 20px 40px; }

  /* PORTFOLIO_FILTER — Pills brechen zentriert um, Tap-Fläche >= 40px */
  .pf-filter { gap: 8px; margin-top: 22px; }
  .pf-note { margin-top: 13px; }
  .pf-work { gap: 18px; margin-top: 13px; }
  .pf-work-item { padding: 9px 2px; letter-spacing: 0.14em; }
  .pf-tag { padding: 13px 16px; font-size: 10px; letter-spacing: 0.18em; }

  .portfolio { padding-top: 80px; }

  .kunden-grid { grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 6px; }

  .kontakt-inner { padding: 50px 20px; }
  .kontakt-portrait-img { max-width: 220px; }

  .site-footer { padding: 24px 20px; }
}

/* ── Theme Toggle ───────────────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: none;
  color: #0a0a0a;
  opacity: 0.55;
  transition: opacity 0.3s, color 0.35s ease;
  flex-shrink: 0;
}

.site-header.scrolled .theme-toggle { color: var(--t-nav-scrolled); }

.theme-toggle:hover { opacity: 1; }

.theme-icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Light mode: show moon */
.theme-icon--sun  { display: none; }
.theme-icon--moon { display: block; }

/* Dark mode: show sun */
[data-theme="dark"] .theme-icon--sun  { display: block; }
[data-theme="dark"] .theme-icon--moon { display: none; }
