@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/cormorant-garamond-400.ttf") format("truetype");
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("./fonts/cormorant-garamond-600.ttf") format("truetype");
}


:root {
  --pointer-x: 0;
  --pointer-y: 0;
  --pointer-glow: 0.5;
  --refraction-shift: 0;
  --grain-alpha: 0.05;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
  overflow: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 50% 44%, rgba(0, 255, 255, 0.05), transparent 20%),
    radial-gradient(circle at 18% 20%, rgba(0, 60, 255, 0.22), transparent 28%),
    radial-gradient(circle at 82% 34%, rgba(255, 0, 200, 0.16), transparent 24%),
    linear-gradient(135deg, #010208 0%, #030612 42%, #020308 100%);
  color: #e8f8ff;
  font-family: "Cormorant Garamond", Georgia, serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0,
      transparent 3px,
      rgba(255, 255, 255, 0.05) 3px,
      rgba(255, 255, 255, 0.05) 4px
    ),
    radial-gradient(circle at 50% 50%, transparent 0, rgba(0, 0, 0, 0.28) 72%, rgba(0, 0, 0, 0.64) 100%);
  mix-blend-mode: screen;
  opacity: 0.75;
  pointer-events: none;
  z-index: 5;
}

body::after {
  content: "";
  position: fixed;
  inset: -20%;
  background:
    linear-gradient(
      120deg,
      transparent 0%,
      rgba(0, 240, 255, calc(var(--grain-alpha) * 0.85)) 32%,
      transparent 56%,
      rgba(200, 0, 255, var(--grain-alpha)) 72%,
      transparent 100%
    );
  transform: translate3d(calc(var(--pointer-x) * 2.5%), calc(var(--pointer-y) * 2.5%), 0);
  filter: blur(70px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}

canvas[data-atmosphere-canvas] {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.hero-lockup {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-mark {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
  text-align: center;
}

.hero-mark::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(82vw, 1180px);
  height: min(30vw, 420px);
  background: radial-gradient(
    ellipse at center,
    rgba(2, 4, 7, 0.86) 0%,
    rgba(4, 7, 12, 0.62) 28%,
    rgba(7, 11, 18, 0.18) 58%,
    transparent 82%
  );
  transform: translate3d(calc(-50% + (var(--pointer-x) * -12px)), calc(-50% + (var(--pointer-y) * -8px)), 0);
  filter: blur(24px);
  pointer-events: none;
  z-index: 1;
}

.hero-mark::after {
  content: "";
  position: absolute;
  inset: 34% 18%;
  background:
    radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.15) 0%, rgba(0, 240, 255, 0.07) 22%, transparent 72%),
    linear-gradient(90deg, rgba(0, 200, 255, 0.10), rgba(255, 0, 200, 0.10));
  filter: blur(56px);
  opacity: calc(0.36 + (var(--pointer-glow) * 0.14));
  transform: translate3d(calc(var(--pointer-x) * 10px), calc(var(--pointer-y) * 6px), 0);
  pointer-events: none;
  z-index: 1;
}

.hero-word {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(6.3rem, 23.1vw, 18.9rem);
  font-weight: 600;
  line-height: 0.88;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  user-select: none;
  white-space: nowrap;
}

.hero-fill {
  position: relative;
  z-index: 2;
  margin: 0;
  color: transparent;
  background:
    linear-gradient(
      90deg,
      rgba(160, 235, 255, 0.95) 0%,
      rgba(220, 248, 255, 0.98) 24%,
      rgba(255, 255, 255, 1) 48%,
      rgba(220, 248, 255, 0.98) 72%,
      rgba(160, 235, 255, 0.95) 100%
    );
  -webkit-background-clip: text;
  background-clip: text;
  transform: translate3d(calc(var(--pointer-x) * 7px), calc(var(--pointer-y) * 4px), 0);
  text-shadow:
    0 0 8px rgba(0, 240, 255, 0.28),
    0 0 22px rgba(0, 200, 255, 0.18),
    0 0 42px rgba(0, 160, 255, 0.12),
    0 0 48px rgba(255, 0, 200, 0.08),
    0 22px 48px rgba(0, 0, 0, 0.6),
    0 38px 96px rgba(0, 0, 0, 0.82);
}

.hero-fill::before,
.hero-fill::after {
  content: attr(data-word);
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.hero-fill::before {
  color: rgba(0, 240, 255, 0.62);
  text-shadow:
    0 0 6px rgba(0, 240, 255, 0.22),
    0 0 14px rgba(0, 240, 255, 0.10);
  mix-blend-mode: screen;
  transform: translate3d(
    calc(-3px + (var(--pointer-x) * -6px) + (var(--refraction-shift) * -10px)),
    calc(-0.5px + (var(--pointer-y) * -2px)),
    0
  );
}

.hero-fill::after {
  color: rgba(255, 0, 200, 0.58);
  text-shadow:
    0 0 6px rgba(255, 0, 200, 0.20),
    0 0 14px rgba(255, 0, 200, 0.10);
  mix-blend-mode: screen;
  transform: translate3d(
    calc(3px + (var(--pointer-x) * 6px) + (var(--refraction-shift) * 9px)),
    calc(0.5px + (var(--pointer-y) * 2px)),
    0
  );
  pointer-events: none;
}

.stage::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 30, 30, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(30, 255, 80, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(30, 80, 255, 0.09) 1px, transparent 1px);
  background-size: 12px 4px, 12px 4px, 12px 4px;
  background-position: 0 0, 4px 0, 8px 0;
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: screen;
}

.scene-credit {
  position: fixed;
  bottom: 1.4rem;
  right: 1.6rem;
  z-index: 6;
  font-family: "Courier New", "Courier", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: rgba(0, 240, 255, 0.28);
  pointer-events: none;
  user-select: none;
}

.noscript {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 6;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 10px;
  background: rgba(2, 5, 12, 0.92);
  color: rgba(180, 240, 255, 0.76);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
}

body.is-ready .hero-fill {
  animation: hero-main-reveal 2000ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.is-ready .hero-mark::after {
  animation: hero-aura-reveal 2000ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

body.is-ready .hero-fill::before,
body.is-ready .hero-fill::after {
  animation: refraction-settle 2000ms 90ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes hero-main-reveal {
  /* hard flash -- horizontal sync fehler */
  0% {
    opacity: 1;
    filter: blur(0px) brightness(18) saturate(0);
    transform: translate3d(32px, 0, 0) scaleX(1.04);
  }

  /* erster glitch -- blur explodiert */
  4% {
    filter: blur(90px) brightness(5) saturate(2.5);
    transform: translate3d(-22px, 2px, 0) scaleX(1.03);
  }

  /* zweiter glitch */
  8% {
    filter: blur(70px) brightness(3.5) saturate(2);
    transform: translate3d(14px, -1px, 0) scaleX(1.02);
  }

  /* kurze stabilisierung */
  14% {
    filter: blur(50px) brightness(2.4);
    transform: translate3d(0, 0, 0) scale(1.01);
  }

  /* blur kollabiert */
  46% {
    opacity: 0.90;
    filter: blur(18px) brightness(1.4);
  }

  72% {
    opacity: 0.96;
    filter: blur(5px) brightness(1.14);
    transform: translate3d(0, 0, 0) scale(1);
  }

  /* phosphor-flash kurz vor ende */
  90% {
    filter: blur(1px) brightness(1.28);
  }

  /* kurzer einbruch */
  96% {
    filter: blur(0) brightness(0.84);
  }

  100% {
    opacity: 1;
    filter: blur(0) brightness(1);
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes hero-aura-reveal {
  0% {
    opacity: 0;
    filter: blur(90px) brightness(1.6);
    transform: scale(1.16);
  }

  50% {
    opacity: 0.66;
    filter: blur(68px) brightness(1.22);
  }

  100% {
    opacity: calc(0.38 + (var(--pointer-glow) * 0.12));
    filter: blur(56px) brightness(1);
    transform: translate3d(calc(var(--pointer-x) * 10px), calc(var(--pointer-y) * 6px), 0);
  }
}

@keyframes refraction-settle {
  0% {
    opacity: 0;
    filter: blur(12px);
  }

  30% {
    opacity: 0.9;
    filter: blur(3px);
  }

  100% {
    filter: blur(0);
  }
}

@keyframes logo-flicker {
  0%, 91%, 100% { opacity: 1; }
  92%   { opacity: 0.48; }
  93.5% { opacity: 1; }
  94.5% { opacity: 0.62; }
  96%   { opacity: 1; }
}

body.is-flickering .hero-mark {
  animation: logo-flicker 10s 0s infinite;
}

@media (max-width: 820px) {
  .hero-lockup {
    width: 100%;
  }

  .hero-word {
    font-size: clamp(4.6rem, 24vw, 9.45rem);
    letter-spacing: 0.14em;
  }

}

@media (prefers-reduced-motion: reduce) {
  :root {
    --pointer-glow: 0.42;
    --fracture-shift: 0;
  }

  body::after,
  .hero-mark::before,
  .hero-mark::after,
  .hero-fill {
    animation: none !important;
    transform: none !important;
  }

  .hero-fill::before,
  .hero-fill::after {
    animation: none !important;
    transform: none !important;
  }
}
