/* ── Self-hosted fonts ────────────────────────────────────────────── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url("assets/fonts/inter-latin-200-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/inter-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

/* ── Design tokens ────────────────────────────────────────────────── */
:root {
  /* Font families - paid fonts first, free self-hosted fallbacks */
  --font-sans:    "ABC Diatype", Inter, ui-sans-serif, system-ui, sans-serif;
  --font-display: "PP Kyoto", Newsreader, Georgia, "Times New Roman", serif;
  --font-mono:    "IBM Plex Mono", "JetBrains Mono", ui-monospace, "Courier New", monospace;

  /* Brand palette */
  --color-forest:  #004E23;
  --color-verdant: #1E7F3A;  /* brand Verdant: one green family at OKLCH hue 150; passes AA as text on Paper */
  --color-growth:  #95D7A2;  /* brand Growth, hue-aligned with Forest and Verdant (was #ABD49E) */
  --color-canvas:  #E4E3DB;
  --color-carbon:  #1E1E1E;

  /* Neutral scale (warm grays - never cold/blue) */
  --color-neutral-50:  #FEFEFE;
  --color-neutral-100: #F9F9F8;
  --color-neutral-200: #F3F2EF;
  --color-neutral-300: #F0EFE9;
  --color-neutral-400: #E4E3DB;
  --color-neutral-500: #C5C2BC;
  --color-neutral-600: #A7A6A2;
  --color-neutral-700: #787672;
  --color-neutral-800: #525150;
  --color-neutral-900: #1E1C1A;
  --color-neutral-950: #111010;

  /* Semantic tokens - light mode */
  --background:         #F3F2EF;
  --surface:            #EEEDE8;
  --card:               #FAF9F6;
  --muted:              #EAE8E2;
  --accent:             #EAE8E2;
  --sidebar-bg:         #F3F2EF;

  --foreground:         #141210;
  --muted-foreground:   #5E5B56;
  --subtle-foreground:  #A7A6A2;

  --primary:            #004E23;
  --primary-foreground: #FEFEFE;

  --border:             #DAD6CE;
  --input:              #DAD6CE;
  --ring:               #A1A1A1;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius:    8px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.10);

  /* Layout - site level */
  --site-gutter:      16px;
  --site-content-max: 1280px;

  /* Layout - component level */
  --sidebar-w: 232px;
  --content-w: 660px;
}

@media (min-width: 768px) {
  :root { --site-gutter: 48px; }
}

/* ── Dark mode ────────────────────────────────────────────────────── */
.dark {
  --background:         #161512;
  --surface:            #24221E;
  --card:               #1B1A17;
  --muted:              #211F1B;
  --accent:             #211F1B;
  --sidebar-bg:         #161512;

  --foreground:         #E8E3DA;
  --muted-foreground:   #A39E96;
  --subtle-foreground:  #787672;

  --primary:            #95D7A2;
  --primary-foreground: #0A0A0A;

  --border:             rgba(255, 255, 255, 0.10);
  --input:              rgba(255, 255, 255, 0.15);
  --ring:               #737373;

  /* palette preview: one lifted green for every accent in dark mode */
  --color-verdant: #95D7A2;
  --color-growth:  #95D7A2;
}

/* Light/dark logo switching - placed after base .mark/.hero__mark rules; see below */

/* Brand greens shift to lighter value in dark mode */
.dark .section__num { color: var(--color-growth); }
.dark .nav__num     { color: var(--color-growth); }
.dark .nav__item.is-active { color: var(--color-growth); }
.dark .nav__item.is-active .nav__num { color: var(--color-growth); }

/* ── Reset / base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

.app { display: flex; min-height: 100vh; }

/* ── Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: transparent;
  display: flex;
  flex-direction: column;
  padding: 64px 22px 22px;
  z-index: 10;
}

.brand { display: block; line-height: 0; }
.mark { width: 168px; height: auto; display: block; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 34px;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-toggle__lines,
.nav-toggle__lines::before,
.nav-toggle__lines::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--foreground);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__lines { position: relative; }
.nav-toggle__lines::before { position: absolute; top: -7px; left: 0; }
.nav-toggle__lines::after  { position: absolute; top:  7px; left: 0; }
.sidebar.is-open .nav-toggle__lines { background: transparent; }
.sidebar.is-open .nav-toggle__lines::before { transform: translateY(7px)  rotate(45deg); }
.sidebar.is-open .nav-toggle__lines::after  { transform: translateY(-7px) rotate(-45deg); }

.nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav__item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 7px;
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.1px;
  color: var(--foreground);
  transition: background 0.15s ease;
}
.nav__item:hover     { background: color-mix(in srgb, var(--foreground) 5%, transparent); }
.nav__item.is-active {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  color: var(--primary);
}
.nav__item.is-active .nav__num { color: var(--primary); }
.nav__num {
  font-family: var(--font-mono);
  color: var(--color-verdant);
  font-size: 11px;
  font-weight: 400;
  min-width: 20px;
}

.sidebar__footer { margin-top: auto; }
.mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  background: var(--background);
  cursor: pointer;
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 300;
  color: var(--foreground);
  transition: background 0.15s ease;
}
.mode:hover { background: var(--muted); }
.mode__icon { font-size: 12px; line-height: 1; }

/* ── Main ─────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rule {
  border: 0;
  border-top: 1px solid var(--border);
  width: var(--content-w);
  max-width: calc(100% - 44px);
  margin: 0 auto;
}
.careers + .rule,
.news-article + .rule {
  width: 720px;
  max-width: calc(100% - 44px);
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 16px;
}
.hero__mark { width: 80px; height: auto; display: block; }

/* Light/dark logo switching - must follow .mark and .hero__mark base rules */
.mark--dark,
.hero__mark--dark { display: none; }
.dark .mark--dark,
.dark .hero__mark--dark { display: block; }
.dark .mark--light,
.dark .hero__mark--light { display: none; }

/* Article figure light/dark image switching - !important beats inline style="display:block" */
.fig--dark,
.theme-img--dark { display: none !important; }
.dark .fig--dark,
.dark .theme-img--dark { display: block !important; }
.dark .fig--light,
.dark .theme-img--light { display: none !important; }

/* ── Sections ─────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
.section { padding: 84px 24px; scroll-margin-top: 24px; }

.section__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--color-verdant);
  margin: 0 0 24px;
}
.section__num--center { text-align: center; }

.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: 0.1px;
  margin: 0;
  color: var(--foreground);
}
.section__title--center { text-align: center; width: var(--content-w); max-width: 100%; margin-left: auto; margin-right: auto; }
.section__title--brand  { letter-spacing: 3px; font-size: 34px; }

/* Footnote reference + note */
.footnote-ref {
  font-size: 0.34em;
  font-weight: 400;
  letter-spacing: normal;
  vertical-align: super;
  line-height: 0;
}
.footnote-ref a { text-decoration: none; color: var(--muted-foreground); }
.footnote-ref a:hover { color: var(--foreground); }

.footnotes {
  width: 100%;
  max-width: 100%;
  margin: 40px 0 0;
  padding: 0;
}
.footnotes::before {
  content: "";
  display: block;
  width: 520px;
  max-width: 100%;
  border-top: 1px solid var(--border);
  margin-bottom: 16px;
}
.prose > .footnotes + p { margin-top: 0; }
.prose > p.section__num {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1;
  color: var(--muted-foreground);
  margin: 48px 0 14px;
}
.prose > p.section__num--center { text-align: center; }
.footnote {
  font-family: var(--font-display);
  font-style: normal;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted-foreground);
  margin: 0;
}
.footnote__num {
  font-style: normal;
  font-size: 0.72em;
  margin-right: 3px;
}

/* Intro: centered header + centered prose column */
.section--intro { padding-top: 20px; padding-bottom: 60px; }
.prose {
  width: var(--content-w);
  max-width: 100%;
  margin: 56px auto 0;
}
.prose > p {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.6;
  color: var(--foreground);
  margin: 0 0 24px;
}
.prose > p:last-of-type { margin-bottom: 0; }
.prose > p > a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose > p > a:hover { color: var(--color-verdant); }

/* Numbered sections (careers / contact) */
.section:not(.section--intro) { min-height: 34vh; }
.section:not(.section--intro) .section__num,
.section:not(.section--intro) .section__body {
  width: var(--content-w);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.section:not(.section--intro) .section__num  { margin-bottom: 22px; text-align: center; }
.section:not(.section--intro) .actions { justify-content: center; }

.section__lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--foreground);
  margin: 0 0 26px;
}
.section__lead a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
.section__lead a:hover { color: var(--muted-foreground); }

/* ── Buttons ──────────────────────────────────────────────────────── */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  border-radius: 7px;
  padding: 10px 18px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 450;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
.btn__icon { font-size: 13px; line-height: 1; }
.btn--solid { background: var(--primary); color: var(--primary-foreground); }
.btn--solid:hover { background: var(--color-verdant); }
.btn--fill  { background: var(--muted); color: var(--foreground); }
.btn--fill:hover  { background: color-mix(in srgb, var(--foreground) 10%, transparent); }
.btn--ghost { background: var(--background); color: var(--foreground); border-color: var(--border); }
.btn--ghost:hover { background: var(--muted); }
.btn--join  { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.btn--join:hover  { background: var(--color-verdant); border-color: var(--color-verdant); }

/* ── Careers page ─────────────────────────────────────────────────── */
.careers {
  width: 720px;
  max-width: 100%;
  margin: 0 auto;
  padding: 96px 24px 88px;
}
.careers__intro {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.6;
  color: var(--foreground);
  text-align: center;
  max-width: 520px;
  margin: 24px auto 0;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  color: var(--muted-foreground);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  line-height: 1;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.back:hover { color: var(--foreground); }
.back:hover .arr { transform: translateX(-2px); }

.jobs { margin-top: 64px; }
.jobs__status {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--muted-foreground);
  text-align: center;
  margin: 40px 0;
}
.jobs__status a { color: var(--foreground); }

.jobs__group + .jobs__group { margin-top: 48px; }
.jobs__dept {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted-foreground);
  margin: 0 0 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.jobs__count { color: var(--subtle-foreground); }

.job {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 8px 18px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--foreground);
  border-radius: var(--radius-md);
  transition: background 0.15s ease, padding 0.15s ease;
}
.job:hover { background: var(--muted); padding-left: 12px; padding-right: 12px; }
.job__main  { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.job__title { font-family: var(--font-display); font-size: 19px; line-height: 1.3; }
.job__meta  { font-family: var(--font-sans); font-size: 13px; font-weight: 300; color: var(--muted-foreground); }
.job__aside {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-foreground);
}
.job__comp  { white-space: nowrap; }
.job__arrow { color: var(--muted-foreground); transition: transform 0.15s ease, color 0.15s ease; }
.job:hover .job__arrow { color: var(--foreground); transform: translateX(2px); }

/* ── Role detail ──────────────────────────────────────────────────── */
.role__meta {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 300;
  color: var(--muted-foreground);
  text-align: center;
  margin: 16px 0 0;
}
.role__body {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.65;
  color: var(--foreground);
  margin-top: 40px;
}
.role__body p                { margin: 0 0 1em; }
.role__body p:last-child     { margin-bottom: 0; }
.role__body ul, .role__body ol { margin: 0 0 1em; padding-left: 1.3em; }
.role__body li               { margin: 0.25em 0; }
.role__body strong           { color: var(--foreground); font-weight: 500; }
.role__body a                { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.careers .role__actions      { justify-content: center; margin-top: 40px; }
.role__apply-note {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--muted-foreground);
  text-align: center;
  margin: 14px 0 0;
}

/* ── Card grid (Datasets, SLMs) ──────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-decoration: none;
  color: var(--foreground);
  min-height: 180px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  background: var(--muted);
  box-shadow: var(--shadow-sm);
}
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card__tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
}
.card__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--foreground);
}
.card__desc {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--muted-foreground);
  margin: 0;
  flex: 1;
}
.card__footer { display: none; }
.card__meta { display: none; }
.card__arrow {
  flex-shrink: 0;
  color: var(--muted-foreground);
  transition: color 0.15s ease, transform 0.15s ease;
}
.card:hover .card__arrow {
  color: var(--primary);
  transform: translate(2px, -2px);
}

/* ── News / Research list ─────────────────────────────────────────── */
.news-row {
  display: flex;
  align-items: baseline;
  gap: 18px;
}
.news-item__num {
  flex: 0 0 2.4em;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.3;
  padding-top: 18px;
  text-align: right;
}
.news-row .job { flex: 1; min-width: 0; }

/* ── News / Research article ──────────────────────────────────────── */
.news-article {
  width: 720px;
  max-width: 100%;
  margin: 0 auto;
  padding: 96px 24px 88px;
  box-sizing: border-box;
}
.news-article__media {
  display: block;
  width: 100%;
  height: auto;
  margin: 30px auto 0;
  background: var(--card);
  border-radius: 7px;
}
.news-article .section__num   { margin-bottom: 16px; }
.news-article .section__title { width: 100%; max-width: 100%; }
.news-article__body.prose {
  width: var(--content-w);
  max-width: 100%;
  margin: 40px auto 0;
  text-align: left;
}
.news-article__body.prose > p {
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.75;
}
.news-article__meta {
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 300 !important;
  color: var(--muted-foreground) !important;
  margin-bottom: 28px !important;
  text-align: center;
}
.news-article__body h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.3;
  color: var(--foreground);
  margin: 36px 0 14px;
}
.news-article__body ul,
.news-article__body ol {
  margin: 16px 0 20px;
  padding-left: 22px;
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.65;
  color: var(--foreground);
}
.news-article__body dl {
  margin: 16px 0 20px;
}
.news-article__body dt {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding-top: 16px;
}
.news-article__body dd {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
  margin-left: 0;
}
.news-article__body li {
  margin-bottom: 10px;
}
.news-article__body li:last-child {
  margin-bottom: 0;
}
.news-article__body li strong {
  font-weight: 500;
  color: var(--foreground);
}
.news-article__body blockquote {
  margin: 28px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--border);
}
.news-article__body blockquote p {
  font-style: italic;
  color: var(--foreground);
}

/* ── News article figures ──────────────────────────────────────────── */
.news-article__figure {
  margin: 36px 0;
}
.news-article__figure img {
  width: 100%;
  border-radius: var(--radius-md);
  display: block;
}
.news-article__figure figcaption {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-foreground);
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Related content (ecosystem cards) ───────────────────────────── */
.related {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.related__label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}
.related__links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.related__link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 14px 16px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  text-decoration: none;
  color: var(--foreground);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.related__link::after {
  content: "";
  width: 14px; height: 14px;
  background: currentColor;
  -webkit-mask: var(--arr-right) center / contain no-repeat; mask: var(--arr-right) center / contain no-repeat;
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1;
  color: var(--muted-foreground);
  transition: transform 0.15s ease, color 0.15s ease;
}
.related__meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.related__num { color: var(--color-verdant); }
.related__kind { color: var(--muted-foreground); }
.related__title {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.25;
  font-weight: 400;
}
.related__link:hover {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
}
.related__link:hover .related__title,
.related__link:hover .related__num { color: var(--primary); }
.related__link:hover::after { color: var(--primary); transform: translateX(3px); }
.dark .related__num { color: var(--color-growth); }

/* ── Data stats bar (horizontal metric cells) ─────────────────────── */
.data-stats {
  display: flex;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 32px 0;
}
.data-stats__cell {
  flex: 1;
  background: var(--muted);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.data-stats__value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  color: var(--color-forest);
  line-height: 1;
  letter-spacing: -0.02em;
}
.dark .data-stats__value { color: var(--color-growth); }
.data-stats__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

/* ── Commerce-1 metrics grid ──────────────────────────────────────── */
.c1-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 36px 0;
}
.c1-metrics__cell {
  background: var(--muted);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.c1-metrics__value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  color: var(--color-forest);
  line-height: 1;
  letter-spacing: -0.02em;
}
.dark .c1-metrics__value { color: var(--color-growth); }
.c1-metrics__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

/* ── Task flow stepper ────────────────────────────────────────────── */
.task-flow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 36px 0;
  overflow-x: auto;
}
.task-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 80px;
  position: relative;
}
.task-flow__step + .task-flow__step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 0;
  height: 1px;
  border-top: 1px dashed var(--border);
  transform: translateX(-50%);
  width: calc(100% / 2);
  left: 0;
}
.task-flow__dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted-foreground);
  position: relative;
  z-index: 1;
}
.task-flow__step--active .task-flow__dot {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.dark .task-flow__step--active .task-flow__dot {
  background: var(--color-verdant);
  border-color: var(--color-verdant);
}
.task-flow__name {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-foreground);
  text-align: center;
  margin-top: 6px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.task-flow__connector {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-top: 16px;
  border-top: 1px dashed var(--border);
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 32px;
  margin-top: auto;
}
.footer__left, .footer__right {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-foreground);
}
.footer a        { text-decoration: none; color: var(--muted-foreground); }
.footer a:hover  { color: var(--foreground); }
.footer__brand   { color: var(--muted-foreground); }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 16px;
    background: var(--background);
    border-right: 0;
    border-bottom: 1px solid var(--border);
    z-index: 20;
  }
  .brand { order: 1; }
  .mark  { width: 116px; }
  .nav-toggle { display: inline-flex; order: 2; margin-left: auto; }

  .nav {
    order: 3;
    flex-basis: 100%;
    margin: 4px 0 0;
    padding: 8px 0 2px;
    border-top: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    display: none;
  }
  .sidebar.is-open .nav { display: flex; }
  .nav__item { padding: 11px 8px; }

  .sidebar__footer {
    order: 4;
    flex-basis: 100%;
    display: none;
    margin: 0;
    padding-bottom: 6px;
  }
  .sidebar.is-open .sidebar__footer { display: block; }

  .main { margin-left: 0; }

  .hero { padding: 36px 24px 12px; }
  .hero__mark { width: 48px; }
  .section { padding: 52px 22px; }
  .section--intro { padding-top: 16px; padding-bottom: 56px; }
  .prose { margin-top: 36px; }
  .section__title { font-size: 25px; }
  .section:not(.section--intro) { min-height: auto; }
  .section:not(.section--intro) .section__num { margin-bottom: 16px; }

  .careers,
  .news-article { padding: 56px 22px 64px; }
  .jobs { margin-top: 44px; }
}

@media (max-width: 560px) {
  .job {
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
  }
  .job__main  { min-width: 0; }
  .job__aside { flex-shrink: 0; gap: 10px; }
}

@media (max-width: 520px) {
  .section__lead br  { display: none; }
  .section__title br { display: none; }
}

@media (max-width: 700px) {
  /* Data stats wrap to 2 columns */
  .data-stats { flex-wrap: wrap; }
  .data-stats__cell { flex: 1 1 calc(50% - 1px); }
  /* 3-col metrics override becomes 1 col per row on small screens */
  .c1-metrics[style*="1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .related__links { grid-template-columns: 1fr; }
  .related__link { gap: 16px; }
}

/* ── Research article template ─────────────────────────────────────── */
.research-article {
  padding: 72px 24px 88px 40px;
  max-width: 1100px;
  margin-left: 0;
  margin-right: 0;
}

.research-article .back { margin-bottom: 20px; }

.research-hero {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 7px;
  margin: 28px 0 0;
  background: var(--muted);
}

.research-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  color: var(--muted-foreground);
  margin: 28px 0 40px;
  text-align: center;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Three-column layout */
.research-layout {
  display: flex;
  align-items: flex-start;
  gap: 48px;
}

/* Left TOC */
.research-toc {
  flex: 0 0 190px;
  position: sticky;
  top: 40px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  align-self: flex-start;
}

.research-toc__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.research-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.research-toc li + li { margin-top: 2px; }

.research-toc__link {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 4px 0 4px 14px;
  transition: color 0.15s ease;
  position: relative;
}

.research-toc__link:hover { color: var(--foreground); }

.research-toc__link.is-active {
  color: var(--foreground);
}

.research-toc__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 2px;
  height: 0.95em;
  background: var(--primary);
  border-radius: 1px;
}

.research-toc ul ul .research-toc__link {
  font-size: 11px;
  padding-left: 22px;
  color: var(--subtle-foreground);
}

.research-toc ul ul .research-toc__link:hover  { color: var(--muted-foreground); }
.research-toc ul ul .research-toc__link.is-active {
  color: var(--foreground);
}
.research-toc ul ul .research-toc__link.is-active::before {
  left: 10px;
}

/* Center prose */
.research-prose {
  flex: 1;
  max-width: 65ch;
  min-width: 0;
  position: relative;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.75;
  color: var(--foreground);
}

.research-prose .research-abstract {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  margin-bottom: 36px;
  color: var(--foreground);
}

.research-prose p { margin-bottom: 1.2em; }

.research-prose h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--foreground);
  margin: 48px 0 16px;
  scroll-margin-top: 40px;
}

.research-prose h3 {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--foreground);
  margin: 32px 0 12px;
  scroll-margin-top: 40px;
}

.research-prose a {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  transition: border-color 0.15s ease;
}

.research-prose a:hover { border-bottom-color: var(--primary); }

.research-prose blockquote {
  margin: 28px 0;
  padding: 0 0 0 18px;
  border-left: 2px solid var(--border);
}

.research-prose blockquote p {
  font-style: italic;
  color: var(--muted-foreground);
  margin-bottom: 0;
}

.research-prose ul,
.research-prose ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.research-prose li { margin-bottom: 0.4em; }

.research-prose code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  padding: 0.15em 0.4em;
  background: var(--muted);
  border-radius: var(--radius-sm);
  color: var(--foreground);
}

.research-prose pre,
.news-article__body pre {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-x: auto;
  margin: 20px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
}

.news-article__body pre { font-size: 12.5px; white-space: pre; }
.research-prose pre code,
.news-article__body pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

.research-prose strong { font-weight: 500; }

.research-prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Figures */
.research-figure {
  margin: 32px 0;
}

.research-figure__media {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--muted);
  border: 1px solid var(--border);
}

.research-figure__media img,
.research-figure__media video {
  display: block;
  width: 100%;
  height: auto;
}

.research-figure__caption {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.research-figure__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--foreground);
}

/* Sidenotes */
.sidenote-wrapper { display: inline; }

.sidenote-ref {
  font-family: var(--font-mono);
  font-size: 0.68em;
  vertical-align: super;
  color: var(--primary);
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.sidenote-wrapper:hover .sidenote-ref {
  color: var(--color-verdant);
}

.sidenote {
  position: absolute;
  left: calc(100% + 32px);
  width: 155px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
  padding: 2px 0;
}

.sidenote-wrapper:hover .sidenote {
  color: var(--foreground);
}

.sidenote a {
  color: var(--color-verdant);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--color-verdant) 40%, transparent);
}
.sidenote a:hover { border-bottom-color: var(--color-verdant); }

/* Mobile-extracted block footnotes - engram-style numbered references */
.block-footnotes {
  margin: 10px 0 22px;
  padding: 0;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

.block-footnotes p { margin: 6px 0 0; }
.block-footnotes p:first-child { margin-top: 0; }

/* Narrow: hide absolute sidenotes, show block-footnotes */
@media (max-width: 1400px) {
  .sidenote { display: none; }
}

/* Wide screens: center the content column without changing sidebar behavior.
   Body is capped and centered; fixed sidebar shifts its left edge to match. */
@media (min-width: 1600px) {
  body {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
  }
  /* Sidebar stays position:fixed but its left edge follows the centered body */
  .sidebar {
    left: max(0px, calc((100vw - 1600px) / 2));
  }
  /* Research article centers within the now-finite main column */
  .research-article {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Medium: hide TOC, prose goes full-width */
@media (max-width: 1049px) {
  .research-toc { display: none; }
  .research-prose { max-width: 100%; }
}


/* Mobile */
@media (max-width: 860px) {
  .research-article {
    padding: 56px 20px 64px;
  }
  .research-layout { display: block; }
  .research-prose  { font-size: 17px; }
}

/* ── Right-margin sidenote - arrow accent ─────────────────────────── */


/* ── Video player component (pi.website style) ────────────────────── */
.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 0;
  cursor: pointer;
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-player__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.28);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.video-player.is-playing .video-player__overlay {
  opacity: 0;
  pointer-events: none;
}

.video-player__btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.2s ease, background 0.2s ease;
}

.video-player:hover .video-player__btn {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.2);
}

.video-player__label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

/* ── Video slider (pi.website style) ─────────────────────────────── */
.video-slider {
  margin: 32px 0;
}

.video-slider__track-wrapper {
  overflow: hidden;
}

.video-slider__track {
  display: flex;
  gap: 10px;
  transition: transform 0.35s ease;
  will-change: transform;
}

.video-slider__item {
  flex: 0 0 calc(40% - 8px);
  min-width: 0;
}

.video-slider__video-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
}

.video-slider__video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-slider__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 20px 10px 9px;
  background: linear-gradient(to top, rgba(0,0,0,0.65) 0%, transparent 100%);
}

.vs-play-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
}

.vs-play-btn:hover { background: rgba(255,255,255,0.22); }

.vs-progress-bar {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.vs-progress-fill {
  height: 100%;
  background: #e5e5e5;
  border-radius: 2px;
  width: 0%;
}

.vs-time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: rgba(255,255,255,0.75);
  flex-shrink: 0;
  white-space: nowrap;
}

.video-slider__caption {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 8px 0 0;
  line-height: 1.4;
  text-align: center;
}

.video-slider__nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.vs-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--foreground);
  color: var(--background);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.vs-nav-btn:hover   { opacity: 0.75; }
.vs-nav-btn:disabled { opacity: 0.25; cursor: default; }

@media (max-width: 860px) {
  .video-slider__item { flex: 0 0 calc(50% - 5px); }
}

/* ── Video expand modal ───────────────────────────────────────────── */
.video-expand-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.video-expand-modal.is-open { display: flex; }
.video-expand-modal__inner {
  position: relative;
  width: 100%;
  max-width: 900px;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.video-expand-modal__inner video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.video-expand-modal__caption {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
}
.video-expand-modal__close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
}
.video-expand-modal__close:hover { color: #fff; }
.video-slider__video-wrap { cursor: zoom-in; }

/* ── Interactive bar chart tooltip ───────────────────────────────── */
.bar-row { position: relative; overflow: visible; }
.bar-row:hover .bar-fill { opacity: 0.85; }
.bar-tooltip {
  display: none;
  position: absolute;
  left: 130px;
  bottom: calc(100% + 4px);
  background: var(--card);
  color: var(--foreground);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: 6px;
  max-width: 260px;
  white-space: normal;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.bar-row:hover .bar-tooltip { display: block; }

/* ── Metrics grid (native component) ─────────────────────────────── */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.metrics-grid__cell {
  background: var(--muted);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.metrics-grid__value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 500;
  color: var(--color-forest);
  line-height: 1;
  letter-spacing: -0.02em;
}
.dark .metrics-grid__value { color: var(--color-growth); }
.metrics-grid__label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
}
.metrics-grid__desc {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.4;
  margin-top: 2px;
}

/* ── Figure grid - 2-column image layout ─────────────────────────── */
.figure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 32px 0;
}

.figure-grid .research-figure { margin: 0; }

@media (max-width: 600px) {
  .figure-grid { grid-template-columns: 1fr; }
}


/* ── Honest-status additions ─────────────────────────────── */
.mock-fig{background:var(--muted);border-radius:var(--radius-md);padding:20px 22px 14px;margin:0}
.mock-fig__tag{font-family:var(--font-mono);font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted-foreground);margin:0 0 12px}
.mock-row{display:flex;align-items:center;gap:14px;margin:9px 0;font-family:var(--font-mono);font-size:11px;color:var(--muted-foreground)}
.mock-row__label{width:150px;flex-shrink:0}
.mock-row__cells{display:flex;gap:14px;flex:1}
.mock-bar{flex:1;height:18px;border-radius:2px;background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--foreground) 10%,transparent) 0 6px,transparent 6px 12px);border:1px dashed color-mix(in srgb,var(--foreground) 22%,transparent)}
.mock-head .mock-bar{height:auto;background:none;border:0;text-align:left}

/* ── Status note (muted panel; text inherits the page body style) ── */
p.status-card{margin-top:24px;margin-bottom:24px;padding:14px 18px;background:color-mix(in srgb,var(--primary) 7%,transparent);border-radius:var(--radius-md)}
.mock-fig{background:var(--muted);border-radius:var(--radius-md);padding:22px 24px;margin:0}
.mock-fig__tag{font-family:var(--font-mono);font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted-foreground);margin:0 0 14px}
.stage{display:grid;grid-template-columns:170px 1fr 120px;align-items:center;gap:14px;margin:10px 0;font-family:var(--font-mono);font-size:11px;color:var(--muted-foreground)}
.stage__track{height:18px;border-radius:2px;background:color-mix(in srgb,var(--foreground) 8%,transparent);position:relative;overflow:hidden}
.stage__fill{position:absolute;left:0;top:0;bottom:0;background:var(--primary);border-radius:2px}
.stage__fill--part{background:repeating-linear-gradient(135deg,var(--primary) 0 6px,color-mix(in srgb,var(--primary) 55%,transparent) 6px 12px)}
.stage__state{text-align:right;white-space:nowrap}
.spec-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;margin:20px 0}
.spec-cell{background:var(--muted);border-radius:var(--radius-md);padding:14px 16px}
.spec-cell__tag{font-family:var(--font-mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--primary);margin:0 0 6px}
.spec-cell__title{font-family:var(--font-display);font-size:17px;line-height:1.3;margin:0 0 4px;color:var(--foreground)}
.spec-cell__desc{font-size:13px;line-height:1.45;color:var(--muted-foreground);margin:0}
.crit-table{width:100%;border-collapse:collapse;font-family:var(--font-sans);font-size:14px;line-height:1.5}
.crit-table th{font-family:var(--font-mono);font-weight:500;font-size:10px;letter-spacing:.06em;text-transform:uppercase;text-align:left;color:var(--muted-foreground);padding:6px 10px 8px 0;border-bottom:1px solid var(--border)}
.crit-table td{padding:10px 10px 10px 0;vertical-align:top;border-bottom:1px solid var(--border);color:var(--foreground)}
.crit-table tr:last-child td{border-bottom:0}
@media (max-width:640px){.stage{grid-template-columns:1fr;gap:6px}.stage__state{text-align:left}.crit-table th:nth-child(3),.crit-table td:nth-child(3){display:none}}

/* ── Shelf articles (Shelf-1, ShelfTrace) ──────────────────────────
   The inline SVG figures read these variables. Every one maps to a GM
   token, so the figures follow the site palette in light and dark.
   Roles: --c-* are product packs on a shelf (a tonal family: Forest,
   Verdant, Growth, warm grey, ink); --amber* is the one highlight
   (Verdant); --paper-* are figure surfaces; --ink-* text and strokes. */
.shelf-article {
  --paper-0: var(--card);
  --paper-1: var(--background);
  --paper-2: var(--muted);
  --paper-3: var(--color-canvas);
  --ink-0: var(--foreground);
  --ink-1: #2B2925;
  --ink-2: var(--color-neutral-800);
  --ink-3: var(--color-neutral-700);
  --ink-4: var(--color-neutral-500);
  --line: var(--border);
  --line-strong: var(--color-neutral-500);
  --amber: var(--color-verdant);
  --amber-strong: var(--color-forest);
  --amber-soft: color-mix(in srgb, var(--color-verdant) 14%, var(--card));
  --c-clay: var(--color-forest);
  --c-moss: var(--color-verdant);
  --c-ochre: var(--color-growth);
  --c-ochre-deep: var(--color-verdant);
  --c-sand: var(--color-neutral-500);
  --c-slate: var(--color-neutral-800);
  --r-sm: var(--radius-md);
  --r-pill: 999px;
}
.dark .shelf-article {
  --paper-3: #2E2B26;
  --ink-1: #D4CFC7;
  --ink-2: #B0AAA1;
  --ink-3: #8E8880;
  --ink-4: #5C5852;
  --line: #34322E;
  --line-strong: #4B4842;
  --amber-soft: color-mix(in srgb, var(--color-verdant) 20%, var(--card));
  --c-clay: #2F7A47;
  --c-moss: #95D7A2;
  --c-ochre: #95D7A2;
  --c-sand: #787672;
  --c-slate: #A39E96;
}
.shelf-article .shelf-lede { font-size: 19px; line-height: 1.6; color: var(--muted-foreground); }
.shelf-article .tablewrap { overflow-x: auto; margin: 16px 0 6px; }
.shelf-article table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: 14px; line-height: 1.5; }
.shelf-article th,
.shelf-article td { text-align: left; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--foreground); }
.shelf-article th { font-family: var(--font-mono); font-weight: 500; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); }
.shelf-article td.n,
.shelf-article th.n { text-align: right; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; padding-left: 10px; }
.shelf-article .caption { font-family: var(--font-sans); font-size: 13px; line-height: 1.5; color: var(--muted-foreground); margin: 10px 0 28px; }
.shelf-article .note { font-family: var(--font-sans); font-size: 14px; color: var(--muted-foreground); }
.shelf-article .refs li { font-family: var(--font-sans); font-size: 14px; line-height: 1.55; }
.shelf-article .est { font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--color-verdant); border: 1px solid color-mix(in srgb, var(--color-verdant) 45%, transparent); border-radius: var(--r-pill); padding: 1px 7px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
.shelf-article pre { white-space: pre; }
.shelf-article figure { margin: 32px 0 8px; }
.shelf-article figure svg { width: 100%; height: auto; display: block; }
.shelf-article figure svg text { font-family: var(--font-sans); fill: var(--ink-1); }
.shelf-article figure svg .box { fill: var(--paper-1); stroke: var(--line-strong); }
.shelf-article figure svg .hot { fill: var(--amber-soft); stroke: var(--amber); }
.shelf-article figure svg .arrow { stroke: var(--ink-3); fill: none; marker-end: url(#ah); }
.shelf-article figure svg .sub { fill: var(--ink-3); font-size: 11px; }
.shelf-article figure svg .phone { fill: var(--paper-0); stroke: var(--ink-2); stroke-width: 1.5; }
.shelf-article figure svg .log { font-family: var(--font-mono); font-size: 10.5px; fill: var(--ink-2); }
.shelf-article figure svg .mono { font-family: var(--font-mono); fill: var(--ink-1); }
.shelf-article figure svg .arrow2 { stroke: var(--ink-3); fill: none; stroke-width: 1.4; marker-end: url(#ah2); }
.shelf-article .phones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.shelf-article .figscroll { overflow-x: auto; }
.shelf-article .figscroll svg { min-width: 560px; }
@media (max-width: 560px) { .shelf-article .phones { grid-template-columns: 1fr 1fr; } }

/* ── Palette preview (preview/palette-beta): one callout treatment ─────
   Every boxed callout gets the same warm surface and hairline border;
   green is kept for text accents and tag outlines, never as a box fill. */
p.status-card,
.data-stats,
.spec-cell,
.mock-fig,
.research-prose pre,
.news-article__body pre {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.data-stats { gap: 0; }
.data-stats__cell { background: transparent; }
.data-stats__cell + .data-stats__cell { border-left: 1px solid var(--border); }
.card__tag {
  color: var(--color-verdant);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--color-verdant) 45%, transparent);
}
.nav__item.is-active { background: var(--muted); }
.related__link:hover {
  background: var(--muted);
  border-color: color-mix(in srgb, var(--color-verdant) 45%, var(--border));
}

/* ── Stepper: a row of numbered stages (Commerce Agent Traces, Commerce-1) */
.stepper { display: flex; align-items: center; gap: 0; margin: 32px 0; overflow-x: auto; }
.stepper__step { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 72px; }
.stepper__dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px;
  background: var(--muted); border: 1px solid var(--border); color: var(--muted-foreground);
}
.stepper__dot--on { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.stepper__label {
  font-family: var(--font-mono); font-size: 10px; line-height: 1.3; letter-spacing: 0.04em;
  text-transform: uppercase; text-align: center; color: var(--muted-foreground); margin-top: 6px;
}
.stepper__line { flex: 1; height: 1px; border-top: 1px dashed var(--border); margin-bottom: 22px; }

/* ── Flow: a left-to-right pipeline figure (Shelf Intelligence) */
.flow { min-height: 100px; display: flex; align-items: center; gap: 0; padding: 24px 20px; }
.flow__step { flex: 1; text-align: center; }
.flow__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 6px; }
.flow__title { font-family: var(--font-display); font-size: 15px; color: var(--foreground); }
.flow__arrow { color: var(--color-verdant); font-size: 18px; padding: 0 12px; flex-shrink: 0; }
@media (max-width: 560px) {
  .flow { flex-direction: column; gap: 6px; }
  .flow__arrow { transform: rotate(90deg); padding: 0; }
}

/* ── Home: lede and latest release ──────────────────────────────── */
.home-lede {
  text-align: center;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 300;
  color: var(--muted-foreground);
  margin: 14px auto 36px;
  max-width: var(--content-w);
  line-height: 1.5;
}
.release {
  display: block;
  max-width: var(--content-w);
  margin: 0 auto 48px;
  padding: 20px 24px;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--foreground);
  text-decoration: none;
  transition: border-color .15s ease;
}
.release:hover { border-color: var(--color-verdant); }
.release__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-verdant);
  margin-bottom: 8px;
}
.release__title { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.2; margin-bottom: 6px; }
.release__desc  { display: block; font-family: var(--font-sans); font-size: 15px; font-weight: 300; line-height: 1.55; color: var(--muted-foreground); }
.release__more  { display: inline-block; margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--primary); }
.release:hover .release__more { color: var(--color-verdant); }

/* ── Arrow icon: one drawn arrow for the whole site ───────────────── */
:root {
  --arr-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8h10M9 4l4 4-4 4'/%3E%3C/svg%3E");
  --arr-ne: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 11l6-6M6 5h5v5'/%3E%3C/svg%3E");
}
.arr {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.14em;
  background: currentColor;
  -webkit-mask: var(--arr-right) center / contain no-repeat;
          mask: var(--arr-right) center / contain no-repeat;
  transition: transform .15s ease;
  flex-shrink: 0;
}
.arr--left { transform: scaleX(-1); }
.back:hover .arr--left { transform: scaleX(-1) translateX(2px); }
.arr--ne { -webkit-mask-image: var(--arr-ne); mask-image: var(--arr-ne); }
a:hover > .arr:not(.arr--left):not(.arr--ne), .release:hover .arr, .job:hover .arr { transform: translateX(2px); }
.card__arrow.arr { width: 16px; height: 16px; }
.card:hover .card__arrow.arr { transform: translate(2px,-2px); }

/* ── Charts (research figures): one accent + gray context, site tokens ── */
.chart {
  --chart-hi: var(--primary);
  --chart-lo: #8C8A84;
  --chart-line: var(--border);
  padding: 20px 20px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted-foreground);
}
.dark .chart { --chart-lo: #6E6A64; }
.chart__legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 0 14px; }
.chart__key { display: inline-flex; align-items: center; gap: 6px; }
.chart__key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--chart-lo); }
.chart__key--hi::before { background: var(--chart-hi); }
.chart__key--ring::before { background: transparent; border: 1.5px solid var(--chart-hi); width: 8px; height: 8px; border-radius: 50%; }
.chart__key--dot::before { background: var(--chart-hi); border-radius: 50%; }
.chart__key--dot-lo::before { border-radius: 50%; }
.chart__rows {
  display: grid;
  grid-template-columns: minmax(0, 12em) minmax(0, 1fr) 3.6em;
  column-gap: 12px;
  row-gap: 6px;
  align-items: center;
}
.chart__label { color: var(--foreground); font-family: var(--font-sans); font-size: 13px; font-weight: 300; }
.chart__label--sub { color: var(--muted-foreground); font-family: var(--font-mono); font-size: 11px; }
.chart__track {
  position: relative;
  height: 12px;
  background-image: linear-gradient(to right, var(--chart-line) 1px, transparent 1px);
  background-size: var(--tick, 25%) 100%;
}
.chart__bar {
  position: absolute; left: 0; top: 1px; height: 10px;
  min-width: 2px;
  width: var(--v);
  background: var(--chart-lo);
  border-radius: 0 4px 4px 0;
}
.chart__bar--hi { background: var(--chart-hi); }
.chart__val { text-align: right; color: var(--foreground); font-variant-numeric: tabular-nums; }
.chart__val--hi { font-weight: 500; }
.chart__axis { display: grid; grid-template-columns: minmax(0, 12em) minmax(0, 1fr) 3.6em; column-gap: 12px; margin-top: 8px; }
.chart__ticks { position: relative; height: 12px; }
.chart__ticks span { position: absolute; left: var(--at); transform: translateX(-50%); white-space: nowrap; }
.chart__ticks span[style*="--at:0%"] { transform: none; }
.chart__ticks span[style*="--at:100%"] { transform: translateX(-100%); }
.chart__axis-title { grid-column: 2; text-align: center; margin-top: 4px; }
.chart__sep { grid-column: 1 / -1; border-top: 1px dashed var(--chart-line); margin: 2px 0; }
.chart__group { grid-column: 1 / -1; margin-top: 6px; color: var(--foreground); font-family: var(--font-sans); font-size: 13px; font-weight: 400; }
.chart__group:first-child { margin-top: 0; }
/* Dot plot with interval whiskers */
.chart__rows--dots { row-gap: 3px; }
.chart__whisker { position: absolute; top: 5.5px; height: 1px; left: var(--lo); width: calc(var(--hi) - var(--lo)); background: var(--chart-lo); }
.chart__dot { position: absolute; top: 2px; width: 8px; height: 8px; margin-left: -4px; left: var(--v); border-radius: 50%; background: var(--chart-lo); box-shadow: 0 0 0 2px var(--muted); }
.chart__dot--hi { background: var(--chart-hi); }
.chart__whisker--hi { background: var(--chart-hi); }
/* Matrix (surfaces x rails) */
.chart-matrix { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11px; }
.chart-matrix th { font-weight: 400; color: var(--muted-foreground); padding: 6px 4px; text-align: center; vertical-align: bottom; }
.chart-matrix th[scope="row"] { text-align: left; color: var(--foreground); font-family: var(--font-sans); font-size: 13px; font-weight: 300; white-space: nowrap; }
.chart-matrix td { text-align: center; padding: 8px 4px; border-top: 1px solid var(--chart-line); }
.chart-matrix .cell { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--chart-hi); }
.chart-matrix .cell--cart { background: transparent; border: 1.5px solid var(--chart-hi); width: 8px; height: 8px; }
.chart-matrix .cell--none { width: 6px; height: 1px; border-radius: 0; background: var(--chart-line); vertical-align: middle; }
.chart-matrix-wrap { overflow-x: auto; }
@media (max-width: 600px) {
  .chart { padding: 16px 14px 12px; }
  .chart-matrix { font-size: 10px; }
  .chart-matrix th, .chart-matrix td { padding-left: 2px; padding-right: 2px; }
  .chart-matrix th[scope="row"] { white-space: normal; font-size: 12px; }
  .chart__rows, .chart__axis { grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) 3.2em; column-gap: 8px; }
  .chart__label { font-size: 12px; }
}
