/* ============================================================
   AI-Substrate — "instrument panel on paper"
   Colour is information: amber = the language path (a model
   reads the brief, once per shape). Teal = the machine path
   (deterministic, every request, no model). Nothing is tinted
   for decoration.
   ============================================================ */

:root {
  --paper:      #eef1f4;
  --paper-2:    #e7ebef;
  --panel:      #ffffff;
  --ink:        #0d1117;
  --ink-2:      #545e6d;
  --ink-3:      #8b94a1;
  --rule:       #dde2e8;
  --rule-2:     #c7cfd9;

  --amber:      #b4530a;
  --amber-fill: #fbf0e1;
  --amber-line: #e2a465;

  --teal:       #0c6b72;
  --teal-fill:  #e2f0f0;
  --teal-line:  #6aa9ad;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body:    "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:    "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1240px;
  --pad:   clamp(20px, 5vw, 40px);
  --sec-y: clamp(76px, 11vw, 136px);
  --ease:  cubic-bezier(.22, .61, .36, 1);
}

/* ── reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16.5px/1.62 var(--body);
  font-feature-settings: "ss02" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -0.032em; line-height: 1.04; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
[hidden] { display: none !important; }
a { color: inherit; }
img, svg { max-width: 100%; }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; border-radius: 3px; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 6px;
  font: 500 13px var(--mono); text-decoration: none;
}
.skip:focus { left: 12px; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding-inline: var(--pad); }

/* ── shared type ───────────────────────────────────────── */
.eyebrow {
  font: 500 11.5px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
}
.eyebrow-inv { color: rgba(255,255,255,.5); }

.sec-h { font-size: clamp(30px, 4.4vw, 50px); }
.sub-h { font-family: var(--display); font-weight: 600; letter-spacing: -.028em; font-size: clamp(22px, 2.6vw, 30px); }
.sec-sub { margin-top: 14px; max-width: 58ch; color: var(--ink-2); font-size: 17px; }

.dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 9px; vertical-align: 1px; flex: none;
}
.dot-amber { background: var(--amber); }
.dot-teal  { background: var(--teal); }

/* ── graph-paper field ─────────────────────────────────── */
.grid-field {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(13,17,23,.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13,17,23,.045) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 90% at 22% 20%, #000 0%, transparent 72%);
          mask-image: radial-gradient(120% 90% at 22% 20%, #000 0%, transparent 72%);
}
.grid-field-dark {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.07) 1px, transparent 1px);
  -webkit-mask-image: radial-gradient(110% 100% at 78% 0%, #000 0%, transparent 70%);
          mask-image: radial-gradient(110% 100% at 78% 0%, #000 0%, transparent 70%);
}

/* ── nav ───────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238,241,244,.82);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
          backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.stuck { border-bottom-color: var(--rule); }
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 600 16px var(--display); letter-spacing: -.02em; text-decoration: none;
}
.mark { width: 17px; height: 17px; fill: var(--ink); }
.mark-plane { fill: var(--teal); }
.wordmark-sm { font-size: 15px; }

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 14.5px; color: var(--ink-2); text-decoration: none; transition: color .18s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  color: var(--ink) !important; font-weight: 500;
  border: 1px solid var(--rule-2); border-radius: 6px; padding: 7px 14px;
  background: var(--panel);
  transition: border-color .18s var(--ease), transform .18s var(--ease);
}
.nav-cta:hover { border-color: var(--ink); transform: translateY(-1px); }

/* ── hero ──────────────────────────────────────────────── */
.hero { position: relative; padding-block: clamp(64px, 9vw, 116px) clamp(64px, 9vw, 108px); overflow: hidden; }
.hero-in {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 352px;
  gap: clamp(32px, 5vw, 72px); align-items: start;
}
.hero h1 { margin-top: 20px; font-size: clamp(38px, 5.6vw, 66px); font-weight: 600; }
.plane-bar { margin-bottom: 22px; }
.plane-bar span {
  display: block; width: 64px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transform: scaleX(0); transform-origin: left;
  animation: sweep .9s .5s var(--ease) forwards;
}
@keyframes sweep { to { transform: scaleX(1); } }

.lede { margin-top: 26px; max-width: 50ch; font-size: clamp(17px, 1.5vw, 19.5px); line-height: 1.55; color: var(--ink-2); }
.hero-copy { max-width: 720px; }

.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 34px; }
.hero-facts li { display: flex; align-items: center; font: 400 13px var(--mono); color: var(--ink-2); }

.hero-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 26px;
  box-shadow: 0 1px 2px rgba(13,17,23,.04), 0 12px 32px -14px rgba(13,17,23,.18);
}
.card-tag { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal); }
.hero-card h2 { margin-top: 14px; font-size: 25px; }
.card-body { margin-top: 10px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.card-foot { margin-top: 16px; font-size: 13px; color: var(--ink-3); text-align: center; }
.card-foot a { color: var(--ink-2); text-underline-offset: 3px; }

/* ── buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: 500 15px var(--body); text-decoration: none; cursor: pointer;
  border-radius: 8px; border: 1px solid transparent; padding: 12px 20px;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s var(--ease); }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 1px 2px rgba(13,17,23,.2); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -6px rgba(13,17,23,.45); }
.btn-primary:active { transform: translateY(0); }
.btn-block { width: 100%; margin-top: 6px; padding-block: 14px; }
.hero-card .btn { width: 100%; margin-top: 20px; }

/* ── signature strip ───────────────────────────────────── */
.strip { border-block: 1px solid var(--rule); background: var(--paper-2); padding-block: clamp(48px, 6vw, 72px); }
.states { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 30px; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.state { background: var(--panel); padding: 22px 24px 24px; }
.state-k { display: flex; align-items: center; font: 500 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.state-teal  .state-k { color: var(--teal); }
.state-amber .state-k { color: var(--amber); }
.code {
  margin: 16px 0 0; padding: 14px; border-radius: 7px; background: var(--paper);
  font: 400 12.5px/1.75 var(--mono); color: var(--ink); white-space: pre-wrap; word-break: break-word;
  border: 1px solid var(--rule);
}
.state-teal  .code { background: var(--teal-fill);  border-color: var(--teal-line); }
.state-amber .code { background: var(--amber-fill); border-color: var(--amber-line); }
.c-mut { color: var(--ink-3); }
.c-lit { color: var(--ink-2); }
.c-teal { color: var(--teal); font-weight: 500; }
.c-amber { color: var(--amber); font-weight: 500; }
.state-n { margin-top: 14px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 22px; font: 400 12.5px var(--mono); color: var(--ink-2); }
.legend-sep { width: 1px; height: 13px; background: var(--rule-2); }

/* ── sections ──────────────────────────────────────────── */
.sec { padding-block: var(--sec-y); }
.sec-tint { background: var(--paper-2); border-block: 1px solid var(--rule); }
.sec-head { max-width: 760px; }
.sec-head .eyebrow { margin-bottom: 18px; }
.sec-head-2 { margin-top: clamp(64px, 8vw, 104px); }

.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); margin-top: clamp(44px, 5vw, 64px); }
.col p { color: var(--ink-2); font-size: 15.5px; }
.col-k { color: var(--ink) !important; font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.015em; margin-bottom: 10px; padding-top: 14px; border-top: 1px solid var(--rule-2); }

.pullquote {
  margin-top: clamp(56px, 7vw, 88px); max-width: 30ch;
  font-family: var(--display); font-weight: 500; font-size: clamp(21px, 2.5vw, 29px);
  line-height: 1.28; letter-spacing: -.024em;
  padding-left: clamp(20px, 3vw, 32px); border-left: 2px solid var(--amber);
}

/* ── fit ───────────────────────────────────────────────── */
.fit-in { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); }
.fit-head .eyebrow { margin-bottom: 18px; }
.checks { display: grid; gap: 0; }
.checks li {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start;
  padding: 18px 0; border-bottom: 1px solid var(--rule-2);
  font-size: clamp(16px, 1.6vw, 18.5px); line-height: 1.5;
}
.checks li:first-child { padding-top: 0; }
.checks li:last-child { border-bottom: none; }
.fit-note { margin-top: 26px; font-size: 15px; color: var(--ink-2); }
.fit-note a { display: inline-block; white-space: nowrap; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule-2); padding-bottom: 2px; transition: border-color .18s var(--ease); }
.fit-note a:hover { border-bottom-color: var(--ink); }
.checks li::before {
  content: ""; margin-top: .42em; width: 14px; height: 8px;
  border-left: 1.8px solid var(--teal); border-bottom: 1.8px solid var(--teal);
  transform: rotate(-45deg);
}

/* ── diagrams ──────────────────────────────────────────── */
.fig { margin: clamp(36px, 4.5vw, 56px) 0 0; }
.diagram { display: block; width: 100%; height: auto; }
.fig figcaption { margin-top: 18px; font-size: 14px; color: var(--ink-3); max-width: 62ch; }

.box { fill: var(--panel); stroke: var(--rule-2); stroke-width: 1; }
.box-src { fill: var(--paper-2); }
.box-dash { fill: var(--amber-fill); stroke: var(--amber-line); stroke-dasharray: 5 4; }
.box-amber { fill: var(--amber-fill); stroke: var(--amber-line); }
.box-teal { fill: var(--teal-fill); stroke: var(--teal-line); }
.boundary { fill: none; stroke: var(--rule-2); stroke-width: 1; stroke-dasharray: 3 5; }
.plane { fill: var(--teal-fill); stroke: var(--teal); stroke-width: 1.4; }
.chip { fill: var(--panel); stroke: var(--teal-line); stroke-width: 1; }
.chip-key { fill: var(--paper-2); stroke: var(--ink-3); stroke-dasharray: 3 3; }

.ln { fill: none; stroke: var(--rule-2); stroke-width: 1.4; stroke-linecap: round; }
.ln-teal { stroke: var(--teal-line); }
.ln-amber { stroke: var(--amber-line); }
.ln-dash { stroke-dasharray: 5 5; }

.t-lbl { font: 500 10.5px var(--mono); letter-spacing: .13em; fill: var(--ink-3); }
.t-md  { font: 400 14px var(--body); fill: var(--ink); }
.t-sm  { font: 400 12.5px var(--body); fill: var(--ink-2); }
.t-xs  { font: 400 11.5px var(--mono); fill: var(--ink-2); }
.t-mut { fill: var(--ink-3); }
.t-teal { fill: var(--teal); }
.t-amber { fill: var(--amber); }

.packet { fill: var(--teal); opacity: 0; }
.fig.in .packet { animation: travel 4.4s 1.1s linear infinite; }
@keyframes travel {
  0%   { opacity: 0; transform: translate(234px, 315px); }
  8%   { opacity: 1; }
  34%  { transform: translate(372px, 315px); }
  50%  { transform: translate(522px, 315px); }
  92%  { opacity: 1; }
  100% { opacity: 0; transform: translate(942px, 315px); }
}

/* draw-on */
.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.fig.in .draw { animation: drawline .9s var(--ease) forwards; }
.ln-dash.draw { stroke-dasharray: var(--len); }
.fig.in .ln-dash.draw { animation: drawline .9s var(--ease) forwards, dashafter 0s .9s forwards; }
@keyframes drawline { to { stroke-dashoffset: 0; } }
@keyframes dashafter { to { stroke-dasharray: 5 5; } }

/* ── specs ─────────────────────────────────────────────── */
.specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 clamp(32px, 5vw, 72px); margin-top: clamp(44px, 5vw, 64px); }
.spec { padding: 22px 0; border-top: 1px solid var(--rule-2); }
.spec dt {
  display: flex; align-items: baseline;
  font-family: var(--display); font-weight: 600; font-size: 17px; letter-spacing: -.015em;
}
.spec dd { margin-top: 9px; padding-left: 16px; color: var(--ink-2); font-size: 15px; }

/* ── interest ──────────────────────────────────────────── */
.interest {
  position: relative; overflow: hidden;
  background: var(--ink); color: #fff;
  padding-block: clamp(76px, 10vw, 128px);
}
.interest::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 70% at 82% 8%, rgba(12,107,114,.34), transparent 62%),
    radial-gradient(46% 60% at 6% 96%, rgba(180,83,10,.24), transparent 66%);
}
.interest-in {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 500px);
  gap: clamp(40px, 6vw, 88px); align-items: start;
}
.interest-h { margin-top: 18px; font-size: clamp(34px, 4.6vw, 54px); }
.interest-sub { margin-top: 20px; max-width: 44ch; color: rgba(255,255,255,.62); font-size: 17px; }

.steps { margin-top: 40px; display: grid; gap: 0; max-width: 42ch; }
.steps li {
  display: grid; grid-template-columns: 42px 1fr; align-items: baseline;
  padding: 15px 0; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 15px; color: rgba(255,255,255,.78);
}
.steps li:last-child { border-bottom: 1px solid rgba(255,255,255,.12); }
.step-n { font: 500 12px var(--mono); letter-spacing: .08em; color: var(--teal-line); }

.form-wrap {
  background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: clamp(22px, 3vw, 32px);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px -30px rgba(0,0,0,.8);
}
.form { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font: 500 12.5px var(--mono); letter-spacing: .03em; color: rgba(255,255,255,.66); }
.opt { color: rgba(255,255,255,.38); letter-spacing: 0; }
.field input, .field textarea {
  width: 100%; font: 400 15px var(--body); color: #fff;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.22); border-radius: 8px;
  padding: 11px 13px; resize: vertical;
  transition: border-color .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,.3); }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal-line);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px rgba(106,169,173,.2);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--amber-line); }
.form .btn-primary { background: #fff; color: var(--ink); }
.form .btn-primary:hover { background: #fff; box-shadow: 0 8px 26px -8px rgba(255,255,255,.5); }
.btn[aria-busy="true"] { opacity: .6; pointer-events: none; }
.form-note { min-height: 1em; font: 400 13px var(--mono); color: var(--amber-line); }

.form-done { display: grid; justify-items: start; gap: 6px; padding: 12px 0 6px; }
.tick { width: 30px; height: 30px; fill: none; stroke: var(--teal-line); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: drawline .5s .05s var(--ease) forwards; }
.done-h { margin-top: 8px; font-family: var(--display); font-weight: 600; font-size: 24px; letter-spacing: -.02em; }
.done-b { color: rgba(255,255,255,.62); font-size: 15px; max-width: 40ch; }

/* ── footer ────────────────────────────────────────────── */
.foot { background: var(--ink); color: rgba(255,255,255,.5); border-top: 1px solid rgba(255,255,255,.1); padding-block: 26px; font-size: 13.5px; }
.foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot .wordmark { color: #fff; }
.foot .mark { fill: #fff; }
.foot .mark-plane { fill: var(--teal-line); }
.foot a { color: rgba(255,255,255,.5); text-decoration: none; text-underline-offset: 3px; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot-mid { flex: 1 1 260px; text-align: center; }

/* ── entrance ──────────────────────────────────────────── */
.rise { opacity: 0; transform: translateY(14px); animation: rise .8s var(--ease) forwards; }
.rise[data-d="0"] { animation-delay: .06s; }
.rise[data-d="1"] { animation-delay: .16s; }
.rise[data-d="2"] { animation-delay: .28s; }
.rise[data-d="3"] { animation-delay: .40s; }
@keyframes rise { to { opacity: 1; transform: none; } }

.js .reveal { opacity: 0; transform: translateY(18px); }
.reveal { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ── responsive ────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-card { max-width: 440px; }
  .interest-in { grid-template-columns: 1fr; }
  .fit-in { grid-template-columns: 1fr; gap: 28px; }
  .three { grid-template-columns: 1fr; gap: 0; }
  .col-k { margin-top: 26px; }
  .three .col:first-child .col-k { margin-top: 0; }
  .specs { grid-template-columns: 1fr; }
  .states { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
}
@media (max-width: 760px) {
  .fig { margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); overflow-x: auto; }
  .diagram { min-width: 720px; }
  .fig figcaption { min-width: 0; }
  .eyebrow { font-size: 10.5px; letter-spacing: .1em; }
  .row { grid-template-columns: 1fr; }
  .foot-mid { flex-basis: 100%; text-align: left; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rise, .reveal, .js .reveal { opacity: 1; transform: none; }
  .draw { stroke-dashoffset: 0; }
  .ln-dash { stroke-dasharray: 5 5; }
  .plane-bar span { transform: scaleX(1); }
  .packet { display: none; }
}
