/* 282racing immersive landing v3 */

:root {
  --bg: #050808;
  --surface: #0f1412;
  --surface-elevated: #171f1a;
  --border: #1f4730;
  --text-primary: #c7ffd1;
  --text-secondary: #599e6b;
  --accent: #e00500;
  --terminal: #33f273;
  --terminal-dim: #1f733d;
  --cyan: #33d9ff;
  --magenta: #ff2bd6;
  --warning: #ffc733;
  --font: "IBM Plex Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;
  --nav-h: 3.25rem;
  --scroll: 0;
  --mx: 0.5;
  --my: 0.5;
  --vx: 0;
  --vy: 0;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: none;
}

body.is-touch { cursor: auto; }
body.is-touch .cursor { display: none !important; }

a { color: var(--terminal); text-decoration: none; }
a:hover { color: var(--text-primary); }

button { font-family: inherit; }

/* —— Custom cursor —— */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  mix-blend-mode: difference;
  opacity: 0;
  transition: opacity 0.3s;
}

body.has-cursor .cursor { opacity: 1; }

.cursor-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #fff;
}

.cursor-ring {
  position: absolute;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  transition: width 0.25s, height 0.25s, margin 0.25s, border-color 0.25s;
}

.cursor.is-hot .cursor-ring {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-color: var(--terminal);
}

.cursor.is-ghost .cursor-ring {
  border-color: var(--accent);
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
}

/* —— Atmosphere —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #050808;
  overflow: hidden;
}

.atmosphere-grid {
  position: absolute;
  inset: -30%;
  background-image:
    linear-gradient(rgba(51, 242, 115, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 242, 115, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  transform:
    translate3d(
      calc((var(--mx) - 0.5) * 40px),
      calc(var(--scroll) * -100px + (var(--my) - 0.5) * 30px),
      0
    )
    perspective(800px)
    rotateX(calc((var(--my) - 0.5) * 4deg));
  will-change: transform;
  mask-image: radial-gradient(ellipse 75% 65% at 50% 28%, #000 15%, transparent 72%);
}

.atmosphere-signals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.atmosphere-beam {
  position: absolute;
  width: 40vmax;
  height: 40vmax;
  left: calc(var(--mx) * 100%);
  top: calc(var(--my) * 100%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(51, 242, 115, 0.12), transparent 60%);
  transition: opacity 0.4s;
  opacity: 0.8;
}

.atmosphere-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(0, 0, 0, 0.2) 3px 4px
  );
  opacity: 0.35;
  animation: scan-drift 9s linear infinite;
}

.atmosphere-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% 8%, rgba(51, 242, 115, 0.08), transparent 48%),
    radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.7) 100%);
}

.atmosphere-noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noise-flicker 0.35s steps(2) infinite;
}

@keyframes scan-drift {
  from { transform: translateY(0); }
  to { transform: translateY(6px); }
}

@keyframes noise-flicker {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-1%, 1%); }
}

/* —— Scroll progress / HUD —— */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 50;
}

.scroll-progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--terminal), var(--cyan));
  box-shadow: 0 0 14px var(--terminal);
}

.scroll-hud {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  pointer-events: none;
  opacity: 0.7;
}

.scroll-hud span:first-child {
  color: var(--terminal);
  font-weight: 700;
}

/* —— Nav —— */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  background: rgba(5, 8, 8, 0.55);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s, background 0.35s, transform 0.4s;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
  background: rgba(5, 8, 8, 0.88);
}

.nav-brand {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--terminal);
  display: inline-block;
  transition: transform 0.25s, text-shadow 0.25s;
}

.nav-brand:hover {
  text-shadow: 0 0 18px rgba(51, 242, 115, 0.6);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: flex-end;
}

.nav-links a {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  position: relative;
  display: inline-block;
  transition: color 0.25s, transform 0.25s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--terminal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--terminal);
}

.nav-links a.is-active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}

@media (max-width: 640px) {
  .nav-links a:not(:last-child) { display: none; }
  .scroll-hud { display: none; }
}

/* —— Page —— */
.page { position: relative; z-index: 1; }

/* —— Hero —— */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(var(--nav-h) + 1.5rem) clamp(1.25rem, 5vw, 3.5rem) 4rem;
  max-width: 58rem;
  margin: 0 auto;
  position: relative;
}

.hero-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.pulse {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--terminal);
  box-shadow: 0 0 12px var(--terminal);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.brand-stage {
  position: relative;
  width: min(100%, 44rem);
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  isolation: isolate;
  cursor: none;
  transform-style: preserve-3d;
  will-change: transform;
  transition: filter 0.3s;
}

.brand-base {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 28px rgba(51, 242, 115, 0.18));
}

.brand-glitch {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.brand-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  will-change: transform, opacity, clip-path;
}

.brand-stage.is-glitching .brand-cyan {
  opacity: 0.9;
  transform: translate3d(-6px, 0, 0);
  filter: brightness(1.15) saturate(1.6) hue-rotate(155deg);
  mix-blend-mode: screen;
  clip-path: inset(8% 0 58% 0);
}

.brand-stage.is-glitching .brand-magenta {
  opacity: 0.85;
  transform: translate3d(7px, 1px, 0);
  filter: brightness(1.1) saturate(1.8) hue-rotate(-55deg);
  mix-blend-mode: screen;
  clip-path: inset(52% 0 8% 0);
}

.brand-stage.is-glitching .brand-base {
  animation: brand-shake 0.16s steps(2) infinite;
  filter:
    drop-shadow(-4px 0 0 rgba(255, 43, 214, 0.65))
    drop-shadow(4px 0 0 rgba(51, 217, 255, 0.65))
    drop-shadow(0 0 28px rgba(51, 242, 115, 0.3));
}

@keyframes brand-shake {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(-3px, 1px, 0); }
  50% { transform: translate3d(3px, -1px, 0); }
  75% { transform: translate3d(1px, 2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.brand-slices {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}

.brand-slice {
  position: absolute;
  left: 0;
  width: 100%;
  height: 14%;
  overflow: hidden;
  opacity: 0;
  will-change: transform, opacity;
}

.brand-slice img {
  position: absolute;
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  display: block;
}

.brand-stage.is-glitching .brand-slice { opacity: 1; }

.brand-noise {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0 1px,
    transparent 1px 3px
  );
  mix-blend-mode: overlay;
}

.brand-stage.is-glitching .brand-noise {
  opacity: 0.55;
  animation: noise-shift 0.12s steps(3) infinite;
}

@keyframes noise-shift {
  from { transform: translateX(0); }
  to { transform: translateX(-6px); }
}

.brand-flare {
  position: absolute;
  inset: -20%;
  z-index: 0;
  background: radial-gradient(circle at 50% 50%, rgba(51, 242, 115, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.brand-stage:hover .brand-flare,
.brand-stage.is-glitching .brand-flare { opacity: 1; }

.headline {
  margin: 0 0 0.85rem;
  font-size: clamp(1.5rem, 5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.15;
}

.headline-line { display: block; color: var(--text-secondary); }
.headline-line.accent {
  color: var(--terminal);
  text-shadow: 0 0 24px rgba(51, 242, 115, 0.4);
}

.lede {
  margin: 0 0 1.75rem;
  max-width: 28rem;
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  color: var(--text-primary);
}

.blink {
  display: inline-block;
  color: var(--terminal);
  animation: blink 1.05s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1.25rem;
}

.cta-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.45rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--terminal);
  border: 1px solid var(--terminal);
  box-shadow: 0 0 32px rgba(51, 242, 115, 0.28);
  cursor: none;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.cta-soon::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: translateX(-120%);
  animation: sheen 3.5s ease-in-out infinite;
}

@keyframes sheen {
  0%, 60% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

.cta-ghost {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  display: inline-block;
  transition: color 0.25s, border-color 0.25s, transform 0.25s;
}

.cta-ghost:hover {
  color: var(--terminal);
  border-bottom-color: var(--terminal);
}

.hero-telemetry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 2rem;
  max-width: 32rem;
}

.tel-item {
  border: 1px solid var(--border);
  background: rgba(15, 20, 18, 0.6);
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.tel-item:hover {
  border-color: var(--terminal);
  box-shadow: 0 0 20px rgba(51, 242, 115, 0.12);
  transform: translateY(-2px);
}

.tel-item span {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

.tel-item strong {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--terminal);
  letter-spacing: 0.06em;
}

.hero-boot {
  margin-top: 1.75rem;
  max-width: 28rem;
  opacity: 0.5;
}

.boot-log {
  margin: 0;
  font-family: inherit;
  font-size: 0.68rem;
  line-height: 1.7;
  color: var(--terminal-dim);
  min-height: 4.5rem;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  width: 1.5rem;
  height: 2.4rem;
  border: 1px solid var(--border);
  background: transparent;
  padding: 0;
  cursor: none;
}

.scroll-cue span {
  display: block;
  width: 3px;
  height: 3px;
  margin: 0.4rem auto 0;
  border-radius: 50%;
  background: var(--terminal);
  animation: cue-drop 1.6s ease-in-out infinite;
  box-shadow: 0 0 8px var(--terminal);
}

@keyframes cue-drop {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(1.2rem); opacity: 0; }
  100% { transform: translateY(1.2rem); opacity: 0; }
}

@media (max-width: 640px) {
  .hero-telemetry { grid-template-columns: repeat(2, 1fr); }
}

/* —— Feature sections —— */
.feature {
  position: relative;
  min-height: 170vh;
  border-top: 1px solid var(--border);
}

.feature-sticky {
  position: sticky;
  top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  max-width: 72rem;
  margin: 0 auto;
}

.feature-sticky--flip .feature-copy { order: 2; }
.feature-sticky--flip .feature-stage { order: 1; }

.feature-center {
  position: sticky;
  top: var(--nav-h);
  min-height: calc(100vh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 6vw, 4rem);
  max-width: 42rem;
  margin: 0 auto;
}

.feature-label {
  margin: 0 0 0.85rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.label-bar {
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  background: var(--terminal);
  box-shadow: 0 0 10px var(--terminal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}

.feature.is-in .label-bar { transform: scaleX(1); }

.feature h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.1;
  color: var(--text-primary);
}

.feature--ghost h2 {
  color: var(--terminal);
  text-shadow: 0 0 30px rgba(51, 242, 115, 0.25);
}

.feature-text {
  margin: 0;
  max-width: 26rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.feature-text.wide { max-width: 34rem; margin-bottom: 1.5rem; }

.feature-hint {
  margin: 1rem 0 0;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terminal-dim);
}

.feature-stage {
  position: relative;
  min-height: min(52vh, 420px);
  transform-style: preserve-3d;
  will-change: transform;
}

.feature-copy {
  will-change: transform, opacity;
}

/* Map */
.map-sim {
  position: relative;
  height: min(52vh, 420px);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(51, 242, 115, 0.06);
  transition: border-color 0.35s, box-shadow 0.35s;
}

.map-sim.is-locked {
  border-color: var(--cyan);
  box-shadow: 0 0 50px rgba(51, 217, 255, 0.15);
}

.map-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.map-links line {
  stroke: rgba(51, 242, 115, 0.35);
  stroke-width: 0.35;
  stroke-dasharray: 2 2;
  animation: dash-move 1.2s linear infinite;
}

.map-links line.is-active {
  stroke: var(--cyan);
  stroke-width: 0.55;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 2px var(--cyan));
}

@keyframes dash-move {
  to { stroke-dashoffset: -8; }
}

.map-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(51, 242, 115, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 242, 115, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  transform: scale(1.15);
  animation: map-drift 18s linear infinite;
}

@keyframes map-drift {
  from { transform: translate(0, 0) scale(1.15); }
  to { transform: translate(-28px, -28px) scale(1.15); }
}

.map-radar {
  position: absolute;
  left: 48%;
  top: 52%;
  width: 55%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(51, 242, 115, 0.2);
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(51, 242, 115, 0.25) 100%);
  animation: radar-spin 4.5s linear infinite;
  opacity: 0.7;
}

@keyframes radar-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.map-crosshair {
  position: absolute;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  left: 48%;
  top: 52%;
  border: 1px solid var(--cyan);
  opacity: 0;
  z-index: 4;
  pointer-events: none;
  transition: left 0.35s ease, top 0.35s ease, opacity 0.3s;
}

.map-crosshair::before,
.map-crosshair::after {
  content: "";
  position: absolute;
  background: var(--cyan);
}

.map-crosshair::before {
  left: 50%;
  top: -6px;
  bottom: -6px;
  width: 1px;
  transform: translateX(-50%);
}

.map-crosshair::after {
  top: 50%;
  left: -6px;
  right: -6px;
  height: 1px;
  transform: translateY(-50%);
}

.map-sim.is-locked .map-crosshair { opacity: 0.9; }

.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  padding: 0.25rem 0.45rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border: 1px solid currentColor;
  background: rgba(5, 8, 8, 0.75);
  z-index: 2;
  cursor: none;
  color: inherit;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
}

.map-pin--you {
  color: var(--cyan);
  box-shadow: 0 0 16px rgba(51, 217, 255, 0.35);
}

.map-pin--friend {
  color: var(--terminal);
  animation: pin-float 4.5s ease-in-out infinite;
}

.map-pin--friend:nth-of-type(2) { animation-delay: -1.2s; }
.map-pin--friend:nth-of-type(3) { animation-delay: -2.4s; }

@keyframes pin-float {
  0%, 100% { transform: translate(-50%, -50%); }
  50% { transform: translate(-50%, calc(-50% - 6px)); }
}

.map-pin--friend::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid currentColor;
  opacity: 0;
}

.map-pin--friend[data-ping]::after {
  animation: pin-ping 2.4s ease-out infinite;
}

@keyframes pin-ping {
  0% { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(1.8); opacity: 0; }
}

.map-pin:hover,
.map-pin.is-active {
  transform: translate(-50%, -50%) scale(1.2);
  background: rgba(15, 20, 18, 0.95);
  z-index: 5;
  animation: none;
}

.map-pin.is-active {
  box-shadow: 0 0 22px currentColor;
}

.map-hud {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  background: rgba(5, 8, 8, 0.85);
  border-top: 1px solid var(--border);
  z-index: 3;
}

.map-hud-live { color: var(--terminal); }

/* Friends terminal */
.terminal-panel {
  height: min(52vh, 420px);
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(224, 5, 0, 0.05);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.terminal-dots::before {
  content: "● ● ●";
  letter-spacing: 0.15em;
  color: var(--terminal-dim);
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0.75rem;
  flex: 1;
  overflow: auto;
}

.friend {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.15rem;
  padding: 0.75rem 0.65rem;
  border-bottom: 1px solid rgba(31, 71, 48, 0.5);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: background 0.25s, color 0.25s, transform 0.25s, border-color 0.25s;
  cursor: none;
  outline: none;
}

.friend .dot {
  grid-row: 1 / span 2;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--terminal-dim);
}

.friend-name { grid-column: 2; }
.friend em {
  grid-column: 3;
  grid-row: 1;
  font-style: normal;
  font-size: 0.7rem;
  color: var(--terminal-dim);
}

.friend-meta,
.friend-actions {
  grid-column: 2 / span 2;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--terminal-dim);
  text-transform: uppercase;
}

.friend-actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.friend-actions button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  padding: 0.25rem 0.45rem;
  cursor: none;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.friend-actions [data-accept]:hover {
  color: var(--terminal);
  border-color: var(--terminal);
  background: rgba(51, 242, 115, 0.08);
}

.friend-actions [data-deny]:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(224, 5, 0, 0.08);
}

.friend.is-online { color: var(--text-primary); }
.friend.is-online .dot {
  background: var(--terminal);
  box-shadow: 0 0 8px var(--terminal);
}

.friend.is-pending { color: var(--warning); }
.friend.is-pending .dot { background: var(--warning); }

.friend:hover,
.friend:focus-visible,
.friend.is-selected {
  background: var(--surface-elevated);
  transform: translateX(6px);
  border-color: var(--border);
}

.friend.is-selected {
  box-shadow: inset 2px 0 0 var(--terminal);
}

.friend.is-denied {
  opacity: 0.35;
  pointer-events: none;
  text-decoration: line-through;
}

.terminal-footer {
  padding: 0.55rem 0.9rem;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--terminal-dim);
  border-top: 1px solid var(--border);
  min-height: 2rem;
}

/* Ghost */
.ghost-viz {
  position: relative;
  height: min(52vh, 420px);
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  place-items: center;
  overflow: hidden;
  transition: border-color 0.5s, box-shadow 0.5s, background 0.5s;
}

.ghost-rings {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.ghost-rings span {
  position: absolute;
  width: 28%;
  aspect-ratio: 1;
  border: 1px solid rgba(51, 242, 115, 0.25);
  border-radius: 50%;
  animation: ring-pulse 3.2s ease-out infinite;
}

.ghost-rings span:nth-child(2) { width: 42%; animation-delay: 0.6s; }
.ghost-rings span:nth-child(3) { width: 58%; animation-delay: 1.2s; }

@keyframes ring-pulse {
  0% { transform: scale(0.85); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}

.ghost-silhouette {
  width: min(42%, 160px);
  aspect-ratio: 3 / 5;
  background: linear-gradient(180deg, rgba(51, 242, 115, 0.4), rgba(51, 242, 115, 0.05));
  clip-path: polygon(50% 0%, 70% 18%, 68% 38%, 85% 70%, 72% 100%, 28% 100%, 15% 70%, 32% 38%, 30% 18%);
  filter: blur(0.5px);
  transition: opacity 0.6s, filter 0.6s, transform 0.6s, background 0.6s;
  box-shadow: 0 0 40px rgba(51, 242, 115, 0.25);
  z-index: 2;
}

.ghost-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.ghost-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px var(--accent);
}

.ghost-scan {
  position: absolute;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--terminal);
  box-shadow: 0 0 20px var(--terminal);
  animation: ghost-scan 3.2s ease-in-out infinite;
  opacity: 0.7;
  z-index: 4;
}

@keyframes ghost-scan {
  0%, 100% { top: 18%; opacity: 0.2; }
  50% { top: 78%; opacity: 0.9; }
}

.ghost-caption {
  position: absolute;
  bottom: 1rem;
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--terminal);
  z-index: 5;
  transition: color 0.4s;
}

.ghost-viz.is-ghosted {
  border-color: rgba(224, 5, 0, 0.5);
  box-shadow: 0 0 50px rgba(224, 5, 0, 0.12);
  background: #0a0808;
}

.ghost-viz.is-ghosted .ghost-silhouette {
  opacity: 0.12;
  filter: blur(10px);
  transform: scale(1.08);
  background: linear-gradient(180deg, rgba(224, 5, 0, 0.35), transparent);
}

.ghost-viz.is-ghosted .ghost-caption { color: var(--accent); }
.ghost-viz.is-ghosted .ghost-scan {
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
}

.ghost-viz.is-ghosted .ghost-rings span {
  border-color: rgba(224, 5, 0, 0.3);
}

.ghost-toggle {
  margin-top: 1.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  border: 0;
  background: none;
  cursor: none;
  color: var(--text-secondary);
}

.ghost-toggle-track {
  width: 3.2rem;
  height: 1.55rem;
  border: 1px solid var(--border);
  background: var(--surface);
  position: relative;
  transition: border-color 0.3s, background 0.3s;
}

.ghost-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.55rem - 6px);
  height: calc(1.55rem - 6px);
  background: var(--terminal);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.3s;
}

.ghost-toggle[aria-pressed="true"] .ghost-toggle-track {
  border-color: var(--accent);
  background: rgba(224, 5, 0, 0.12);
}

.ghost-toggle[aria-pressed="true"] .ghost-toggle-thumb {
  transform: translateX(1.55rem);
  background: var(--accent);
}

.ghost-toggle-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ghost-toggle[aria-pressed="true"] .ghost-toggle-label { color: var(--accent); }

/* Grid stats */
.grid-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  max-width: 28rem;
}

.grid-stat {
  border: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  text-align: center;
  background: rgba(15, 20, 18, 0.5);
  transition: border-color 0.3s, transform 0.3s;
}

.grid-stat:hover {
  border-color: var(--terminal);
  transform: translateY(-3px);
}

.grid-stat strong {
  display: block;
  font-size: 1.4rem;
  color: var(--terminal);
  letter-spacing: 0.08em;
}

.grid-stat span {
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
}

/* Reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.feature.is-in .feature-copy {
  animation: feature-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.feature.is-in .feature-stage {
  animation: feature-in 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

@keyframes feature-in {
  from { opacity: 0; transform: translateY(28px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Footer */
.site-footer {
  padding: 2.5rem clamp(1.25rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  max-width: 72rem;
  margin: 0 auto;
}

.site-footer a { color: var(--text-secondary); }
.site-footer a:hover { color: var(--terminal); }

@media (max-width: 860px) {
  .feature { min-height: auto; }
  .feature-sticky,
  .feature-sticky--flip {
    position: relative;
    top: auto;
    min-height: auto;
    grid-template-columns: 1fr;
    padding-block: 3.5rem;
  }
  .feature-sticky--flip .feature-copy,
  .feature-sticky--flip .feature-stage { order: initial; }
  .feature-center {
    position: relative;
    top: auto;
    min-height: auto;
    padding-block: 4rem;
  }
  .map-sim,
  .terminal-panel,
  .ghost-viz { height: 280px; }
  body { cursor: auto; }
  .cursor { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere-scan,
  .atmosphere-noise,
  .map-grid,
  .map-radar,
  .ghost-scan,
  .ghost-rings span,
  .pulse,
  .blink,
  .scroll-cue span,
  .cta-soon::before,
  .map-links line,
  .brand-stage.is-glitching .brand-base,
  .brand-stage.is-glitching .brand-noise,
  .map-pin--friend {
    animation: none !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  body { cursor: auto; }
  .cursor { display: none !important; }
}
