:root {
  --void: #08080a;
  --ink: #0f0f12;
  --charcoal: #18181c;
  --smoke: #252530;
  --ash: #3a3a48;
  --silver: #7a7a8c;
  --mist: #a0a0b0;
  --cloud: #d0d0dc;
  --white: #f5f5f7;
  --gold: #c9a962;
  --gold-bright: #e8c56d;
  --gold-dim: #8a7340;
  --ember: #d4845a;
  --error: #c45a5a;
  --success: #5ac47a;
  --info: #5a9ed4;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--void);
  color: var(--silver);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
  z-index: 10000;
}

/* Typography */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  color: var(--white);
}

.mono {
  font-family: 'Space Mono', monospace;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 24px 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, var(--void) 0%, transparent 100%);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--silver);
  text-decoration: none;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--gold);
}

.btn-waitlist {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 24px;
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-waitlist:hover {
  background: var(--gold);
  color: var(--void);
}

/* Sections */
section {
  padding: 120px 60px;
  position: relative;
}

.section-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 16px;
}

/* ════════════════════════════════════════════════════════════
   HERO SECTION
════════════════════════════════════════════════════════════ */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#hero::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(201, 169, 98, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 900px;
}

.hero-tagline {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeIn 1s ease-out 0.3s forwards;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeSlideUp 1s ease-out 0.5s forwards;
}

.hero-title .highlight {
  color: var(--gold);
  font-style: italic;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--mist);
  max-width: 600px;
  margin: 0 auto 48px;
  opacity: 0;
  animation: fadeSlideUp 1s ease-out 0.7s forwards;
}

.hero-cta {
  display: flex;
  gap: 20px;
  justify-content: center;
  opacity: 0;
  animation: fadeSlideUp 1s ease-out 0.9s forwards;
}

.btn-primary {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 32px;
  background: var(--gold);
  border: none;
  color: var(--void);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--gold-bright);
  transform: translateY(-2px);
}

.btn-secondary {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 16px 32px;
  background: transparent;
  border: 1px solid var(--smoke);
  color: var(--mist);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn 1s ease-out 1.5s forwards;
}

.scroll-indicator span {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ash);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--gold-dim), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* ════════════════════════════════════════════════════════════
   PROBLEM SECTION
════════════════════════════════════════════════════════════ */
#problem {
  display: flex;
  align-items: center;
  gap: 80px;
  min-height: 100vh;
}

.problem-text {
  flex: 1;
  max-width: 500px;
}

.problem-text h2 {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 24px;
}

.problem-text p {
  margin-bottom: 16px;
  font-size: 1rem;
  color: var(--mist);
}

.problem-quote {
  margin-top: 32px;
  padding-left: 20px;
  border-left: 2px solid var(--gold-dim);
}

.problem-quote blockquote {
  font-style: italic;
  color: var(--mist);
  font-size: 0.95rem;
  line-height: 1.7;
}

.problem-visual {
  flex: 1;
  height: 400px;
  position: relative;
}

#problem-canvas {
  width: 100%;
  height: 100%;
}

/* ════════════════════════════════════════════════════════════
   GAP SECTION
════════════════════════════════════════════════════════════ */
#gap {
  background: var(--ink);
  text-align: center;
}

#gap h2 {
  font-size: 2.2rem;
  margin-bottom: 60px;
}

.gap-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--smoke);
}

.gap-card {
  background: var(--charcoal);
  padding: 48px 36px;
  text-align: left;
}

.gap-card.highlight {
  background: linear-gradient(135deg, rgba(201, 169, 98, 0.1) 0%, var(--charcoal) 100%);
  border-top: 2px solid var(--gold-dim);
}

.gap-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.gap-card .subtitle {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 20px;
}

.gap-card p {
  font-size: 0.9rem;
  line-height: 1.7;
}

.gap-card.highlight h3 {
  color: var(--gold);
}

/* ════════════════════════════════════════════════════════════
   DEMO SECTION - NEW LINK-FOCUSED
════════════════════════════════════════════════════════════ */
#demo {
  display: flex;
  flex-direction: column;
  padding-top: 80px;
  padding-bottom: 60px;
}

.demo-header {
  text-align: center;
  margin-bottom: 32px;
}

.demo-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.demo-header p {
  color: var(--silver);
  max-width: 550px;
  margin: 0 auto;
  font-size: 0.95rem;
}

.demo-container {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2px;
  background: var(--smoke);
  border: 1px solid var(--smoke);
  height: 520px;
  max-width: 1300px;
  margin: 0 auto;
  width: 100%;
}

.demo-panel {
  background: var(--charcoal);
  display: flex;
  flex-direction: column;
  position: relative;
}

.demo-panel-header {
  padding: 14px 20px;
  background: var(--ink);
  border-bottom: 1px solid var(--smoke);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.demo-panel-title {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mist);
}

.demo-panel-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  padding: 4px 10px;
  background: var(--smoke);
  color: var(--silver);
}

.document-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  font-size: 0.88rem;
  line-height: 1.9;
  color: var(--mist);
}

.document-paragraph {
  margin-bottom: 20px;
}

.sentence {
  transition: all 0.25s ease;
}

.sentence[data-ref] {
  cursor: pointer;
  border-bottom: 1px dotted var(--ash);
}

.sentence[data-ref]:hover {
  color: var(--white);
  border-bottom-color: var(--gold-dim);
}

.sentence.active {
  background: var(--gold);
  color: var(--void);
  font-weight: 500;
  padding: 2px 6px;
  margin: 0 -6px;
  border-bottom: none;
  box-shadow: 0 0 20px rgba(201, 169, 98, 0.3);
}

.document-scroll.has-selection .sentence:not(.active) {
  opacity: 0.35;
}

.document-scroll.has-selection .sentence[data-ref]:not(.active):hover {
  opacity: 1;
}

.graph-panel {
  background: var(--ink);
}

.graph-area {
  flex: 1;
  position: relative;
}

#demo-graph {
  width: 100%;
  height: 100%;
}

/* Relationship Detail Panel */
.relation-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--charcoal);
  border-top: 1px solid var(--gold-dim);
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.relation-panel.visible {
  max-height: 250px;
  padding: 20px 24px;
}

.relation-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.relation-type-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 2px;
}

.relation-type-badge.supports { background: rgba(90, 196, 122, 0.2); color: var(--success); }
.relation-type-badge.causes { background: rgba(201, 169, 98, 0.2); color: var(--gold); }
.relation-type-badge.defines { background: rgba(90, 158, 212, 0.2); color: var(--info); }
.relation-type-badge.enables { background: rgba(201, 169, 98, 0.2); color: var(--gold); }

.relation-close {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--ash);
  background: none;
  border: 1px solid var(--smoke);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.relation-close:hover {
  border-color: var(--silver);
  color: var(--silver);
}

.relation-nodes {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.relation-node {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--white);
}

.relation-arrow {
  color: var(--gold);
  font-size: 1.2rem;
}

.relation-explanation {
  background: var(--ink);
  border-left: 2px solid var(--gold-dim);
  padding: 12px 16px;
  margin-bottom: 12px;
}

.relation-explanation-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 6px;
}

.relation-explanation-text {
  font-size: 0.85rem;
  color: var(--mist);
  line-height: 1.6;
}

.relation-source {
  font-size: 0.75rem;
  color: var(--ash);
}

.relation-source-link {
  color: var(--gold-dim);
  cursor: pointer;
  text-decoration: underline;
}

.relation-source-link:hover {
  color: var(--gold);
}

.graph-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
  transition: opacity 0.3s;
}

.relation-panel.visible ~ .graph-legend {
  opacity: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.6rem;
  color: var(--ash);
}

.legend-line {
  width: 20px;
  height: 2px;
}

.legend-line.causes { background: var(--gold); }
.legend-line.supports { background: var(--success); }
.legend-line.defines { background: var(--info); }

.demo-instructions {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 24px;
}

.instruction {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--ash);
}

.instruction-icon {
  width: 28px;
  height: 28px;
  border: 1px solid var(--smoke);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.instruction-icon.node { color: var(--silver); }
.instruction-icon.edge { color: var(--gold); }

/* Node tooltip */
.node-tooltip {
  position: fixed;
  background: var(--charcoal);
  border: 1px solid var(--smoke);
  padding: 10px 14px;
  max-width: 200px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.node-tooltip.visible {
  opacity: 1;
}

.node-tooltip-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--white);
}

.node-tooltip-hint {
  font-size: 0.65rem;
  color: var(--ash);
  margin-top: 4px;
}

/* ════════════════════════════════════════════════════════════
   FEATURES SECTION
════════════════════════════════════════════════════════════ */
#features {
  background: var(--ink);
}

.features-header {
  text-align: center;
  margin-bottom: 60px;
}

.features-header h2 {
  font-size: 2.2rem;
}

.features-list {
  max-width: 900px;
  margin: 0 auto;
}

.feature-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 32px;
  padding: 48px 0;
  border-bottom: 1px solid var(--smoke);
}

.feature-item:last-child {
  border-bottom: none;
}

.feature-number {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--gold-dim);
}

.feature-content h3 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.feature-content p {
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.feature-tag {
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--gold-dim);
}

/* ════════════════════════════════════════════════════════════
   CTA SECTION
════════════════════════════════════════════════════════════ */
#cta {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.cta-content {
  max-width: 500px;
}

.cta-content h2 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.cta-content p {
  font-size: 1rem;
  margin-bottom: 40px;
}

.waitlist-form {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.waitlist-form input {
  flex: 1;
  padding: 16px 20px;
  background: var(--charcoal);
  border: 1px solid var(--smoke);
  color: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
}

.waitlist-form input::placeholder {
  color: var(--ash);
}

.waitlist-form input:focus {
  outline: none;
  border-color: var(--gold-dim);
}

.waitlist-note {
  font-size: 0.75rem;
  color: var(--ash);
}

/* ════════════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════════ */
footer {
  padding: 60px;
  border-top: 1px solid var(--smoke);
}

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

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--gold-dim);
}

.footer-links {
  display: flex;
  gap: 32px;
}

.footer-links a {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  color: var(--silver);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.footer-links a:hover {
  color: var(--gold);
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--ash);
}

/* ════════════════════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  nav {
    padding: 20px 30px;
  }

  .nav-links {
    display: none;
  }

  section {
    padding: 80px 30px;
  }

  #problem {
    flex-direction: column;
    gap: 40px;
  }

  .problem-text {
    max-width: 100%;
  }

  .gap-grid {
    grid-template-columns: 1fr;
  }

  .demo-container {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .demo-panel {
    min-height: 400px;
  }

  .demo-instructions {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
}
