:root {
  /* Dark sections */
  --bg-deep: #0b0b1a;
  --bg-section: #111128;
  --bg-card: #1a1a36;
  --bg-elevated: #222244;
  /* Light / hero */
  --bg-cream: #f5f3ed;
  --bg-cream-warm: #ede9df;
  /* Accents */
  --accent-primary: #4b7bf5;
  --accent-warm: #f5a623;
  --accent-teal: #3ecfb4;
  --accent-rose: #f56b8a;
  /* Text */
  --text-primary: #ffffff;
  --text-body: #c8c8d8;
  --text-muted: #8888a8;
  --text-dark: #1a1a1a;
  --text-dark-body: #3a3a3a;
  --text-dark-muted: #888888;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-dark: rgba(0, 0, 0, 0.1);
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family:
    "Inter",
    -apple-system,
    sans-serif;
  background: var(--bg-deep);
  color: var(--text-body);
  line-height: 1.75;
  font-size: 1.125rem;
  -webkit-font-smoothing: antialiased;
}
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 32px;
}
.container-wide {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Chapter Navigation Bar (Intercom-style) ─── */
.chapter-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border-dark);
  display: flex;
  align-items: stretch;
  height: 48px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chapter-nav::-webkit-scrollbar {
  display: none;
}
.chapter-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 120px;
  padding: 0 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #888;
  text-decoration: none;
  border-right: 1px solid var(--border-dark);
  white-space: nowrap;
  transition:
    background 0.2s,
    color 0.2s;
  position: relative;
}
.chapter-nav a:last-child {
  border-right: none;
}
.chapter-nav a:hover {
  background: #000;
  color: #fff;
}
.chapter-nav a.active {
  background: #000;
  color: #fff;
  font-weight: 600;
}
.chapter-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #333;
}
.chapter-nav .nav-logo-cell {
  min-width: 48px;
  max-width: 48px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-dark);
  background: #e8f5e0;
  font-size: 1rem;
}

/* ─── Dark Hero Cover (3D Dynamic Funnel) ─── */
.hero-cover {
  background: #000;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 80px 32px 60px;
}
.hero-cover-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hero-cover-canvas canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-cover-content {
  position: relative;
  z-index: 2;
  text-align: left;
  max-width: 780px;
  width: 100%;
}
.hero-cover-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 2rem;
  display: block;
}
.hero-cover-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 7vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #fff;
  margin-bottom: 1.5rem;
}
.hero-cover-highlight {
  display: inline;
  background: #fff;
  color: #000;
  -webkit-text-fill-color: #000;
  padding: 0.05em 0.15em;
  position: relative;
  clip-path: inset(0 100% 0 0);
  animation: typeReveal 6s steps(16) 0.5s infinite;
}
.hero-cover-highlight::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 0.05em;
  width: 3px;
  height: 0.9em;
  background: #fff;
  animation: cursorBlink 0.6s step-end infinite;
}
@keyframes typeReveal {
  0% {
    clip-path: inset(0 100% 0 0);
  }
  40% {
    clip-path: inset(0 0% 0 0);
  }
  80% {
    clip-path: inset(0 0% 0 0);
  }
  80.1% {
    clip-path: inset(0 100% 0 0);
  }
  85% {
    clip-path: inset(0 100% 0 0);
  }
  100% {
    clip-path: inset(0 100% 0 0);
  }
}
@keyframes cursorBlink {
  0%,
  50% {
    opacity: 1;
  }
  50.1%,
  100% {
    opacity: 0;
  }
}
.hero-cover-meta {
  display: flex;
  gap: 2rem;
  justify-content: flex-start;
  margin-top: 3rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.733);
}
.hero-cover-meta span {
  opacity: 0.7;
}

/* ─── Scroll Marquee ─── */
.scroll-marquee {
  background: #000;
  overflow: hidden;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.marquee-inner {
  display: flex;
  white-space: nowrap;
  will-change: transform;
}
.marquee-track {
  font-size: 1.25rem;
  letter-spacing: 0.5em;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 1rem;
  flex-shrink: 0;
}

/* ─── Light About Hero (transition section) ─── */
.hero {
  background: var(--bg-cream);
  padding: 6rem 32px;
  position: relative;
}
.hero-content {
  max-width: 780px;
  margin: 0 auto;
}
.hero-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--text-dark);
  margin-bottom: 2rem;
}
.hero-body {
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.7;
  color: var(--text-dark-body);
  max-width: 680px;
}
.hero-body p {
  margin-bottom: 1.5rem;
}

/* ─── About Section (still light theme) ─── */
.about-section {
  background: var(--bg-cream-warm);
  padding: 6rem 32px;
}
.about-inner {
  max-width: 780px;
  margin: 0 auto;
}
.about-inner h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 1.5rem 0 2rem;
}
.about-tag {
  background: rgba(0, 0, 0, 0.06);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 1rem;
  color: var(--text-dark-body);
}
.about-tag.accent {
  background: #222;
  color: #fff200;
}
.about-values {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.about-values h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.about-values li,
.about-styles li {
  color: var(--text-dark-body);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  padding-left: 0;
  list-style: none;
}
.about-values li::before,
.about-styles li::before {
  content: "— ";
  color: var(--text-dark-muted);
}
.about-styles {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.about-styles h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}
.about-styles p {
  color: var(--text-dark-body);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

/* ─── Next / Transition bar ─── */
.next-bar {
  background: var(--bg-cream);
  text-align: center;
  padding: 3rem 32px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.next-bar a {
  font-family: "JetBrains Mono", monospace;
  font-size: 4rem;
  letter-spacing: 0.1em;
  color: var(--text-dark-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.next-bar a:hover {
  color: var(--text-dark);
}

/* ─── Project Sections (Light theme, matching About) ─── */
section.project {
  background: var(--bg-cream);
  padding: 6rem 32px;
  min-height: calc(100vh - 48px);
}
section.project .container {
  max-width: 780px;
  margin: 0 auto;
}

.section-number {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.875rem;
  color: var(--text-dark-muted);
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 1rem;
}
.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}
.section-subtitle {
  font-size: 1rem;
  color: var(--text-dark-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}
.project-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 2rem;
}
.project-role {
  font-size: 0.8rem;
  color: #1a6b5a;
  background: rgba(62, 180, 150, 0.12);
  padding: 4px 12px;
  border-radius: 100px;
}
.project-year {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-dark-muted);
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2rem;
}
.project-tags span {
  font-size: 0.75rem;
  color: var(--text-dark-body);
  background: rgba(0, 0, 0, 0.05);
  padding: 3px 10px;
  border-radius: 4px;
}
.content p {
  margin-bottom: 1rem;
  color: var(--text-dark-body);
}
.content strong {
  color: var(--text-dark);
  font-weight: 600;
}
.content h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

/* Stat callout */
.stat-callout {
  background: #fff;
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
}
.stat-number {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--text-dark);
  display: block;
  line-height: 1.2;
}
.stat-label {
  font-size: 0.95rem;
  color: var(--text-dark-muted);
  margin-top: 0.5rem;
}

/* Findings grid */
.findings-grid {
  display: grid;
  gap: 1.5rem;
  margin: 2rem 0;
}
.finding-card {
  background: #fff;
  border: 1px solid var(--border-dark);
  border-radius: 10px;
  padding: 1.5rem;
}
.finding-card h4 {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}
.finding-card p {
  font-size: 0.9rem;
  color: var(--text-dark-muted);
}

blockquote {
  border-left: 3px solid var(--text-dark-muted);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 0 8px 8px 0;
  font-size: 1rem;
  color: var(--text-dark-body);
  font-style: italic;
}
.insight-box {
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}
.insight-box h4 {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dark-muted);
  margin-bottom: 0.75rem;
}
.insight-box p,
.insight-box li {
  font-size: 0.95rem;
  color: var(--text-dark-body);
  line-height: 1.7;
}
.insight-box ul {
  padding-left: 1.2rem;
}
.insight-box li {
  margin-bottom: 0.4rem;
}

.section-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--text-dark-muted), transparent);
  margin: 2rem 0;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  transition: all 0.2s;
}
.project-link:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: var(--text-dark);
}

/* Footer */
.footer {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-deep);
}
.footer-cta {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.footer-link {
  display: inline-block;
  margin-top: 1rem;
  padding: 12px 32px;
  border-radius: 8px;
  background: var(--accent-primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s;
}
.footer-link:hover {
  background: #3a6ae0;
  transform: translateY(-1px);
}
.footer-sub {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .chapter-nav a {
    min-width: 100px;
    font-size: 0.6rem;
    padding: 0 10px;
  }
  .hero-cover {
    min-height: 50vh;
    padding: 60px 24px 40px;
  }
  .hero-cover-meta {
    gap: 1rem;
    flex-wrap: wrap;
  }
  .hero {
    padding: 4rem 24px;
  }
  section.project {
    padding: 4rem 0;
  }
  .container,
  .container-wide {
    padding: 0 20px;
  }
  .about-section {
    padding: 4rem 20px;
  }
  .stat-number {
    font-size: 2.5rem;
  }
}
