@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ──────────────────────────────────────────────── */
:root {
  --bg:       #04040f;
  --surface:  #090916;
  --accent1:  #6c63ff;
  --accent2:  #00d4ff;
  --accent3:  #ff6b9d;
  --gold:     #f7c948;
  --text:     #e8e8f0;
  --muted:    #7a7a9a;
  --faint:    #1a1a2e;
  --glass:       rgba(255,255,255,0.04);
  --glass-border:rgba(255,255,255,0.08);

  /* Epistemic ladder */
  --ep-established: #00d4ff;
  --ep-emerging:    #4ade80;
  --ep-hypothesis:  #f7c948;
  --ep-vision:      #ff6b9d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ── FIXED CANVAS ────────────────────────────────────────── */
#particle-canvas {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
}

section { position: relative; z-index: 1; }

/* ── NAV ─────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 3rem;
  background: rgba(4,4,15,0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}
.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  background: linear-gradient(90deg, var(--accent2), var(--accent1));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.05em;
}
.nav-links { display: flex; gap: 2.2rem; list-style: none; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--accent2); }

/* ── HERO ────────────────────────────────────────────────── */
#hero {
  height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 0 2rem;
}
.hero-eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent2); margin-bottom: 1.5rem;
  opacity: 0; animation: fadeUp 1s 0.3s forwards;
}
.hero-anchor {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 1.8vw, 1.3rem);
  font-style: italic;
  color: var(--muted);
  margin-bottom: 1.8rem;
  opacity: 0; animation: fadeUp 1s 0.55s forwards;
  letter-spacing: 0.02em;
}
.hero-anchor span { color: var(--text); font-style: normal; }
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 6.5vw, 5.5rem);
  line-height: 1.1; max-width: 960px;
  opacity: 0; animation: fadeUp 1s 0.8s forwards;
}
.hero-title em {
  font-style: italic;
  background: linear-gradient(135deg, var(--accent1), var(--accent2), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub {
  margin-top: 1.6rem; color: var(--muted); font-size: 1rem;
  max-width: 540px; line-height: 1.75;
  opacity: 0; animation: fadeUp 1s 1.05s forwards;
}
.scroll-hint {
  margin-top: 3rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  opacity: 0; animation: fadeUp 1s 1.5s forwards;
  color: var(--muted); font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
}
.scroll-arrow {
  width: 20px; height: 34px;
  border: 2px solid rgba(255,255,255,0.2); border-radius: 10px; position: relative;
}
.scroll-arrow::after {
  content: ''; position: absolute; top: 5px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 8px; background: var(--accent2); border-radius: 2px;
  animation: scrollBob 1.4s infinite;
}

/* ── REGION HEADERS ──────────────────────────────────────── */
.region-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.68rem; letter-spacing: 0.25em; text-transform: uppercase;
  padding: 0.3rem 0.9rem; border-radius: 20px; margin-bottom: 1.2rem;
  border: 1px solid;
}
.region-tag.fracture   { color: var(--accent3); border-color: rgba(255,107,157,0.35); }
.region-tag.continuity { color: var(--accent2); border-color: rgba(0,212,255,0.35); }
.region-tag.fusion     { color: var(--accent1); border-color: rgba(108,99,255,0.35); }
.region-tag.frontier   { color: var(--gold);    border-color: rgba(247,201,72,0.35); }

.region-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; opacity: 0.6;
}

/* ── THE FRACTURE ────────────────────────────────────────── */
#fracture {
  padding: 8rem 2rem 6rem;
  max-width: 1100px; margin: 0 auto;
}
.fracture-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5rem;
  align-items: center; margin-top: 3rem;
}
.fracture-text h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.2; margin-bottom: 1.2rem;
}
.fracture-text p { color: var(--muted); line-height: 1.85; margin-bottom: 1rem; }
.fracture-text p strong { color: var(--text); }
.fracture-text .pull {
  font-family: 'Playfair Display', serif; font-style: italic;
  font-size: 1.15rem; color: var(--text);
  border-left: 2px solid var(--accent3);
  padding-left: 1.2rem; margin: 1.5rem 0;
}

.silo-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 8px;
}
.silo-cell {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 1.1rem 0.5rem;
  text-align: center; font-size: 0.68rem; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  transition: all 0.35s;
  cursor: default;
}
.silo-cell:hover { border-color: var(--accent3); color: var(--accent3); transform: scale(1.04); }
.silo-cell .icon { font-size: 1.5rem; display: block; margin-bottom: 0.4rem; }
.silo-divider {
  grid-column: 1/-1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,107,157,0.3), transparent);
  margin: 4px 0;
}

/* ── THE CONTINUITY ──────────────────────────────────────── */
#continuity {
  padding: 8rem 2rem 6rem;
  background: linear-gradient(180deg, transparent, rgba(0,212,255,0.02), transparent);
}
.continuity-inner { max-width: 1100px; margin: 0 auto; }
.continuity-header { margin-bottom: 4rem; }
.continuity-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); line-height: 1.2; margin-bottom: 1rem;
}
.continuity-header p { color: var(--muted); max-width: 620px; line-height: 1.8; }

.continuity-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: start;
}

/* Math derivation */
.math-glow-box {
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 2rem;
  font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; line-height: 2.1;
  position: relative; overflow: hidden;
}
.math-glow-box::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,212,255,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.math-line { color: var(--muted); transition: all 0.4s; }
.math-line.glow {
  color: var(--accent2);
  text-shadow: 0 0 10px var(--accent2), 0 0 28px rgba(0,212,255,0.4);
}

/* Epistemic ladder */
.ep-ladder {
  display: flex; flex-direction: column; gap: 0;
}
.ep-rung {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.2rem 1.4rem; border-radius: 12px;
  border: 1px solid transparent; transition: all 0.3s; cursor: default;
  position: relative;
}
.ep-rung:not(:last-child)::after {
  content: ''; position: absolute; left: 2rem; bottom: -1px;
  width: 1px; height: 100%; background: var(--glass-border); z-index: -1;
}
.ep-rung:hover { background: var(--glass); }
.ep-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
  box-shadow: 0 0 8px currentColor;
}
.ep-rung.established .ep-dot { background: var(--ep-established); color: var(--ep-established); }
.ep-rung.emerging    .ep-dot { background: var(--ep-emerging);    color: var(--ep-emerging); }
.ep-rung.hypothesis  .ep-dot { background: var(--ep-hypothesis);  color: var(--ep-hypothesis); }
.ep-rung.vision      .ep-dot { background: var(--ep-vision);      color: var(--ep-vision); }

.ep-content {}
.ep-label {
  font-size: 0.68rem; letter-spacing: 0.18em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 0.25rem;
}
.ep-rung.established .ep-label { color: var(--ep-established); }
.ep-rung.emerging    .ep-label { color: var(--ep-emerging); }
.ep-rung.hypothesis  .ep-label { color: var(--ep-hypothesis); }
.ep-rung.vision      .ep-label { color: var(--ep-vision); }
.ep-text { font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.ep-text strong { color: var(--text); }

/* Morph canvas inside continuity */
.morph-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 1.2rem;
  margin-top: 4rem;
}
#morph-canvas {
  width: 420px; height: 420px; max-width: 90vw;
  border-radius: 50%;
  box-shadow: 0 0 60px rgba(0,212,255,0.2), 0 0 120px rgba(108,99,255,0.1);
}
.morph-label { font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--accent2); transition: opacity 0.5s; }
.morph-sub   { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; transition: opacity 0.5s; }

/* ── GRAPH EXPLORER ──────────────────────────────────────── */
#graph-explorer {
  padding: 8rem 2rem;
}
.graph-inner { max-width: 1200px; margin: 0 auto; }
.graph-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.8rem;
}
.graph-inner .graph-desc {
  color: var(--muted); max-width: 600px; line-height: 1.8; margin-bottom: 2rem;
}
.graph-hint {
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent1); margin-bottom: 2rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.graph-hint::before { content: '↗'; font-size: 1rem; }

.graph-stage {
  display: grid; grid-template-columns: 1fr 340px; gap: 2rem; align-items: start;
}
#graph-canvas {
  width: 100%; border-radius: 20px;
  background: rgba(9,9,22,0.8);
  border: 1px solid var(--glass-border);
  cursor: pointer;
}

/* Node info panel */
.graph-panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px; padding: 1.8rem;
  min-height: 280px;
  display: flex; flex-direction: column; gap: 1rem;
  transition: all 0.4s;
}
.panel-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--muted); text-align: center; gap: 1rem;
}
.panel-idle-icon { font-size: 2.5rem; opacity: 0.4; }
.panel-idle p { font-size: 0.85rem; line-height: 1.6; }

.panel-active { display: flex; flex-direction: column; gap: 1rem; }
.panel-node-name {
  font-family: 'Playfair Display', serif; font-size: 1.6rem;
}
.panel-ep-badge {
  display: inline-block; font-size: 0.65rem; letter-spacing: 0.18em;
  text-transform: uppercase; padding: 0.25rem 0.7rem; border-radius: 20px;
  border: 1px solid; font-weight: 600; width: fit-content;
}
.panel-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }
.panel-connections { margin-top: 0.5rem; }
.panel-connections-label {
  font-size: 0.65rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.6rem;
}
.panel-conn-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.panel-conn-chip {
  font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 20px;
  border: 1px solid var(--glass-border); color: var(--text);
  background: var(--glass);
}

/* EP colors for panel badge */
.ep-badge-established { color: var(--ep-established); border-color: rgba(0,212,255,0.4); background: rgba(0,212,255,0.08); }
.ep-badge-emerging    { color: var(--ep-emerging);    border-color: rgba(74,222,128,0.4); background: rgba(74,222,128,0.08); }
.ep-badge-hypothesis  { color: var(--ep-hypothesis);  border-color: rgba(247,201,72,0.4); background: rgba(247,201,72,0.08); }
.ep-badge-vision      { color: var(--ep-vision);      border-color: rgba(255,107,157,0.4); background: rgba(255,107,157,0.08); }

/* ── THE FUSION ──────────────────────────────────────────── */
#fusion {
  padding: 8rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(108,99,255,0.03), transparent);
}
.fusion-inner { max-width: 1100px; margin: 0 auto; }
.fusion-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 3rem;
}

.fusion-cards { display: flex; flex-direction: column; gap: 1.2rem; }
.fusion-card {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 16px; overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}
.fusion-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 50px rgba(108,99,255,0.18);
}
.fc-cell { padding: 1.6rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; }
.fc-label {
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 600;
}
.fc-old     { border-right: 1px solid var(--glass-border); }
.fc-old .fc-label     { color: var(--accent3); }
.fc-fusion  { border-right: 1px solid var(--glass-border); background: rgba(247,201,72,0.03); }
.fc-fusion .fc-label  { color: var(--gold); }
.fc-achieve { background: rgba(0,212,255,0.03); }
.fc-achieve .fc-label { color: var(--accent2); }
.fc-cell p { font-size: 0.88rem; line-height: 1.55; color: var(--text); }
.fc-cell .fc-question {
  font-style: italic; color: var(--muted); font-size: 0.82rem; margin-top: 0.4rem;
}
.fc-arrow { display: flex; align-items: center; padding: 0 0.5rem; color: var(--muted); }

/* ── THE FRONTIER ────────────────────────────────────────── */
#frontier {
  padding: 8rem 2rem 6rem;
}
.frontier-inner { max-width: 860px; margin: 0 auto; }
.frontier-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 1rem;
}
.frontier-intro { color: var(--muted); line-height: 1.8; margin-bottom: 3.5rem; }

.frontier-questions { display: flex; flex-direction: column; gap: 2rem; }
.frontier-q {
  padding: 1.6rem 2rem;
  border-left: 2px solid; border-radius: 0 12px 12px 0;
  background: var(--glass); transition: all 0.3s;
}
.frontier-q:hover { background: rgba(255,255,255,0.06); }
.frontier-q:nth-child(1) { border-color: var(--ep-established); }
.frontier-q:nth-child(2) { border-color: var(--ep-emerging); }
.frontier-q:nth-child(3) { border-color: var(--ep-hypothesis); }
.frontier-q:nth-child(4) { border-color: var(--ep-vision); }
.fq-ep {
  font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 0.5rem;
}
.frontier-q:nth-child(1) .fq-ep { color: var(--ep-established); }
.frontier-q:nth-child(2) .fq-ep { color: var(--ep-emerging); }
.frontier-q:nth-child(3) .fq-ep { color: var(--ep-hypothesis); }
.frontier-q:nth-child(4) .fq-ep { color: var(--ep-vision); }
.fq-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; line-height: 1.5; color: var(--text);
}

/* ── FINALE ──────────────────────────────────────────────── */
#finale {
  padding: 10rem 2rem 8rem; text-align: center; position: relative;
}
.finale-glow {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(108,99,255,0.12) 0%, transparent 65%);
  pointer-events: none;
}
.finale-chip {
  width: 380px; max-width: 88vw; border-radius: 50%;
  margin: 0 auto 3.5rem; display: block;
  box-shadow: 0 0 60px rgba(108,99,255,0.45), 0 0 120px rgba(0,212,255,0.18);
  animation: chipPulse 4s ease-in-out infinite;
}
.finale-quote {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 3.2vw, 2.2rem);
  line-height: 1.65; max-width: 780px; margin: 0 auto 2.5rem;
}
.finale-quote em {
  background: linear-gradient(135deg, var(--accent2), var(--accent1), var(--accent3));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.finale-tagline {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--accent2);
}
.finale-links {
  display: flex; align-items: center; justify-content: center;
  gap: 1rem; margin-top: 1rem;
}
.finale-sep { color: var(--muted); }
.finale-email,
.finale-linkedin {
  font-size: 0.82rem; color: var(--muted); text-decoration: none;
  letter-spacing: 0.06em; transition: color 0.3s;
}
.finale-email:hover,
.finale-linkedin:hover { color: var(--accent2); }

/* ── FOOTER ──────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--glass-border);
  padding: 2rem 3rem;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted); font-size: 0.78rem;
  position: relative; z-index: 1;
}

/* ── ANIMATIONS ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scrollBob {
  0%,100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50%      { transform: translateX(-50%) translateY(10px); opacity: 0; }
}
@keyframes chipPulse {
  0%,100% { box-shadow: 0 0 60px rgba(108,99,255,0.45), 0 0 120px rgba(0,212,255,0.18); }
  50%      { box-shadow: 0 0 90px rgba(108,99,255,0.7), 0 0 180px rgba(0,212,255,0.32); }
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 0.85s ease, transform 0.85s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .fracture-grid    { grid-template-columns: 1fr; }
  .continuity-body  { grid-template-columns: 1fr; }
  .graph-stage      { grid-template-columns: 1fr; }
  .fusion-card      { grid-template-columns: 1fr; }
  .fc-arrow         { display: none; }
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  #graph-canvas { height: 360px !important; }
}