/* =========================================================
   Friedrich Krüger — Portfolio · Variante B "Safelight"
   Komposition wie die Basis, aber mit Mikro-Feinschliff und
   verfeinerter Bewegung: Scroll-Fortschrittslinie, Clip-Wipe-
   Reveals mit Stagger, ruhigere Glas-Rahmen, EXIF-Captions,
   Underline-Sweeps, nummerierte Navigation.
   ========================================================= */

:root {
  --ink:      #0B0B0D;
  --ink-2:    #141418;
  --ink-3:    #1C1C22;
  --bone:     #EDE8DE;
  --bone-dim: #B7B1A6;
  --muted:    #7E786C;
  --amber:    #D9573D;
  --amber-dk: color-mix(in oklab, var(--amber) 62%, black);
  --amber-lt: color-mix(in oklab, var(--amber) 78%, white);
  --line:     rgba(237,232,222,0.12);
  --line-2:   rgba(237,232,222,0.06);

  --f-display: "Clash Display", "Satoshi", system-ui, sans-serif;
  --f-body:    "Satoshi", system-ui, -apple-system, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(1.25rem, 4vw, 4rem);
  --maxw: 1500px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--f-body);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, video { display: block; width: 100%; height: 100%; object-fit: cover; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--amber); color: var(--ink); }

body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9000;
  opacity: var(--grain, 0.05); mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Scroll-Fortschritt ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 1200;
  background: var(--amber);
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Reveal-System (data-reveal) ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(26px);
  transition: opacity .9s ease var(--d, 0s), transform 1.15s cubic-bezier(.16,1,.3,1) var(--d, 0s);
}
[data-reveal].in { opacity: 1; transform: none; }

/* ---------- shared bits ---------- */
.eyebrow {
  display: flex; gap: 0.9rem; align-items: center;
  font-family: var(--f-mono);
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--amber);
}
.eyebrow span:not(:first-child) { color: var(--muted); }
.eyebrow::before {
  content: ""; width: 34px; height: 1px; background: var(--amber); opacity: 0.6;
}
.eyebrow--center { justify-content: center; }
.eyebrow--center::before { display: none; }

/* =========================================================
   NAV — nummerierte Links, Underline-Sweep
   ========================================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--pad);
  mix-blend-mode: difference;
  color: #fff;
}
.nav__mark {
  font-family: var(--f-display); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.04em;
}
.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: 0.82rem; letter-spacing: 0.02em; position: relative;
}
.nav__num {
  font-family: var(--f-mono); font-size: 0.6rem; opacity: 0.55;
  margin-right: 0.4rem; vertical-align: 0.35em; letter-spacing: 0.06em;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.nav__links a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }
.nav__meta {
  font-family: var(--f-mono); font-size: 0.7rem; letter-spacing: 0.16em;
}

/* =========================================================
   HERO (identisch zur Basis — 3D-Kamera bleibt Herzstück)
   ========================================================= */
.hero { position: relative; height: 125vh; background: var(--ink); }

.hero__canvas {
  position: fixed; inset: 0; width: 100vw !important; height: 100vh !important;
  z-index: 2; display: block; pointer-events: none;
  will-change: opacity;
}
.hero__type {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh; z-index: 1;
  display: grid; align-content: center; justify-items: center; text-align: center;
  pointer-events: none; will-change: transform;
  padding: 0 1rem;
}
.hero__eyebrow {
  display: flex; gap: 0.7rem; justify-content: center; align-items: center;
  font-family: var(--f-mono); font-size: 0.74rem;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--bone-dim); margin-bottom: clamp(1rem, 2vw, 1.8rem);
}
.hero__eyebrow .dot { color: var(--amber); }
.hero__name {
  font-family: var(--f-display); font-weight: 600;
  font-size: clamp(3.4rem, 15vw, 15rem);
  line-height: 0.86; letter-spacing: -0.02em;
  color: var(--bone);
}
.hero__name .line { display: block; }
.hero__name .line:last-child {
  color: transparent;
  -webkit-text-stroke: 1.2px var(--bone-dim);
  text-stroke: 1.2px var(--bone-dim);
}
.hero__role {
  margin-top: clamp(1rem, 2vw, 2rem);
  font-family: var(--f-mono); font-size: clamp(0.8rem, 1.1vw, 1rem);
  letter-spacing: 0.2em; text-transform: uppercase; color: var(--amber);
}
.hero__cue {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  will-change: opacity; pointer-events: none;
}
.hero__cue-label {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--muted);
}
.hero__cue-track {
  width: 22px; height: 40px; border: 1px solid var(--line);
  border-radius: 12px; display: flex; justify-content: center; padding-top: 7px;
}
.hero__cue-thumb {
  width: 2px; height: 8px; border-radius: 2px; background: var(--amber);
  animation: cue 1.8s ease-in-out infinite;
}
@keyframes cue { 0%,100%{ transform: translateY(0); opacity: 1 } 60%{ transform: translateY(12px); opacity: 0.2 } }

.hero__loading {
  position: fixed; z-index: 5; bottom: 2rem; right: var(--pad);
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem;
  transition: opacity .6s ease;
}
.hero__loading.is-done { opacity: 0; pointer-events: none; }
.hero__loading-bar { width: 120px; height: 2px; background: var(--line); overflow: hidden; }
.hero__loading-bar > span { display: block; height: 100%; width: 0%; background: var(--amber); transition: width .3s ease; }
.hero__loading-label { font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

/* =========================================================
   WORKS — Glas-Rahmen verfeinert + Clip-Wipe-Reveal
   ========================================================= */
main { position: relative; z-index: 3; background: var(--ink); }
.works { padding: clamp(5rem, 12vh, 11rem) var(--pad) clamp(3rem, 8vh, 6rem); max-width: var(--maxw); margin: 0 auto; }
.works__head { max-width: 760px; margin-bottom: clamp(3rem, 7vh, 6rem); }
.works__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2.6rem, 7vw, 6rem); line-height: 0.95; letter-spacing: -0.02em;
  margin: 1.4rem 0 1.6rem;
}
.works__title em { font-style: normal; color: var(--amber); }

/* Reveal: Einblenden + Gate-Wipe auf dem Medium */
.work { position: relative; opacity: 0; transform: translateY(26px); }
.work .work__media { clip-path: inset(10% 5% 10% 5%); }
.work.in {
  opacity: 1; transform: none;
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.16,1,.3,1);
}
.work.in .work__media {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.3s cubic-bezier(.16,1,.3,1) .1s;
}

/* ruhigerer Glas-Rahmen: weniger Blur, feinere Kante, sanfteres Floaten */
.work__frame {
  position: relative; padding: 9px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(237,232,222,0.08), rgba(237,232,222,0.02));
  border: 1px solid rgba(237,232,222,0.14);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 30px 60px -26px rgba(0,0,0,0.8),
              0 10px 22px -14px rgba(0,0,0,0.55),
              inset 0 1px 0 rgba(255,255,255,0.14);
  animation: floaty 10s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.9s);
  will-change: transform;
  transition: box-shadow .5s ease;
}
.work__media {
  position: relative; overflow: hidden; border-radius: 10px; background: var(--ink-2);
}
/* Schnittmarken in den Ecken des Mediums */
.work__media::before,
.work__media::after {
  content: ""; position: absolute; width: 12px; height: 12px; z-index: 2;
  border: 1px solid rgba(237,232,222,0.4); pointer-events: none;
}
.work__media::before { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.work__media::after  { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }

.work__media img,
.work__media video {
  transition: transform 1.1s cubic-bezier(.16,1,.3,1), filter 1.1s ease;
  filter: grayscale(0.12) contrast(1.03);
}
.work:hover .work__frame {
  box-shadow: 0 40px 80px -24px rgba(0,0,0,0.85),
              0 0 0 1px color-mix(in oklab, var(--amber) 35%, transparent),
              inset 0 1px 0 rgba(255,255,255,0.18);
}
.work:hover .work__media img,
.work:hover .work__media video { transform: scale(1.04); filter: grayscale(0) contrast(1.06); }

/* YouTube-Fassade */
.yt-facade {
  display: block; position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; background: var(--ink-2); cursor: pointer;
}
.yt-facade img { width: 100%; height: 100%; object-fit: cover; display: block; }
.yt-facade__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: clamp(56px, 7vw, 72px); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--bone);
  background: rgba(11, 11, 13, 0.62);
  border: 1px solid rgba(237, 232, 222, 0.28);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background .35s ease, transform .35s ease, box-shadow .35s ease;
}
.yt-facade__play svg { width: 42%; height: 42%; margin-left: 6%; }
.yt-facade:hover .yt-facade__play,
.yt-facade:focus-visible .yt-facade__play {
  background: var(--amber);
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow: 0 0 0 10px color-mix(in oklab, var(--amber) 18%, transparent);
}
.work__media iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; display: block;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.work--intro { margin-bottom: clamp(1rem, 3vw, 2rem); }
.work--intro .work__media { aspect-ratio: 16 / 9; }

/* Caption: Titel links, EXIF rechts */
.work__cap {
  display: flex; justify-content: flex-end; align-items: baseline;
  gap: 0.8rem; margin-top: 1rem;
  padding-bottom: 0.6rem; border-bottom: 1px solid var(--line);
}
.work__title {
  font-family: var(--f-display); font-weight: 500; font-size: 1.05rem;
  letter-spacing: -0.01em; color: var(--bone);
}
.work__exif {
  font-family: var(--f-mono); font-size: 0.68rem; letter-spacing: 0.04em;
  color: var(--muted); text-align: right; white-space: nowrap;
}

/* =========================================================
   FAN-KARTEN
   ========================================================= */
.fan-section {
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(9rem, 20vh, 15rem) var(--pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.fan-section__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -0.02em;
  color: var(--bone); text-align: center;
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}
#fan-carousel-root { width: 100%; max-width: var(--maxw); }

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  display: grid; grid-template-columns: 0.85fr 1fr; gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(6rem, 16vh, 13rem) var(--pad);
}
.about__portrait { position: relative; }
.about__portrait img {
  aspect-ratio: 4 / 5; border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: 0 34px 70px -24px rgba(0,0,0,0.85);
  filter: grayscale(0.25) contrast(1.03);
}
.about__portrait { animation: floaty 11s ease-in-out infinite; }
.about__tag {
  position: absolute; bottom: 1rem; left: 1rem;
  font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.12em;
  color: var(--bone); background: rgba(11,11,13,0.72); backdrop-filter: blur(6px);
  padding: 0.4rem 0.7rem; text-transform: uppercase;
}
.about__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2.1rem, 4.6vw, 4rem); line-height: 1.02; letter-spacing: -0.02em;
  margin: 1.4rem 0 1.8rem;
}
.about__prose p { color: var(--bone-dim); max-width: 52ch; margin-bottom: 1.1rem; font-size: 1.05rem; }

.about__stats {
  list-style: none; display: flex; justify-content: space-between;
  max-width: 24rem; gap: 2rem;
  margin: 2.6rem 0 2rem; padding-top: 2rem; border-top: 1px solid var(--line);
}
.about__stats li { display: flex; flex-direction: column; gap: 0.4rem; }
.stat__num { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--bone); }
.stat__lbl { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--bone-dim); }

.about__skills { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.about__skills li {
  font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: 0.08em;
  padding: 0.4rem 0.85rem; border: 1px solid var(--line); border-radius: 40px; color: var(--bone-dim);
  transition: border-color .3s ease, color .3s ease;
}
.about__skills li:hover { border-color: var(--amber); color: var(--bone); }

/* =========================================================
   CONTACT — Underline-Sweep auf der Mail
   ========================================================= */
.contact {
  text-align: center; padding: clamp(6rem, 18vh, 14rem) var(--pad);
  border-top: 1px solid var(--line-2);
}
.contact__title {
  font-family: var(--f-display); font-weight: 500;
  font-size: clamp(2.6rem, 8vw, 7rem); line-height: 0.98; letter-spacing: -0.025em;
  margin: 1.4rem 0 2.4rem;
}
.contact__mail {
  display: inline-block; font-family: var(--f-display); font-weight: 500;
  font-size: clamp(1.2rem, 3vw, 2.2rem); color: var(--amber);
  padding-bottom: 0.25rem;
  background-image: linear-gradient(var(--amber-dk), var(--amber-dk)), linear-gradient(var(--amber), var(--amber));
  background-repeat: no-repeat;
  background-size: 100% 1px, 0% 1px;
  background-position: 0 100%, 0 100%;
  transition: background-size .55s cubic-bezier(.16,1,.3,1);
}
.contact__mail:hover { background-size: 100% 1px, 100% 1px; }
.contact__social {
  list-style: none; display: flex; gap: 2rem; justify-content: center; margin-top: 3rem;
}
.contact__social a {
  font-family: var(--f-mono); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bone-dim); position: relative;
}
.contact__social a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: currentColor;
  transform: scaleX(0); transform-origin: 100% 50%;
  transition: transform .45s cubic-bezier(.16,1,.3,1);
}
.contact__social a:hover { color: var(--bone); }
.contact__social a:hover::after { transform: scaleX(1); transform-origin: 0 50%; }

/* =========================================================
   FOOTER
   ========================================================= */
.foot {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  padding: 1.6rem var(--pad); border-top: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: var(--bone-dim); text-transform: uppercase;
  position: relative; z-index: 3; background: var(--ink);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .about { grid-template-columns: 1fr; }
  .about__portrait { max-width: 420px; }
}
@media (max-width: 560px) {
  .work__exif { display: none; }
  .hero__cue-label { display: none; }
}
@media (max-width: 767px) {
  html { background: var(--ink); }
  .hero__name { font-size: clamp(3.4rem, 20.5vw, 15rem); }
  .hero__type { padding: 0 0.75rem; }
  .hero__type { height: 100svh; }
  .hero__cue { bottom: 1.1rem; }
  .nav {
    mix-blend-mode: normal;
    background: linear-gradient(to bottom, rgba(11, 11, 13, 0.92) 0%, rgba(11, 11, 13, 0.6) 62%, rgba(11, 11, 13, 0) 100%);
  }
  .fan-section { overflow-x: hidden; }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition-duration: 0.001ms !important; }
  .work { opacity: 1 !important; }
  .work .work__media { clip-path: none !important; }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .work__frame, .about__portrait { animation: none !important; transform: none !important; }
}

/* keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 2px;
}
