@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700&display=swap");

:root {
  --bg-dark: #05070a;
  --bg-panel: rgba(10, 15, 25, 0.7);
  --cyan: #00f4ff;
  --cyan-dim: rgba(0, 244, 255, 0.5);
  --gold: #ffb454;
  --purple: #9d50bb;
  --ink: #e0faff;
  --muted: #88a0b0;
  --stroke: rgba(0, 244, 255, 0.15);
  --glow: rgba(0, 244, 255, 0.3);
  --shadow: 0 0 30px rgba(0, 0, 0, 0.8);
  --radius: 4px;
  --hud-font: "Orbitron", sans-serif;
  --body-font: "Space Grotesk", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--body-font);
  color: var(--ink);
  background: var(--bg-dark);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* Animated Starfield Background */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at 50% 50%, #0a1118 0%, #05070a 100%);
}

.starfield::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1.5px 1.5px at 100px 150px, #fff, rgba(0, 0, 0, 0)),
    radial-gradient(1px 1px at 200px 250px, #fff, rgba(0, 0, 0, 0));
  background-size: 300px 300px;
  opacity: 0.3;
  animation: stars 120s linear infinite; /* Slowed down for better performance/feel */
  will-change: transform;
}

@keyframes stars {
  from { transform: translateY(0); }
  to { transform: translateY(-300px); }
}

/* HUD Shell */
.hud-frame {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  border: 1px solid var(--stroke);
  margin: 10px;
  box-shadow: inset 0 0 50px rgba(0, 244, 255, 0.05);
}

.hud-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid var(--cyan);
}
.corner-tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.corner-tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.corner-bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.corner-br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.hud-header {
  position: fixed;
  top: 25px;
  left: 40px;
  z-index: 1001;
  font-family: var(--hud-font);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--cyan);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 15px;
}

.hud-header .status-dot {
  width: 6px;
  height: 6px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan);
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Page Structure */
.content {
  position: relative;
  z-index: 10;
  padding: 100px 40px;
  max-width: 1200px;
  margin: 0 auto;
}

section {
  margin-bottom: 150px;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--hud-font);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 20px;
}

h1 {
  font-size: clamp(40px, 8vw, 80px);
  line-height: 0.9;
  background: linear-gradient(to bottom, #fff, var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff; /* Fallback */
}

h2 {
  font-size: clamp(24px, 4vw, 36px);
  color: var(--gold);
  border-left: 4px solid var(--cyan);
  padding-left: 20px;
  margin-top: 40px;
}

h3 {
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--cyan);
  margin-top: 30px;
}

p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 800px;
}

.readout {
  font-family: var(--hud-font);
  font-size: 12px;
  color: var(--cyan);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Game-like Cards */
.panel {
  background: var(--bg-panel);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--stroke);
  padding: 30px;
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  transition: border-color 0.3s ease;
}

.panel:hover {
  border-color: var(--cyan-dim);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.5;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 30px;
}

.grid-cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.grid-cols-large {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

/* Navigation */
.nav-hud {
  position: fixed;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--cyan);
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.nav-dot.active {
  background: var(--cyan);
  box-shadow: 0 0 15px var(--cyan);
  transform: scale(1.2) rotate(45deg);
}

.nav-dot::after {
  content: attr(data-label);
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--hud-font);
  font-size: 10px;
  color: var(--cyan);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.nav-dot:hover::after {
  opacity: 1;
}

/* Constants & Values */
.value-large {
  font-family: var(--hud-font);
  font-size: 48px;
  color: #fff;
  text-shadow: 0 0 20px var(--glow);
  transition: text-shadow 0.3s;
}

/* Interactive Sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  height: 4px;
  outline: none;
  margin: 20px 0;
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--cyan);
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--cyan);
  transform: rotate(45deg);
  transition: transform 0.2s, background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: rotate(45deg) scale(1.2);
  background: #fff;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--cyan);
  cursor: pointer;
  border-radius: 2px;
  box-shadow: 0 0 10px var(--cyan);
  transform: rotate(45deg);
  border: none;
}

/* CTA Simulator Styling */
.cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.cta-item {
  background: rgba(0, 244, 255, 0.05);
  padding: 15px;
  border-radius: var(--radius);
  border-left: 2px solid var(--cyan);
}

.cta-val {
  font-family: var(--hud-font);
  font-size: 20px;
  color: #fff;
}

.cta-button {
  background: var(--cyan);
  color: var(--bg-dark);
  border: none;
  padding: 15px 30px;
  font-family: var(--hud-font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
  margin-top: 20px;
  width: 100%;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.cta-button:hover:not(:disabled) {
  box-shadow: 0 0 20px var(--cyan);
  transform: translateY(-2px);
}

.cta-button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  opacity: 0.5;
}

.cta-progress-bar {
  height: 2px;
  background: var(--cyan);
  width: 0%;
  margin-top: 10px;
  box-shadow: 0 0 10px var(--cyan);
  transition: width 0.3s linear;
}

canvas {
  width: 100%;
  height: 300px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--stroke);
  margin-top: 20px;
}

/* Explainer Boxes */
.explainer-box {
  background: linear-gradient(135deg, rgba(0, 244, 255, 0.05), rgba(157, 80, 187, 0.05));
  border: 1px solid var(--stroke);
  border-left: 3px solid var(--cyan);
  padding: 25px 30px;
  margin: 30px 0;
  border-radius: var(--radius);
}

.explainer-box p.lead {
  font-size: 20px;
  color: var(--ink);
  margin-bottom: 15px;
}

.explainer-box p {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.explainer-mini {
  background: rgba(0, 0, 0, 0.3);
  border-left: 2px solid var(--gold);
  padding: 15px 20px;
  margin: 20px 0;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}

/* Insight Chain */
.insight-chain {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 40px 0;
  flex-wrap: wrap;
  justify-content: center;
}

.insight-step {
  display: flex;
  gap: 15px;
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  padding: 20px;
  border-radius: var(--radius);
  flex: 1;
  min-width: 200px;
  max-width: 280px;
}

.insight-step.highlight-step {
  background: linear-gradient(135deg, rgba(0, 244, 255, 0.1), rgba(255, 180, 84, 0.1));
  border-color: var(--gold);
}

.step-number {
  font-family: var(--hud-font);
  font-size: 24px;
  color: var(--cyan);
  font-weight: 700;
  min-width: 30px;
}

.highlight-step .step-number {
  color: var(--gold);
}

.step-title {
  font-family: var(--hud-font);
  font-size: 13px;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.highlight-step .step-title {
  color: var(--gold);
}

.step-content p {
  font-size: 14px;
  margin: 0;
  line-height: 1.5;
}

.chain-arrow {
  display: flex;
  align-items: center;
  font-size: 24px;
  color: var(--cyan);
  opacity: 0.5;
}

@media (max-width: 900px) {
  .chain-arrow {
    transform: rotate(90deg);
    width: 100%;
    justify-content: center;
  }
}

/* Feature List */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.feature-list li {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  align-items: flex-start;
}

.feature-icon {
  color: var(--cyan);
  font-size: 18px;
  min-width: 24px;
}

.feature-list strong {
  color: var(--ink);
  display: block;
  margin-bottom: 5px;
}

.feature-list p {
  font-size: 14px;
  margin: 0;
  color: var(--muted);
}

/* Tau Explanation */
.tau-explanation {
  margin-top: 15px;
  font-size: 14px;
  color: var(--muted);
  min-height: 20px;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  margin-top: -10px;
}

/* Equation Block Enhanced */
.equation-block {
  font-family: "Courier New", monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 4px;
  margin: 20px 0;
  border: 1px dashed var(--stroke);
  color: var(--cyan);
  font-size: 20px;
  text-align: center;
}

.equation-label {
  font-family: var(--hud-font);
  font-size: 10px;
  color: var(--gold);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.equation-meaning {
  font-family: var(--body-font);
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
}

/* Axiom Grid */
.axiom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.axiom-card {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  padding: 25px;
  border-radius: var(--radius);
  position: relative;
}

.axiom-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.axiom-number {
  font-family: var(--hud-font);
  font-size: 10px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.axiom-title {
  font-family: var(--hud-font);
  font-size: 16px;
  color: var(--cyan);
  margin-bottom: 12px;
}

.axiom-card p {
  font-size: 14px;
  margin: 0 0 15px;
}

.axiom-status {
  font-size: 11px;
  color: var(--gold);
  font-style: italic;
}

/* Derivation Panel */
.derivation-panel {
  background: linear-gradient(180deg, var(--bg-panel), rgba(0, 0, 0, 0.4));
}

.derivation-steps {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 20px;
}

.deriv-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius);
}

.deriv-step.result-step {
  background: linear-gradient(135deg, rgba(0, 244, 255, 0.1), rgba(255, 180, 84, 0.05));
  border: 1px solid var(--cyan);
}

.deriv-num {
  font-family: var(--hud-font);
  font-size: 20px;
  color: var(--cyan);
  min-width: 30px;
}

.deriv-content strong {
  color: var(--ink);
  font-size: 15px;
}

.deriv-eq {
  font-family: "Courier New", monospace;
  color: var(--cyan);
  font-size: 14px;
  margin-top: 8px;
}

.deriv-eq.final-eq {
  font-size: 18px;
  color: var(--gold);
}

.deriv-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.deriv-arrow {
  text-align: center;
  color: var(--cyan);
  opacity: 0.5;
  font-size: 20px;
}

/* Horizon Grid */
.horizon-grid {
  display: flex;
  gap: 30px;
  margin-top: 15px;
  flex-wrap: wrap;
}

.horizon-item {
  display: flex;
  gap: 15px;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 15px 20px;
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--ink);
}

.horizon-icon {
  font-size: 24px;
}

/* Parameter Groups */
.param-group {
  margin-bottom: 25px;
}

.param-value {
  font-family: var(--hud-font);
  font-size: 18px;
  color: #fff;
  margin: 5px 0 10px;
}

.param-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

/* Result Panel */
.result-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--gold);
  padding: 25px;
  margin-top: 25px;
  text-align: center;
  border-radius: var(--radius);
}

.result-explanation {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

.chart-label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
}

/* Outcome Grid */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.outcome-card {
  background: var(--bg-panel);
  border: 1px solid var(--stroke);
  padding: 25px;
  border-radius: var(--radius);
  text-align: center;
}

.outcome-card.outcome-negative {
  border-color: rgba(255, 100, 100, 0.3);
}

.outcome-icon {
  font-size: 32px;
  margin-bottom: 15px;
}

.outcome-card:nth-child(1) .outcome-icon { color: var(--cyan); }
.outcome-card:nth-child(2) .outcome-icon { color: var(--gold); }
.outcome-card.outcome-negative .outcome-icon { color: #ff6464; }

.outcome-title {
  font-family: var(--hud-font);
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.outcome-card p {
  font-size: 14px;
  margin: 0;
}

/* Results Explainer */
.results-explainer {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}

.cta-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
}

/* Footer */
.footer-link {
  color: var(--cyan);
  margin: 0 15px;
  text-decoration: none;
  font-family: var(--hud-font);
  font-size: 12px;
  transition: color 0.3s;
}

.footer-link:hover {
  color: #fff;
}

.footer-note {
  margin: 30px auto 0;
  font-size: 12px;
  opacity: 0.4;
}

.disclaimer {
  max-width: 700px;
  margin: 30px auto 0;
  padding: 20px;
  background: rgba(255, 180, 84, 0.05);
  border: 1px solid rgba(255, 180, 84, 0.2);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.disclaimer strong {
  color: var(--gold);
}

/* Animations */
.scanline {
  position: fixed;
  inset: 0;
  z-index: 1002;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.1) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.1;
}

.equation-block {
  font-family: "Courier New", monospace;
  background: rgba(0, 0, 0, 0.4);
  padding: 20px;
  border-radius: 4px;
  margin: 20px 0;
  border: 1px dashed var(--stroke);
  color: var(--cyan);
  font-size: 20px;
  text-align: center;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1002;
  background: transparent;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  padding: 8px;
  font-family: var(--hud-font);
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hud-header {
    left: 20px;
    top: 15px;
    font-size: 9px;
    width: calc(100% - 70px); /* Make room for toggle */
  }

  .mobile-nav-toggle {
    display: block;
  }

  .nav-hud {
    display: flex;
    position: fixed;
    inset: 0;
    transform: none;
    background: rgba(5, 7, 10, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    clip-path: circle(0% at 100% 0);
    transition: clip-path 0.5s cubic-bezier(0.77, 0, 0.175, 1);
  }

  .nav-hud.open {
    clip-path: circle(150% at 100% 0);
  }

  .nav-dot {
    width: auto;
    height: auto;
    border: none;
    border-radius: 0;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: var(--hud-font);
    font-size: 24px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 10px;
  }

  .nav-dot.active {
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
  }

  .nav-dot::after {
    display: none; /* Hide hover content, use text content inside div for mobile */
  }
  
  /* Helper for mobile text */
  .nav-dot span {
    display: block;
  }

  .content {
    padding: 80px 20px;
  }
  
  h1 { font-size: 36px; }
  .value-large { font-size: 36px; }
  
  .equation-block {
    font-size: 14px;
    overflow-x: auto;
  }
}
