/* Pillar pages (page.html) only: docs shell, rail, article views, framed media,
   the simulation library, section rhythm. The overview loads none of it.
   Breakpoints are the canonical four — 640 · 900 · 1180 · 1440. Add no fifth. */

/* ---------- stub pages (page.html) ---------- */
/* Legacy name only: .stub-links is the button row pillar.js still puts under a
   section. Everything else from the stub-page era is gone. */
.stub-links { display: flex; flex-wrap: wrap; gap: 12px 26px; }
/* The homepage footer layout lives in sections.css; stub pages need this one rule. */
body[data-page="stub"] .f-note { display: flex; flex-wrap: wrap; gap: 8px 28px;
  justify-content: space-between; color: var(--muted); font-size: 13.5px;
  padding: 26px 0 40px; border-top: 1px solid var(--line-soft); }

/* ---------- pillar pages ---------- */
.pillar-main { min-height: 72vh; }
/* Docs shell: sticky sidebar left, content column CENTERED in the viewport.
   justify-content centers the whole grid; minmax(0,·) keeps tables scrollable. */
.pillar-shell { display: grid; grid-template-columns: 260px minmax(0, 940px);
  justify-content: center; gap: 72px; padding: 118px 32px 90px; }
.side { position: sticky; top: 96px; align-self: start;
  max-height: calc(100dvh - 120px); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; padding: 2px 14px 24px 2px;
  scrollbar-width: thin; }
/* Scale play (2026-09-04, same move as the mega-menu): the pillar name and
   the CHAPTER links carry display weight; the mono group labels and the
   per-simulation sub-links stay small. The size gap is the hierarchy. */
.side-title { font-family: var(--sans); font-weight: 700; font-size: 21px;
  letter-spacing: -.018em; color: var(--text);
  text-decoration: none; margin: 0 0 10px; padding: 0 10px; }
.side-title:hover { color: var(--brand-lift); }
.side-link { display: block; font-family: var(--sans); font-size: 16.5px;
  font-weight: 600; letter-spacing: -.012em; color: var(--text);
  text-decoration: none; padding: 6px 10px; margin-top: 2px;
  border-radius: 8px; }
.side-link:hover { background: var(--nav-hov); }
.side-link.on { color: var(--brand); background: var(--nav-act); }
.side-arts { display: flex; flex-direction: column; gap: 1px;
  margin: 3px 0 8px 16px; padding-left: 2px;
  border-left: 1.5px solid var(--line); }
/* WebKit paints the clamped third line into the padding, so the box stays tight
   vertically and the rhythm comes from the margin instead. */
.side-art { position: relative; font-size: 13px; line-height: 1.45;
  color: var(--muted); text-decoration: none; padding: 0 10px; margin: 5px 0;
  border-radius: 8px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.side-art:hover { color: var(--text); background: var(--nav-hov); }
/* Sub-active: text + a straight bar over the rail. (An inset box-shadow
   gets clipped by the border-radius into a curved '(' — Kimi pass.) */
.side-art.on { color: var(--brand); font-weight: 600; }
.side-art.on::before { content: ""; position: absolute; left: -3.5px;
  top: 5px; bottom: 5px; width: 2px; border-radius: 1px;
  background: var(--brand); }
:root[data-theme="light"] .side-art.on,
:root[data-theme="light"] .side-link.on { color: var(--brand-deep); }
.pillar-head { padding: 12px 0 8px; }
.pillar-head h1 { font-family: var(--sans); font-size: clamp(34px, 5vw, 50px);
  line-height: 1.05; letter-spacing: -.024em; margin: 0 0 14px; }
/* Below the sidebar-capable width the rail becomes a collapsible summary block
   ABOVE the content — closed by default, the toggle naming the section you are
   in. It replaces a `.pillar-subnav` pill row that no renderer ever emitted, so
   this band previously had no section navigation, no sub-menu and no scrollspy. */
.side-wrap { min-width: 0; }
.side-toggle { display: none; }
@media (max-width: 1180px) {
  /* One column now, so the 72px column gap would become a 72px hole under the
     closed toggle. */
  .pillar-shell { grid-template-columns: minmax(0, 1fr); padding-top: 96px; row-gap: 18px; }
  .side-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    width: 100%; min-height: 44px; padding: 12px 14px; margin: 0 0 8px;
    background: var(--card-grad); border: 1px solid var(--line-soft);
    border-radius: 12px; cursor: pointer; font: inherit; text-align: left;
    color: var(--text);
  }
  .side-toggle b { font-family: var(--sans); font-size: 14px; font-weight: 600; }
  .side-toggle .caret { font-size: 10px; color: var(--muted); transition: transform .16s ease; }
  .side-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
  .side-wrap[data-open="false"] .side { display: none; }
  /* Open, it is part of the flow — not a sticky rail beside text that is no
     longer beside it. */
  .side { position: static; max-height: none; overflow: visible;
    padding: 2px 0 18px; margin-bottom: 12px;
    border-bottom: 1px solid var(--line-soft); }
}
.pillar-section { padding: 56px 0 8px; scroll-margin-top: 112px; }
.pillar-section .lede { margin-bottom: 22px; }
.pillar-section p { color: var(--text); }
.pillar-section a { color: var(--brand-lift); }
.pillar-note { color: var(--muted); font-size: 14px; border-left: 2px solid var(--line);
  padding-left: 14px; }
.pillar-content .code { background: var(--ink-2); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 18px 20px; margin: 18px 0 26px;
  font-family: var(--mono); font-size: 13px; line-height: 1.65; overflow-x: auto; }
.pillar-content .code .c { color: var(--muted); }
.pillar-content .code .k { color: var(--brand-lift); }
.pillar-content .code .s { color: var(--data); }
/* ---------- article cards + article view ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px; }
.card { display: flex; flex-direction: column; gap: 8px; text-decoration: none;
 padding: 16px; 
 }
.card:hover { border-color: var(--brand-lift); }
.card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; }
.card b { color: var(--text); font-family: var(--sans); font-size: 15.5px;
  font-weight: 600; line-height: 1.3; }
.card span { color: var(--muted); font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card small { color: var(--muted); }
.article { padding: 0; }
.article-meta { color: var(--muted); margin: 6px 0 10px; }
.article h1 { font-family: var(--sans); font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1; letter-spacing: -.02em; margin: 0 0 14px; }
.article > .lede { font-size: 18.5px; line-height: 1.65; }
/* MDX widget placeholders import as a blockquote holding one <em>. Style the
   slot as deliberate — a dashed embed frame — instead of a broken quote. */
.article-body blockquote:has(> em:only-child) { border: 1.5px dashed var(--line);
  border-left: 3px solid var(--brand); border-radius: 10px;
  padding: 16px 20px; background: var(--nav-hov); }
.article-body blockquote em { font-style: normal; font-family: var(--mono);
  font-size: 12.5px; letter-spacing: .04em; color: var(--muted); }
.art-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 50px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.art-nav { display: flex; flex-direction: column; gap: 5px; text-decoration: none;
 padding: 16px 18px; 
 transition: transform .14s ease, border-color .2s ease;
 box-shadow: var(--shadow); }
.art-nav:hover { border-color: var(--brand-lift); transform: translateY(-1px); }
.art-nav.next { text-align: right; }
.art-nav small { color: var(--muted); }
.art-nav b { color: var(--text); font-family: var(--sans); font-size: 14.5px;
  font-weight: 600; line-height: 1.35; }
.article-body { margin: 30px 0 40px; }
.article-body h2, .article-body h3, .article-body h4 { margin-top: 40px; }
/* No image is ever a wall: cap the height, keep the frame. */
.article-body img { border-radius: 10px; margin: 18px 0;
  max-height: 520px; object-fit: contain; }
.article-body a { color: var(--brand-lift); }
.article-body blockquote { border-left: 2px solid var(--brand); color: var(--muted);
  margin: 20px 0; padding: 4px 0 4px 16px; }
.article-body pre { background: var(--ink-2); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font-family: var(--mono); font-size: 13px; }
.md-table { overflow-x: auto; margin: 20px 0; }
.md-table table { border-collapse: collapse; font-size: 14px; min-width: 480px; }
.md-table th, .md-table td { border: 1px solid var(--line-soft); padding: 8px 12px;
  text-align: left; vertical-align: top; }
.md-table th { color: var(--muted); font-family: var(--mono); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; }
.spotify { width: 100%; height: 152px; border: none; border-radius: 12px; margin: 8px 0 6px; }

/* ---------- pillar media + feature grid ---------- */
.p-shot { margin: 4px 0 26px; }
/* No image is ever a wall: cap the height, keep the frame. */
.p-shot video, .p-shot img { width: 100%; border-radius: 12px; display: block;
  border: 1px solid var(--line-soft); max-height: 460px; object-fit: cover; }
.p-shot-cap { display: block; color: var(--muted); padding: 8px 2px 0; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px; margin: 22px 0 24px; }
.feat { display: flex; flex-direction: column; gap: 6px; padding: 16px 17px;
 }
.feat b { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--text); }
.feat span { font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.mono-inline { font-family: var(--mono); font-size: .88em; color: var(--data); }

/* ---------- groups, teasers, parts ---------- */
.side-group { color: var(--muted); margin: 24px 0 5px; padding: 0 10px; }
.side-group:first-of-type { margin-top: 14px; }
.group-head { color: var(--data); margin: 70px 0 -36px; }
.group-head:first-child { margin-top: 8px; }
.teaser h2 a { color: inherit; text-decoration: none; }
.teaser h2 a:hover { color: var(--brand-lift); }
.part { scroll-margin-top: 96px; }
.part h3 { font-family: var(--sans); font-size: 21px; font-weight: 600;
  letter-spacing: -.012em; margin: 46px 0 10px; }
.crumb { color: var(--brand-lift); text-decoration: none; }
.crumb:hover { color: var(--text); }

/* ---------- trust logos band (slot 2) ---------- */
.logo-band { background: var(--ink-1); border-bottom: 1px solid var(--line-soft);
  padding: 18px 0 14px; }
.logo-band .supported-by { border: none; margin: 0; padding: 0; }
/* ---------- persona carry-over ---------- */
.you-tag { color: var(--brand); background: var(--nav-act); border-radius: 4px; padding: 2px 6px; margin-left: 8px; vertical-align: 2px; white-space: nowrap; }
/* ---------- content links ---------- */
.pillar-content :is(p, li, td) > a:not(.btn) {
  color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pillar-content :is(p, li, td) > a:not(.btn):hover {
  color: var(--brand-lift); }

/* ---------- use the width ---------- */
/* ONE shared edge: text, media, cards and tables all end on the same line.
   homepage.css caps every <p> at 34em (right for the overview); here the
   column itself is the measure — sized below so full-bleed text stays
   readable. Long-form articles keep a reading cap. */
.pillar-content p, .pillar-content .lede,
.pillar-content ul, .pillar-content ol { max-width: none; }
.article-body p, .article-body li { color: var(--text); font-size: 16px;
  line-height: 1.7; max-width: 46em; }
@media (min-width: 1441px) {
  .pillar-shell { grid-template-columns: 280px minmax(0, 880px); gap: 84px; }
}

/* ---------- simulation feature rows: [img] text / text [img] ---------- */
/* Rhythm: each model is a chapter, not a line. */
.part-bare { padding-top: 88px; }
.part-bare:first-of-type { padding-top: 64px; }
/* ONE mono label spec. homepage.css owns the canonical values under .lbl;
   this is that same spec for the pillar-page labels. The per-use rules
   below add colour and layout only — never a second size or tracking. */
.sim-th, .sim-gh, .side-group,
.group-head, .art-nav small, .card small,
.p-shot-cap, .lib-step .idx, .chip,
.order-note, .val-strip b, .side-cta .cta-eyebrow,
.head-cta .proof, .you-tag {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
}

/* ---------- the shared primitives: split · frame · surface ---------- */
/* ONE ratio for text-beside-media; .split-flip mirrors the reading order.
   The 900px collapse must stay after BOTH, or the flip keeps two columns. */
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 6fr);
  gap: 56px; align-items: center; }
.split-flip { grid-template-columns: minmax(0, 6fr) minmax(0, 7fr);
  align-items: start; margin-top: 26px; }
.split-body h3 { margin: 0 0 4px; }
.split-body p { max-width: none; }

/* ONE framed-media box: hairline, radius, dark ground. .frame-chrome is the
   browser bar, .frame-ramp the in-frame legend, .frame-4x3 the fixed-ratio
   variant that sits beside body copy. */
.frame { position: relative; margin: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow);
  background: var(--ink-2); }
.frame img { width: 100%; display: block; object-fit: cover; }
.frame-4x3 { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.frame-4x3 img { height: 100%; transition: transform .35s ease; }
.split:hover .frame-4x3 img { transform: scale(1.025); }

/* ONE card-like ground under every raised block. */
.surface { background: var(--card-grad); border: 1px solid var(--line-soft);
  border-radius: var(--radius); }

@media (max-width: 900px) {
  .split, .split-flip { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- simulation overview table (first-class) ---------- */
.sim-table { border: 1px solid var(--line-soft); border-radius: var(--radius);
  overflow: hidden; margin: 26px 0 8px; background: var(--card-grad); }
/* Four tracks: model · answer · output unit · the hover arrow. */
.sim-th, .sim-tr { display: grid;
  grid-template-columns: 205px minmax(0, 1fr) 150px 18px;
  gap: 18px; align-items: baseline; padding: 13px 20px; }
.sim-th { color: var(--muted); border-bottom: 1px solid var(--line); padding-top: 15px; padding-bottom: 11px; }
.sim-th span:last-child { text-align: right; }
.sim-tr { text-decoration: none; border-bottom: 1px solid var(--line-soft); }
.sim-tr:last-child { border-bottom: none; }
.sim-tr:hover { background: var(--nav-hov); }
.sim-tr b { color: var(--text); font-family: var(--sans); font-weight: 600;
  font-size: 15px; }
.sim-tr span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.sim-tr code { font-family: var(--mono); font-size: 11px; color: var(--data);
  text-align: right; white-space: nowrap; border: 1px solid var(--line-soft);
  border-radius: 6px; padding: 3px 8px; background: var(--ink-0);
  justify-self: end; }
/* Phone: one column. This query MUST stay after EVERY .sim-th/.sim-tr column
   definition. A media query adds no specificity, so an unconditional
   redefinition further down the file silently wins — one did, and the table
   never collapsed on a phone. */
@media (max-width: 640px) {
  .sim-th, .sim-tr { grid-template-columns: 1fr; gap: 3px; }
  .sim-th span:not(:first-child), .sim-tr code, .sim-tr .sim-go { display: none; }
}

/* ---------- the 1200-1400px laptop band ---------- */
@media (max-width: 1440px) and (min-width: 1181px) {
  .pillar-shell { grid-template-columns: 225px minmax(0, 800px);
    justify-content: center; gap: 48px; padding: 108px 40px 80px; }
  .side-group { letter-spacing: .1em; line-height: 1.6; }
}
@media (max-width: 1180px) and (min-width: 901px) {
  .split { grid-template-columns: 1fr; gap: 18px; }
  .frame-4x3 { max-width: 640px; }
}

/* Headings are ink; only the arrow-link register is brand (Kimi pass:
   the content-link :not() chain out-specified .teaser h2 a). */
.pillar-content .teaser h2 a { color: inherit; text-decoration: none; }
.pillar-content .teaser h2 a:hover { color: var(--brand-lift); }

/* ---------- section-page header CTA row (demo-first + proof chip) ---------- */
.head-cta { display: flex; align-items: center; flex-wrap: wrap;
  gap: 10px 18px; margin: 18px 0 26px; }
.head-cta .proof { color: var(--muted); }

/* ---------- sim-table: groups + affordance + unit chips ---------- */
.sim-gh { display: block; color: var(--muted); background: var(--ink-2); padding: 8px 20px; border-bottom: 1px solid var(--line-soft); }
.sim-go { font-family: var(--mono); font-size: 12px; color: var(--brand);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .16s ease-out, transform .16s ease-out; }
.sim-tr:hover .sim-go { opacity: 1; transform: none; }
.sim-tr:hover b { color: var(--brand); }

/* ---------- motion discipline ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important;
    transition-duration: .01ms !important; }
}

/* ================= Kimi round 2 ================= */

/* ---------- type scale: docs register, tighter than the overview ---------- */
.pillar-content { font-size: 16.5px; }
.pillar-content p, .pillar-content li { line-height: 1.7; }
.pillar-content h2 { font-size: clamp(24px, 2.4vw, 30px); }
.teaser h2 { font-size: clamp(26px, 2.8vw, 32px); }

/* ---------- scrollytelling: sticky stage + stepping list ---------- */
.lib-steps { min-width: 0; }
.lib-step { min-height: 54vh; display: flex; flex-direction: column;
  justify-content: center; }
.lib-step .idx { color: var(--data); margin: 0 0 6px; }
.lib-step h3 { margin: 0 0 10px; }
.lib-step > .frame { display: none; }        /* mobile only */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.chip { color: var(--muted); border: 1px solid var(--line-soft); border-radius: 6px; padding: 3px 8px; background: var(--ink-1); }
.chip b { color: var(--data); font-weight: 600; text-transform: none; }
.lib-stage { position: sticky; top: 96px;
  height: min(600px, calc(100dvh - 210px)); }
.lib-stage .frame { position: absolute; inset: 0; opacity: 0;
  transform: scale(1.015);
  transition: opacity .24s ease-out, transform .3s ease; }
.lib-stage .frame.on { opacity: 1; transform: none; }
.lib-progress { position: absolute; left: -26px; top: 8px; bottom: 8px;
  width: 2px; display: flex; flex-direction: column; gap: 4px; }
.lib-progress i { flex: 1; background: var(--line-soft); border-radius: 1px; }
.lib-progress i.on { background: var(--brand); }
.order-note { color: var(--muted); margin: 14px 0 0; }
.order-note a { color: var(--brand-lift); text-decoration: none; }
@media (max-width: 1180px) {
  .split-flip { display: block; }
  .lib-stage { display: none; }
  .lib-step { min-height: 0; padding: 30px 0; justify-content: flex-start; }
  .lib-step > .frame { display: block; margin: 0 0 14px; }
}

/* The stage frames are absolutely positioned and full height, so their image
   fills what the chrome bar leaves. In a step it keeps its own ratio. */
.lib-stage .frame img { height: calc(100% - 30px); }
.lib-step > .frame img { aspect-ratio: 16 / 10; }
.frame-chrome { height: 30px; display: flex; align-items: center; gap: 6px;
  padding: 0 12px; background: var(--ink-2);
  border-bottom: 1px solid var(--line-soft); }
.frame-chrome i { width: 8px; height: 8px; border-radius: 50%;
  background: var(--line); }
.frame-chrome .url { margin: 0 auto; font-family: var(--mono); font-size: 10px;
  color: var(--muted); background: var(--ink-0);
  border: 1px solid var(--line-soft); border-radius: 6px; padding: 2px 10px; }
.frame-ramp { position: absolute; left: 12px; bottom: 12px;
  display: flex; gap: 8px; align-items: center; padding: 6px 9px;
  background: var(--scrim); backdrop-filter: blur(8px); border-radius: 8px;
  border: 1px solid var(--line-soft); font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .04em; color: var(--text); }
.frame-ramp i { width: 84px; height: 6px; border-radius: 3px; display: block; }

/* ---------- validation strip: an instrument readout, not badges ---------- */
.val-strip { display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden;
  margin: 18px 0 0; background: var(--ink-1); }
.val-strip a { display: flex; flex-direction: column; gap: 3px;
  padding: 13px 16px; text-decoration: none;
  border-right: 1px solid var(--line-soft); }
.val-strip a:last-child { border-right: none; }
.val-strip a:hover { background: var(--nav-hov); }
.val-strip b { color: var(--data); }
.val-strip span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
@media (max-width: 640px) { .val-strip { grid-template-columns: 1fr; }
  .val-strip a { border-right: none; border-bottom: 1px solid var(--line-soft); } }

/* ---------- sidebar mini-CTA + end conversion card ---------- */
.side-cta { margin-top: 22px; padding: 14px 10px 4px;
  border-top: 1px solid var(--line-soft); }
.side-cta .cta-eyebrow { color: var(--data); }
.side-cta p { font-size: 12.5px; margin: 6px 0 2px; line-height: 1.5; }
.side-cta a { color: var(--brand-lift); text-decoration: none; }
.side-cta a:hover { color: var(--text); }
:root[data-theme="light"] .side-cta a { color: var(--brand-deep); }
.next-step { display: flex; flex-wrap: wrap; justify-content: space-between;
 align-items: center; gap: 18px 28px; margin-top: 64px; padding: 26px 28px;
 
 box-shadow: var(--shadow); }
.next-step h3 { margin: 0 0 4px; }
.next-step p { margin: 0; color: var(--muted); font-size: 14px; max-width: 34em; }
.next-cta { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }

/* ---------- section-page rhythm (v4 dropped the .pillar-section wrapper) ---------- */
.pillar-content .code .n { color: var(--data); }
.pillar-content .p-shot { margin: 24px 0 30px; }
.p-shot-cap + p, .pillar-content .p-shot + p { margin-top: 18px; }
.pillar-content > h1 { margin: 6px 0 12px; }
.pillar-content > .lede { margin-bottom: 6px; }

/* Apple-style fine print: the technical qualifiers live at the section's foot,
   small and grey, referenced from the claim with an asterisk. */
.finenote { font-size: 11.5px; line-height: 1.6; color: var(--muted);
  opacity: .85; margin: 26px 0 0; max-width: 60em; }
