:root {
  --bg: #06080d;
  --bg-soft: #0a0e14;
  --bg-card: #0a0e14;
  --bg-card-hover: #11161e;
  --line: #1f2630;
  --line-soft: #1a2230;
  --text: #f3f6fa;
  --text-soft: #d6dde8;
  --text-mute: #a8b2bf;
  --text-dim: #7c8694;
  --brand: #ffd60a;
  --p-engine: #ffd60a;
  --p-product: #f59e0b;
  --p-validate: #fb923c;
  --p-company: #f472b6;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--sans);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--brand); color: var(--bg); }
a { color: inherit; }

@keyframes canPulse { 0%,100% { opacity: 1 } 50% { opacity: 0.35 } }

/* Background grid */
.bg-grid {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0;
}

/* Top sticky bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(6,8,13,0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 14px 32px;
  display: flex; align-items: center; gap: 24px;
  font-family: var(--mono);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot {
  width: 10px; height: 10px; background: var(--brand);
  border-radius: 50%; box-shadow: 0 0 10px var(--brand);
}
.brand-name { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: 2px; }
.brand-sub { font-size: 11px; color: var(--text-dim); letter-spacing: 1.5px; text-transform: uppercase; }
.topnav {
  flex: 1; display: flex; justify-content: center; gap: 28px;
}
.topnav a {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; transition: color .12s;
}
.topnav a:hover { color: var(--brand); }
.counter { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-dim); letter-spacing: 1.5px; }
.counter-pct { color: var(--brand); font-weight: 600; }
.scroll-progress { height: 2px; background: var(--bg-soft); position: relative; }
.scroll-progress-fill {
  position: absolute; inset: 0; width: 0%;
  background: var(--brand);
  box-shadow: 0 0 8px rgba(255,214,10,0.55);
}

/* Layout */
.container {
  position: relative; z-index: 1;
  max-width: 1280px; margin: 0 auto; padding: 0 32px;
}

/* HERO */
.hero { padding: 180px 0 120px; position: relative; }
.hero-mark {
  position: absolute; top: 130px; left: 0;
  width: 40px; height: 40px; pointer-events: none;
}
.label-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.label-bar {
  width: 64px; height: 4px; background: var(--brand);
  box-shadow: 0 0 16px rgba(255,214,10,0.6);
}
.label-text {
  font-family: var(--mono); font-size: 12px; color: var(--brand);
  letter-spacing: 3px; text-transform: uppercase;
}
.hero h1 {
  margin: 0; font-size: 96px; font-weight: 600;
  color: var(--text); letter-spacing: -0.035em; line-height: 0.95;
}
.hero p {
  margin: 36px 0 0; font-size: 19px; color: var(--text-mute);
  line-height: 1.6; max-width: 720px;
}

.hero-stats {
  margin-top: 64px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: rgba(10,14,20,0.6);
  backdrop-filter: blur(4px);
  font-family: var(--mono);
}
.stat { padding: 24px 28px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: none; }
.stat-key {
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
}
.stat-name {
  font-size: 22px; color: var(--text); font-family: var(--sans);
  font-weight: 600; margin-top: 8px; letter-spacing: -0.01em;
}
.stat-range { font-size: 11px; color: var(--text-dim); margin-top: 4px; letter-spacing: 1.5px; }
.stat-num { display: flex; align-items: baseline; gap: 6px; margin-top: 18px; }
.stat-done { font-size: 32px; font-weight: 300; font-family: var(--sans); letter-spacing: -0.02em; }
.stat-total { font-size: 16px; color: var(--text-dim); font-family: var(--sans); }
.stat-bar { display: flex; gap: 3px; margin-top: 10px; height: 4px; }
.stat-bar div { flex: 1; background: var(--line-soft); }
.stat-bar div.on { background: var(--phase-color); }

.scroll-hint {
  margin-top: 80px; font-family: var(--mono);
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
  display: flex; align-items: center; gap: 12px;
}
.scroll-hint span.line { width: 60px; height: 1px; background: var(--line); }
.scroll-hint span.arrow { color: var(--brand); }

/* PHASES */
.phase { padding: 80px 0; position: relative; scroll-margin-top: 80px; }
.phase[data-phase="engine"]   { --phase-color: var(--p-engine); }
.phase[data-phase="product"]  { --phase-color: var(--p-product); }
.phase[data-phase="validate"] { --phase-color: var(--p-validate); }
.phase[data-phase="company"]  { --phase-color: var(--p-company); }

.phase-header {
  display: flex; align-items: flex-end; gap: 32px; margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid color-mix(in srgb, var(--phase-color) 20%, transparent);
}
.phase-meta { flex: 1; }
.phase-label-row { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.phase-label-bar {
  width: 36px; height: 3px; background: var(--phase-color);
  box-shadow: 0 0 12px color-mix(in srgb, var(--phase-color) 55%, transparent);
}
.phase-label-text {
  font-family: var(--mono); font-size: 11px;
  color: var(--phase-color); letter-spacing: 3px; text-transform: uppercase;
}
.phase-header h2 {
  margin: 0; font-size: 64px; font-weight: 600;
  color: var(--text); letter-spacing: -0.03em; line-height: 1;
}
.phase-header p {
  margin: 14px 0 0; font-size: 17px; color: var(--text-mute);
  max-width: 560px;
}
.phase-completion {
  font-family: var(--mono); text-align: right;
  border: 1px solid var(--line); padding: 14px 22px;
  background: var(--bg-soft);
}
.phase-completion-key {
  font-size: 10px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase;
}
.phase-completion-num {
  font-size: 32px; color: var(--phase-color); font-weight: 300;
  font-family: var(--sans); letter-spacing: -0.02em; margin-top: 4px;
}
.phase-completion-num span { color: var(--text-dim); font-size: 18px; }

/* MILESTONE CARDS */
.milestones { display: flex; flex-direction: column; gap: 16px; }
.milestone {
  border: 1px solid var(--line);
  background: var(--bg-card);
  transition: border-color .12s, background .12s;
  position: relative; display: flex; align-items: stretch;
  overflow: hidden;
}
.milestone:hover { border-color: var(--phase-color); background: var(--bg-card-hover); }
.milestone.done { border-color: color-mix(in srgb, var(--phase-color) 55%, transparent); }

.m-rail-l {
  width: 88px; padding: 24px 0;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-family: var(--mono);
}
.milestone.done .m-rail-l {
  border-right-color: color-mix(in srgb, var(--phase-color) 27%, transparent);
  background: color-mix(in srgb, var(--phase-color) 6%, transparent);
}
.m-dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--phase-color);
  display: flex; align-items: center; justify-content: center;
  color: var(--bg); font-size: 10px; font-weight: 700;
}
.milestone.done .m-dot { background: var(--phase-color); }
.milestone.live .m-dot {
  box-shadow: 0 0 12px var(--phase-color);
  animation: canPulse 1.4s ease-in-out infinite;
}
.m-code { font-size: 12px; color: var(--phase-color); font-weight: 600; letter-spacing: 2px; }
.m-rail-l .grow { flex: 1; }
.m-status-vertical {
  font-size: 9px; color: var(--text-dim);
  letter-spacing: 1.5px; transform: rotate(-90deg);
  white-space: nowrap; text-transform: uppercase;
}

.m-body {
  flex: 1; padding: 24px 32px;
  display: flex; flex-direction: column; justify-content: center;
  min-height: 120px;
}
.m-title-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.m-title {
  margin: 0; font-size: 24px; font-weight: 600; color: var(--text);
  letter-spacing: -0.015em; line-height: 1.2;
}
.m-title-line { flex: 1; height: 1px; background: var(--line); }
.m-position {
  font-family: var(--mono); font-size: 11px;
  color: var(--phase-color); letter-spacing: 1.5px; white-space: nowrap;
}
.m-short {
  font-family: var(--mono); font-size: 12px;
  color: var(--phase-color); opacity: 0.85;
  margin-bottom: 10px; letter-spacing: 0.5px;
}
.m-desc { margin: 0; font-size: 14px; line-height: 1.6; color: var(--text-mute); }

.m-rail-r {
  width: 200px; border-left: 1px solid var(--line);
  display: flex; flex-direction: column;
  font-family: var(--mono);
}
.m-date {
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.m-date-key {
  font-size: 9px; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px;
}
.m-date-val { font-size: 18px; color: var(--text); letter-spacing: 1px; font-weight: 500; }
.m-status {
  font-size: 11px; padding: 14px 24px;
  letter-spacing: 1.5px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-dim); font-weight: 600;
}
.milestone.done .m-status { background: var(--phase-color); color: var(--bg); }
.milestone.live .m-status { color: var(--phase-color); }
.m-status .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--phase-color);
  animation: canPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 8px var(--phase-color);
}

/* FOOTER */
.footer {
  padding: 120px 0 80px;
  border-top: 1px solid var(--line);
  margin-top: 80px;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 40px;
}
.footer-title {
  font-size: 36px; font-weight: 600; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.1; max-width: 540px;
}
.footer-title span { color: var(--brand); }
.doc-card {
  font-family: var(--mono); text-align: right;
  border: 1px solid rgba(255,214,10,0.33);
  background: rgba(14,18,24,0.85);
  box-shadow: 0 0 0 1px rgba(255,214,10,0.09), 0 0 40px rgba(255,214,10,0.08);
}
.doc-card-bar { height: 3px; background: var(--brand); box-shadow: 0 0 12px rgba(255,214,10,0.6); }
.doc-card-head {
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 14px;
}
.doc-card-head .key { font-size: 11px; color: var(--brand); letter-spacing: 2px; text-transform: uppercase; }
.doc-card-head .val { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: 1px; }
.doc-card-grid { display: grid; grid-template-columns: auto auto; font-size: 10px; }
.doc-card-grid div {
  padding: 6px 22px;
  border-bottom: 1px solid var(--line);
}
.doc-card-grid div:nth-child(odd) {
  border-right: 1px solid var(--line);
  color: var(--text-dim); letter-spacing: 1.5px;
}
.doc-card-grid div:nth-child(even) {
  color: var(--text-soft); letter-spacing: 1px;
}
.doc-card-grid div:nth-last-child(-n+2) { border-bottom: none; }

/* Responsive */
@media (max-width: 900px) {
  .hero { padding: 140px 0 80px; }
  .hero h1 { font-size: 56px; }
  .hero p { font-size: 16px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .stat { border-right: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .topnav { display: none; }
  .phase-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .phase-header h2 { font-size: 44px; }
  .milestone { flex-direction: column; }
  .m-rail-l {
    width: 100%; flex-direction: row; padding: 12px 18px;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .m-rail-l .grow { display: none; }
  .m-status-vertical { transform: none; }
  .m-rail-r { width: 100%; border-left: none; border-top: 1px solid var(--line); flex-direction: row; }
  .m-date { border-bottom: none; border-right: 1px solid var(--line); padding: 14px 18px; }
  .m-status { padding: 14px 18px; }
  .footer { flex-direction: column; align-items: flex-start; }
  .doc-card { width: 100%; text-align: left; }
}
@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .topbar-inner { padding: 12px 18px; gap: 12px; }
  .brand-sub { display: none; }
  .hero h1 { font-size: 42px; }
  .phase-header h2 { font-size: 36px; }
  .m-title { font-size: 19px; }
}
