/* Final layer (Nov 2026): one colour set, one type scale, two typefaces, every page.
   Loaded last; overrides site.css, exec.css and vibe.css. */

:root {
  --bg: #ffffff; --surface: #f6f1ea; --line: #e6ddd2; --text: #2b0e09; --muted: #5c4a45;
  --brand: #7E0F02; --accent: #F3D08A; --link: #7E0F02; --band: #2b0e09; --code-bg: #1a0b08;
  --ink: var(--bg); --ink-2: #ffffff; --ink-3: var(--surface); --faint: var(--muted); --signal: var(--link);
  --blue: var(--brand); --sun: var(--accent); --deep: var(--band); --blue-soft: var(--surface); --blue-line: var(--line);
  --amber: var(--brand); --teal: var(--brand); --violet: var(--brand); --rose: var(--brand);
  --display: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: var(--display);
  --fs-display: clamp(2.6rem, 5vw, 4.5rem); --fs-h2: clamp(1.875rem, 3vw, 2.5rem); --fs-h3: 1.375rem;
  --fs-lead: 1.1875rem; --fs-body: 1.0625rem; --fs-small: .875rem;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1a0b08; --surface: #26120d; --line: #3d211a; --text: #fbf1ee; --muted: #d2bdb6;
    --link: #E9A58F; --band: #2f120c; --ink-2: #26120d; }
}

html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 400 var(--fs-body)/1.65 var(--sans); }
a { color: var(--link); }

/* Type scale */
h1, h2, h3, .mark { font-family: var(--display); color: var(--text); }
h1 { font-size: var(--fs-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; }
h2 { font-size: var(--fs-h2); font-weight: 660; line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
h3, .note-title, .x-chapters h3, .x-moment h3 { font-size: var(--fs-h3); font-weight: 620; line-height: 1.25; letter-spacing: -0.01em; font-family: var(--display); font-style: normal; }
.x-lede, .lede, .x-standfirst { font: 400 var(--fs-lead)/1.6 var(--sans); color: var(--muted); }
.prose p, .prose li, .x-moment p, .note-hook, .note-desc, .x-chapters p, .sheet dd, .rules dd, .x-outcomes dd, .x-facts dd {
  font-family: var(--sans); font-size: var(--fs-body); line-height: 1.65; }
.x-kicker, .x-yr, .post-meta, .note-meta, .note-topic, .x-topic, .x-byline, .foot-line, .foot-links a, .foot-links span, .x-more-item span {
  font-family: var(--sans); font-size: var(--fs-small); line-height: 1.4; letter-spacing: .01em; }
.x-kicker { font-weight: 600; color: var(--brand); }

/* Hero */
.x-hero { background: var(--brand); }
.x-hero h1 { color: #fff; max-width: 16ch; }
.x-hero .x-lede { color: #f5e3dd; max-width: 56ch; }
.x-facts dt { color: var(--accent); font: 700 clamp(2.25rem, 4vw, 3rem)/1 var(--display); letter-spacing: -0.03em; }
.x-facts dd { color: #f5e3dd; font-size: .9375rem; }

/* Leadership */
.x-outcomes dt { color: var(--brand); font: 620 1.75rem/1.1 var(--display); letter-spacing: -0.02em; }
@media (prefers-color-scheme: dark) { .x-outcomes dt { color: var(--accent); } }

/* Bands */
.x-story { background: var(--surface); }
.x-moment::before { background: var(--accent); }
.x-moment p { color: var(--muted); }
.x-principles { background: var(--band); border-top: 1px solid #4d281f; }
.x-principles .rules dd { color: #e6d3cc; }
.x-chapters li { border-top-color: var(--line); }
.x-chapters li.now { border-top-color: var(--brand); }
.x-chapters li.now .x-yr { color: var(--brand); }
@media (prefers-color-scheme: dark) { .x-chapters li.now { border-top-color: var(--accent); } .x-chapters li.now .x-yr { color: var(--accent); } }

/* Notes: one accent, no underlines inside cards */
.note a, .note a * { text-decoration: none !important; }
.note { --tc: var(--brand) !important; }
.note a::before { background: var(--brand); }
.note-topic { color: var(--brand) !important; font-weight: 600; }
.note-figure b { color: var(--brand); }
.next li { --tc: var(--brand) !important; }
.x-topic-name { color: var(--brand); }
@media (prefers-color-scheme: dark) {
  .note { --tc: var(--accent) !important; } .note-topic, .note-figure b, .x-topic-name { color: var(--accent) !important; }
  .note a::before { background: var(--accent); }
}
.note a { background: var(--ink-2); border-color: var(--line); }

/* Articles and pages: comfortable measure */
.x-article .prose, .x-body, .page-body { max-width: 68ch; }
.x-article { max-width: 760px; }
.prose p, .prose li { font-size: var(--fs-body); line-height: 1.7; }
.prose h2 { font-size: 1.625rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.25rem; }
.prose code { font-size: .86em; background: var(--surface); border-color: var(--line); color: var(--text); }

/* Code, terminal and the live instrument: warm dark, no navy */
.prose pre, .term, .fit, .term-body, .code { background: var(--code-bg) !important; border-color: #3d211a !important; color: #f1e4df; }
.prose pre code { background: none; color: #f1e4df; }
.term-bar, .fit .term-bar { border-bottom-color: #3d211a; color: #c9b3ab; }
.term-body .p { color: var(--accent); } .term-body .ok { color: #9fc7a0; }
.fit-row button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #2b0e09; }
.fit-row button { border-color: #4d281f; color: #d2bdb6; }
.fit-read .ok { color: #9fc7a0; }

/* Buttons */
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--band); border-color: var(--band); }
.x-hero .btn-primary { background: var(--accent); border-color: var(--accent); color: #2b0e09; }
@media (prefers-color-scheme: dark) { .btn-primary { background: var(--accent); border-color: var(--accent); color: #2b0e09; } }

/* Top bar and mobile menu */
.topbar nav a { white-space: nowrap; font-size: .9375rem; }
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .topbar-inner { flex-direction: row; align-items: center; height: 60px; padding: 0 20px; position: relative; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font: 600 15px var(--sans);
    color: var(--text); background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
  .topbar nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 20px 16px; overflow: visible; }
  .topbar.open nav { display: flex; }
  .topbar nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.0625rem; color: var(--text); }
  .topbar nav a:last-child { border-bottom: 0; }
  .topbar nav a[aria-current] { box-shadow: none; color: var(--brand); }
  h1 { font-size: clamp(2.25rem, 9vw, 2.8rem); }
  .x-outcomes dt { font-size: 1.5rem; }
  .x-hero { padding: 48px 0 56px; }
  section { padding: 64px 0; }
}

/* Writing as editorial rows (after OpenAI / Gumroad indexes on Mobbin) */
.notes { display: block !important; list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--text); }
.note { border-bottom: 1px solid var(--line); }
.note a { display: grid; grid-template-columns: 1fr auto; column-gap: 32px; row-gap: 6px; padding: 28px 0; background: none !important;
  border: 0 !important; border-radius: 0; box-shadow: none !important; transform: none !important; height: auto; }
.note a::before { display: none; }
.note a > * { grid-column: 1; }
.note a::after { content: "→"; grid-column: 2; grid-row: 1 / span 4; align-self: center; font: 400 1.5rem var(--display); color: var(--muted); transition: transform .2s, color .2s; }
.note a:hover::after { color: var(--brand); transform: translateX(4px); }
.note a:hover .note-title { color: var(--brand); }
.note-topic { margin: 0; }
.note-title { margin: 0 !important; font-size: 1.5rem; max-width: 34ch; }
.note-hook, .note-desc { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }
.note-foot { border-top: 0; padding-top: 6px; justify-content: flex-start; gap: 6px 22px; }
.x-notes .notes, .page-body .notes { grid-template-columns: none; }
@media (prefers-color-scheme: dark) { .note a:hover::after, .note a:hover .note-title { color: var(--accent); } }

/* Article headline: lighter, comfortable */
.x-article h1 { font-size: clamp(2.2rem, 4vw, 3.25rem); font-weight: 680; letter-spacing: -0.025em; line-height: 1.08; }
.page-body h1 { font-size: clamp(2.4rem, 4.5vw, 3.5rem); }

@media (max-width: 760px) {
  .note a { grid-template-columns: 1fr; padding: 22px 0; }
  .note a::after { display: none; }
  .note-title { font-size: 1.3rem; }
  .x-article h1 { font-size: 2rem; }
}

/* Palette (owner's choice, 23 Nov 2026): red #D52B1E with black and white */
:root { --brand: #D52B1E; --accent: #ffffff; --link: #D52B1E; --text: #111111; --muted: #555555; --line: #e5e5e5;
  --surface: #f5f5f5; --band: #111111; --code-bg: #111111; --bg: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d0d0d; --surface: #181818; --line: #2a2a2a; --text: #f5f5f5; --muted: #b3b3b3; --link: #ff6b5e; --band: #000000; --ink-2: #181818; --accent: #ffffff; }
  .x-outcomes dt, .note-topic, .note-figure b, .x-topic-name, .x-kicker, .x-chapters li.now .x-yr { color: #ff6b5e !important; }
  .x-chapters li.now { border-top-color: #ff6b5e; }
  .btn-primary { background: #ffffff; border-color: #ffffff; color: #111111; }
  .note a::before { background: #ff6b5e; }
}
.x-hero { background: var(--brand); }
.x-hero .x-lede, .x-facts dd { color: #ffffff; }
.x-facts { border-top-color: rgba(255,255,255,.4); }
.x-facts dt { color: #ffffff; }
.x-hero .btn-primary { background: #ffffff; border-color: #ffffff; color: #111111; }
.x-hero .btn-primary:hover { background: #111111; border-color: #111111; color: #ffffff; }
.x-hero .btn-ghost { color: #ffffff; border-color: rgba(255,255,255,.7); }
.x-portrait img { box-shadow: 0 0 0 6px rgba(255,255,255,.25), 0 40px 80px -40px rgba(0,0,0,.5); }
.x-moment::before { background: var(--brand); }
.x-principles { background: var(--band); border-top: 0; }
.x-principles .x-kicker { color: #ff6b5e !important; }
.x-principles .rules dd { color: #d0d0d0; }
.x-principles .rules div, .x-principles .rules { border-color: rgba(255,255,255,.18); }
.prose pre, .term, .fit, .term-body, .code { border-color: #2a2a2a !important; color: #eeeeee; }
.term-bar, .fit .term-bar { border-bottom-color: #2a2a2a; color: #b3b3b3; }
.term-body .p { color: #ff6b5e; }
.fit-row button[aria-pressed="true"] { background: #ffffff; border-color: #ffffff; color: #111111; }
.fit-row button { border-color: #3a3a3a; color: #cccccc; }

/* QA fixes */
@media (prefers-color-scheme: dark) { :root { --brand: #ff6b5e; } .x-hero { background: #D52B1E; } .x-hero .btn-primary { color: #111; } }
.term-bar i { background: #3a3a3a !important; }
.fit figcaption, .term figcaption { color: #a0a0a0; } .fit figcaption a, .term figcaption a { color: #ff8a7f; }
.seg.w, .sw.w { background: #D52B1E !important; } .seg.k, .sw.k { background: #111111 !important; } .seg.o, .sw.o { background: #9a9a9a !important; }
@media (prefers-color-scheme: dark) { .seg.k, .sw.k { background: #f5f5f5 !important; } }
pre, .prose pre, .code, .cmd-box { background: #111111 !important; color: #eeeeee; font-size: .875rem; overflow-x: auto; }
.prose :not(pre) > code { white-space: nowrap; }
.prose table { display: block; overflow-x: auto; max-width: 100%; }
.prose th { white-space: nowrap; }
.table-wrap { overflow-x: auto; }
ul.ports, .prose ul.ports { list-style: none; padding-left: 0; } .ports li::marker { content: ""; }
.port-val, a.port .port-val { text-decoration: none !important; }
@media (min-width: 961px) { .x-lead-intro { position: sticky; top: 96px; } }
.project h2 .tag { vertical-align: middle; margin-left: 8px; }
@media (max-width: 760px) {
  .topbar-inner { padding: 0 24px; }
  .topbar nav { padding: 8px 24px 16px; box-shadow: 0 12px 24px rgba(0,0,0,.12); }
  .note-figure { display: block; }
}
/* Pre-publish fixes */
.ports, .ports li { list-style: none !important; } .prose .ports li { padding-left: 0; } .prose .ports li::before { content: none !important; }
.x-portrait img { border-radius: 20px; box-shadow: 0 0 0 1px rgba(255,255,255,.35), 0 24px 48px -28px rgba(0,0,0,.45) !important; }
.x-chapters { grid-template-columns: repeat(5, 1fr); }
.x-chapters li.next { border-top: 3px dashed var(--brand); }
.x-chapters li.next .x-yr { color: var(--brand); }
@media (max-width: 1100px) { .x-chapters { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .x-chapters { grid-template-columns: 1fr; } }

/* Palette (23 Nov 2026, final): deep navy base, the owner's own red #7E0F02 as a precise accent,
   warm paper and slate. No company's brand colours. */
:root { --navy: #0F1B2D; --brand: #7E0F02; --link: #7E0F02; --accent: #7E0F02; --text: #0F1B2D; --muted: #475569;
  --bg: #ffffff; --surface: #f4f5f7; --line: #e3e6eb; --band: #0F1B2D; --code-bg: #0F1B2D; --ink-2: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1220; --surface: #111a2b; --line: #23304a; --text: #e6e9ef; --muted: #aab3c2; --link: #ff8a7f;
    --brand: #ff8a7f; --band: #070d18; --ink-2: #111a2b; }
  .x-outcomes dt, .note-topic, .note-figure b, .x-topic-name, .x-kicker, .x-chapters li.now .x-yr, .x-chapters li.next .x-yr { color: #ff8a7f !important; }
  .x-chapters li.now { border-top-color: #ff8a7f; } .x-chapters li.next { border-top-color: #ff8a7f; }
  .note a::before { background: #ff8a7f; }
  .btn-primary { background: #e6e9ef; border-color: #e6e9ef; color: #0b1220; }
}
.x-hero { background: var(--navy) !important; }
.x-hero h1 { color: #ffffff; }
.x-hero h1::after { content: ""; display: block; width: 72px; height: 4px; margin-top: 28px; background: #c0392b; border-radius: 2px; }
.x-hero .x-lede, .x-facts dd { color: #d9dee7; }
.x-facts dt { color: #f3c9c3 !important; }
.x-facts { border-top-color: rgba(255,255,255,.18); }
.x-hero .btn-primary { background: #ffffff; border-color: #ffffff; color: var(--navy); }
.x-hero .btn-primary:hover { background: #7E0F02; border-color: #7E0F02; color: #ffffff; }
.x-hero .btn-ghost { color: #ffffff; border-color: rgba(255,255,255,.45); }
.x-portrait img { box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 24px 48px -28px rgba(0,0,0,.6) !important; }
.x-kicker { color: var(--brand) !important; }
.x-outcomes dt { color: var(--brand); }
.x-moment::before { background: var(--brand); }
.x-principles { background: var(--band); }
.x-principles .x-kicker { color: #f3c9c3 !important; }
.x-principles .rules dd { color: #c9d0db; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: #7E0F02; border-color: #7E0F02; }
.topbar { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.prose pre, .term, .fit, .term-body, .code, pre { background: #0F1B2D !important; border-color: #23304a !important; }
.term-bar, .fit .term-bar { border-bottom-color: #23304a; }
.term-body .p { color: #f3c9c3; }
.fit figcaption a, .term figcaption a { color: #f3c9c3; }
.seg.k, .sw.k { background: var(--navy) !important; } .seg.w, .sw.w { background: #7E0F02 !important; }
@media (prefers-color-scheme: dark) { .seg.k, .sw.k { background: #e6e9ef !important; } .seg.w, .sw.w { background: #ff8a7f !important; } }
/* Hover: titles keep their colour; only the arrow moves */
.note a:hover .note-title, .x-more-item:hover, .posts a:hover { color: var(--text) !important; }
.note a:hover::after { color: var(--text) !important; }
.x-chapters { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .x-chapters { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .x-chapters { grid-template-columns: 1fr; } }
