:root {
  --bg: #08070c;
  --card: #11101a;
  --card-soft: #171124;
  --border: #2b2440;

  --purple: #8f45ff;
  --purple-soft: #b875ff;
  --purple-dark: #5d25c9;

  --text: #ffffff;
  --muted: #bdb7c9;
  --soft: #70687d;

  --cursor-x: 50%;
  --cursor-y: 50%;
  --card-x: 50%;
  --card-y: 50%;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  position: fixed;
  inset: 0;

  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;

  color: var(--text);
  background: var(--bg);
}

/* Cursor-Licht */
.cursor-light {
  position: fixed;
  left: 0;
  top: 0;

  width: 440px;
  height: 440px;

  border-radius: 999px;
  pointer-events: none;
  z-index: 5;

  background:
    radial-gradient(
      circle,
      rgba(143, 69, 255, 0.20) 0%,
      rgba(143, 69, 255, 0.10) 35%,
      transparent 70%
    );

  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 180ms ease;
  will-change: transform;
}

body.cursor-active .cursor-light {
  opacity: 1;
}

/* Seite */
.page {
  position: relative;
  z-index: 1;

  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 22px;

  background:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    #08070c;

  background-size: 42px 42px;
}

/* Cursor-Spotlight über die komplette Seite */
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;

  pointer-events: none;

  background:
    radial-gradient(
      620px circle at var(--cursor-x) var(--cursor-y),
      rgba(143, 69, 255, 0.15),
      rgba(143, 69, 255, 0.07) 28%,
      transparent 62%
    );

  opacity: 0;
  transition: opacity 180ms ease;
}

body.cursor-active .page::before {
  opacity: 1;
}

/* Card */
.card {
  width: 100%;
  max-width: 640px;
  padding: 48px 34px;

  text-align: center;

  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 36%),
    var(--card);

  border: 1px solid var(--border);
  border-radius: 26px;

  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);

  position: relative;
  overflow: hidden;
  z-index: 1;

  transform: translateY(0) scale(1);

  transition:
    padding 900ms cubic-bezier(0.16, 1, 0.3, 1),
    background 900ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 900ms cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 900ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-loading .card {
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  transform: translateY(0) scale(1.02);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;

  border-radius: 26px;
  border-top: 4px solid var(--purple);

  pointer-events: none;
  opacity: 1;

  transition: opacity 700ms ease;
}

body.is-loading .card::before {
  opacity: 0;
}

/* Card-Spotlight */
.card::after {
  content: "";
  position: absolute;
  inset: 0;

  background:
    radial-gradient(
      480px circle at var(--card-x) var(--card-y),
      rgba(143, 69, 255, 0.13),
      transparent 44%
    );

  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}

.card:hover::after {
  opacity: 1;
}

.card-inner,
.card > * {
  position: relative;
  z-index: 2;
}

/* Label */
.server-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 22px;
  padding: 8px 15px;

  border-radius: 999px;
  background: #1a1328;
  border: 1px solid #38255c;

  color: #c7a6ff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.4px;

  opacity: 1;
  transform: translateY(0);
  max-height: 50px;

  transition:
    opacity 550ms ease,
    transform 700ms cubic-bezier(0.16, 1, 0.3, 1),
    max-height 700ms cubic-bezier(0.16, 1, 0.3, 1),
    margin 700ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 700ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-loading .server-label {
  opacity: 0;
  transform: translateY(12px);
  max-height: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

/* Titel */
.logo-title {
  min-height: 1em;

  font-size: clamp(46px, 9vw, 78px);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -2px;

  color: #ffffff;

  text-shadow:
    0 4px 0 rgba(143, 69, 255, 0.25),
    0 18px 42px rgba(0, 0, 0, 0.35);

  visibility: hidden;

  transition:
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1),
    text-shadow 800ms ease;
}

/* Erst sichtbar, wenn JS alles vorbereitet hat */
body.intro-ready .logo-title,
body.is-ready .logo-title {
  visibility: visible;
}

body.is-loading .logo-title {
  text-shadow:
    0 4px 0 rgba(143, 69, 255, 0.34),
    0 24px 60px rgba(0, 0, 0, 0.58);
}

.logo-title span {
  display: inline-block;

  opacity: 0;
  transform:
    translateY(34px)
    scale(0.96)
    rotateX(18deg);

  filter: blur(8px);
}

/* Animation startet erst durch JS */
body.intro-start .logo-title span {
  animation:
    letterIn 720ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Linie */
.intro-line {
  width: 0;
  height: 4px;

  margin: 24px auto 0;

  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--purple), transparent);

  opacity: 0;
  transform: scaleX(0.72);
}

/* Linie startet erst nach dem Schriftzug */
body.line-start .intro-line {
  animation:
    lineIn 650ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Beim Öffnen der Card klappt die Linie weg */
body:not(.is-loading) .intro-line {
  opacity: 0;
  transform: scaleX(0.22);
  margin-top: 0;
  height: 0;

  transition:
    opacity 500ms ease,
    transform 650ms cubic-bezier(0.7, 0, 0.2, 1),
    margin 650ms cubic-bezier(0.7, 0, 0.2, 1),
    height 650ms cubic-bezier(0.7, 0, 0.2, 1);
}

/* Inhalt */
.content-reveal {
  max-height: 500px;
  opacity: 1;
  overflow: hidden;

  transform: translateY(0);

  transition:
    max-height 950ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 650ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-loading .content-reveal {
  max-height: 0;
  opacity: 0;
  transform: translateY(22px);
}

.subtitle,
.status-box,
.text,
.mini-blocks,
.footer-text {
  opacity: 0;
  transform: translateY(18px);

  transition:
    opacity 650ms ease,
    transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

body.is-ready .subtitle {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 160ms;
}

body.is-ready .status-box {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 260ms;
}

body.is-ready .text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 360ms;
}

body.is-ready .mini-blocks {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 460ms;
}

body.is-ready .footer-text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 540ms;
}

.subtitle {
  margin-top: 16px;

  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.status-box {
  width: fit-content;
  margin: 34px auto 0;
  padding: 14px 20px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 14px;
  background: var(--card-soft);
  border: 1px solid #3c2861;

  color: #d6bdff;
  font-size: 21px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.text {
  max-width: 460px;
  margin: 22px auto 0;

  color: #a9a2b6;
  font-size: 16px;
  line-height: 1.65;
}

.mini-blocks {
  margin-top: 34px;

  display: flex;
  justify-content: center;
  gap: 9px;
}

.mini-blocks span {
  width: 13px;
  height: 13px;

  background: var(--purple);
  border-radius: 3px;

  animation: blockMove 1.4s infinite ease-in-out;
}

.mini-blocks span:nth-child(2) {
  animation-delay: 0.15s;
  background: #7b35e6;
}

.mini-blocks span:nth-child(3) {
  animation-delay: 0.3s;
  background: var(--purple-dark);
}

.footer-text {
  margin-top: 34px;

  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Animationen */
@keyframes letterIn {
  0% {
    opacity: 0;
    transform: translateY(34px) scale(0.96) rotateX(18deg);
    filter: blur(8px);
  }

  68% {
    opacity: 1;
    transform: translateY(-5px) scale(1.018) rotateX(0);
    filter: blur(0);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
    filter: blur(0);
  }
}

@keyframes lineIn {
  0% {
    width: 0;
    opacity: 0;
    transform: scaleX(0.72);
  }

  65% {
    opacity: 1;
  }

  100% {
    width: min(280px, 62vw);
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes blockMove {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.55;
  }

  50% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .cursor-light {
    display: none;
  }

  .page::before {
    display: none;
  }

  .page {
    padding: 18px;
    background-size: 34px 34px;
  }

  .card {
    padding: 38px 22px;
    border-radius: 22px;
  }

  body.is-loading .card {
    padding: 0;
  }

  .card::before {
    border-radius: 22px;
  }

  .server-label {
    margin-bottom: 18px;
    font-size: 13px;
  }

  .logo-title {
    font-size: clamp(42px, 13vw, 60px);
  }

  .subtitle {
    font-size: 16px;
  }

  .status-box {
    margin-top: 30px;
    padding: 13px 17px;

    font-size: 18px;
    letter-spacing: 1.5px;
  }

  .text {
    font-size: 15px;
  }

  .mini-blocks {
    margin-top: 30px;
  }

  .footer-text {
    margin-top: 30px;
  }
}

/* Kleine Höhen */
@media (max-height: 650px) {
  .card {
    padding: 28px 20px;
  }

  body.is-loading .card {
    padding: 0;
  }

  .server-label {
    margin-bottom: 14px;
  }

  .subtitle {
    margin-top: 10px;
  }

  .status-box {
    margin-top: 22px;
  }

  .text {
    margin-top: 16px;
  }

  .mini-blocks {
    margin-top: 22px;
  }

  .footer-text {
    margin-top: 22px;
  }
}

/* Weniger Bewegung */
@media (prefers-reduced-motion: reduce) {
  .logo-title {
    visibility: visible;
  }

  .logo-title span {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .logo-title span,
  .intro-line,
  .mini-blocks span {
    animation: none !important;
  }

  .intro-line {
    opacity: 0;
    height: 0;
    margin: 0;
  }

  .card,
  .server-label,
  .content-reveal,
  .subtitle,
  .status-box,
  .text,
  .mini-blocks,
  .footer-text {
    transition: none;
  }
}