html { scroll-behavior: smooth; }
body {
  text-wrap: pretty;
  background:
    radial-gradient(1200px 720px at 82% -160px, color-mix(in srgb, var(--color-accent-900) 75%, transparent), transparent 60%),
    radial-gradient(1100px 800px at -10% 100%, color-mix(in srgb, black 30%, transparent), transparent 55%),
    var(--color-bg);
}
a { color: var(--color-accent-300); text-decoration: none; }
a:hover { color: var(--color-accent-200); }
.btn-primary, .btn-ghost { color: var(--color-accent); }

.page { min-height: 100vh; color: var(--color-text); font-family: var(--font-body); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px); }
.mono { font-family: 'Ubuntu Mono', ui-monospace, monospace; }
.btn { white-space: nowrap; flex: none; }
.actions { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: 32px; }
.rule {
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right, transparent, var(--color-neutral-700) 48px calc(100% - 48px), transparent);
}

.eyebrow {
  display: block; font-family: 'Ubuntu Mono', ui-monospace, monospace;
  font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 16px;
}
.eyebrow.muted { margin: 56px 0 0; color: color-mix(in srgb, var(--color-text) 60%, transparent); }
.eyebrow.light { color: var(--color-accent-200); }
.eyebrow.accent { color: var(--color-accent); }

/* nav */
.site-nav {
  padding-inline: clamp(20px, 5vw, 72px); position: sticky; top: 0; z-index: 10;
  height: 48px; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--color-bg) 78%, transparent);
}
.site-nav a { white-space: nowrap; }
.site-nav .nav-brand { color: var(--color-text); font-size: 19px; font-weight: 400; letter-spacing: 0; }
.site-nav .btn-primary:hover { color: var(--color-accent); }

/* hero */
.hero { min-height: calc(100svh - 48px); padding: 48px 0; display: flex; flex-direction: column; justify-content: center; }
.hero h1 {
  font-size: clamp(44px, 7.4vw, 96px); line-height: 1.04; letter-spacing: -0.022em; margin: 0 0 0 -0.06em;
}
.hero h1 span { display: block; }
.hero-sub {
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; letter-spacing: -0.01em;
  max-width: 30ch; margin: 28px 0 0; color: var(--color-accent-200);
}
.hero-copy { font-size: 17px; line-height: 27px; max-width: 50ch; margin: 20px 0 0; color: color-mix(in srgb, var(--color-text) 72%, transparent); }
.hero-copy span { color: var(--color-text); }

/* lifecycle */
.lifecycle {
  background: radial-gradient(900px 420px at 85% -40%, color-mix(in srgb, var(--color-section-glow) 70%, transparent), transparent 64%), var(--color-section);
  padding: clamp(64px, 8vw, 104px) 0;
}
.lifecycle h2 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -0.015em; margin: 0; }
.lifecycle-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px 20px; }
.lifecycle .tag-accent { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: 0.1em; }
.timeline { margin-top: clamp(24px, 4vw, 48px); }
.timeline-svg { display: block; overflow: visible; }
/* three equal columns, no gap: column centres sit under the SVG nodes (1/6, 1/2, 5/6) */
.timeline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; text-align: center; }
.stage-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 clamp(8px, 2vw, 28px); color: var(--color-text); }
.stage-link:hover { color: var(--color-text); }
.stage-link:hover .stage-name { color: var(--color-accent-200); }
.stage-phase {
  font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 14px; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--color-accent-300); font-feature-settings: 'tnum' 1;
}
.stage-name { font-family: var(--font-heading); font-weight: var(--font-heading-weight); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.15; letter-spacing: -0.015em; }
.stage-verb { font-size: 15px; line-height: 23px; max-width: 28ch; color: color-mix(in srgb, var(--color-text) 72%, transparent); }
/* narrow screens: the SVG can't line up with stacked columns, so stack and hide it */
@media (max-width: 720px) {
  .timeline-svg { display: none; }
  .timeline-grid { grid-template-columns: 1fr; gap: 32px; text-align: left; }
  .stage-link { align-items: flex-start; padding: 0; }
}

/* stage details */
.stages { padding: clamp(56px, 8vw, 96px) 0 clamp(40px, 6vw, 72px); }
.stage {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 20px clamp(24px, 5vw, 80px); padding: 44px 0; position: relative; scroll-margin-top: 72px;
}
.stage-head { display: flex; flex-direction: column; gap: 12px; }
.stage-id { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 16px; color: var(--color-accent); font-feature-settings: 'tnum' 1; }
.stage h3 { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -0.012em; margin: 0; }
.stage-body { display: flex; flex-direction: column; gap: 20px; }
.stage-body p { font-size: 16px; line-height: 26px; margin: 0; max-width: 52ch; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags .tag { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }

/* faq */
.faq {
  padding: clamp(40px, 6vw, 72px) 0; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 32px clamp(24px, 5vw, 80px); scroll-margin-top: 72px;
}
.faq h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 0; }
.faq-list { display: flex; flex-direction: column; }
.faq-item { border-bottom: 1px solid var(--color-divider); }
.faq-q {
  all: unset; box-sizing: border-box; width: 100%; display: flex; justify-content: space-between;
  align-items: center; gap: 24px; padding: 22px 0; cursor: pointer;
  font-family: var(--font-heading); font-weight: var(--font-heading-weight);
  font-size: 18px; line-height: 26px; color: var(--color-text);
}
.faq-q:hover { color: var(--color-accent-200); }
.faq-q:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.faq-icon { font-size: 22px; line-height: 1; color: var(--color-accent); flex: none; }
.faq-a { margin: 0 0 24px; font-size: 16px; line-height: 26px; max-width: 58ch; color: color-mix(in srgb, var(--color-text) 80%, transparent); }


/* cta + footer */
.cta { padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 6vw, 80px); scroll-margin-top: 72px; }
.cta h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 0 -0.04em; max-width: 16ch; }
.cta p { font-size: 17px; line-height: 28px; max-width: 52ch; margin: 24px 0 0; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.footer {
  padding: 32px 0 48px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  font-size: 14px; color: color-mix(in srgb, var(--color-text) 55%, transparent); position: relative;
}
.footer .rule { background: linear-gradient(to right, transparent, var(--color-divider) 48px calc(100% - 48px), transparent); }

/* FAQ smooth open/close */
.faq-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.faq-panel > div { overflow: hidden; }
.faq-q[aria-expanded='true'] + .faq-panel { grid-template-rows: 1fr; }
.faq-icon { transition: transform 0.3s ease; }

/* ── Animations (motion only for users who haven't opted out) ── */
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes node-in { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: none; } }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 16px color-mix(in srgb, var(--color-accent) 70%, transparent); }
  50% { box-shadow: 0 0 26px 4px color-mix(in srgb, var(--color-accent) 90%, transparent); }
}

@media (prefers-reduced-motion: no-preference) {
  /* hero entrance */
  .hero h1 span, .hero-sub, .hero-copy, .hero .actions, .hero .eyebrow {
    animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }
  .hero h1 span:nth-child(1) { animation-delay: 0.05s; }
  .hero h1 span:nth-child(2) { animation-delay: 0.18s; }
  .hero-sub { animation-delay: 0.38s; }
  .hero-copy { animation-delay: 0.5s; }
  .hero .actions { animation-delay: 0.62s; }
  .hero .eyebrow { animation-delay: 0.78s; }

  /* scroll reveals (only hidden when JS is running) */
  .js [data-reveal] {
    opacity: 0; transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }

  /* timeline draw-in */
  .tl-node { transform-box: fill-box; transform-origin: center; }
  .js .tl-line { transform-box: fill-box; transform-origin: left; transform: scaleX(0); }
  .js .tl-node, .js .tl-loop { opacity: 0; }
  .js .timeline-grid .stage-link { opacity: 0; transform: translateY(12px); }
  .js .timeline.in .tl-line { animation: draw 1.2s cubic-bezier(0.6, 0, 0.2, 1) forwards; }
  .js .timeline.in .tl-node { animation: node-in 0.5s ease forwards; }
  .js .timeline.in .n1 { animation-delay: 0.2s; }
  .js .timeline.in .n2 { animation-delay: 0.6s; }
  .js .timeline.in .n3 { animation-delay: 1.0s; }
  .js .timeline.in .tl-loop { opacity: 1; transition: opacity 0.8s ease 1.4s; }
  .js .timeline.in .stage-link { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .timeline.in .stage-link:nth-child(1) { transition-delay: 0.3s; }
  .js .timeline.in .stage-link:nth-child(2) { transition-delay: 0.7s; }
  .js .timeline.in .stage-link:nth-child(3) { transition-delay: 1.1s; }
}

@media (prefers-reduced-motion: reduce) {
  .faq-panel, .faq-icon { transition: none; }
}

/* Houston / mission control */
.houston { padding: clamp(40px, 6vw, 72px) 0; }
.houston h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 0 0 12px; }
.houston-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px; margin-top: 28px;
}
.houston .card { padding: 22px; gap: 12px; }
.houston .card-kicker { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }
.houston .card-title { font-size: 20px; }
.trace { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.9; color: var(--color-neutral-400); margin-top: 6px; }
.trace > div { display: flex; gap: 10px; }
.trace .t { color: var(--color-neutral-600); }
.trace .k { color: var(--color-accent-400); width: 34px; }
.trace .flag { background: var(--color-accent-900); border-radius: 4px; margin: 0 -8px; padding: 0 8px; color: var(--color-accent-200); }
.trace .flag .t { color: var(--color-neutral-500); }
.trace .flag .k { color: var(--color-accent-300); }
.checks { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; font-size: 15px; }
.checks > div { display: flex; justify-content: space-between; align-items: center; color: var(--color-neutral-300); }
.checks .tag { font-size: 12px; padding: 2px 10px; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; font-size: 13px; color: var(--color-neutral-400); }
.bar-row { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; }
.bar { height: 8px; border-radius: 4px; background: var(--color-neutral-700); }
.bar-fix { background: var(--color-accent); box-shadow: 0 0 10px color-mix(in srgb, var(--color-accent) 50%, transparent); }
.bar-row .fix { color: var(--color-accent-300); }
.bar-note { color: var(--color-neutral-600); font-size: 13px; }
@media (prefers-reduced-motion: no-preference) {
  .js .houston .card { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .houston.in .card { opacity: 1; transform: none; }
  .js .houston.in .card:nth-child(2) { transition-delay: 0.12s; }
  .js .houston.in .card:nth-child(3) { transition-delay: 0.24s; }
}


/* Better safe than sorry */
.safe { padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 6vw, 72px); }
.safe h2 { font-size: clamp(28px, 3vw, 36px); line-height: 1.2; margin: 0 0 16px; }
.safe > p { font-size: 17px; line-height: 28px; max-width: 52ch; margin: 0; color: color-mix(in srgb, var(--color-text) 80%, transparent); }
.safe-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px; margin-top: 28px; max-width: 760px;
}
.safe .card { padding: 22px; gap: 10px; }
.safe .card-kicker { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }
.safe .card-title { font-size: 20px; }
.safe .card-body { font-size: 15px; line-height: 23px; }
.safe .safe-close { margin-top: 24px; font-size: 17px; line-height: 28px; color: var(--color-accent-300); }
@media (prefers-reduced-motion: no-preference) {
  .js .safe .card { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .js .safe.in .card { opacity: 1; transform: none; }
  .js .safe.in .card:nth-child(2) { transition-delay: 0.12s; }
}

/* Stage details: journey line, question, example visuals */
.stages { --sp: clamp(28px, 4vw, 48px); position: relative; padding-left: var(--sp); }
.stages::before {
  content: ''; position: absolute; left: 9px; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--color-accent-700) 64px calc(100% - 64px), transparent);
}
.stage::before {
  content: ''; position: absolute; left: calc(var(--sp) * -1); top: 48px; width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--color-accent-300); background: var(--color-bg);
  box-shadow: 0 0 16px color-mix(in srgb, var(--color-accent) 60%, transparent), inset 0 0 0 4px var(--color-bg), inset 0 0 0 9px var(--color-accent-300);
}
.stage-q { margin: 0; font-size: 18px; line-height: 26px; color: var(--color-accent-300); }
.stage-visual { padding: 20px; gap: 12px; max-width: 440px; }
.stage-visual .card-kicker { font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; }
.stage-visual .checks { margin-top: 0; font-size: 15px; }
.stage-visual .trace { margin-top: 0; }
.trace.rec .k { width: 70px; color: var(--color-neutral-500); }
.trace.rec .flag .k { color: var(--color-accent-300); }
.visual-foot {
  font-family: 'Ubuntu Mono', ui-monospace, monospace; font-size: 13px; letter-spacing: 0.04em;
  color: var(--color-accent-300); padding-top: 12px; border-top: 1px solid var(--color-divider);
}


/* hero logo: right of the headline block, its base aligned with the last text line */
.hero-top { position: relative; width: fit-content; max-width: 100%; }
.hero-logo {
  position: absolute; right: 0; bottom: 5px; color: var(--color-accent-400);
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.9s both;
}
@media (max-width: 720px) { .hero-logo { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }

/* footer links + legal pages */
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { color: inherit; }
.footer-links a:hover { color: var(--color-accent-200); }
.legal { max-width: 720px; padding: clamp(48px, 8vw, 96px) 0 clamp(48px, 6vw, 80px); }
.legal h1 { font-size: clamp(34px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 32px; }
.legal h2 { font-size: 22px; line-height: 1.25; margin: 40px 0 10px; }
.legal p, .legal li { font-size: 16px; line-height: 26px; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.legal address { font-style: normal; font-size: 16px; line-height: 26px; color: color-mix(in srgb, var(--color-text) 82%, transparent); }
.legal ul { padding-left: 20px; margin: 0 0 var(--space-3); }
.legal .back { display: inline-block; margin-top: 40px; }
