:root {
  --bg: #060608;
  --bg-2: #1b1b21;
  --text: #f4f4f6;
  --muted: #a3a3ae;
  --accent: #7c5cff;
  --accent-rgb: 124, 92, 255;
  --accent-soft: color-mix(in srgb, var(--accent) 55%, #ffffff);
  --line: rgba(255, 255, 255, .16);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.7, 0, .2, 1);
  --mega-size: min(15vw, 15rem);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(1.1rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) 1.1rem max(1.25rem, env(safe-area-inset-left));
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.is-ready .nav { opacity: 1; transform: none; }

.nav__logo {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -.02em;
}
.nav__logo span { color: var(--accent); }

.nav__links { display: flex; gap: clamp(.9rem, 2.5vw, 2rem); }
.nav__links a {
  font-size: .78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  padding: .4rem 0;
  position: relative;
  transition: color .2s;
}
.nav__links a:hover, .nav__links a[aria-current] { color: var(--text); }
.nav__links a[aria-current]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
}
@media (max-width: 640px) {
  .nav__links a:not([aria-current]):not(:last-child) { display: none; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 520px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, var(--bg-2) 0%, var(--bg) 72%);
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  left: var(--gx, 50%);
  top: var(--gy, 50%);
  width: 60vmin;
  height: 60vmin;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .05) 35%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.hero__portrait {
  position: absolute;
  left: 50%;
  bottom: 0;
  height: min(92svh, 165vw);
  width: auto;
  max-width: none;
  translate: -50% 0;
  opacity: 0;
  z-index: 2;
  user-select: none;
  -webkit-user-drag: none;
  transition: opacity .9s var(--ease-out);
}
.hero__portrait.is-visible { opacity: 1; }

.hero__pixels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  transition: opacity .9s var(--ease-out);
}
.hero__pixels.is-hidden { opacity: 0; }

/* Portrait läuft unten weich in den Hintergrund aus, damit der Text lesbar bleibt */
.hero__fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 38%;
  background: linear-gradient(to top, rgba(6, 6, 8, .92) 0%, rgba(6, 6, 8, .55) 45%, transparent 100%);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.is-ready .hero__fade { opacity: 1; }

/* ---------- MEGA WORD ---------- */
.mega {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: 0;
  z-index: 5;
  translate: -50% -50%;
  transform: translateY(0);
  transition: transform 1.1s var(--ease-in-out);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .55));
}
.is-settled .mega { transform: translateY(var(--drop, 22svh)); }

.mega__scale {
  display: block;
  transform: scale(var(--s, 1));
  transform-origin: 50% 50%;
  transition: transform 1.1s var(--ease-in-out);
}

.mega__word, .mega__measure {
  white-space: nowrap;
  font-family: "Bricolage Grotesque", sans-serif;
  font-variation-settings: "opsz" 96;
  font-weight: 800;
  font-size: var(--mega-size);
  line-height: 1;
  letter-spacing: -.035em;
  text-transform: uppercase;
}

/* Wort-Box ohne Breite: jeder Buchstabe sitzt absolut (transform),
   damit Umbauten nie ein Reflow auslösen → durchgehend flüssig */
.mega__word {
  position: relative;
  display: block;
  width: 0;
  height: 1em;
}

.mega__measure {
  position: absolute;
  left: -9999px;
  top: 0;
  visibility: hidden;
  display: inline-block;
}
.mega__measure span { display: inline-block; }

.slot {
  position: absolute;
  left: 0;
  top: 0;
  height: 1em;
  perspective: 3.5em;
  will-change: transform;
}

.ch {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
  color: transparent;
  background: linear-gradient(180deg, #ffffff 8%, #dcdce4 42%, #8b8b98 78%, #4d4d58 100%);
  -webkit-background-clip: text;
  background-clip: text;
  transform-origin: 50% 55% -.32em;
  backface-visibility: hidden;
  opacity: 0;
  will-change: transform, opacity, filter;
}
.ch.is-on { opacity: 1; }

.probe { display: inline-block; width: 0; height: 0; vertical-align: baseline; }

/* Punkt + Strich, aus denen das "I" entsteht */
.mega__dot, .mega__bar {
  position: absolute;
  background: #f2f2f6;
  pointer-events: none;
}
.mega__dot { border-radius: 50%; box-shadow: 0 0 24px rgba(255, 255, 255, .45); }
.mega__bar { border-radius: .02em; transform-origin: 50% 100%; }

/* ---------- META (Rolle + CTA) ---------- */
.hero__meta {
  position: absolute;
  left: 50%;
  top: var(--meta-top, 88%);
  width: min(var(--meta-w, 90vw), calc(100vw - 2.5rem));
  translate: -50% 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__role {
  margin: 0;
  font-size: clamp(1rem, 2.3vw, 1.75rem);
  letter-spacing: -.01em;
}
.hero__role strong { font-weight: 700; }
.hero__role em { font-weight: 300; color: var(--muted); }

.hero__cta { display: flex; gap: .6rem; }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #d6d6de;
  font-size: .95rem;
  font-style: italic;
  font-weight: 300;
  letter-spacing: .04em;
  transition: background .25s, border-color .25s, color .25s;
}
.pill--icon { width: 44px; padding: 0; }
.pill--icon svg { transition: transform .3s var(--ease-out); }
.pill:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .32); color: #fff; }
.pill:hover svg { transform: rotate(45deg); }

.hero__role, .hero__cta {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}
.hero__cta { transition-delay: .12s; }
.is-ready .hero__role, .is-ready .hero__cta { opacity: 1; transform: none; }

@media (max-width: 640px) {
  .hero__meta { flex-direction: column; justify-content: center; }
  .hero__fade {
    height: 55%;
    background: linear-gradient(to top, rgba(6, 6, 8, .95) 0%, rgba(6, 6, 8, .7) 50%, transparent 100%);
  }
}

/* ---------- REPLAY ---------- */
.replay {
  position: absolute;
  right: max(1.25rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: 0 .9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, .3);
  color: var(--muted);
  font: 500 .72rem/1 Inter, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition: opacity .6s var(--ease-out) .6s, color .2s, border-color .2s;
}
.replay:hover { color: var(--text); border-color: rgba(255, 255, 255, .32); }
.is-done .replay { opacity: 1; }
@media (max-width: 640px) { .replay { display: none; } }

.no-anim *, .no-anim *::before, .no-anim *::after { transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; transition-delay: 0s !important; }
}
