/* InferNext site styles. Brand colour settled: #1677FF primary, #00C8D2 graphic accent. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/spacegrotesk-var.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/plexsans-var.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/plexmono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #fbfcfd;
  --surface: #f2f5f9;
  --ink: #0c131c;
  --ink-2: #38465a;
  --muted: #5b6979;
  --line: #dce3eb;
  --line-strong: #c3cddb;
  --brand: #1677ff;
  --brand-ink: #0b5ed7;
  --accent: #0e8e99;
  --focus: #1677ff;

  --font-display: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --shell: 1080px;
  --gut: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0a0e13;
    --surface: #121a23;
    --ink: #e9eef4;
    --ink-2: #b9c6d4;
    --muted: #8c9aab;
    --line: #1f2a36;
    --line-strong: #33424f;
    --brand: #4d93ff;
    --brand-ink: #7fb2ff;
    --accent: #00c8d2;
    --focus: #7fb2ff;
  }
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

a { color: var(--brand-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

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

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gut);
  padding-right: var(--gut);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  z-index: 20;
}
.skip:focus { left: 8px; top: 8px; color: #fff; }

/* ---- nav ---- */

.nav {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  z-index: 10;
}
.nav-in {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--ink); }
.brand-mark { width: 26px; height: 26px; color: var(--brand); flex: none; }
.brand-mark .t2 { opacity: 0.55; }
.brand-name .nx { color: var(--brand-ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9375rem;
}
.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
}
.nav-links a:hover { color: var(--brand-ink); }
.nav-links a[aria-current="page"] { color: var(--ink); }

@media (max-width: 560px) {
  .nav-in { min-height: 58px; gap: 14px; }
  .nav-links { gap: 15px; font-size: 0.875rem; }
}

/* ---- shared blocks ---- */

.band { padding-top: 84px; padding-bottom: 84px; }
.band-tint { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-tight { padding-top: 60px; padding-bottom: 60px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 20px;
  max-width: 22ch;
  text-wrap: balance;
}
.h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}
.prose { max-width: 62ch; color: var(--ink-2); margin: 0 0 18px; }
.prose:last-child { margin-bottom: 0; }
.prose-muted { color: var(--muted); }

/* ---- hero ---- */

.hero { padding-top: 76px; padding-bottom: 68px; }
.hero-grid { display: grid; gap: 46px; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 56px; }
}
.h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.35rem, 6.2vw, 3.85rem);
  line-height: 1.03;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  text-wrap: balance;
}
.h1 em { font-style: normal; color: var(--brand-ink); }
.hero-lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 54ch;
  margin: 0 0 30px;
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--brand-ink); color: #fff; transform: translateY(-1px); }
.btn-note { font-size: 0.875rem; color: var(--muted); max-width: 34ch; }
.btn-arrow { width: 20px; height: 10px; flex: none; }

/* ---- trace figure: the signature motif ---- */

.trace { width: 100%; height: auto; display: block; color: var(--brand); }
.trace .t2 { color: var(--accent); }
.trace-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  animation: trace-draw 1s cubic-bezier(0.22, 0.7, 0.3, 1) forwards;
  animation-delay: var(--d, 0ms);
}
.trace-cap {
  fill: currentColor;
  opacity: 0;
  animation: trace-pop 0.3s ease forwards;
  animation-delay: calc(var(--d, 0ms) + 0.85s);
}
.trace-seed { fill: currentColor; }
@keyframes trace-draw { to { stroke-dashoffset: 0; } }
@keyframes trace-pop { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .trace-line { stroke-dashoffset: 0; }
  .trace-cap { opacity: 1; }
}

.fig-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 14px 0 0;
  letter-spacing: 0.02em;
}

/* ---- stages: the workflow sequence ---- */

.stages { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
@media (min-width: 860px) { .stages { grid-template-columns: repeat(3, 1fr); } }
.stage { background: var(--paper); padding: 26px 24px 28px; }
.stage-n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand-ink);
  letter-spacing: 0.1em;
  margin: 0 0 14px;
}
.stage-body { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.stage-rail { display: block; width: 100%; height: 12px; margin-bottom: 18px; color: var(--brand); }

/* ---- fact rows ---- */

.facts { margin: 0; padding: 0; border-top: 1px solid var(--line); }
.fact { display: grid; gap: 4px 32px; padding: 20px 0; border-bottom: 1px solid var(--line); }
@media (min-width: 760px) { .fact { grid-template-columns: 210px 1fr; gap: 0 32px; } }
.fact-k {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin: 0;
  padding-top: 2px;
}
.fact-v { margin: 0; color: var(--muted); font-size: 0.9375rem; max-width: 60ch; }

/* ---- misc ---- */

.card-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .card-list { grid-template-columns: 1fr 1fr; gap: 20px; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px 22px 24px; }
.card-t { font-family: var(--font-display); font-weight: 700; font-size: 1rem; margin: 0 0 8px; }
.card-b { margin: 0; color: var(--muted); font-size: 0.9375rem; }

.callout {
  border-left: 3px solid var(--brand);
  padding: 4px 0 4px 20px;
  margin: 0;
  color: var(--ink-2);
  max-width: 60ch;
}

/* ---- footer ---- */

.foot { border-top: 1px solid var(--line); padding-top: 40px; padding-bottom: 56px; margin-top: 20px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.9375rem; }
.foot-links a { color: var(--ink-2); text-decoration: none; }
.foot-links a:hover { color: var(--brand-ink); }
.foot-meta { font-size: 0.875rem; color: var(--muted); margin: 0; }

/* ---- promotion flow diagram ---- */

.flow { display: grid; gap: 14px; margin: 26px 0 0; }
@media (min-width: 860px) {
  .flow { grid-template-columns: 1fr auto 1.25fr auto 1fr; gap: 16px; align-items: center; }
}
.flow-node { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 18px; height: 100%; }
.flow-node-key { border-color: var(--brand); }
.flow-k { font-family: var(--font-display); font-weight: 700; font-size: 0.9375rem; margin: 0 0 6px; }
.flow-b { margin: 0; color: var(--muted); font-size: 0.875rem; }
.flow-arrow { color: var(--brand); display: flex; align-items: center; justify-content: center; }
.flow-arrow svg { width: 46px; height: 12px; }
@media (max-width: 859px) { .flow-arrow svg { transform: rotate(90deg); } }
