:root {
  --bg: #04060c;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --violet: #a78bfa;
  --green: #4ade80;
  --muted: #7d92b0;
  --text: #dbe9ff;
  --disp: 'Orbitron', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scrollbar-color: #1e3a5c var(--bg); }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
  overflow-x: hidden;
}

#starfield { position: fixed; inset: 0; z-index: 0; }

/* ---------- deep-space decor ---------- */
.space-decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orbit-ring { position: absolute; border: 1px solid rgba(140,180,230,.07); border-radius: 50%; top: -340px; right: -260px; }
.ring-1 { width: 900px; height: 900px; }
.ring-2 { width: 1240px; height: 1240px; top: -480px; right: -420px; border-color: rgba(140,180,230,.05); }
.ring-3 { width: 620px; height: 620px; top: -220px; right: -140px; border-color: rgba(103,232,249,.09); }
.planet-earth {
  position: absolute; top: -190px; right: -150px; width: 540px; height: 540px; border-radius: 50%;
  background:
    radial-gradient(circle at 28% 68%, rgba(96,165,250,.85) 0%, rgba(37,99,235,.75) 26%, rgba(30,58,138,.55) 46%, rgba(10,20,48,.9) 72%, #050a18 100%);
  box-shadow:
    inset -60px -40px 110px rgba(0,0,0,.85),
    inset 18px 14px 60px rgba(147,197,253,.25),
    0 0 90px rgba(59,130,246,.28);
}
.planet-earth::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: radial-gradient(circle at 30% 65%, transparent 62%, rgba(125,211,252,.35) 66%, transparent 70%);
  filter: blur(1px);
}
.planet-earth::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(253,224,71,.16) 0%, transparent 8%),
    radial-gradient(circle at 45% 55%, rgba(253,224,71,.12) 0%, transparent 6%),
    radial-gradient(circle at 70% 60%, rgba(253,224,71,.10) 0%, transparent 5%);
  mix-blend-mode: screen;
}
.station-ring {
  position: absolute; bottom: -220px; left: -160px; width: 480px; height: 480px; border-radius: 50%;
  border: 1px dashed rgba(103,232,249,.12);
  animation: stationSpin 90s linear infinite;
}
.station-ring::after {
  content: ''; position: absolute; top: 50%; left: -7px; width: 13px; height: 13px; margin-top: -6px;
  border-radius: 50%; background: rgba(103,232,249,.55); box-shadow: 0 0 16px rgba(103,232,249,.7);
}
@keyframes stationSpin { to { transform: rotate(360deg); } }

/* ---------- overlays ---------- */
.crt-overlay {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(2,5,12,.55) 100%);
  mix-blend-mode: overlay;
}
.hud-frame { position: fixed; inset: 10px; z-index: 2; pointer-events: none; }
.hud-corner { position: absolute; width: 34px; height: 34px; opacity: .5; }
.hud-corner.tl { top: 0; left: 0; border-top: 1.5px solid rgba(34,211,238,.7); border-left: 1.5px solid rgba(34,211,238,.7); border-top-left-radius: 6px; }
.hud-corner.tr { top: 0; right: 0; border-top: 1.5px solid rgba(34,211,238,.7); border-right: 1.5px solid rgba(34,211,238,.7); border-top-right-radius: 6px; }
.hud-corner.bl { bottom: 0; left: 0; border-bottom: 1.5px solid rgba(34,211,238,.7); border-left: 1.5px solid rgba(34,211,238,.7); border-bottom-left-radius: 6px; }
.hud-corner.br { bottom: 0; right: 0; border-bottom: 1.5px solid rgba(34,211,238,.7); border-right: 1.5px solid rgba(34,211,238,.7); border-bottom-right-radius: 6px; }

/* ---------- hero ---------- */
.hero { position: relative; z-index: 3; text-align: center; padding: 10vh 20px 3vh; }
.eyebrow {
  font-family: var(--disp); font-size: .72rem; letter-spacing: .55em; text-indent: .55em;
  color: var(--cyan-soft); text-shadow: 0 0 12px rgba(34,211,238,.6); margin-bottom: 1.4rem;
  animation: eyebrowFlicker 6s ease-in-out infinite;
}
@keyframes eyebrowFlicker {
  0%, 100% { opacity: 1; } 92% { opacity: 1; } 94% { opacity: .45; } 96% { opacity: 1; } 98% { opacity: .6; }
}
.mega-title {
  font-family: var(--disp);
  font-size: clamp(3rem, 10vw, 6.4rem);
  font-weight: 800; letter-spacing: .16em; text-indent: .16em;
  background: linear-gradient(180deg, #f0feff 0%, #9beaff 42%, #39c1e8 78%, #1178a0 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(34,211,238,.4)) drop-shadow(0 0 64px rgba(34,211,238,.18));
  cursor: default; line-height: 1.1;
  transition: filter .25s ease;
}
.mega-title:hover {
  filter: drop-shadow(-2px 0 0 rgba(255,80,120,.55)) drop-shadow(2px 0 0 rgba(80,220,255,.6)) drop-shadow(0 0 30px rgba(34,211,238,.5));
}
.console-subtitle {
  letter-spacing: .62em; text-indent: .62em; text-transform: uppercase;
  color: #6fa3c4; font-size: .8rem; font-weight: 600; margin-top: 1rem;
}

.stats { display: flex; justify-content: center; gap: clamp(1.2rem, 4vw, 3.4rem); margin-top: 3rem; flex-wrap: wrap; }
.stat {
  min-width: 108px; padding: .8rem 1rem .7rem; border-radius: 12px;
  background: rgba(12,20,36,.5); border: 1px solid rgba(120,160,210,.14);
  backdrop-filter: blur(8px);
  transition: border-color .25s ease, transform .25s ease;
}
.stat:hover { border-color: rgba(34,211,238,.4); transform: translateY(-2px); }
.stat b {
  display: block; font-family: var(--disp); font-size: 1.8rem; color: #eaf6ff;
  text-shadow: 0 0 14px rgba(56,189,248,.5);
}
.stat span { font-size: .6rem; letter-spacing: .34em; color: var(--muted); }

/* ---------- portals ---------- */
.portals {
  position: relative; z-index: 3;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px;
  max-width: 1080px; margin: 4vh auto 7vh; padding: 0 22px;
}
.portal {
  --pc: var(--cyan);
  display: flex; gap: 20px; align-items: flex-start; text-decoration: none;
  padding: 28px 26px 22px; border-radius: 18px; position: relative; overflow: hidden;
  background: rgba(12,19,33,.55); border: 1px solid rgba(120,160,210,.14);
  backdrop-filter: blur(10px); color: var(--text);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), border-color .22s ease, box-shadow .22s ease;
}
.portal.p-violet { --pc: var(--violet); }
.portal:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--pc) 55%, transparent);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 34px color-mix(in srgb, var(--pc) 14%, transparent);
}
.portal::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(120deg, color-mix(in srgb, var(--pc) 8%, transparent), transparent 45%);
  pointer-events: none;
}
.portal:hover::before { opacity: 1; }
.p-glyph {
  flex-shrink: 0; width: 66px; height: 66px; border-radius: 16px; position: relative;
  display: grid; place-items: center; color: var(--pc);
  border: 1px solid color-mix(in srgb, var(--pc) 38%, transparent);
  background: color-mix(in srgb, var(--pc) 7%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--pc) 12%, transparent) inset;
}
.p-glyph svg { width: 34px; height: 34px; }
.p-orbit {
  position: absolute; inset: -9px; border-radius: 18px; opacity: 0;
  border: 1px dashed color-mix(in srgb, var(--pc) 45%, transparent);
  transition: opacity .25s ease, transform .25s ease;
}
.portal:hover .p-orbit { opacity: 1; animation: pSpin 6s linear infinite; }
@keyframes pSpin { to { transform: rotate(360deg); } }
.p-body h2 {
  font-family: var(--disp); font-size: 1.05rem; letter-spacing: .32em; margin: 0 0 .5rem;
  text-shadow: 0 0 12px color-mix(in srgb, var(--pc) 45%, transparent);
}
.p-body p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .92rem; }
.p-meta { display: flex; justify-content: space-between; align-items: center; margin-top: .9rem; font-size: .72rem; letter-spacing: .18em; color: var(--pc); }
.p-go { font-family: var(--disp); font-size: .68rem; opacity: 0; transform: translateX(-6px); transition: all .22s ease; }
.portal:hover .p-go { opacity: 1; transform: translateX(0); }

/* ---------- footer ---------- */
.foot {
  position: relative; z-index: 3; text-align: center; padding: 0 20px 5vh;
  color: var(--muted); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase;
}
.made-with { display: flex; justify-content: center; align-items: center; gap: .55rem; margin-top: 1.1rem; flex-wrap: wrap; }
.mw-label { font-size: .58rem; letter-spacing: .3em; color: #5b6f86; margin-right: .2rem; }
.mw-chip {
  font-family: var(--disp); font-size: .58rem; font-weight: 600; letter-spacing: .22em;
  padding: .34rem .7rem; border-radius: 99px; text-decoration: none; cursor: pointer;
  color: var(--cyan-soft); border: 1px solid rgba(34,211,238,.28);
  background: rgba(12,20,36,.5);
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.mw-chip:hover { border-color: rgba(34,211,238,.6); box-shadow: 0 0 12px rgba(34,211,238,.18); color: #eaf6ff; }
.mw-chip.t3 { color: var(--violet); border-color: rgba(167,139,250,.32); }
.mw-chip.t3:hover { border-color: rgba(167,139,250,.65); box-shadow: 0 0 12px rgba(167,139,250,.2); color: #f1eaff; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; animation: ledPulse 2.2s ease-in-out infinite; }
.led.green { background: var(--green); box-shadow: 0 0 8px rgba(74,222,128,.9); }
@keyframes ledPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

@media (max-width: 760px) {
  .portals { grid-template-columns: 1fr; }
  .hud-corner, .station-ring { display: none; }
  .planet-earth { top: -260px; right: -220px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
