/* ============================================================
   MAX MAHLER — Portfolio
   The void · depth · slow colour story · restraint
   ============================================================ */

:root {
  --bg: #030304;
  --fg: #eceae6;
  --fg-dim: #6f6d68;
  --fg-faint: #35342f;
  --line: rgba(255, 255, 255, 0.07);
  --accent-h: 228;                     /* driven by scroll in JS */
  --accent: hsl(var(--accent-h) 70% 62%);
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Space Grotesk", -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --pad: clamp(20px, 5vw, 70px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
}
@media (hover: hover) and (pointer: fine) { body { cursor: none; } }

.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

a { color: inherit; text-decoration: none; }
.italic { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
::selection { background: var(--accent); color: #000; }

/* ============================================================
   THE VOID — WebGL constellation + depth
   ============================================================ */
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.scene.on { opacity: 1; }

.vignette {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(130% 100% at 50% 38%, transparent 45%, rgba(0,0,0,0.6) 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* frosted glass surface */
.glass {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   CURSOR — light & precise (follows exactly, no lag)
   ============================================================ */
.cursor {
  position: fixed;
  top: 0; left: 0;
  width: 22px; height: 22px;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  /* only size/opacity animate — position is set instantly for zero lag */
  transition: width .35s var(--ease), height .35s var(--ease),
              border-color .35s var(--ease), background .35s var(--ease), opacity .3s;
  will-change: left, top;
}
.cursor.hover {
  width: 44px; height: 44px;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }
@media (hover: hover) and (pointer: fine) { body { cursor: none; } }

/* ============================================================
   PRELOADER
   ============================================================ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--pad);
}
.preloader__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
  padding-bottom: 26px;
}
.preloader__word {
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: 0.01em;
  overflow: hidden;
  display: flex;
  gap: 0.25em;
}
.preloader__word span { display: inline-block; transform: translateY(110%); }
.preloader__count {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 300;
  letter-spacing: -0.02em;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}
.preloader__bar { height: 1px; width: 100%; background: var(--line); overflow: hidden; }
.preloader__bar i { display: block; height: 100%; width: 0; background: var(--fg); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  padding: clamp(20px, 3vw, 34px) var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}
/* keep the nav's glass whisper-quiet: only a bottom hairline */
.nav.glass {
  background: rgba(6, 6, 8, 0.35);
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
.nav__brand { font-size: 15px; font-weight: 400; letter-spacing: 0.01em; }
.nav__links { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav__links a { font-size: 13px; letter-spacing: 0.02em; color: var(--fg-dim); overflow: hidden; }
.nav__links a span {
  display: inline-block;
  transition: transform .55s var(--ease), color .4s var(--ease);
}
.nav__links a:hover span { transform: translateY(-2px); color: var(--fg); }
.nav__clock { font-size: 12px; letter-spacing: 0.05em; color: var(--fg-dim); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .nav__clock, .nav__links a:not(:last-child) { display: none; } }

/* ============================================================
   HERO
   ============================================================ */
main { position: relative; z-index: 1; }

.hero {
  min-height: 100vh;
  padding: var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
.hero__index {
  position: absolute;
  top: 50%; right: var(--pad);
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
  text-align: right;
  font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-dim);
}
@media (max-width: 860px) { .hero__index { display: none; } }

.hero__title {
  font-size: clamp(48px, 11vw, 168px);
  line-height: 0.96;
  font-weight: 300;
  letter-spacing: -0.035em;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.hero__title .word { display: inline-block; transform: translateY(110%); will-change: transform; }

.hero__sub {
  margin-top: clamp(28px, 4vh, 46px);
  max-width: 46ch;
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.65;
  color: var(--fg-dim);
}
.hero__foot { position: absolute; bottom: var(--pad); left: var(--pad); }
.hero__scroll {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim);
}
.hero__scroll i {
  width: 26px; height: 1px; background: var(--fg-dim); position: relative; overflow: hidden;
}
.hero__scroll i::after {
  content: ""; position: absolute; inset: 0; background: var(--fg);
  transform: translateX(-100%); animation: line 2.4s var(--ease) infinite;
}
@keyframes line { 0%{transform:translateX(-100%)} 50%{transform:translateX(0)} 100%{transform:translateX(100%)} }

/* fade-in utility (JS toggles) */
[data-fade] { opacity: 0; transform: translateY(18px); }

/* ============================================================
   STATEMENT
   ============================================================ */
.section-label {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: clamp(30px, 5vh, 60px);
}
.section-label--c { text-align: center; }

.statement {
  padding: clamp(130px, 22vh, 280px) var(--pad);
  max-width: 1500px; margin: 0 auto;
}
.statement__text {
  font-size: clamp(26px, 4.4vw, 68px);
  line-height: 1.24;
  font-weight: 300;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.statement__text [data-w] { display: inline-block; opacity: 0.1; transition: opacity .25s; }

/* ============================================================
   WORK
   ============================================================ */
.work { position: relative; padding-top: clamp(60px, 8vh, 110px); }
.work__head { padding: 0 var(--pad) clamp(48px, 7vh, 90px); }
.work__heading {
  font-size: clamp(40px, 8vw, 110px);
  font-weight: 300; letter-spacing: -0.03em; line-height: 1; margin-top: 18px;
}
.work__hint { color: var(--fg-dim); font-size: 14px; letter-spacing: 0.04em; margin-top: 14px; }

.work__viewport { overflow: hidden; }
.work__track {
  display: flex;
  gap: clamp(28px, 4vw, 70px);
  padding: 0 var(--pad);
  width: max-content;
  align-items: flex-start;
}

.card { width: clamp(300px, 42vw, 520px); flex-shrink: 0; }
.card__media {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 16px;
  overflow: hidden;
  will-change: transform;
}
.card__aura {
  position: absolute; inset: 0;
  background:
    radial-gradient(90% 80% at 30% 20%, hsl(var(--h, 228) 70% 55% / 0.28), transparent 60%),
    radial-gradient(80% 90% at 80% 90%, hsl(calc(var(--h, 228) + 40) 70% 50% / 0.22), transparent 60%);
  transition: opacity .6s var(--ease);
}
.card:hover .card__aura { opacity: 1.15; }
.card__frame {
  position: absolute; inset: 0;
  padding: 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.card__num {
  font-family: var(--serif);
  font-size: clamp(50px, 6vw, 88px);
  line-height: 0.8; color: rgba(255,255,255,0.85);
}
.card__type {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  border: 1px solid var(--line); padding: 6px 11px; border-radius: 100px;
}
.card__body { padding-top: 26px; }
.card__title {
  font-family: var(--serif); font-size: clamp(28px, 3.2vw, 44px);
  font-weight: 400; letter-spacing: -0.01em;
}
.card__desc {
  color: var(--fg-dim); font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.6; margin-top: 14px; max-width: 44ch;
}
.card__meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 24px;
  font-size: 12px; letter-spacing: 0.03em; color: var(--fg-dim);
}
.card__meta span { border: 1px solid var(--line); padding: 5px 11px; border-radius: 100px; }
.card__meta a {
  margin-left: auto; color: var(--fg);
  border-bottom: 1px solid var(--fg-faint); padding-bottom: 2px;
  transition: border-color .4s var(--ease);
}
.card__meta a:hover { border-color: var(--fg); }

.work__end {
  width: clamp(260px, 30vw, 400px); flex-shrink: 0;
  display: flex; align-items: center; padding-left: 20px;
}
.work__end p {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(24px, 3vw, 44px); line-height: 1.15; color: var(--fg-dim);
}

/* ============================================================
   CAPABILITIES
   ============================================================ */
.cap { padding: clamp(120px, 20vh, 240px) var(--pad); max-width: 1400px; margin: 0 auto; }
.cap__grid { border-top: 1px solid var(--line); }
.cap__row {
  display: flex; align-items: baseline; gap: clamp(20px, 6vw, 90px);
  padding: clamp(26px, 3.5vh, 44px) 0;
  border-bottom: 1px solid var(--line);
}
.cap__k {
  flex: 0 0 auto; width: clamp(120px, 20vw, 260px);
  font-size: clamp(20px, 2.4vw, 34px); font-weight: 300; letter-spacing: -0.01em;
}
.cap__v { color: var(--fg-dim); font-size: clamp(14px, 1.3vw, 18px); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact { padding: clamp(130px, 24vh, 300px) var(--pad); text-align: center; }
.contact__mail {
  display: inline-block;
  max-width: 100%;
  font-size: clamp(19px, 5vw, 66px);
  font-weight: 300; letter-spacing: -0.03em; line-height: 1.05;
  margin-bottom: clamp(60px, 10vh, 110px);
  transition: opacity .4s var(--ease);
}
.contact__mail [data-char] { display: inline-block; will-change: transform; }
.contact__socials {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: clamp(22px, 4vw, 54px);
  margin-bottom: clamp(90px, 15vh, 170px);
}
.contact__socials a { font-size: 15px; color: var(--fg-dim); overflow: hidden; }
.contact__socials a span { display: inline-block; transition: transform .5s var(--ease), color .4s var(--ease); }
.contact__socials a:hover span { transform: translateY(-2px); color: var(--fg); }

.footer {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 36px; border-top: 1px solid var(--line);
  font-size: 12px; letter-spacing: 0.03em; color: var(--fg-faint);
}
.footer__links { display: flex; gap: 22px; }
.footer__links a { color: var(--fg-dim); transition: color .4s var(--ease); }
.footer__links a:hover { color: var(--fg); }

/* ============================================================
   LEGAL PAGES (Impressum / Datenschutz)
   — live crystal background behind a frosted glass container
   ============================================================ */
.legal-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(80px, 12vh, 140px) var(--pad);
}
.legal-panel {
  width: 100%;
  max-width: 800px;
  max-height: 84vh;
  overflow-y: auto;
  padding: clamp(30px, 5vw, 62px);
  border-radius: 22px;
  background: rgba(8, 9, 14, 0.5);
  backdrop-filter: blur(24px) saturate(120%);
  -webkit-backdrop-filter: blur(24px) saturate(120%);
  border: 1px solid rgba(255, 255, 255, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    0 40px 90px -30px rgba(0, 0, 0, 0.85);
}
.legal-panel::-webkit-scrollbar { width: 8px; }
.legal-panel::-webkit-scrollbar-track { background: transparent; }
.legal-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 8px; }

.legal__back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 0.03em; color: var(--fg-dim);
  margin-bottom: clamp(30px, 5vh, 50px);
  transition: color .4s var(--ease);
}
.legal__back:hover { color: var(--fg); }
.legal-panel h1 {
  font-size: clamp(30px, 5vw, 56px); font-weight: 300;
  letter-spacing: -0.03em; line-height: 1.04;
  margin-bottom: clamp(24px, 4vh, 44px);
}
.legal-panel h2 {
  font-family: var(--serif); font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 400; letter-spacing: -0.01em;
  margin: clamp(30px, 4vh, 44px) 0 12px;
}
.legal-panel p, .legal-panel address {
  color: var(--fg-dim); font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.7; font-style: normal; margin-bottom: 13px;
}
.legal-panel strong { color: var(--fg); font-weight: 500; }
.legal-panel a[href^="mailto"], .legal-panel a[href^="http"] { color: var(--fg); border-bottom: 1px solid var(--fg-faint); }
.legal-panel a[href^="mailto"]:hover, .legal-panel a[href^="http"]:hover { border-color: var(--fg); }
.ph { color: var(--accent); font-style: italic; }   /* placeholders to fill in */
.legal__note {
  margin-top: clamp(40px, 6vh, 70px);
  padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; line-height: 1.6; color: var(--fg-faint);
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01ms !important; }
  .hero__title .word, .preloader__word span { transform: none !important; }
  [data-fade] { opacity: 1 !important; transform: none !important; }
  .statement__text [data-w] { opacity: 1 !important; }
}
