:root {
  --paper: #F4F6F3;
  --panel: #FFFFFF;
  --ink: #14213A;
  --muted: #4D5A6E;
  --grid: #DCE3DA;
  --axis: #9EAA9B;
  --accent: #2350C8;
  --accent-soft: rgba(35, 80, 200, 0.12);
  --accent-softer: rgba(35, 80, 200, 0.06);
  --rule: #C9D2C6;
  --alert: #B42318;
  --dot: rgba(20, 33, 58, 0.6);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F1624;
    --panel: #151F31;
    --ink: #E7EBF2;
    --muted: #A3AEC0;
    --grid: #1F2B3E;
    --axis: #3D4D66;
    --accent: #86A8FF;
    --accent-soft: rgba(134, 168, 255, 0.18);
    --accent-softer: rgba(134, 168, 255, 0.08);
    --rule: #2A3850;
    --alert: #FF7A6B;
    --dot: rgba(231, 235, 242, 0.6);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img, svg, canvas { display: block; max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.serif { font-family: "IBM Plex Serif", Georgia, serif; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 1.05rem; white-space: nowrap; }
.brand svg { width: 28px; height: 28px; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav .nav-cta { color: var(--paper); background: var(--ink); padding: 8px 16px; border-radius: 6px; font-weight: 500; }
.nav .nav-cta:hover { color: var(--paper); opacity: 0.9; }
@media (max-width: 860px) {
  .nav a:not(.nav-cta):not(.nav-keep) { display: none; }
  .nav { gap: 16px; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-block; text-decoration: none; padding: 12px 22px; border-radius: 6px; font-weight: 500; font-size: 0.98rem; border: 1.5px solid var(--ink); cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { opacity: 0.9; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--accent-softer); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding-top: 64px; padding-bottom: 40px; }
.hero h1 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 24px;
  max-width: 15ch;
}
.hero-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: end; }
.hero .lede { font-size: 1.2rem; margin: 0 0 32px; max-width: 30em; }
.hero-figure { margin: 0; }
.hero-canvas-wrap { position: relative; height: 340px; border-left: 1px solid var(--axis); border-bottom: 1px solid var(--axis); }
.hero-canvas-wrap canvas { width: 100%; height: 100%; }
.fig-note { font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.status-line { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem; }
.status-line strong { color: var(--ink); font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-soon { color: var(--accent); background: var(--accent-soft); }
.badge-dev { color: var(--muted); background: color-mix(in srgb, var(--muted) 14%, transparent); }
.badge-soon::before { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .badge-soon::before { animation: none; } }

/* ---------- Sections ---------- */
.section { padding: 96px 0; border-top: 1px solid var(--rule); }
.section h2 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  max-width: 22ch;
}
.section-intro { color: var(--muted); font-size: 1.08rem; max-width: 40em; margin: 0 0 48px; }
h3 { font-size: 1.15rem; font-weight: 600; line-height: 1.3; margin: 0 0 8px; }

/* ---------- What we do ---------- */
.desks { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--panel); }
.desk { padding: 32px; }
.desk + .desk { border-left: 1px solid var(--rule); }
.desk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.desk-head h3 { margin: 0; font-size: 1.3rem; }
.desk p { color: var(--muted); margin: 0 0 16px; }
.desk ul { margin: 0; padding-left: 18px; color: var(--ink); }
.desk li { margin: 4px 0; }

.horizon { margin-top: 56px; }
.horizon h3 { font-size: 1.25rem; }
.horizon > p { color: var(--muted); margin: 0 0 24px; max-width: 40em; }
.horizon-scale { position: relative; margin: 8px 0 6px; }
.horizon-scale input[type="range"] { width: 100%; margin: 0; accent-color: var(--accent); height: 28px; cursor: pointer; }
.horizon-ticks { position: relative; height: 22px; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.horizon-ticks > span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.horizon-ticks > span:nth-child(1) { left: 0; transform: none; }
.horizon-ticks > span:nth-child(2) { left: 25%; }
.horizon-ticks > span:nth-child(3) { left: 50%; }
.horizon-ticks > span:nth-child(4) { left: 75%; }
.horizon-ticks > span:nth-child(5) { left: 100%; transform: translateX(-100%); }
.horizon-ticks > span.on { color: var(--ink); font-weight: 600; }
.horizon-ticks .short { display: none; }
@media (max-width: 600px) {
  .horizon-ticks .long { display: none; }
  .horizon-ticks .short { display: inline; }
}
.horizon-bands { display: grid; grid-template-columns: 3fr 5fr; font-size: 0.82rem; margin-top: 10px; }
.horizon-bands span { padding: 6px 10px; border-top: 3px solid var(--axis); color: var(--muted); }
.horizon-bands span.on { border-top-color: var(--accent); color: var(--ink); font-weight: 500; }
.horizon-panel { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 28px; }
.horizon-panel dt { font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }
.horizon-panel dd { margin: 0; }
.horizon-title { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.horizon-title strong { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 500; font-size: 1.5rem; }

/* ---------- Models tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 32px; overflow-x: auto; }
.tab { appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 12px 18px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tab:hover { color: var(--ink); }
.tabpanel { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 48px; }
.tabpanel[hidden] { display: none; }
.model h3 { font-size: 1.08rem; }
.model p { margin: 0; color: var(--muted); }

/* ---------- Pipeline ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 20px; counter-reset: step; }
.pipeline li { counter-increment: step; position: relative; padding-top: 24px; border-top: 2px solid var(--ink); }
.pipeline li::before {
  content: counter(step); position: absolute; top: -15px; left: 0;
  width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
  display: grid; place-items: center; font-size: 0.82rem; font-weight: 600; line-height: 1;
}
.pipeline h3 { font-size: 1rem; margin-top: 6px; }
.pipeline p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* ---------- Two-column lists + demos ---------- */
.split { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.split.split-risk { grid-template-columns: 1.35fr 0.85fr; gap: 48px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { padding: 18px 0 18px 34px; border-bottom: 1px solid var(--rule); position: relative; }
.checklist li:first-child { border-top: 1px solid var(--rule); }
.checklist li::before {
  content: ""; position: absolute; left: 2px; top: 23px; width: 16px; height: 9px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg);
}
.checklist strong { display: block; font-weight: 600; margin-bottom: 2px; }
.checklist span { color: var(--muted); font-size: 0.97rem; }

.demo { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 24px; }
.demo-title { font-weight: 600; margin: 0 0 4px; }
.demo-sub { color: var(--muted); font-size: 0.93rem; margin: 0 0 16px; }
.demo svg { width: 100%; height: auto; }
.demo .grid line { stroke: var(--grid); stroke-width: 1; }
.demo .axis-line { stroke: var(--axis); stroke-width: 1.25; }
.demo text { fill: var(--muted); font-family: "IBM Plex Sans", system-ui, sans-serif; font-size: 12px; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; }
.controls label { font-size: 0.93rem; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.controls input[type="range"] { accent-color: var(--accent); width: 180px; cursor: pointer; }
.controls input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.readout { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.readout div { font-size: 0.85rem; color: var(--muted); }
.readout b { display: block; color: var(--ink); font-size: 1.15rem; font-weight: 600; margin-top: 2px; }
.verdict { margin: 14px 0 0; font-weight: 500; min-height: 1.6em; }
.verdict.bad { color: var(--alert); }
.verdict.good { color: var(--accent); }

.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 0.92rem; padding: 8px 14px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--rule); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.85rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.legend i.dash { border-top: 2px dashed var(--muted); }
.legend i.limit { border-top: 2px dashed var(--alert); }

/* ---------- Infrastructure ---------- */
.stack { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stack p { margin: 0; color: var(--muted); }

/* ---------- Audience CTAs ---------- */
.audiences { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.audience { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; padding: 40px; display: flex; flex-direction: column; }
.audience h3 { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 500; font-size: 1.7rem; margin-bottom: 14px; }
.audience p { color: var(--muted); margin: 0 0 14px; }
.audience ul { margin: 0 0 28px; padding-left: 18px; }
.audience li { margin: 6px 0; }
.audience .btn-row { margin-top: auto; }
.audience.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.audience.dark p { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.audience.dark .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.audience.dark .btn-ghost { color: var(--paper); border-color: var(--paper); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 36px 0 48px; color: var(--muted); font-size: 0.92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-inner a { color: var(--ink); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.disclaimer { margin-top: 20px; font-size: 0.82rem; max-width: 60em; }

/* ---------- Careers ---------- */
.page-hero { padding-top: 72px; padding-bottom: 56px; }
.page-hero h1 { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 500; font-size: clamp(2.3rem, 4.8vw, 3.6rem); line-height: 1.08; letter-spacing: -0.015em; margin: 0 0 20px; max-width: 18ch; }
.page-hero p { font-size: 1.15rem; color: var(--muted); max-width: 36em; margin: 0; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.values p { margin: 0; color: var(--muted); }
.role { background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 16px; }
.role summary { list-style: none; cursor: pointer; padding: 28px 32px; display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; align-items: center; }
.role summary::-webkit-details-marker { display: none; }
.role summary h3 { font-family: "IBM Plex Serif", Georgia, serif; font-weight: 500; font-size: 1.6rem; margin: 0; }
.role-meta { color: var(--muted); font-size: 0.95rem; grid-column: 1; }
.role-toggle { grid-column: 2; grid-row: 1 / span 2; width: 40px; height: 40px; border: 1.5px solid var(--rule); border-radius: 50%; position: relative; }
.role-toggle::before, .role-toggle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; background: var(--ink); transform: translate(-50%, -50%); transition: transform 0.2s; }
.role-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.role[open] .role-toggle::after { transform: translate(-50%, -50%) rotate(0deg); }
@media (prefers-reduced-motion: reduce) { .role-toggle::before, .role-toggle::after { transition: none; } }
.role-body { padding: 0 32px 32px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; border-top: 1px solid var(--rule); padding-top: 28px; margin: 0 0 0; }
.role-body h4 { margin: 0 0 10px; font-size: 1rem; }
.role-body ul { margin: 0; padding-left: 18px; color: var(--muted); }
.role-body li { margin: 6px 0; }
.role-apply { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.role-apply span { color: var(--muted); font-size: 0.93rem; }
.process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.process li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 24px; position: relative; }
.process li::before { content: counter(step); position: absolute; top: -15px; left: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); display: grid; place-items: center; font-size: 0.82rem; font-weight: 600; }
.process p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .pipeline { grid-template-columns: repeat(3, 1fr); row-gap: 40px; }
  .stack { grid-template-columns: repeat(2, 1fr); }
  .horizon-panel { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .hero { padding-top: 36px; padding-bottom: 24px; }
  .hero-grid, .split, .split.split-risk, .audiences, .desks, .values { grid-template-columns: 1fr; }
  .hero-grid { gap: 36px; }
  .hero-canvas-wrap { height: 260px; }
  .desk + .desk { border-left: 0; border-top: 1px solid var(--rule); }
  .tabpanel { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .role-body { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  body { font-size: 16px; }
  .hero .lede { font-size: 1.1rem; }
  .pipeline, .stack, .process { grid-template-columns: 1fr; }
  .horizon-panel { grid-template-columns: 1fr; padding: 22px; }
  .desk, .audience { padding: 26px; }
  .role summary { padding: 22px; }
  .role-body { padding: 22px; }
  .horizon-ticks { font-size: 0.72rem; }
  .demo { padding: 18px; }
  .controls input[type="range"] { width: 140px; }
  #overfit-svg text { font-size: 20px; }
}
