:root {
  color-scheme: dark;
  --bg: #03040d;
  --ink: #f6f8ff;
  --muted: rgba(246, 248, 255, 0.62);
  --cyan: #6fe8ff;
  --mint: #79ffd8;
  --rose: #ff6f9f;
  --gold: #ffd271;
  --violet: #a993ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  min-height: 100vh;
}

.stage {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 15%, rgba(111, 232, 255, 0.2), transparent 27%),
    radial-gradient(circle at 86% 21%, rgba(255, 111, 159, 0.17), transparent 24%),
    radial-gradient(circle at 50% 78%, rgba(121, 255, 216, 0.14), transparent 27%),
    linear-gradient(140deg, #03040d 0%, #090a1b 46%, #03040d 100%);
}

.stage::before,
.stage::after {
  position: absolute;
  inset: -20vmax;
  z-index: -1;
  content: "";
  pointer-events: none;
}

.stage::before {
  opacity: 0.72;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image: radial-gradient(circle, black 0%, transparent 70%);
  transform: perspective(880px) rotateX(64deg) translateY(18vh);
}

.stage::after {
  inset: -10vmax;
  opacity: 0.58;
  background:
    conic-gradient(from 130deg, transparent, rgba(111, 232, 255, 0.22), transparent 18%),
    conic-gradient(from 310deg, transparent, rgba(255, 210, 113, 0.16), transparent 16%);
  filter: blur(26px);
  /* Promote to its own compositor layer so the blurred conic gradient is
     rasterized once and only the rotation is re-composited (no per-frame
     main-thread repaint of the blur). */
  will-change: transform;
  transform: translateZ(0);
  animation: nebula-turn 30s linear infinite;
}

.scanline {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(transparent 0 49%, rgba(111, 232, 255, 0.22) 50%, transparent 51%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px);
  mix-blend-mode: screen;
  opacity: 0.16;
  transform: translateY(-100%);
  will-change: transform;
  animation: scan-pass 8s ease-in-out infinite;
}

#cosmos {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.brand {
  position: fixed;
  top: clamp(18px, 3vw, 34px);
  left: clamp(18px, 3vw, 38px);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  padding: 11px 16px 12px;
  border: 1px solid rgba(246, 248, 255, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(111, 232, 255, 0.12), rgba(255, 255, 255, 0.025)),
    rgba(5, 6, 17, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 20px 70px rgba(111, 232, 255, 0.12);
  backdrop-filter: blur(16px);
}

.brand-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(111, 232, 255, 0.6));
}

h1 {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  margin: 0;
  font-family: 'Orbitron', sans-serif;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

.tech-brand-main {
  font-family: 'Orbitron', sans-serif;
  color: var(--ink);
  text-shadow: 0 0 12px rgba(246, 248, 255, 0.25);
}

.tech-brand-sub {
  font-family: 'Orbitron', sans-serif;
  color: var(--cyan);
  font-weight: 500;
  font-size: 0.8em;
  letter-spacing: 0.16em;
  margin-left: 2px;
  text-shadow: 0 0 12px rgba(111, 232, 255, 0.4);
}

.hud {
  position: fixed;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: clamp(170px, 20vw, 240px);
  padding: 10px 14px;
  border: 1px solid rgba(246, 248, 255, 0.08);
  border-radius: 8px;
  background: rgba(3, 4, 13, 0.42);
  backdrop-filter: blur(10px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 30px rgba(3, 4, 13, 0.6);
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  pointer-events: none;
}

.hud-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(246, 248, 255, 0.08);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hud-item:last-child {
  border-bottom: none;
}

.hud-item span {
  color: var(--cyan);
  font-weight: bold;
  text-shadow: 0 0 8px rgba(111, 232, 255, 0.35);
}

.hud-left {
  bottom: clamp(20px, 4vw, 44px);
  left: clamp(20px, 4vw, 44px);
}

.hud-right {
  bottom: clamp(20px, 4vw, 44px);
  right: clamp(20px, 4vw, 44px);
}

/* ----- Hero overlay ------------------------------------------------------ */

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(92vw, 720px);
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
}

/* Subtle scrim so copy stays legible over the bright core. */
.hero::before {
  position: absolute;
  inset: -18% -8%;
  z-index: -1;
  content: "";
  background: radial-gradient(ellipse at center, rgba(3, 4, 13, 0.62) 0%, transparent 68%);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 15px;
  border: 1px solid rgba(111, 232, 255, 0.42);
  border-radius: 999px;
  background: rgba(5, 6, 17, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 24px rgba(111, 232, 255, 0.18);
  backdrop-filter: blur(10px);
  color: rgba(246, 248, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-indent: 0.32em;
}

.badge-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.wordmark {
  margin: 0;
  color: var(--ink);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(54px, 13vw, 148px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(246, 248, 255, 0.45),
    0 0 46px rgba(111, 232, 255, 0.4),
    0 2px 30px rgba(3, 4, 13, 0.8);
}

.wordmark-sub {
  margin: 0;
  color: rgba(246, 248, 255, 0.78);
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(12px, 2.4vw, 18px);
  font-weight: 700;
  letter-spacing: 0.62em;
  text-transform: uppercase;
  text-indent: 0.62em;
  text-shadow: 0 1px 18px rgba(3, 4, 13, 0.85);
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 2.1vw, 17px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 16px rgba(3, 4, 13, 0.9);
}

.site-footer {
  position: fixed;
  bottom: clamp(14px, 2.6vw, 24px);
  left: 50%;
  z-index: 2;
  color: rgba(246, 248, 255, 0.5);
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 1px 14px rgba(3, 4, 13, 0.85);
  pointer-events: none;
  transform: translateX(-50%);
}

/* ----- Entrance (plays once when JS adds `.loaded` to <body>) ------------- */

/* Star and system fade in (opacity only — their transforms vary per
   breakpoint, so we don't touch them here to avoid clobbering positioning). */
.star,
.system {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.badge,
.wordmark,
.wordmark-sub,
.tagline,
.site-footer,
.hud {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-footer {
  transform: translate(-50%, 14px);
}

body.loaded .star,
body.loaded .system {
  opacity: 1;
}

body.loaded .hud {
  opacity: 0.72;
  transform: none;
  transition-delay: 0.5s;
}

body.loaded .badge {
  opacity: 1;
  transform: none;
  transition-delay: 0.7s;
}

body.loaded .wordmark {
  opacity: 1;
  transform: none;
  transition-delay: 0.86s;
}

body.loaded .wordmark-sub {
  opacity: 1;
  transform: none;
  transition-delay: 1s;
}

body.loaded .tagline {
  opacity: 1;
  transform: none;
  transition-delay: 1.16s;
}

body.loaded .site-footer {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 1.3s;
}

.badge,
.wordmark,
.wordmark-sub,
.tagline {
  opacity: 1;
  transform: none;
  transition: none;
}

.hud {
  opacity: 0.72;
  transform: none;
  transition: none;
}

.site-footer,
body.loaded .site-footer {
  opacity: 1;
  transform: translateX(-50%);
  transition: none;
}

@keyframes corona-breathe {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.06);
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.7);
  }
}

/* ----- Hero overlay ------------------------------------------------------ */

.hero {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 14px;
  width: min(92vw, 720px);
  padding: 0 16px;
  text-align: center;
  pointer-events: none;
}

/* Subtle scrim so copy stays legible over the bright core. */
.hero::before {
  position: absolute;
  inset: -18% -8%;
  z-index: -1;
  content: "";
  background: radial-gradient(ellipse at center, rgba(3, 4, 13, 0.62) 0%, transparent 68%);
  pointer-events: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 7px 15px;
  border: 1px solid rgba(111, 232, 255, 0.42);
  border-radius: 999px;
  background: rgba(5, 6, 17, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 24px rgba(111, 232, 255, 0.18);
  backdrop-filter: blur(10px);
  color: rgba(246, 248, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  text-indent: 0.32em;
}

.badge-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 12px var(--mint);
  animation: dot-pulse 2.4s ease-in-out infinite;
}

.wordmark {
  margin: 0;
  color: var(--ink);
  font-family:
    "Arial Narrow", "Roboto Condensed", "DIN Condensed", "Segoe UI",
    ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(54px, 13vw, 148px);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 0.92;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(246, 248, 255, 0.45),
    0 0 46px rgba(111, 232, 255, 0.4),
    0 2px 30px rgba(3, 4, 13, 0.8);
}

.wordmark-sub {
  margin: 0;
  color: rgba(246, 248, 255, 0.78);
  font-size: clamp(12px, 2.4vw, 18px);
  font-weight: 600;
  letter-spacing: 0.62em;
  text-transform: uppercase;
  text-indent: 0.62em;
  text-shadow: 0 1px 18px rgba(3, 4, 13, 0.85);
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(13px, 2.1vw, 17px);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 16px rgba(3, 4, 13, 0.9);
}

.site-footer {
  position: fixed;
  bottom: clamp(14px, 2.6vw, 24px);
  left: 50%;
  z-index: 2;
  color: rgba(246, 248, 255, 0.5);
  font-size: clamp(11px, 1.5vw, 13px);
  letter-spacing: 0.06em;
  white-space: nowrap;
  text-shadow: 0 1px 14px rgba(3, 4, 13, 0.85);
  pointer-events: none;
  transform: translateX(-50%);
}

/* ----- Entrance (plays once when JS adds `.loaded` to <body>) ------------- */

/* Star and system fade in (opacity only — their transforms vary per
   breakpoint, so we don't touch them here to avoid clobbering positioning). */
.star,
.system {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.badge,
.wordmark,
.wordmark-sub,
.tagline,
.site-footer,
.hud {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.7s ease,
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-footer {
  transform: translate(-50%, 14px);
}

body.loaded .star,
body.loaded .system {
  opacity: 1;
}

body.loaded .hud {
  opacity: 0.72;
  transform: none;
  transition-delay: 0.5s;
}

body.loaded .badge {
  opacity: 1;
  transform: none;
  transition-delay: 0.7s;
}

body.loaded .wordmark {
  opacity: 1;
  transform: none;
  transition-delay: 0.86s;
}

body.loaded .wordmark-sub {
  opacity: 1;
  transform: none;
  transition-delay: 1s;
}

body.loaded .tagline {
  opacity: 1;
  transform: none;
  transition-delay: 1.16s;
}

body.loaded .site-footer {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 1.3s;
}

.badge,
.wordmark,
.wordmark-sub,
.tagline {
  opacity: 1;
  transform: none;
  transition: none;
}

.hud {
  opacity: 0.72;
  transform: none;
  transition: none;
}

.site-footer,
body.loaded .site-footer {
  opacity: 1;
  transform: translateX(-50%);
  transition: none;
}

@keyframes corona-breathe {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.9);
  }

  50% {
    opacity: 0.95;
    transform: scale(1.06);
  }
}

@keyframes dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.7);
  }
}

@keyframes orbit-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes nebula-turn {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan-pass {
  0%,
  32% {
    transform: translateY(-100%);
  }

  58%,
  100% {
    transform: translateY(100%);
  }
}

@media (min-width: 900px) {
  .stage::after {
    opacity: 0.32;
    filter: none;
    transform: none;
    animation: none;
  }

  .scanline {
    opacity: 0.08;
    mix-blend-mode: normal;
    animation-duration: 14s;
  }

  .brand,
  .hud,
  .badge {
    backdrop-filter: none;
  }

  .wordmark {
    text-shadow:
      0 0 14px rgba(246, 248, 255, 0.34),
      0 0 28px rgba(111, 232, 255, 0.26),
      0 2px 24px rgba(3, 4, 13, 0.78);
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow: auto;
  }

  .stage {
    min-height: 100svh;
  }

  .system {
    width: 174vw;
    transform: translate(-50%, -42%) rotateX(61deg) rotateZ(-17deg);
  }

  .star {
    width: 150px;
    min-width: 0;
    transform: translate(-50%, -38%);
  }

  .hero {
    width: min(94vw, 480px);
    gap: 11px;
  }

  .wordmark {
    font-size: 46px;
    letter-spacing: 0.04em;
  }

  .wordmark-sub {
    font-size: 12px;
    letter-spacing: 0.46em;
    text-indent: 0.46em;
  }

  .badge {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-indent: 0.22em;
  }

  .tagline {
    max-width: calc(100vw - 36px);
    font-size: 12px;
    line-height: 1.4;
  }

  .site-footer {
    width: max-content;
    max-width: calc(100vw - 24px);
    white-space: normal;
    text-align: center;
  }

  .brand {
    width: max-content;
    gap: 10px;
    padding: 10px 12px 11px;
  }

  .brand-logo {
    width: 18px;
    height: 18px;
  }

  h1 {
    font-size: 15px;
    line-height: 1;
  }

  .hud {
    display: none;
  }
}

@media (min-width: 721px) and (max-width: 980px) {
  h1 {
    font-size: 18px;
  }
}

@media (max-width: 360px) {
  h1 {
    font-size: 13px;
  }
}

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

  /* Show the final composed state immediately, regardless of the `.loaded`
     entrance (no fade-up, no bloom). Only reset transform on elements whose
     transform is purely the entrance offset — never on .star/.system/.site-footer
     whose transforms are positional. */
  .star,
  .system,
  .badge,
  .wordmark,
  .wordmark-sub,
  .tagline,
  .site-footer {
    opacity: 1;
  }

  .badge,
  .wordmark,
  .wordmark-sub,
  .tagline {
    transform: none;
  }

  .hud {
    opacity: 0.72;
    transform: none;
  }

  .site-footer {
    transform: translateX(-50%);
  }
}
