/* ==========================================================================
   PROJECT ODYSSEY — REFINED APPLE TERMINAL DESIGN SYSTEM
   ========================================================================== */

:root {
  --bg: #03070d;
  --panel: rgba(10, 16, 24, 0.78);
  --panel-solid: #0b121c;
  --ink: #edf5f7;
  --muted: #8ea3af;
  --gold: #d8b35b;
  --gold-glow: rgba(216, 179, 91, 0.45);
  --volt: #8bea3d;
  --cyan: #58d7ea;
  --cyan-glow: rgba(88, 215, 234, 0.4);
  --crimson: #ff3366;
  --line: rgba(255, 255, 255, 0.08);
  --line-light: rgba(255, 255, 255, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.65 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
.shell { width: min(1200px, calc(100% - 40px)); margin: auto; }

/* 3D WebGL Canvas Layer */
#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: auto;
}

/* ==========================================================================
   SEAMLESS CINEMATIC PROLOGUE (3 ACTS: 3 PATRIOTS, 3 PASTORS, 1 CONSTITUTION)
   ========================================================================== */
#cinematic-prologue {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #010408;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.4s;
}

#cinematic-prologue.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.prologue-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.prologue-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  transform: scale(1.06);
  pointer-events: none;
}

.prologue-slide.active {
  opacity: 1;
  pointer-events: auto;
  animation: kenBurnsSmooth 7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes kenBurnsSmooth {
  0% { transform: scale(1.06) translate(0, 0); }
  50% { transform: scale(1.02) translate(-0.8%, -0.5%); }
  100% { transform: scale(1.0) translate(0.4%, 0.4%); }
}

.prologue-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(2, 5, 9, 0.2) 0%, rgba(2, 5, 9, 0.78) 100%),
              linear-gradient(180deg, rgba(2, 5, 9, 0.65) 0%, transparent 30%, transparent 65%, rgba(2, 5, 9, 0.95) 100%);
  pointer-events: none;
}

.prologue-caption-box {
  position: relative;
  z-index: 5;
  text-align: center;
  max-width: 1050px;
  padding: 0 24px;
}

.prologue-title {
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(3rem, 8vw, 6.2rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 16px;
  background: linear-gradient(180deg, #ffffff 15%, #d8b35b 80%, #99782e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 45px rgba(216, 179, 91, 0.6));
}

.prologue-title.cyan {
  background: linear-gradient(180deg, #ffffff 15%, #58d7ea 80%, #15798e 100%);
  filter: drop-shadow(0 0 45px rgba(88, 215, 234, 0.6));
}

.prologue-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.85rem, 1.8vw, 1.2rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #cddce5;
  text-transform: uppercase;
  margin: 0 auto;
  max-width: 880px;
  line-height: 1.7;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.9);
}

.prologue-top-bar {
  position: relative;
  z-index: 10;
  padding: 28px 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.prologue-brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.prologue-brand span { color: var(--gold); }

.btn-enter-terminal {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 10px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.25s;
  backdrop-filter: blur(14px);
}
.btn-enter-terminal:hover {
  background: var(--cyan);
  border-color: var(--cyan);
  color: #000;
  box-shadow: 0 0 25px rgba(88, 215, 234, 0.5);
}

/* ==========================================================================
   APPLE TERMINAL WINDOW EXPRESSIONS
   ========================================================================== */
.apple-terminal {
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7), 0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
  overflow: hidden;
  margin-bottom: 28px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-terminal:hover {
  border-color: rgba(88, 215, 234, 0.28);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.8), 0 0 35px rgba(88, 215, 234, 0.08);
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mac-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mac-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.mac-dot.close { background: #ff5f56; box-shadow: 0 0 6px rgba(255,95,86,0.5); }
.mac-dot.min { background: #ffbd2e; box-shadow: 0 0 6px rgba(255,189,46,0.5); }
.mac-dot.max { background: #27c93f; box-shadow: 0 0 6px rgba(39,201,63,0.5); }

.terminal-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-body {
  padding: 28px 32px;
}

/* ==========================================================================
   NAVIGATION & TICKER
   ========================================================================== */
.hud-layer {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hud-header {
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(3, 7, 13, 0.94) 0%, rgba(3, 7, 13, 0) 100%);
  pointer-events: auto;
}

.brand {
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
}
.brand span { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }

.brand-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 12px var(--volt);
  animation: hudPulse 2s infinite;
}
@keyframes hudPulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.8)} }

.hud-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hud-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: all 0.2s;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
}
.hud-link:hover, .hud-link.active {
  color: var(--cyan);
  background: rgba(88, 215, 234, 0.1);
  text-shadow: 0 0 8px var(--cyan);
}

.btn-hud {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-hud:hover {
  background: var(--cyan);
  color: #000;
  border-color: var(--cyan);
  box-shadow: 0 0 18px var(--cyan);
}

.ticker-bar {
  height: 34px;
  background: rgba(3, 7, 13, 0.94);
  border-top: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: tickerScroll 36s linear infinite;
  white-space: nowrap;
}
@keyframes tickerScroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }
.ticker-track span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--cyan);
  padding: 0 28px;
  text-transform: uppercase;
}

/* ==========================================================================
   CONTENT LAYER
   ========================================================================== */
.content-layer {
  position: relative;
  z-index: 20;
  pointer-events: auto;
  padding-top: 14vh;
  padding-bottom: 70px;
}

.page { display: none; animation: fadeIn 0.3s ease; }
.page.visible { display: block; }
@keyframes fadeIn { from{opacity:0.2;transform:translateY(6px)} to{opacity:1;transform:none} }

.hero { padding: 48px 0 36px; text-align: center; }
.kicker {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.74rem;
  margin-bottom: 12px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.8rem);
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin: 0 auto 18px;
  max-width: 980px;
}

.hero .lead {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: #c0d2dc;
  max-width: 860px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.statusline {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 7px 16px;
  color: #c7d5db;
  font-weight: 700;
  font-size: 0.82rem;
}

/* ==========================================================================
   YOUTUBE SPEARHEAD THEATER OVER TOP OF ORBITAL GLOBE
   ========================================================================== */
.spearhead-video-wrap {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(88, 215, 234, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(88, 215, 234, 0.15);
  background: #000;
  aspect-ratio: 16/9;
}
.spearhead-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-action.primary {
  background: linear-gradient(135deg, var(--cyan), #7fe8f5);
  color: #03070d;
}
.btn-action.primary:hover {
  box-shadow: 0 0 20px var(--cyan-glow);
  transform: translateY(-1px);
}
.btn-action.ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.btn-action.ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--cyan);
}

/* ==========================================================================
   CYBER OPERATIONS SECTOR CARDS (12 DOMAINS)
   ========================================================================== */
.sectors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 22px;
}

.sector-card {
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.sector-card:hover {
  border-color: rgba(88, 215, 234, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), 0 0 25px rgba(88, 215, 234, 0.12);
}
.sector-card.origin {
  border-color: rgba(88, 215, 234, 0.45);
  box-shadow: 0 0 35px rgba(88, 215, 234, 0.15);
}

.sector-header {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sector-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sector-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--volt);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sector-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--volt);
  box-shadow: 0 0 8px var(--volt);
}

.sector-body {
  padding: 22px 24px 18px;
  flex: 1;
}

.sector-title {
  font-size: 1.22rem;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.01em;
}

.sector-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}

.sector-footer {
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-sector {
  flex: 1;
  min-width: 140px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.btn-sector.primary {
  background: linear-gradient(135deg, var(--cyan), #7fe8f5);
  color: #03070d;
}
.btn-sector.primary:hover {
  box-shadow: 0 0 15px var(--cyan-glow);
}
.btn-sector.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}
.btn-sector.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}

/* ==========================================================================
   TARGETRY CONSOLE (INTEGRATED NORAD #68049 TELEMETRY)
   ========================================================================== */
.targetry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.targetry-cell {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
}
.targetry-label {
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.targetry-val {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--cyan);
}
.targetry-val.gold { color: var(--gold); }
.targetry-val.volt { color: var(--volt); }

/* ==========================================================================
   FUSION BANNER
   ========================================================================== */
.fusion-banner {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(216, 179, 91, 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  margin-bottom: 32px;
  position: relative;
  background: #000;
}
.fusion-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 580px;
  object-fit: cover;
}
.fusion-caption {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  padding: 36px 32px 24px;
  background: linear-gradient(180deg, transparent 0%, rgba(2, 5, 9, 0.92) 50%, rgba(2, 5, 9, 0.99) 100%);
  color: #fff;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  background: rgba(3, 7, 13, 0.92);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 30px;
  padding: 40px 0;
}
.footer h4 { margin: 0 0 12px; font-size: 0.9rem; color: #fff; }
.footer p, .footer a { color: var(--muted); font-size: 0.85rem; }
.footer a { display: block; margin: 6px 0; }
.footer a:hover { color: var(--cyan); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-align: center;
}

@media(max-width: 820px) {
  .sectors-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
