:root {
  --bg: #04050a;
  --bg-elevated: rgba(9, 12, 24, 0.6);
  --panel-border: rgba(157, 117, 255, 0.22);
  --text: #eef3ff;
  --muted: #a6b4d4;
  --cyan: #53d9ff;
  --cyan-soft: rgba(83, 217, 255, 0.18);
  --violet: #8f6fff;
  --violet-soft: rgba(143, 111, 255, 0.2);
  --success: #7bffb7;
  --danger: #ff6999;
  --glow-strength: 1;
  --shadow-premium:
    0 0 calc(35px * var(--glow-strength)) rgba(83, 217, 255, 0.16),
    0 0 calc(70px * var(--glow-strength)) rgba(143, 111, 255, 0.12);
  --panel-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 20px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 20%, rgba(83, 217, 255, 0.16), transparent 28%),
    radial-gradient(circle at 85% 18%, rgba(143, 111, 255, 0.14), transparent 24%),
    radial-gradient(circle at 50% 85%, rgba(92, 33, 169, 0.18), transparent 34%),
    linear-gradient(180deg, #020308 0%, #050712 45%, #020308 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 45%);
  pointer-events: none;
}

body.intense-glow {
  --glow-strength: 1.65;
}

.particle-canvas,
.grid-overlay,
.scanlines,
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.particle-canvas {
  z-index: 0;
  opacity: 0.82;
}

.grid-overlay {
  z-index: 1;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(83, 217, 255, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 217, 255, 0.12) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 88%);
  animation: driftGrid 14s linear infinite;
}

.scanlines {
  z-index: 3;
  opacity: 0.12;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent 4px
  );
  mix-blend-mode: screen;
}

.ambient-glow {
  z-index: 1;
  filter: blur(110px);
  opacity: calc(0.22 * var(--glow-strength));
}

.ambient-glow-left {
  background: radial-gradient(circle, rgba(83, 217, 255, 0.28), transparent 65%);
  transform: translate(-25%, -15%);
}

.ambient-glow-right {
  background: radial-gradient(circle, rgba(143, 111, 255, 0.24), transparent 65%);
  transform: translate(35%, 12%);
}

.scene {
  position: relative;
  z-index: 5;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.shell {
  width: min(1180px, 100%);
}

.reveal {
  animation: revealUp 1.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(7, 10, 22, 0.55);
  backdrop-filter: blur(16px);
  color: #d6e1ff;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: var(--shadow-premium);
}

.status-dot,
.metric-card__pulse,
.terminal__dot {
  border-radius: 50%;
}

.status-dot {
  width: 9px;
  height: 9px;
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
  animation: breathe 1.8s ease-in-out infinite;
}

.glass-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13, 18, 34, 0.78), rgba(7, 10, 20, 0.6));
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--panel-shadow), var(--shadow-premium);
}

.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.14), transparent 28%, transparent 72%, rgba(83, 217, 255, 0.08));
  pointer-events: none;
}

.hero__content {
  margin-top: 18px;
  padding: 32px;
  will-change: transform;
}

.hero__badge,
.hero__footer,
.hero__meta,
.terminal__header {
  display: flex;
  align-items: center;
}

.hero__badge {
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.glow-toggle {
  border: 1px solid rgba(83, 217, 255, 0.32);
  background: rgba(83, 217, 255, 0.08);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.glow-toggle:hover,
.glow-toggle:focus-visible {
  transform: translateY(-1px);
  background: rgba(83, 217, 255, 0.14);
  box-shadow: 0 0 18px rgba(83, 217, 255, 0.18);
  outline: none;
}

.hero__title {
  position: relative;
  margin: 24px 0 12px;
  max-width: 12ch;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: 0;
  text-shadow: 0 0 25px rgba(83, 217, 255, 0.16);
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.glitch::before {
  color: rgba(83, 217, 255, 0.75);
  transform: translate(1px, 0);
  animation: glitchFlicker 6s infinite;
}

.glitch::after {
  color: rgba(255, 77, 178, 0.45);
  transform: translate(-1px, 0);
  animation: glitchFlicker 6s infinite reverse;
}

.hero__subtitle {
  margin: 0;
  max-width: 42rem;
  color: #dce7ff;
  font-size: clamp(1.1rem, 2.4vw, 1.5rem);
}

.hero__copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.hero__meta {
  align-items: stretch;
  gap: 18px;
  margin-top: 30px;
}

.metric-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  padding: 20px;
  border-radius: 22px;
  background: rgba(9, 13, 27, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  will-change: transform;
}

.metric-card:hover {
  transform: translateY(-3px);
  border-color: rgba(83, 217, 255, 0.3);
  box-shadow: 0 16px 34px rgba(5, 8, 20, 0.44);
}

.metric-card__label,
.countdown__label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-card__value {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
}

.metric-card__pulse {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 10px;
  height: 10px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
  animation: breathe 1.6s ease-in-out infinite;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(68px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.countdown__unit {
  padding: 14px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.countdown__value {
  display: block;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 700;
}

.hero__footer {
  align-items: stretch;
  gap: 20px;
  margin-top: 28px;
}

.loader,
.loader__core,
.loader__wave {
  position: relative;
}

.loader {
  flex: 0 0 210px;
  min-height: 220px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    radial-gradient(circle at center, rgba(83, 217, 255, 0.1), transparent 58%),
    rgba(9, 13, 27, 0.52);
  border: 1px solid rgba(83, 217, 255, 0.14);
  box-shadow: inset 0 0 30px rgba(83, 217, 255, 0.06);
  contain: layout paint;
}

.loader__core {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, #b7f4ff 0%, #53d9ff 100%);
  box-shadow:
    0 0 22px rgba(83, 217, 255, 0.9),
    0 0 42px rgba(143, 111, 255, 0.46);
  animation: corePulse 2.4s ease-in-out infinite;
}

.loader__wave {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(83, 217, 255, 0.42);
  animation: waveExpand 3.6s ease-out infinite;
}

.loader__wave--two {
  animation-delay: 1.1s;
}

.loader__wave--three {
  animation-delay: 2.2s;
}

.terminal-panel {
  flex: 1 1 auto;
  min-height: 220px;
  padding: 0;
  contain: layout paint;
}

.terminal__header {
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.terminal__dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.22);
}

.terminal__dot:first-child {
  background: #ff6b81;
}

.terminal__dot:nth-child(2) {
  background: #ffd56b;
}

.terminal__dot:nth-child(3) {
  background: #7bffb7;
}

.terminal__label {
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal__body {
  padding: 18px;
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #c8f4ff;
}

.terminal__line {
  display: block;
  white-space: pre-wrap;
  opacity: 0;
  animation: fadeLine 260ms ease forwards;
}

.terminal__line::before {
  content: ">";
  margin-right: 10px;
  color: rgba(123, 255, 183, 0.9);
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes driftGrid {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(64px);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.92);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes glitchFlicker {
  0%,
  89%,
  100% {
    opacity: 0;
  }
  90% {
    opacity: 0.7;
  }
  91% {
    opacity: 0;
  }
  92% {
    opacity: 0.38;
  }
}

@keyframes corePulse {
  0%,
  100% {
    transform: scale(0.9);
    filter: hue-rotate(0deg);
  }
  45% {
    transform: scale(1.14);
    filter: hue-rotate(24deg);
  }
  65% {
    transform: scale(0.98);
  }
}

@keyframes waveExpand {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(4.8);
    opacity: 0;
  }
}

@keyframes fadeLine {
  to {
    opacity: 1;
  }
}

@media (max-width: 980px) {
  .scene {
    min-height: auto;
    padding: 24px 16px 36px;
  }

  .hero__content {
    padding: 24px;
  }

  .hero__meta,
  .hero__footer,
  .hero__badge {
    flex-direction: column;
    align-items: stretch;
  }

  .loader {
    flex-basis: auto;
    min-height: 180px;
  }
}

@media (max-width: 640px) {
  .particle-canvas,
  .grid-overlay,
  .scanlines {
    opacity: 0.5;
  }

  .ambient-glow {
    opacity: 0.16;
  }

  .hero__eyebrow {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .hero__title {
    max-width: 100%;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terminal__body {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .particle-canvas,
  .grid-overlay,
  .scanlines,
  .ambient-glow {
    display: none;
  }
}
