/* ═══════════════════════════════════════════════════════════════
   AEGIS NEXUS — Interactive Cyber Attack Simulation Platform
   Boot sequence → Terminal → Live Map → Game → Sound Design
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&family=Rajdhani:wght@400;500;600;700&display=swap');

:root {
  --bg:         #020408;
  --panel:      rgba(0, 18, 36, 0.7);
  --border:     rgba(0, 255, 200, 0.08);
  --border-hi:  rgba(0, 255, 200, 0.3);
  --cyan:       #00ffc8;
  --cyan2:      #00b8ff;
  --red:        #ff003c;
  --amber:      #ffa600;
  --green:      #00ff6a;
  --violet:     #a855f7;
  --pink:       #ff2d95;
  --text:       #c8f0e8;
  --text-dim:   #4a7a6a;
  --text-mute:  #1a3a2a;
  --mono:       'Fira Code', monospace;
  --head:       'Orbitron', sans-serif;
  --body:       'Rajdhani', sans-serif;
  --ease:       cubic-bezier(.25,.46,.45,.94);
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--cyan); border-radius: 3px; }

/* ═══════ BOOT SEQUENCE OVERLAY ═══════ */
#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10% 12%;
  transition: opacity 0.8s, visibility 0.8s;
}
#boot-screen.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#boot-lines {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.9;
  color: var(--cyan);
}
#boot-lines .line { opacity: 0; transform: translateX(-10px); }
#boot-lines .line.show { opacity: 1; transform: translateX(0); transition: opacity 0.15s, transform 0.15s; }
#boot-lines .ok   { color: var(--green); }
#boot-lines .warn { color: var(--amber); }
#boot-lines .err  { color: var(--red); }
#boot-lines .dim  { color: var(--text-dim); }
#boot-progress {
  margin-top: 30px;
  height: 3px;
  background: var(--text-mute);
  border-radius: 2px;
  overflow: hidden;
}
#boot-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--cyan2));
  border-radius: 2px;
  transition: width 0.15s;
  box-shadow: 0 0 10px var(--cyan);
}
.boot-logo {
  font-family: var(--head);
  font-size: 1.4rem;
  letter-spacing: 6px;
  color: var(--cyan);
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(0,255,200,0.4);
}

/* ═══════ GRID BACKGROUND ═══════ */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,200,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,200,0.02) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* ═══════ SCANLINE ═══════ */
.scanline-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 9998;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}

/* ═══════ ANIMATIONS ═══════ */
@keyframes fadeUp { from { opacity:0; transform:translateY(30px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.3; } }
@keyframes blink { 0%,100%{ opacity:1; } 50%{ opacity:0; } }
@keyframes float { 0%,100%{ transform:translateY(0); } 50%{ transform:translateY(-12px); } }
@keyframes glitch1 {
  0%   { clip-path: inset(40% 0 61% 0); transform: translate(-2px, 2px); }
  20%  { clip-path: inset(92% 0 1% 0);  transform: translate(1px, -1px); }
  40%  { clip-path: inset(43% 0 1% 0);  transform: translate(-1px, 3px); }
  60%  { clip-path: inset(25% 0 58% 0); transform: translate(3px, 1px); }
  80%  { clip-path: inset(54% 0 7% 0);  transform: translate(-3px, -2px); }
  100% { clip-path: inset(58% 0 43% 0); transform: translate(2px, -3px); }
}
@keyframes glitch2 {
  0%   { clip-path: inset(65% 0 10% 0); transform: translate(3px, -1px); }
  20%  { clip-path: inset(15% 0 65% 0); transform: translate(-2px, 2px); }
  40%  { clip-path: inset(80% 0 5% 0);  transform: translate(1px, 1px); }
  60%  { clip-path: inset(5% 0 75% 0);  transform: translate(-3px, -2px); }
  80%  { clip-path: inset(40% 0 30% 0); transform: translate(2px, 3px); }
  100% { clip-path: inset(55% 0 35% 0); transform: translate(-1px, 1px); }
}
@keyframes scan-beam {
  0% { top: -5%; } 100% { top: 105%; }
}
@keyframes ring-draw {
  from { stroke-dashoffset: 283; }
}
@keyframes dotPulse {
  0%,100% { r: 3; opacity: 1; }
  50% { r: 6; opacity: 0.5; }
}
@keyframes arcDraw {
  from { stroke-dashoffset: 300; }
  to   { stroke-dashoffset: 0; }
}
@keyframes statusPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,255,106,0.4); }
  50%     { box-shadow: 0 0 0 8px rgba(0,255,106,0); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.reveal { opacity:0; transform:translateY(30px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ═══════ GLASS ═══════ */
.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.glass:hover { border-color: var(--border-hi); }

/* ═══════ GLITCH TEXT ═══════ */
.glitch {
  position: relative;
  display: inline-block;
}
.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.glitch::before {
  color: var(--red);
  animation: glitch1 3s infinite linear alternate-reverse;
  z-index: -1;
}
.glitch::after {
  color: var(--cyan2);
  animation: glitch2 2s infinite linear alternate-reverse;
  z-index: -1;
}

/* ═══════ TOPBAR ═══════ */
.topbar {
  position: fixed; top: 0; left: 0; width: 100%;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  z-index: 500;
  border-bottom: 1px solid transparent;
  transition: 0.4s;
}
.topbar.scrolled {
  background: rgba(2,4,8,0.92);
  backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}
.logo {
  font-family: var(--head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(0,255,200,0.3);
  display: flex; align-items: center; gap: 8px;
}
.logo img { width: 28px; height: 28px; border-radius: 4px; filter: drop-shadow(0 0 6px rgba(0,255,200,0.4)); }
.nav-links {
  display: flex; align-items: center; gap: 24px;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  transition: 0.3s;
}
.nav-links a:hover, .nav-links a.active { color: var(--cyan); }
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--cyan);
  box-shadow: 0 0 6px rgba(0,255,200,0.5);
  transition: width 0.3s;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.topbar-clock {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex; align-items: center; gap: 8px;
}
.topbar-clock .live-dot {
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  animation: statusPulse 2s infinite;
}

.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; padding: 4px; z-index: 501;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ═══════ CONTAINER ═══════ */
.container { max-width: 1300px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

/* ═══════ SECTION HEADERS ═══════ */
.sec-head { text-align: center; margin-bottom: 48px; }
.sec-label { font-family: var(--mono); font-size: 0.75rem; color: var(--cyan); letter-spacing: 4px; text-transform: uppercase; margin-bottom: 8px; }
.sec-title { font-family: var(--head); font-size: clamp(1.6rem,3.5vw,2.4rem); font-weight: 800; letter-spacing: 2px; }
.sec-title .hl {
  background: linear-gradient(135deg, var(--cyan), var(--cyan2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.sec-line { width: 40px; height: 3px; margin: 12px auto 0; background: var(--cyan); border-radius: 2px; box-shadow: 0 0 8px rgba(0,255,200,0.4); }

/* ═══════ HERO ═══════ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 80px 24px 40px;
  position: relative;
  z-index: 1;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 50px;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}
.hero-text { z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.72rem; color: var(--green);
  padding: 5px 14px; border-radius: 20px;
  border: 1px solid rgba(0,255,106,0.2);
  background: rgba(0,255,106,0.04);
  margin-bottom: 18px;
  animation: fadeUp 0.5s var(--ease) both;
}
.hero-badge .dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; animation: statusPulse 2s infinite; }
.hero-title {
  font-family: var(--head); font-size: clamp(2.4rem,5vw,4.2rem);
  font-weight: 900; letter-spacing: 2px; line-height: 1.1;
  margin-bottom: 10px;
  animation: fadeUp 0.5s var(--ease) 0.1s both;
}
.hero-sub {
  font-family: var(--mono); font-size: 0.95rem; color: var(--cyan);
  margin-bottom: 18px; min-height: 1.5em;
  animation: fadeUp 0.5s var(--ease) 0.2s both;
}
.hero-sub .cursor { display: inline-block; width: 2px; height: 1.1em; background: var(--cyan); margin-left: 2px; vertical-align: text-bottom; animation: blink 0.9s step-end infinite; }
.hero-desc {
  font-size: 1rem; color: var(--text-dim); max-width: 480px;
  line-height: 1.7; margin-bottom: 24px;
  animation: fadeUp 0.5s var(--ease) 0.3s both;
}
.hero-btns {
  display: flex; gap: 12px; flex-wrap: wrap;
  animation: fadeUp 0.5s var(--ease) 0.4s both;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-family: var(--head); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 1px; text-transform: uppercase;
  border: none; transition: transform 0.3s, box-shadow 0.3s;
}
.btn-neon { background: linear-gradient(135deg, rgba(0,255,200,0.15), rgba(0,184,255,0.15)); border: 1px solid var(--border-hi); color: var(--cyan); }
.btn-neon:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,255,200,0.2); background: linear-gradient(135deg, rgba(0,255,200,0.25), rgba(0,184,255,0.25)); }
.btn-solid { background: var(--cyan); color: var(--bg); }
.btn-solid:hover { transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,255,200,0.35); }

/* Hero: Live SVG Map */
.hero-map {
  position: relative;
  animation: fadeUp 0.8s var(--ease) 0.2s both;
}
#world-map { width: 100%; height: auto; }
#world-map .land { fill: rgba(0,255,200,0.06); stroke: rgba(0,255,200,0.12); stroke-width: 0.5; }
#world-map .attack-arc { fill: none; stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 300; animation: arcDraw 2s ease forwards; opacity: 0.7; filter: drop-shadow(0 0 4px var(--red)); }
#world-map .defense-arc { fill: none; stroke: var(--cyan); stroke-width: 1.5; stroke-dasharray: 300; animation: arcDraw 2.5s ease forwards; opacity: 0.7; filter: drop-shadow(0 0 4px var(--cyan)); }
#world-map .city { fill: var(--cyan); animation: dotPulse 2s ease-in-out infinite; cursor: pointer; }
#world-map .city.threat { fill: var(--red); }
#world-map .city.neutralized { fill: var(--green); transition: fill 0.3s; }
.map-legend {
  display: flex; gap: 16px; margin-top: 12px; justify-content: center;
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim);
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.map-legend .dot.r { background: var(--red); }
.map-legend .dot.c { background: var(--cyan); }
.map-legend .dot.g { background: var(--green); }

.score-float {
  position: absolute; top: 10px; right: 10px;
  font-family: var(--head); font-size: 1.2rem; font-weight: 800;
  color: var(--cyan); padding: 8px 16px; border-radius: 10px;
  background: rgba(0,18,36,0.8); border: 1px solid var(--border);
}
.score-float .label { font-family: var(--mono); font-size: 0.6rem; color: var(--text-dim); display: block; letter-spacing: 2px; }

/* ═══════ INTERACTIVE TERMINAL ═══════ */
.terminal-section { padding: 80px 24px; z-index: 1; position: relative; }
.terminal-window {
  max-width: 900px; margin: 0 auto;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(0,255,200,0.05);
}
.terminal-bar {
  background: rgba(0,18,36,0.9);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot.r { background: #ff5f57; }
.terminal-dot.y { background: #ffbd2e; }
.terminal-dot.g { background: #28c840; }
.terminal-title {
  flex: 1; text-align: center;
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-dim); letter-spacing: 1px;
}
.terminal-body {
  background: rgba(0,6,14,0.95);
  padding: 20px;
  min-height: 350px;
  max-height: 450px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.8;
}
.terminal-body .output-line { white-space: pre-wrap; word-break: break-all; }
.terminal-body .output-line.sys { color: var(--cyan); }
.terminal-body .output-line.ok  { color: var(--green); }
.terminal-body .output-line.err { color: var(--red); }
.terminal-body .output-line.warn { color: var(--amber); }
.terminal-body .output-line.info { color: var(--text-dim); }
.terminal-body .output-line.art { color: var(--cyan); opacity: 0.7; }
.terminal-input-row {
  display: flex; align-items: center; gap: 0;
  margin-top: 8px;
}
.terminal-prompt {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.8rem;
  white-space: nowrap;
}
#terminal-input {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  caret-color: var(--cyan);
  padding-left: 4px;
}

/* ═══════ STATS ═══════ */
.stats-section { padding: 80px 24px; z-index: 1; position: relative; }
.stats-row {
  display: grid; grid-template-columns: repeat(4,1fr); gap: 18px;
  max-width: 1300px; margin: 0 auto;
}
.stat-card {
  padding: 24px 16px; text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative; overflow: hidden;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,255,200,0.15); }
.stat-card::before { content:''; position: absolute; top:0; left:0; right:0; height: 2px; }
.stat-card.c::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.stat-card.r::before { background: var(--red); box-shadow: 0 0 10px var(--red); }
.stat-card.g::before { background: var(--green); box-shadow: 0 0 10px var(--green); }
.stat-card.v::before { background: var(--violet); box-shadow: 0 0 10px var(--violet); }
.stat-icon { font-size: 1.6rem; margin-bottom: 8px; }
.stat-num { font-family: var(--head); font-size: 2rem; font-weight: 900; margin-bottom: 4px; }
.stat-card.c .stat-num { color: var(--cyan); }
.stat-card.r .stat-num { color: var(--red); }
.stat-card.g .stat-num { color: var(--green); }
.stat-card.v .stat-num { color: var(--violet); }
.stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* ═══════ FEATURES ═══════ */
.features { padding: 80px 24px; z-index: 1; position: relative; }
.features-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 20px;
  max-width: 1300px; margin: 0 auto;
}
.feat-card {
  padding: 28px 22px;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}
.feat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 35px rgba(0,255,200,0.12); }
.feat-card .feat-icon { font-size: 2rem; margin-bottom: 14px; }
.feat-card h3 { font-family: var(--head); font-size: 0.95rem; font-weight: 700; letter-spacing: 1px; margin-bottom: 10px; }
.feat-card p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.6; }
.feat-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ft {
  padding: 3px 10px; font-size: 0.65rem; font-weight: 600; border-radius: 5px;
  background: rgba(0,255,200,0.06); border: 1px solid rgba(0,255,200,0.1);
  color: var(--text-dim);
}

/* ═══════ HEX STREAM ═══════ */
.hex-section { padding: 40px 24px; z-index: 1; position: relative; overflow: hidden; }
.hex-stream {
  font-family: var(--mono); font-size: 0.6rem; color: rgba(0,255,200,0.08);
  white-space: nowrap; overflow: hidden;
  line-height: 1.6; max-height: 80px;
  text-align: center;
  user-select: none;
}

/* ═══════ FOOTER ═══════ */
.footer {
  padding: 40px 24px 20px;
  border-top: 1px solid var(--border);
  z-index: 1; position: relative;
}
.footer-inner {
  max-width: 1300px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
}
.footer p { font-size: 0.72rem; color: var(--text-mute); }
.footer p .hl { color: var(--cyan); }
.footer-links { display: flex; gap: 16px; }
.footer-links a { font-size: 0.72rem; color: var(--text-dim); transition: color 0.3s; }
.footer-links a:hover { color: var(--cyan); }

/* ═══════ RESPONSIVE ═══════ */
@media (max-width:1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-map { order: -1; max-width: 500px; margin: 0 auto; }
  .hero-desc { margin: 0 auto 24px; }
  .hero-btns { justify-content: center; }
  .features-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width:768px) {
  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 0; right: -100%; width: 250px; height: 100vh;
    flex-direction: column; justify-content: center;
    background: rgba(2,4,8,0.97); backdrop-filter: blur(30px);
    padding: 40px; gap: 20px;
    transition: right 0.4s var(--ease);
    border-left: 1px solid var(--border);
  }
  .nav-links.open { right: 0; }
  .topbar-clock { display: none; }
  .stats-row { grid-template-columns: repeat(2,1fr); }
  .features-grid { grid-template-columns: 1fr; }
}
@media (max-width:480px) {
  .hero-title { font-size: 2rem !important; }
  .stats-row { grid-template-columns: 1fr; }
  .terminal-body { min-height: 250px; }
}
