/* ============ RESET & BASE ============ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #08090d;
  --bg-surface: #0e1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2333;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #7c5bf5;
  --accent-glow: rgba(124, 91, 245, 0.3);
  --accent-soft: rgba(124, 91, 245, 0.12);
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.12);
  --orange: #d29922;
  --orange-soft: rgba(210, 153, 34, 0.12);
  --blue: #58a6ff;
  --blue-soft: rgba(88, 166, 255, 0.12);
  --red: #f85149;
  --border: rgba(240, 246, 252, 0.06);
  --border-accent: rgba(124, 91, 245, 0.25);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: 'Space Grotesk', -apple-system, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--blue); }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-card);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent);
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  padding: 2rem;
}

.hero-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.2s forwards;
}

.hero h1 {
  font-size: clamp(2.5rem, 7vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.4s forwards;
}

.accent {
  background: linear-gradient(135deg, var(--accent), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 3rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.6s forwards;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.8s forwards;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

.scroll-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.3s;
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
}
.scroll-cta:hover { color: var(--accent); }
.scroll-cta svg {
  animation: bounce 2s ease infinite;
}

/* ---- Hero Nav Buttons ---- */
.hero-nav {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  margin-top: 1rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 1s forwards;
}

.hero-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 0.3s;
  text-align: center;
  min-width: 200px;
  text-decoration: none;
}

.hero-btn svg {
  color: var(--accent);
}

.hero-btn span {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.hero-btn small {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hero-btn-primary {
  border-color: var(--border-accent);
  background: var(--accent-soft);
}

.hero-btn-primary:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-2px);
}

.hero-btn-secondary:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.hero-btn-ghost {
  background: transparent;
  border-color: var(--border);
  padding: 0.75rem 1.5rem;
  min-width: auto;
  flex-direction: row;
}

.hero-btn-ghost span {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.hero-btn-ghost:hover {
  border-color: var(--text-muted);
}

/* ---- Teaser Section ---- */
.teaser {
  max-width: 900px;
  margin: 0 auto;
  padding: 6rem 2rem;
}

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

.teaser-quote blockquote {
  font-size: 1.4rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1rem;
  position: relative;
  padding-left: 1.5rem;
  border-left: 3px solid var(--accent);
}

.teaser-quote cite {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: normal;
  padding-left: 1.5rem;
}

.teaser-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.tl-item {
  display: grid;
  grid-template-columns: 50px 1fr;
  grid-template-rows: auto auto;
  gap: 0 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

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

.tl-day {
  grid-row: 1 / 3;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  padding-top: 0.15rem;
}

.tl-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tl-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ============ TIMELINE SPINE ============ */
.timeline-spine {
  position: fixed;
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  opacity: 0;
  transition: opacity 0.4s;
}

.timeline-spine.visible {
  opacity: 1;
}

.spine-line {
  position: absolute;
  width: 2px;
  height: 100%;
  background: var(--border);
  left: 50%;
  transform: translateX(-50%);
}

.spine-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--text-muted);
  margin: 1.2rem 0;
  transition: all 0.3s;
  cursor: pointer;
  z-index: 1;
}

.spine-dot.active {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.spine-dot span {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.spine-dot:hover span,
.spine-dot.active span {
  opacity: 1;
}

.spine-dot.active span {
  color: var(--accent);
}

/* ============ ACTS ============ */
.act {
  max-width: 900px;
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.act.visible {
  opacity: 1;
  transform: translateY(0);
}

.act-header {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 3rem;
}

.act-number {
  font-size: 5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  color: var(--accent);
  opacity: 0.2;
}

.act-meta {
  padding-top: 0.5rem;
}

.act-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.act-meta h2 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.25rem 0;
}

.act-tagline {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.act-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* ============ NARRATIVE ============ */
.narrative {
  font-size: 1.05rem;
}

.narrative p {
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
}

.narrative p.lead {
  font-size: 1.2rem;
  color: var(--text-primary);
  font-weight: 400;
}

.narrative h3 {
  font-size: 1.3rem;
  margin: 2.5rem 0 1rem;
  color: var(--text-primary);
}

.narrative strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============ COMMIT CARDS ============ */
.commit-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
  font-size: 0.95rem;
  transition: border-color 0.3s, background 0.3s;
}

.commit-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.commit-card code {
  flex-shrink: 0;
  background: var(--accent-soft);
  border-color: var(--border-accent);
}

.commit-card span {
  color: var(--text-secondary);
}

.highlight-commit {
  border-left-color: var(--green);
  background: var(--green-soft);
}

.highlight-commit code {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(63, 185, 80, 0.25);
}

/* ============ AGENT CHIPS ============ */
.agent-wave {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.agent-chip {
  padding: 0.4rem 0.9rem;
  background: var(--accent-soft);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  transition: all 0.3s;
}

.agent-chip:hover {
  background: var(--accent);
  color: var(--bg-deep);
}

.agent-chip.highlight {
  background: var(--orange-soft);
  border-color: rgba(210, 153, 34, 0.25);
  color: var(--orange);
}

.agent-chip.highlight:hover {
  background: var(--orange);
  color: var(--bg-deep);
}

/* ============ INSIGHT CARDS ============ */
.insight-card {
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
}

.insight-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.insight-card p {
  color: var(--text-secondary);
  margin-bottom: 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ============ PROGRESS BAR ============ */
.progress-bar {
  height: 32px;
  background: var(--bg-card);
  border-radius: 100px;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0%;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill span {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

/* ============ ZONE GRID ============ */
.zone-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 2rem 0;
}

.zone {
  padding: 1.25rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.zone:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.zone-name {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.zone-level {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.zone-kernel {
  background: rgba(248, 81, 73, 0.08);
  border-color: rgba(248, 81, 73, 0.2);
}
.zone-kernel .zone-name { color: var(--red); }

.zone-profil {
  background: var(--orange-soft);
  border-color: rgba(210, 153, 34, 0.2);
}
.zone-profil .zone-name { color: var(--orange); }

.zone-satellite {
  background: var(--blue-soft);
  border-color: rgba(88, 166, 255, 0.2);
}
.zone-satellite .zone-name { color: var(--blue); }

.zone-work {
  background: var(--green-soft);
  border-color: rgba(63, 185, 80, 0.2);
}
.zone-work .zone-name { color: var(--green); }

/* ============ TIER STACK ============ */
.tier-stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.tier {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

.tier code {
  font-weight: 600;
  margin-right: 0.5rem;
}

.tier-always {
  background: rgba(248, 81, 73, 0.06);
  border-color: rgba(248, 81, 73, 0.15);
}
.tier-always code { color: var(--red); }

.tier-hot {
  background: var(--orange-soft);
  border-color: rgba(210, 153, 34, 0.15);
}
.tier-hot code { color: var(--orange); }

.tier-warm {
  background: var(--blue-soft);
  border-color: rgba(88, 166, 255, 0.15);
}
.tier-warm code { color: var(--blue); }

.tier-cold {
  background: var(--bg-card);
}
.tier-cold code { color: var(--text-muted); }

/* ============ ACT METRICS ============ */
.act-metrics {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 2rem;
}

.metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.metric-val {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent);
}

.metric-key {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* ============ EPILOGUE ============ */
.epilogue {
  max-width: 900px;
  margin: 0 auto;
  padding: 8rem 2rem;
  text-align: center;
}

.epilogue h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.epilogue .lead {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 3rem;
}

.timeline-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto 3rem;
}

.ts-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s;
}

.ts-item:hover {
  border-color: var(--border-accent);
}

.ts-day {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  flex-shrink: 0;
  width: 60px;
}

.ts-what {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: left;
}

.epilogue-now {
  max-width: 600px;
  margin: 0 auto;
}

.epilogue-now p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.epilogue-cta {
  font-size: 1.1rem;
  color: var(--text-primary) !important;
  font-weight: 500;
}

/* ============ FOOTER ============ */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

footer a {
  color: var(--text-secondary);
}

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(6px); }
  60% { transform: translateY(3px); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .timeline-spine { display: none; }

  .act { padding: 4rem 1.25rem 2rem; }

  .teaser-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .teaser-quote blockquote {
    font-size: 1.15rem;
  }

  .hero-nav {
    flex-direction: column;
    align-items: center;
  }

  .hero-btn { min-width: 260px; }

  .act-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .act-number {
    font-size: 3rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .zone-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .act-metrics {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .metric {
    min-width: 80px;
  }

  .commit-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero-stats {
    flex-wrap: wrap;
    gap: 1rem;
  }

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