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

:root {
  --bg: #fff;
  --bg-2: #f8f8f8;
  --text: #111;
  --text-2: #444;
  --text-3: #888;
  --border: #e5e5e5;
  --accent: #2563eb;
  --font: system-ui, -apple-system, sans-serif;
  --mono: 'Menlo', 'Monaco', monospace;
}

html { scroll-behavior: auto; }
body { font-family: var(--font); background: var(--bg); color: var(--text); }

/* Progress bar */
.progress-bar-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: 3px;
  background: var(--border);
  display: flex;
  align-items: center;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.05s linear;
}
.progress-label {
  position: fixed;
  top: 8px;
  right: 16px;
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-3);
  z-index: 201;
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Nav */
.site-nav {
  position: sticky;
  top: 3px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 40px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-back { font-size: 0.8125rem; color: var(--text-3); text-decoration: none; }
.nav-back:hover { color: var(--text); }
.nav-brand { font-weight: 700; font-size: 0.9rem; }

/* Shared inner */
.inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

/* Hero */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.hero .inner { padding-top: 80px; padding-bottom: 80px; }
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 4rem;
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin-bottom: 24px;
}
.accent { color: var(--accent); }
.sub {
  font-size: 1rem;
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.7;
}

/* Generic section */
.section {
  padding: 100px 0;
  border-bottom: 1px solid var(--border);
}
.section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 20px;
}
.section h2 {
  font-size: 2.5rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.section-sub {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 500px;
  margin-bottom: 48px;
}
.section-sub code, p code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.scroll-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  background: var(--bg);
  transition: border-color 0.12s;
}
.scroll-card:hover { border-color: #bbb; }
.card-icon {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.card-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 6px; font-family: var(--mono); }
.card-desc { font-size: 0.8125rem; color: var(--text-2); line-height: 1.55; }

/* Parallax section */
.parallax-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: #111;
  color: #fff;
  overflow: hidden;
  border-bottom: none;
}
.parallax-bg {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at 30% 50%, #1e3a8a 0%, #111 60%);
  z-index: 0;
}
.parallax-inner { position: relative; z-index: 1; }
.parallax-heading {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: #fff;
  margin-bottom: 20px;
  will-change: transform;
}
.parallax-sub {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 480px;
}
.parallax-sub code {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.85);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.85em;
}

/* Pinned story section */
.story-section {
  position: relative;
  height: 100vh;
  border-bottom: 1px solid var(--border);
}
.story-inner {
  position: relative;
  height: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.story-section .section-label {
  position: absolute;
  top: 40px;
  left: 40px;
}
.story-panels {
  position: relative;
  height: 200px;
}
.story-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
}
.story-panel:first-child { opacity: 1; }
.panel-num {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-3);
  margin-bottom: 16px;
  letter-spacing: 0.05em;
}
.story-panel h2 {
  font-size: 2.75rem;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}
.story-panel p {
  font-size: 0.9375rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 500px;
}
.story-panel p code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Counter section */
.counter-section { min-height: 100vh; }
.counter-inner { padding-top: 100px; padding-bottom: 100px; }
.counter-display {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.counter-number {
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--accent);
  font-family: var(--mono);
  min-width: 8ch;
}
.counter-bar-track {
  width: 320px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.counter-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.05s linear;
}
.counter-note {
  font-size: 0.8125rem;
  color: var(--text-3);
  margin-top: 4px;
}

/* Footer pad */
.footer-pad {
  padding: 60px 0 80px;
  border-top: 1px solid var(--border);
}
.footer-pad .inner { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  display: inline-block;
  padding: 11px 24px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s;
}
.btn-primary:hover { background: #1d4ed8; }
.btn-ghost {
  display: inline-block;
  padding: 11px 24px;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: #bbb; color: var(--text); }

@media (max-width: 640px) {
  .site-nav { padding: 14px 20px; }
  .inner { padding: 0 20px; }
  .hero .inner { padding: 60px 20px; }
  .hero h1 { font-size: 2.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .section h2, .story-panel h2 { font-size: 1.9rem; }
  .counter-number { font-size: 4rem; }
  .counter-bar-track { width: 100%; }
  .story-inner { padding: 0 20px; }
  .story-section .section-label { left: 20px; }
  .parallax-heading { font-size: 2rem; }
}
