:root {
  --c-primary: #8a2be2;
  --c-secondary: #9370db;
  --c-ink: #efe7ff;
  --c-shadow: #0a0710;
  --c-obsidian: #120a1d;
  --c-obsidian-dark: #0b0713;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "VT323", "Courier New", monospace;
  color: var(--c-ink);
  background:
    radial-gradient(900px 500px at 70% -10%, rgba(138, 43, 226, 0.35), transparent 70%),
    radial-gradient(800px 600px at 20% 120%, rgba(147, 112, 219, 0.2), transparent 65%),
    linear-gradient(180deg, #1b1028 0%, #120a1e 45%, #0b0713 100%);
  overflow-x: hidden;
  position: relative;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 22px, rgba(147, 112, 219, 0.12) 23px),
    linear-gradient(90deg, transparent 22px, rgba(147, 112, 219, 0.12) 23px),
    linear-gradient(transparent 44px, rgba(10, 7, 16, 0.45) 45px),
    linear-gradient(90deg, transparent 44px, rgba(10, 7, 16, 0.45) 45px);
  background-size: 45px 45px;
  opacity: 0.2;
}

.bg-noise {
  position: absolute;
  inset: -20%;
  background-image: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 2px,
      transparent 2px,
      transparent 4px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(0, 0, 0, 0.2) 0,
      rgba(0, 0, 0, 0.2) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.35;
  animation: haze 16s linear infinite;
}

.portal-scene {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
  pointer-events: none;
}

.portal-glow {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(138, 43, 226, 0.35) 0%,
    rgba(138, 43, 226, 0.18) 35%,
    transparent 70%
  );
  filter: blur(12px);
  animation: portal-pulse 6s ease-in-out infinite;
}

.portal-frame {
  position: relative;
  width: min(360px, 70vw);
  height: min(520px, 90vw);
  z-index: 1;
  background:
    linear-gradient(135deg, rgba(18, 10, 29, 0.9), rgba(11, 7, 19, 0.95)),
    repeating-linear-gradient(
      90deg,
      rgba(147, 112, 219, 0.08) 0,
      rgba(147, 112, 219, 0.08) 10px,
      transparent 10px,
      transparent 20px
    );
  border: 6px solid #1b0f2c;
  box-shadow: 0 18px 0 rgba(10, 7, 16, 0.8), 0 0 34px rgba(138, 43, 226, 0.25);
  image-rendering: pixelated;
}

.portal-frame::before {
  content: "";
  position: absolute;
  inset: -30px;
  z-index: -1;
  border-radius: 30px;
  border: 2px solid rgba(147, 112, 219, 0.5);
  box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
  animation: rune-glow 5s ease-in-out infinite;
}


.portal-inner {
  position: absolute;
  inset: 16px;
  z-index: 2;
  border: 2px solid rgba(147, 112, 219, 0.6);
  background:
    radial-gradient(circle at 30% 30%, rgba(147, 112, 219, 0.9), rgba(138, 43, 226, 0.35) 45%, rgba(10, 7, 16, 0.95) 75%),
    conic-gradient(
      from 180deg,
      rgba(138, 43, 226, 0.6),
      rgba(147, 112, 219, 0.2),
      rgba(138, 43, 226, 0.6)
    );
  overflow: hidden;
  animation: portal-wave 7s ease-in-out infinite;
}


.portal-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(147, 112, 219, 0.18) 0,
    rgba(147, 112, 219, 0.18) 6px,
    transparent 6px,
    transparent 14px
  );
  opacity: 0.35;
  animation: shimmer 4.8s ease-in-out infinite;
}

.sparks {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  background: rgba(147, 112, 219, 0.75);
  box-shadow: 0 0 12px rgba(138, 43, 226, 0.85);
  opacity: 0.8;
  will-change: transform, opacity;
}

.wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 24px 64px;
  text-align: center;
  gap: 26px;
}

.hero {
  width: min(880px, 100%);
  padding: 34px 30px 38px;
  border: 2px solid rgba(138, 43, 226, 0.6);
  background: rgba(15, 10, 24, 0.82);
  box-shadow: 0 12px 0 rgba(10, 7, 16, 0.8), 0 0 28px rgba(138, 43, 226, 0.2);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(147, 112, 219, 0.35);
  pointer-events: none;
  opacity: 0.45;
}

.badge {
  display: inline-block;
  padding: 8px 14px;
  border: 2px solid var(--c-secondary);
  background: rgba(147, 112, 219, 0.12);
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 18px;
}

h1 {
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.2;
  margin: 0 0 16px;
  text-shadow: 0 6px 0 rgba(10, 7, 16, 0.8);
}

.hero p {
  margin: 0 auto 28px;
  max-width: 520px;
  font-size: clamp(20px, 3vw, 26px);
  color: rgba(239, 231, 255, 0.85);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 14px 20px;
  font-family: "Press Start 2P", "VT323", monospace;
  font-size: 12px;
  text-decoration: none;
  color: var(--c-ink);
  border: 2px solid var(--c-primary);
  background: linear-gradient(180deg, rgba(138, 43, 226, 0.9), rgba(74, 25, 120, 0.95));
  box-shadow: 0 6px 0 rgba(10, 7, 16, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 rgba(10, 7, 16, 0.9);
  filter: brightness(1.1);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(10, 7, 16, 0.9);
}

.btn-alt {
  border-color: var(--c-secondary);
  background: linear-gradient(180deg, rgba(147, 112, 219, 0.9), rgba(60, 35, 100, 0.95));
}


[data-reveal] {
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-reveal].in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes haze {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(3%) translateY(2%);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

@keyframes portal-pulse {
  0% {
    transform: scale(0.96);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(0.96);
    opacity: 0.6;
  }
}

@keyframes rune-glow {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}


@keyframes portal-wave {
  0% {
    filter: hue-rotate(0deg) saturate(1);
  }
  50% {
    filter: hue-rotate(18deg) saturate(1.1);
  }
  100% {
    filter: hue-rotate(0deg) saturate(1);
  }
}

@keyframes shimmer {
  0% {
    transform: translateX(-12%);
  }
  50% {
    transform: translateX(12%);
  }
  100% {
    transform: translateX(-12%);
  }
}

@media (max-width: 720px) {
  .top {
    flex-direction: column;
    text-align: center;
  }

  .hero {
    padding: 30px 20px 34px;
  }
}
