/* css/style.css */
:root {
  --bg:         #1e1410;
  --surface:    #160e08;
  --surface-deep: #120904;
  --accent:     #cc5500;
  --accent-bright: #e87030;
  --text-primary:  #fff5ee;
  --text-secondary: #c09070;
  --text-muted:  #b08060;
  --text-label:  #8a5035;
  --nav-inactive: #b07050;
  --grid-major: rgba(200,80,0,0.09);
  --grid-minor: rgba(200,80,0,0.04);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
}

#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 12px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  color: var(--accent-bright);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  text-decoration: none;
}
.nav-logo span {
  color: var(--text-label);
  font-weight: 400;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--nav-inactive);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1.5px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent-bright); }
.nav-links a.nav-active {
  color: var(--accent-bright);
  border-bottom: 2px solid var(--accent-bright);
  padding-bottom: 2px;
  font-weight: 700;
}

/* === HERO === */
#hero {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 30px 30px, 30px 30px, 6px 6px, 6px 6px;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 3fr 2fr;
  min-height: 320px;
  max-width: 1000px;
  margin: 0 auto;
}

.hero-left {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.section-label {
  font-size: 10px;
  color: var(--text-label);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero-subtitle {
  font-size: 12px;
  color: var(--accent-bright);
  letter-spacing: 1.5px;
  margin-bottom: 16px;
}

.hero-body {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 380px;
  margin-bottom: 22px;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 9px 22px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--accent-bright); }

.btn-outline {
  border: 1.5px solid var(--accent);
  color: var(--accent-bright);
  padding: 9px 20px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-outline:hover { border-color: var(--accent-bright); }

.hero-equation {
  font-size: 11px;
  font-family: 'Courier New', Courier, monospace;
  color: #d08050;
  background: #120904cc;
  border: 1px solid #cc550066;
  padding: 8px 16px;
  display: inline-block;
  align-self: flex-start;
}

/* === SPHERE === */
.hero-right {
  border-left: 1px solid rgba(204,85,0,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 20px;
}

.sphere-container {
  position: relative;
  width: 120px;
  height: 120px;
}

.sphere-glow {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(204,85,0,0.15), transparent 65%);
}

.sphere-ring {
  position: absolute;
  border-radius: 50%;
}
.ring-outer { inset: 0;    border: 2px solid rgba(204,85,0,0.6); }
.ring-mid   { inset: 12px; border: 1px solid rgba(204,85,0,0.4); transform: rotate(45deg); }
.ring-inner { inset: 24px; border: 1px solid rgba(204,85,0,0.3); }

.sphere-axis {
  position: absolute;
}
.axis-h {
  top: 50%; left: 10px; right: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204,85,0,0.4), transparent);
  margin-top: -0.5px;
}
.axis-v {
  left: 50%; top: 10px; bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(204,85,0,0.4), transparent);
  margin-left: -0.5px;
}

.sphere-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sphere-core::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(204,85,0,0.4);
}

.sphere-label {
  position: absolute;
  bottom: -22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  letter-spacing: 3px;
  font-family: monospace;
  color: rgba(204,85,0,0.7);
}

.equation-box {
  background: var(--surface-deep);
  border: 1px solid rgba(204,85,0,0.35);
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  text-align: center;
}
.eq-label {
  font-size: 9px;
  color: #9a6040;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.eq-formula {
  font-size: 14px;
  font-family: monospace;
  color: var(--accent-bright);
  letter-spacing: 1px;
}

/* === CONCEPTS === */
#concepts {
  padding: 40px 32px;
}

.concepts-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.concepts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.concept-card {
  background: rgba(22,16,8,0.55);
  border: 1px solid rgba(204,85,0,0.28);
  border-top: 2px solid var(--accent);
  padding: 18px 16px;
}

.concept-symbol {
  font-size: 22px;
  color: var(--accent-bright);
  margin-bottom: 8px;
}

.concept-card h3 {
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}

.concept-card p {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.65;
}

/* === FOOTER === */
#footer {
  background: #100a05;
  border-top: 1px solid rgba(204,85,0,0.2);
  padding: 16px 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-copy {
  font-size: 10px;
  color: #806050;
  letter-spacing: 1px;
}

.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  font-size: 10px;
  color: #806050;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent-bright); }

/* === THEORY PAGE === */
.theory-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 32px 60px;
}

.theory-header {
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(204,85,0,0.25);
}

.theory-header h1 {
  margin-top: 10px;
  margin-bottom: 8px;
}

.theory-article {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.theory-section {
  border-left: 3px solid var(--accent);
  padding: 28px 0 28px 28px;
  border-bottom: 1px solid rgba(204,85,0,0.12);
}
.theory-section:last-child { border-bottom: none; }

.theory-section h2 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-num {
  color: var(--accent);
  font-family: monospace;
  font-size: 0.95rem;
}

.theory-section p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.85;
  max-width: 640px;
}

.inline-eq {
  display: inline-block;
  margin-top: 14px;
  font-size: 12px;
  font-family: monospace;
  color: var(--accent-bright);
  background: var(--surface-deep);
  border: 1px solid rgba(204,85,0,0.35);
  border-left: 3px solid var(--accent);
  padding: 8px 16px;
}

/* === DIVIDER === */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204,85,0,0.5), transparent);
}

/* === JOURNEY SECTIONS === */
.journey { padding: 56px 32px; }
.journey-inner { max-width: 1000px; margin: 0 auto; }
.journey h2 { font-size: 1.7rem; color: var(--text-primary); margin-bottom: 14px; line-height: 1.2; }
.caption-lay { font-size: 13px; color: var(--text-secondary); line-height: 1.85; max-width: 720px; margin-bottom: 24px; }
.caption-rigor { margin-top: 22px; background: var(--surface-deep); border: 1px solid rgba(204,85,0,0.25); border-left: 3px solid var(--accent); padding: 14px 18px; max-width: 860px; }
.caption-rigor p { font-size: 11px; color: var(--text-muted); line-height: 1.8; }
.rigor-tag { color: var(--accent-bright); font-family: monospace; font-size: 9px; letter-spacing: 2px; margin-right: 8px; }

/* === 3D SCENES === */
.scene-3d { position: relative; height: 460px; border: 1px solid rgba(204,85,0,0.28); overflow: hidden; background-color: var(--surface-deep); background-image: linear-gradient(var(--grid-major) 1px, transparent 1px), linear-gradient(90deg, var(--grid-major) 1px, transparent 1px); background-size: 30px 30px; }
.scene-3d canvas { position: absolute; inset: 0; display: block; }
.scene-hint { position: absolute; bottom: 10px; right: 14px; font-size: 9px; letter-spacing: 2px; color: var(--text-label); font-family: monospace; pointer-events: none; }
.fallback-note { display: none; }
.scene-3d.scene-fallback .fallback-note { display: flex; align-items: center; justify-content: center; position: absolute; inset: 0; padding: 32px; }
.scene-3d.scene-fallback .scene-hint { display: none; }
.fallback-note p { font-size: 12px; color: var(--text-muted); max-width: 480px; text-align: center; line-height: 1.8; }
.scene-fallback + .holonomy-controls { display: none; }

/* === HOLONOMY CONTROLS === */
.holonomy-controls { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; background: rgba(22,14,8,0.55); border: 1px solid rgba(204,85,0,0.28); padding: 12px 18px; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row label { font-size: 10px; letter-spacing: 1.5px; font-family: monospace; color: var(--text-muted); }
#holonomy-value { color: var(--accent-bright); }
#holonomy-slider { width: 220px; accent-color: var(--accent); }
.ratio-readout { display: flex; gap: 18px; flex-wrap: wrap; font-size: 11px; font-family: monospace; color: var(--text-muted); }
.ratio-readout b { color: var(--text-primary); font-weight: 700; }
.ratio-readout em { font-style: normal; color: var(--text-label); }
#ratio-match { letter-spacing: 1.5px; color: var(--text-label); }
.ratio-readout.match-good #ratio-match { color: var(--accent-bright); }

/* === FERMION TORUS / BOSON CIRCLE === */
.particle-topology-scene { height: 500px; }
.topology-label { position: absolute; top: 16px; z-index: 2; pointer-events: none; display: flex; flex-direction: column; gap: 3px; font-family: monospace; }
.topology-label b { color: var(--accent-bright); font-size: 11px; letter-spacing: 1.8px; }
.topology-label span { color: var(--text-label); font-size: 9px; letter-spacing: 1px; }
.topology-label-fermion { left: 18px; }
.topology-label-boson { right: 18px; text-align: right; }
.projection-label { position: absolute; right: 18px; z-index: 2; pointer-events: none; color: var(--text-label); font: 9px monospace; letter-spacing: 1.2px; }
.projection-label-major { top: 31%; }
.projection-label-minor { left: 43%; right: auto; top: 70%; }
.topology-controls { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 12px 18px; border: 1px solid rgba(204,85,0,0.28); background: rgba(22,14,8,0.55); }
.topology-slider-row { flex: 1 1 430px; }
#spin-phase-slider { flex: 1; min-width: 180px; accent-color: var(--accent); }
#spin-phase-value { color: var(--accent-bright); }
.topology-readout { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; font: 11px monospace; color: var(--text-muted); }
.topology-readout b { color: var(--text-primary); }
.topology-readout .state-negative { color: var(--accent-bright); }
.topology-play { border: 1px solid var(--accent); background: transparent; color: var(--accent-bright); padding: 6px 10px; font: 9px monospace; letter-spacing: 1.5px; cursor: pointer; }
.topology-play:hover { background: rgba(204,85,0,0.12); }

/* === MASS LADDER === */
.ladder-wrap { position: relative; border: 1px solid rgba(204,85,0,0.28); background: var(--surface-deep); }
#mass-ladder-canvas { display: block; width: 100%; height: 260px; }
.ladder-tooltip { position: absolute; pointer-events: none; background: #120904; border: 1px solid var(--accent); padding: 8px 12px; font-size: 11px; font-family: monospace; color: var(--text-primary); z-index: 5; white-space: nowrap; }
.ladder-tooltip small { display: block; color: var(--text-muted); font-size: 9px; letter-spacing: 1px; }

/* === FALSIFIER TABLE === */
.falsifier-table { border: 1px solid rgba(204,85,0,0.28); background: rgba(22,14,8,0.55); }
.falsifier-head, .falsifier-main { display: grid; grid-template-columns: 1.3fr 1.2fr 1fr; gap: 12px; padding: 10px 18px; }
.falsifier-head { border-bottom: 1px solid rgba(204,85,0,0.35); font-size: 9px; letter-spacing: 2px; color: var(--text-label); font-family: monospace; }
.falsifier-row { border-bottom: 1px solid rgba(204,85,0,0.12); cursor: pointer; transition: background 0.15s; }
.falsifier-row:last-child { border-bottom: none; }
.falsifier-row:hover { background: rgba(204,85,0,0.07); }
.f-obs { font-size: 12px; color: var(--text-primary); }
.f-pred { font-size: 12px; font-family: monospace; color: var(--accent-bright); }
.f-exec { font-size: 11px; color: var(--text-muted); }
.f-lay { max-height: 0; overflow: hidden; transition: max-height 0.25s ease, padding 0.25s ease; font-size: 11px; color: var(--text-secondary); line-height: 1.7; padding: 0 18px; }
.falsifier-row.open .f-lay, .falsifier-row:hover .f-lay { max-height: 90px; padding: 0 18px 12px; }

/* === PUBLICATIONS === */
.pub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.pub-card { background: rgba(22,16,8,0.55); border: 1px solid rgba(204,85,0,0.28); border-top: 2px solid var(--accent); padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.pub-date { font-size: 9px; letter-spacing: 2px; font-family: monospace; color: var(--text-label); }
.pub-card h3 { font-size: 15px; color: var(--text-primary); line-height: 1.4; }
.pub-meta { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; }
.pub-summary { font-size: 11px; color: var(--text-secondary); line-height: 1.8; }
.pub-preds { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.pub-preds li { font-size: 10px; font-family: monospace; color: var(--text-muted); padding-left: 14px; position: relative; }
.pub-preds li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }
.pub-actions { margin-top: auto; display: flex; gap: 12px; }

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .pub-grid { grid-template-columns: 1fr; }
  .falsifier-head, .falsifier-main { grid-template-columns: 1fr; gap: 2px; }
  .particle-topology-scene { height: 420px; }
  .topology-label span { display: none; }
}
