*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --void: #030508;
  --deep: #0a0f14;
  --fog: rgba(140, 155, 168, 0.08);
  --mist: rgba(180, 195, 210, 0.06);
  --shore: #0c1018;
  --accent: #6a8a9a;
  --glitch-cyan: #3dd9c4;
  --glitch-magenta: #c43d8a;
  --text-dim: rgba(160, 175, 190, 0.35);
}

html,
body {
  height: 100dvh;
  overflow: hidden;
  background: var(--void);
  color: var(--text-dim);
  font-family: "IBM Plex Mono", "Courier New", monospace;
  -webkit-font-smoothing: antialiased;
}

.viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: block;
}

.atmosphere {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

/* Soft tint — no hard stops */
.sky-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 70% at 50% 20%, rgba(35, 50, 70, 0.22) 0%, transparent 65%),
    linear-gradient(180deg, rgba(8, 12, 20, 0.28) 0%, rgba(8, 12, 20, 0.08) 35%, rgba(8, 12, 20, 0) 70%);
}

.horizon-glow {
  position: absolute;
  left: -15%;
  right: -15%;
  top: 36%;
  height: 22%;
  background: radial-gradient(ellipse at center, rgba(14, 26, 38, 0.07) 0%, transparent 75%);
  filter: blur(48px);
  animation: horizon-pulse 28s ease-in-out infinite;
}

@keyframes horizon-pulse {
  0%, 100% { opacity: 0.25; transform: scaleY(1); }
  50% { opacity: 0.45; transform: scaleY(1.08); }
}

.fog {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 28%;
  background: radial-gradient(ellipse at center, var(--mist) 0%, transparent 72%);
  filter: blur(48px);
  animation: fog-drift linear infinite;
}

.fog-1 {
  top: 8%;
  animation-duration: 90s;
  animation-delay: 0s;
  opacity: 0.4;
  height: 35%;
}

.fog-2 {
  top: 18%;
  animation-duration: 110s;
  animation-delay: -30s;
  opacity: 0.3;
  height: 30%;
}

.fog-3 {
  top: 32%;
  animation-duration: 100s;
  animation-delay: -50s;
  opacity: 0.22;
  height: 30%;
  background: radial-gradient(ellipse at center, var(--fog) 0%, transparent 68%);
}

.fog-4 {
  top: 58%;
  height: 22%;
  animation-duration: 120s;
  animation-delay: -40s;
  opacity: 0.4;
  filter: blur(60px);
}

@keyframes fog-drift {
  0% { transform: translateX(-4%) scale(1); opacity: 0.25; }
  50% { transform: translateX(4%) scale(1.03); opacity: 0.45; }
  100% { transform: translateX(-4%) scale(1); opacity: 0.25; }
}

.glitch-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(61, 217, 196, 0.025) 2px,
      rgba(61, 217, 196, 0.025) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(196, 61, 138, 0.015) 40px,
      rgba(196, 61, 138, 0.015) 41px
    );
  animation: glitch-surface 6s steps(1) infinite;
}

@keyframes glitch-surface {
  0%, 88%, 100% { opacity: 0; transform: translate(0); filter: none; }
  89% { opacity: 0.35; transform: translate(-4px, 1px); filter: hue-rotate(-8deg); }
  90% { opacity: 0.08; transform: translate(5px, -2px); }
  91% { opacity: 0.45; transform: translate(-2px, 0); filter: hue-rotate(12deg); }
  92% { opacity: 0; transform: translate(3px, 1px); }
  94% { opacity: 0.2; transform: translate(-3px, -1px); }
  95% { opacity: 0; }
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.05) 3px,
    rgba(0, 0, 0, 0.05) 4px
  );
  opacity: 0.2;
  animation: scanline-drift 12s linear infinite;
}

@keyframes scanline-drift {
  0% { transform: translateY(0); }
  100% { transform: translateY(4px); }
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    ellipse 90% 80% at 50% 35%,
    transparent 55%,
    rgba(0, 0, 0, 0.35) 100%
  );
}

.lightning-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: rgba(200, 215, 235, 0);
  transition: background 0.05s ease-out;
}

.lightning-flash.active {
  background: linear-gradient(
    180deg,
    rgba(120, 140, 160, 0.04) 0%,
    rgba(100, 120, 140, 0.08) 45%,
    rgba(80, 100, 120, 0.03) 100%
  );
}

.lightning-flash.active.hard {
  background: linear-gradient(
    180deg,
    rgba(140, 160, 180, 0.08) 0%,
    rgba(120, 145, 170, 0.14) 40%,
    rgba(90, 110, 130, 0.05) 100%
  );
}

.content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(1.5rem, 5vw, 3rem);
  pointer-events: none;
}

.hold-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(106, 138, 154, 0.15);
  background: rgba(8, 12, 18, 0.5);
  backdrop-filter: blur(8px);
  font-size: clamp(0.65rem, 2vw, 0.75rem);
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: rgba(140, 160, 175, 0.5);
  animation: badge-flicker 6s ease-in-out infinite;
}

.hold-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(106, 138, 154, 0.6);
  animation: dot-pulse 2.5s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes badge-flicker {
  0%, 100% { opacity: 0.7; }
  48% { opacity: 0.7; }
  49% { opacity: 0.3; }
  50% { opacity: 0.85; }
  51% { opacity: 0.4; }
  52% { opacity: 0.75; }
}

.shore-ui {
  position: absolute;
  bottom: clamp(1rem, 4vw, 2.5rem);
  left: 0;
  right: 0;
  z-index: 10;
  text-align: center;
  pointer-events: none;
}

.whisper {
  font-size: clamp(0.6rem, 1.8vw, 0.7rem);
  letter-spacing: 0.35em;
  text-transform: lowercase;
  color: rgba(100, 120, 135, 0.25);
  animation: whisper-breathe 10s ease-in-out infinite;
}

@keyframes whisper-breathe {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.45; }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 480px) {
  .fog {
    filter: blur(30px);
  }

  .hold-badge {
    letter-spacing: 0.15em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
