/* ============================================================
   ideaSquared - site styles
   Built on the ideaSquared Design System (tokens.css). Components use
   semantic tokens only; hero and band sections switch to the dark theme
   through the same tokens, so no colour is hard-coded here.
   Class names used by the journal and venture changelogs
   (.venture-card, .chip, .venture-grid-2, .changelog ...) are
   kept stable so dated entries can be added without touching CSS.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

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

body.i2 {
  margin: 0;
  background: var(--bg);
  color: var(--fg-body);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--fg);
  margin: 0;
  text-wrap: balance;
}
h1 { font-family: var(--font-display); font-weight: 500; font-size: var(--t-h1); line-height: 1.08; letter-spacing: -0.02em; }
h2 { font-weight: 700; font-size: var(--t-h2); line-height: 1.15; letter-spacing: -0.02em; }
h3 { font-size: var(--t-h3); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-size: var(--t-h4); line-height: 1.3; }
h5 { font-size: var(--t-h5); line-height: 1.3; }
/* An h4 turned into an h3 for heading order keeps the h4 look. */
h3.h4-look { font-size: var(--t-h4); line-height: 1.3; letter-spacing: normal; }

p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--sp-3); }
strong { color: var(--fg); font-weight: 600; }
ul, ol { margin: 0; padding: 0; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--link-hover); }

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 1px var(--sp-2);
}

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-fg);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: var(--sp-3); color: var(--accent-fg); }

.container,
.nav-inner,
.footer-grid,
.footer-bottom {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Labels ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}
.eyebrow.signal { color: var(--accent-text); }

/* Small uppercase labels: sans, never mono (mono is for code and numerals). */
.track-caption,
.gate-title,
.gate-label,
.facts dt,
.venture-stat .label,
.table-label,
.venture-table thead th,
.changelog-count,
.footer-col .footer-heading,
.track-here,
.outcomes b,
.venture-table.stack td::before {
  font-family: var(--font-sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: var(--t-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--fg-body);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  padding: var(--sp-2) var(--sp-3);
  text-decoration: none;
  white-space: nowrap;
}
a.chip:hover { color: var(--link-hover); border-color: var(--accent); }
.chip.signal { color: var(--on-accent-soft); border-color: var(--accent); background: var(--accent-soft); }
.chip.success, .chip.go { color: var(--go); border-color: var(--go); background: var(--go-soft); }
.chip.stopped { color: var(--fg-muted); border-style: dashed; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  font-family: var(--font-sans);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn-md { font-size: var(--t-small); padding: var(--sp-2) var(--sp-4); }
.btn-lg { font-size: var(--t-body); padding: var(--sp-4) var(--sp-6); }
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--i2-signal-400); color: var(--accent-fg); }
.btn-secondary,
.btn-ghost-dark { color: var(--fg); border-color: var(--line-strong); background: transparent; }
.btn-secondary:hover,
.btn-ghost-dark:hover { color: var(--fg); border-color: var(--accent); }

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  min-height: var(--sp-16);
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  margin-right: auto;
}
.nav-brand img { width: var(--sp-10); height: var(--sp-10); display: block; }
.brand-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--t-h4);
  letter-spacing: -0.02em;
  color: var(--fg);
}
.brand-text em { font-style: normal; color: var(--accent-text); }
.nav-links { display: flex; align-items: center; gap: var(--sp-1); }
.nav-links a {
  font-size: var(--t-small);
  font-weight: 500;
  color: var(--fg-body);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-pill);
}
.nav-links a:hover { color: var(--fg); background: var(--bg-sunken); }
.nav-links a[aria-current="page"] { color: var(--accent-text); }
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--sp-10);
  height: var(--sp-10);
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .nav .btn { display: none; }
  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) var(--gutter) var(--sp-4);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: var(--sp-4) var(--sp-1); border-radius: 0; border-bottom: 1px solid var(--line); font-size: var(--t-body); }
  .nav-links a:last-child { border-bottom: 0; }
}

/* ---------- Home hero (flat navy, no gradient) ---------- */

.hero {
  position: relative;
  padding: clamp(56px, 9vw, 120px) 0 clamp(40px, 6vw, 72px);
}
.hero h1 {
  font-size: var(--t-display-1);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 13ch;
  margin-top: var(--sp-5);
}
.hero-lede {
  font-size: var(--t-lede);
  max-width: 56ch;
  margin-top: var(--sp-6);
  color: var(--fg-body);
}
.hero-cta, .cta { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-8); }

/* ---------- The stage track: one spark, a long line ---------- */

.track-wrap { margin-top: clamp(48px, 7vw, 88px); }
.track-caption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-6);
  color: var(--fg-muted);
  margin-bottom: var(--sp-8);
}
.track {
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-6);
}
.track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 6px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0, var(--accent) calc(50% + 16px), var(--line-strong) calc(50% + 16px));
  transform-origin: left center;
  animation: spark-line 1600ms var(--ease-out) 200ms both;
}
.track li { position: relative; padding-top: var(--sp-8); }
.track li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
}
.track li:first-child::before {
  background: var(--accent);
  box-shadow: var(--shadow-glow-signal);
}
.track li.is-here::before { background: var(--accent); }
.track li.is-ahead::before { border-color: var(--line-strong); }
.track-n {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.track h2 { font-size: var(--t-h5); line-height: 1.25; letter-spacing: -0.01em; margin-top: var(--sp-2); }
.track p { font-size: var(--t-small); margin-top: var(--sp-2); max-width: 26ch; }
.track-here {
  display: inline-block;
  margin-top: var(--sp-3);
  color: var(--accent-text);
}

@keyframes spark-line {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

@media (max-width: 760px) {
  .track { grid-template-columns: 1fr; gap: 0; }
  .track::before {
    left: 6px;
    right: auto;
    top: 0;
    bottom: 0;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, var(--accent) 0, var(--accent) 62%, var(--line-strong) 62%);
    transform-origin: center top;
    animation-name: spark-line-y;
  }
  .track li { padding: 0 0 var(--sp-8) var(--sp-10); }
  .track li:last-child { padding-bottom: 0; }
  .track p { max-width: none; }
  @keyframes spark-line-y {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
  }
}

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section:not(.band) { border-top: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: clamp(32px, 4vw, 48px); }
.section-head h2 { margin-top: var(--sp-4); }
.section-head p { margin-top: var(--sp-4); font-size: var(--t-lede); }
.section-foot { margin-top: var(--sp-8); font-size: var(--t-small); color: var(--fg-muted); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Gate card: go / stop numbers, written down in advance */
.gate {
  background: var(--bg-sunken);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  font-size: var(--t-small);
}
.gate-title {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-4);
  color: var(--fg-muted);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.gate-block { padding: var(--sp-5) 0; border-bottom: 1px solid var(--line); }
.gate-block:last-child { border-bottom: 0; padding-bottom: 0; }
.gate-label { font-weight: 700; }
.gate-label.go { color: var(--go); }
.gate-label.stop { color: var(--stop); }
.gate-label.mid { color: var(--fg-muted); }
.gate ul { list-style: none; margin-top: var(--sp-3); display: grid; gap: var(--sp-2); }
.gate li { display: grid; grid-template-columns: 56px 1fr; gap: var(--sp-3); align-items: baseline; }
.gate li b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.gate p { margin-top: var(--sp-3); }

/* Rules: the studio's standing decisions */
.rules {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
}
.rules li {
  padding: var(--sp-6) var(--sp-6) var(--sp-6) 0;
  border-bottom: 1px solid var(--line);
}
.rules h3 { font-size: var(--t-h5); }
.rules p { font-size: var(--t-small); margin-top: var(--sp-2); max-width: 34ch; }
@media (max-width: 860px) { .rules { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .rules { grid-template-columns: 1fr; } .rules li { padding-right: 0; } }

/* Plain facts list (label + value rows) */
.facts { border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  grid-template-columns: minmax(120px, 200px) 1fr;
  gap: var(--sp-2) var(--sp-6);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
}
.facts dt {
  color: var(--fg-muted);
  padding-top: var(--sp-1);
}
.facts dd { margin: 0; color: var(--fg); }
dl.facts { margin: 0; }
@media (max-width: 560px) { .facts > div { grid-template-columns: 1fr; gap: var(--sp-1); } }

/* Stage detail rows on How we work */
.stages { list-style: none; border-top: 1px solid var(--line); }
.stages > li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4) var(--sp-10);
  padding: var(--sp-8) 0;
  border-bottom: 1px solid var(--line);
}
.stages .track-n { margin-bottom: var(--sp-1); }
.stages h3 { font-size: var(--t-h3); }
.stages .q { color: var(--fg); font-size: var(--t-lede); }
.stages p + p { margin-top: var(--sp-2); }
.stages .gate-line {
  font-size: var(--t-small);
  color: var(--fg-muted);
}
.stages .gate-line b { color: var(--accent-text); font-family: var(--font-mono); font-weight: 500; }
@media (max-width: 860px) { .stages > li { grid-template-columns: 1fr; gap: var(--sp-3); } }

.outcomes {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}
.outcomes li {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--sp-5);
  background: var(--bg-raised);
}
.outcomes b {
  display: block;
  color: var(--fg);
  margin-bottom: var(--sp-2);
}
.outcomes li:first-child b { color: var(--go); }
.outcomes li:last-child b { color: var(--stop); }
.outcomes span { font-size: var(--t-small); }
@media (max-width: 860px) { .outcomes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .outcomes { grid-template-columns: 1fr; } }

/* ---------- Venture cards (home + ventures index) ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-4);
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-6);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--fg-body);
  transition: border-color var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.project-card:hover { border-color: var(--line-strong); color: var(--fg-body); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.project-card.is-focus { border-color: var(--accent); }
.project-card.is-stopped { background: transparent; border-style: dashed; box-shadow: none; }
.project-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.project-meta { font-size: var(--t-small); color: var(--fg-muted); }
.project-name { font-size: var(--t-h3); }
.project-desc { font-size: var(--t-small); flex: 1; }
.project-foot {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--accent-text);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
}

/* ---------- Subpage + venture pages (flat navy) ---------- */

.subpage-hero,
.venture-hero {
  padding: clamp(48px, 7vw, 96px) var(--gutter) clamp(32px, 5vw, 56px);
}
.venture-hero-inner { max-width: var(--max); margin-inline: auto; }
.subpage-hero { padding-inline: 0; }
.subpage-hero h1 { margin-top: var(--sp-4); max-width: 20ch; }
.subpage-hero p { margin-top: var(--sp-5); font-size: var(--t-lede); max-width: 60ch; }

.venture-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: end;
}
.venture-hero h1 { margin-top: var(--sp-4); font-size: var(--t-display-2); letter-spacing: -0.03em; }
.venture-hero .lede { margin-top: var(--sp-5); font-size: var(--t-lede); max-width: 54ch; }
.venture-hero .meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-6); }
.venture-hero-side {
  border-top: 1px solid var(--line-strong);
}
.venture-stat {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.venture-stat .label {
  color: var(--fg-muted);
  padding-top: var(--sp-1);
}
.venture-stat .value { color: var(--fg); font-weight: 500; }
@media (max-width: 860px) { .venture-hero-inner { grid-template-columns: 1fr; align-items: start; } }

.venture-section {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding: clamp(40px, 6vw, 72px) var(--gutter);
  border-top: 1px solid var(--line);
}
.venture-section .head { max-width: 68ch; margin-bottom: var(--sp-8); }
.venture-section .head h2 { margin-top: var(--sp-4); }
.venture-section .head p { margin-top: var(--sp-4); }

.venture-grid-2,
.venture-grid-3 { display: grid; gap: var(--sp-4); }
.venture-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.venture-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .venture-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .venture-grid-2, .venture-grid-3 { grid-template-columns: 1fr; } }

.venture-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-width: 0;
}
.venture-card h4,
.venture-card h3.h4-look { font-size: var(--t-h5); }
.venture-card p { font-size: var(--t-small); overflow-wrap: anywhere; }
.venture-card .num {
  font-family: var(--font-mono);
  font-size: var(--t-h4);
  color: var(--accent-text);
}

.table-label {
  color: var(--fg-muted);
  margin: var(--sp-8) 0 var(--sp-3);
}
.venture-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-small);
}
.venture-table th,
.venture-table td {
  text-align: left;
  vertical-align: top;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.venture-table thead th {
  color: var(--fg-muted);
  border-bottom-color: var(--line-strong);
}
.venture-table tbody th { color: var(--fg); font-weight: 600; }
.venture-table .num-col { font-family: var(--font-mono); white-space: nowrap; color: var(--fg); }
@media (max-width: 560px) {
  .venture-table th, .venture-table td { padding-right: var(--sp-3); }
}

.callout {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin-top: var(--sp-6);
  padding: var(--sp-5);
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  border-radius: var(--radius-md);
}
.callout .icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--sp-8);
  height: var(--sp-8);
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
}

/* Changelog (venture pages) */
.changelog {
  margin-top: var(--sp-8);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-sunken);
}
.changelog summary {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  font-weight: 600;
  color: var(--fg);
  list-style: none;
}
.changelog summary::-webkit-details-marker { display: none; }
.changelog summary::before { content: "+"; font-family: var(--font-mono); color: var(--accent-text); margin-right: var(--sp-1); }
.changelog[open] summary::before { content: "\2212"; }
.changelog-count {
  margin-left: auto;
  color: var(--fg-muted);
}
.changelog-list { list-style: none; border-top: 1px solid var(--line); }
.changelog-list > li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-small);
}
.changelog-list > li:last-child { border-bottom: 0; }
.changelog-list time {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--accent-text);
  padding-top: 2px;
}
.changelog-list ul { padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
@media (max-width: 560px) { .changelog-list > li { grid-template-columns: 1fr; gap: var(--sp-1); } }

/* ---------- Build log (journal): cards read as a dated list ---------- */

.page-journal .venture-grid-2 { display: block; border-top: 1px solid var(--line); }
.page-journal .venture-card {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: var(--sp-5) 0;
  max-width: 78ch;
}
.page-journal .venture-card h4 { font-size: var(--t-h5); letter-spacing: 0; }

/* Entry header: venture chip and date */
.entry-meta {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-1);
}
.entry-date {
  font-family: var(--font-mono);
  font-size: var(--t-small);
  color: var(--fg-muted);
}

/* ---------- Footer ---------- */

.footer {
  margin-top: clamp(48px, 7vw, 96px);
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  padding: clamp(40px, 6vw, 64px) 0 var(--sp-6);
  font-size: var(--t-small);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--sp-8);
}
.footer-brand p { margin-top: var(--sp-3); max-width: 34ch; color: var(--fg-muted); }
.brand-lockup { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand-lockup img { width: var(--sp-10); height: var(--sp-10); }
.footer-col .footer-heading {
  line-height: 1.3;
  color: var(--fg-muted);
  margin-bottom: var(--sp-3);
}
.footer-col ul { list-style: none; display: grid; gap: var(--sp-2); }
.footer-col a { color: var(--fg-body); text-decoration: none; }
.footer-col a:hover { color: var(--link-hover); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-6);
  margin-top: var(--sp-10);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: var(--t-small);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */

.notfound { min-height: 56vh; display: grid; align-content: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.footer-bottom a { margin-left: var(--sp-3); }

/* Wide tables stack into labelled rows on small screens */
@media (max-width: 640px) {
  .venture-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .venture-table.stack tr { display: block; padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
  .venture-table.stack th,
  .venture-table.stack td { display: block; padding: 0; border: 0; }
  .venture-table.stack tbody th { font-size: var(--t-h5); }
  .venture-table.stack td { margin-top: var(--sp-3); }
  .venture-table.stack td::before {
    content: attr(data-label);
    display: block;
    color: var(--fg-muted);
    margin-bottom: 2px;
  }
}

/* Spacing helpers that replace one-off inline styles */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--sp-1); }
.mt-4 { margin-top: var(--sp-4); }
.lede-text { font-size: var(--t-lede); }
.note { color: var(--fg-muted); font-size: var(--t-small); }
.self-start { align-self: flex-start; }
.mb-1 { margin-bottom: var(--sp-1); }
