/* ---------- Tokens ---------- */
:root {
  --bg: #0A0A0B;
  --surface: #0E0E10;
  --surface-2: #121214;
  --line: #1C1C20;
  --line-2: #232327;
  --text: #EDEDEF;
  --text-2: #A1A1AA;
  --text-3: #8A8A93;
  --text-4: #6B6B75;
  --accent: #5EEAD4;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Geist', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }
.muted { color: var(--text-3); }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 10px; font-size: 15px; font-weight: 500; transition: background .2s, border-color .2s, transform .2s; }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: 14px; border-radius: 8px; }
.btn--light { background: var(--text); color: var(--bg); }
.btn--light:hover { background: #fff; }
.btn--ghost { border: 1px solid #2A2A2F; }
.btn--ghost:hover { border-color: #3F3F46; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(10, 10, 11, .8); backdrop-filter: saturate(140%) blur(12px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.nav__brand { font-weight: 600; font-size: 15px; }
.nav__links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--text-3); }
.nav__links a:not(.btn) { transition: color .2s; }
.nav__links a:not(.btn):hover { color: var(--text); }

/* ---------- Hero ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding-top: 72px; padding-bottom: 48px; }
.hero__text { flex: 1 1 420px; min-width: 0; }
.badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--text-2); margin-bottom: 28px; }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 2s ease-in-out infinite; }
.hero__title { font-size: clamp(38px, 5.2vw, 58px); font-weight: 600; line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 22px; }
.hero__title .muted { white-space: nowrap; }
.hero__lead { font-size: 17px; line-height: 1.65; color: var(--text-2); max-width: 470px; margin-bottom: 34px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Flow diagram ---------- */
.flow { flex: 1 1 460px; min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 12px; }
.flow__stage { position: relative; width: 100%; aspect-ratio: 520 / 400; container-type: inline-size; }
.flow__svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wire { fill: none; stroke: #2A2A30; stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) var(--d, 0s) forwards; }
.node { position: absolute; left: var(--x); top: var(--y); width: 20.77%; height: 12%; display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font-size: clamp(10px, 2.4cqw, 13px); line-height: 1.25; transition: border-color .3s, background .3s; }
.node:hover { border-color: #3F3F46; background: #16161A; }
.node__kind { display: block; font-family: 'Geist Mono', ui-monospace, monospace; font-size: clamp(8px, 1.9cqw, 10px); text-transform: uppercase; letter-spacing: .04em; color: #6B6B75; margin-bottom: 2px; }
.core { position: absolute; left: 44.23%; top: 42%; width: 15.38%; height: 16%; }
.core__ring { position: absolute; inset: 0; border: 1px solid var(--accent); border-radius: 12px; opacity: 0; animation: ring 2.4s ease-out 1.8s infinite; }
.node--core { inset: 0; left: 0; top: 0; width: 100%; height: 100%; align-items: center; text-align: center; padding: 0 6px; border-color: #2F5F58; border-radius: 12px; background: #0F1715; font-weight: 600; }
.node--core .node__kind { color: var(--accent); font-weight: 400; }

/* ---------- Logos ---------- */
.logos { border-top: 1px solid #18181B; border-bottom: 1px solid #18181B; }
.logos__inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 48px; padding-top: 28px; padding-bottom: 28px; }
.logos__label { font-size: 13px; color: var(--text-4); }
.logos__list { display: flex; flex-wrap: wrap; gap: 16px 48px; font-size: 17px; font-weight: 600; color: var(--text-4); }

/* ---------- Cards / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; padding-top: 56px; padding-bottom: 24px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 26px; transition: border-color .3s, transform .3s var(--ease); }
.card:hover { border-color: #3A3A40; transform: translateY(-3px); }
.card h3 { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.card p { font-size: 14px; color: var(--text-3); line-height: 1.6; }
.card .stat__value { font-size: 44px; font-weight: 600; letter-spacing: -0.045em; line-height: 1.1; color: var(--text); }
.card .stat__label { margin-top: 6px; }

/* ---------- Sections ---------- */
.section { padding-top: 72px; padding-bottom: 32px; }
.eyebrow { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 12px; }
.section__title { font-size: clamp(28px, 3.4vw, 38px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; margin-bottom: 40px; max-width: 640px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--line-2); }
.step { position: relative; padding: 24px 24px 8px 0; }
.step::before { content: ''; position: absolute; top: -1px; left: 0; height: 2px; width: 0; background: var(--accent); transition: width .9s var(--ease) .2s; }
.step.is-visible::before { width: 100%; }
.step:nth-child(2)::before { transition-delay: .5s; }
.step:nth-child(3)::before { transition-delay: .8s; }
.step:nth-child(4)::before { transition-delay: 1.1s; }
.step__num { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-4); }
.step h3 { font-size: 17px; font-weight: 600; margin: 10px 0 8px; }
.step p { font-size: 14px; color: var(--text-3); line-height: 1.6; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }

.timeline { border-top: 1px solid var(--line); }
.timeline__row { display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.timeline__date { flex: 0 0 130px; font-family: 'Geist Mono', ui-monospace, monospace; font-size: 13px; color: var(--text-4); padding-top: 2px; }
.timeline__org { flex: 0 0 200px; font-weight: 600; }
.timeline__desc { flex: 1 1 300px; color: var(--text-3); font-size: 15px; }

.stack { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.stack li { font-family: 'Geist Mono', ui-monospace, monospace; font-size: 12px; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 6px 12px; }

.cta { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 56px 32px; text-align: center; margin-bottom: 40px; }
.cta .section__title { margin: 0 auto 12px; }
.cta p { color: var(--text-3); margin-bottom: 28px; }
.cta .cta__mail { margin: 20px 0 0; font-size: 14px; }
.cta__mail a { color: var(--text); border-bottom: 1px solid #3F3F46; }
.cta__mail a:hover { border-color: var(--text); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid #18181B; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 32px; font-size: 13px; color: var(--text-4); }
.footer__links { display: flex; gap: 20px; }
.footer__links a { transition: color .2s; }
.footer__links a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--stagger, 0s); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Keyframes ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes ring { 0% { transform: scale(1); opacity: .45; } 100% { transform: scale(1.35); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .nav__links a:not(.btn) { display: none; }
  .hero { padding-top: 40px; gap: 40px; }
  .node { padding: 0 6px; border-radius: 7px; }
  .timeline__date, .timeline__org { flex-basis: 100%; }
  .cta { padding: 40px 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .wire { stroke-dashoffset: 0; }
  .core__ring, .packets { display: none; }
}
