/* Shared shell for the server-rendered pages (case records and writing).
 *
 * These pages are produced by the Edge middleware, so they cannot use the
 * bundled portfolio stylesheet. This file mirrors it: white ground by default,
 * serif page titles, grotesque body, mono labels, and one header on every
 * route. Keep it in step with site/src/styles/. */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --paper: #FFFFFF;
  --line: #D7D4CD;
  --line-soft: #EAE7E0;
  --fg: #15140F;
  --fg-mute: #55524B;
  --fg-dim: #8B877E;
  --signal: #2C3E9E;
  --signal-soft: #E7EAF7;
  --evidence: #A2532E;
  --evidence-soft: #F6EAE3;
  --topbar-bg: rgba(255, 255, 255, 0.94);
  --font-display: "League Gothic Variable", Impact, "Arial Narrow", sans-serif;
  --font-body: "Archivo Variable", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Archivo Variable", "SFMono-Regular", Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D0D0F;
  --paper: #131316;
  --line: #2C2C31;
  --line-soft: #202024;
  --fg: #F2F0EC;
  --fg-mute: #A5A29B;
  --fg-dim: #6E6B65;
  --signal: #8E9CF0;
  --signal-soft: rgba(142, 156, 240, 0.16);
  --evidence: #D6906A;
  --evidence-soft: rgba(214, 144, 106, 0.16);
  --topbar-bg: rgba(13, 13, 15, 0.92);
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; background: var(--bg); }
body {
  min-height: 100vh; margin: 0; overflow-x: hidden;
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { max-width: 100%; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ------------------------------------------------------------- Header ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--topbar-bg); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px;
  max-width: 1200px; margin: 0 auto; padding: 13px 48px;
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand .name { font-family: var(--font-display); font-weight: 500; font-size: 18px; letter-spacing: -0.01em; }
.brand .role { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.nav { display: flex; gap: 26px; justify-self: center; }
.nav a {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-mute); padding: 6px 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--fg); }
.nav a.active { color: var(--fg); border-bottom-color: var(--signal); }
.topbar-actions { display: flex; align-items: center; justify-self: end; gap: 8px; }
.theme-toggle, .nav-toggle {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 7px 11px; border: 1px solid var(--line); color: var(--fg-mute);
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--fg); border-color: var(--fg-mute); }
.nav-toggle { display: none; }

/* --------------------------------------------------------------- Page ---- */
.shell { max-width: 1200px; margin: 0 auto; padding: 56px 48px 40px; }
.page-num { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--signal); }
.page-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-mute); }
.page-head { padding-bottom: 26px; border-bottom: 1px solid var(--fg); margin-bottom: 40px; }
.page-head h1 {
  margin: 14px 0 16px; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 3.4vw, 48px); line-height: 1.08; letter-spacing: -0.018em;
  max-width: 22ch; text-wrap: balance;
}
.lede { max-width: 58ch; margin: 0; font-size: clamp(16.5px, 1.2vw, 19px); line-height: 1.52; color: var(--fg-mute); }
.link-inline { color: var(--signal); border-bottom: 1px solid var(--signal); padding-bottom: 1px; }

.section { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 44px; padding: 36px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section--wide { grid-template-columns: minmax(0, 1fr); gap: 18px; }
.section--wide .section-rail { flex-direction: row; gap: 14px; align-items: baseline; }
.section-rail { display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
.section-rail .n { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--signal); }
.section-rail .t { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg); }
.section-body { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.section-body h2 { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(20px, 1.8vw, 27px); line-height: 1.18; }
.section-body p { margin: 0; font-size: 16.5px; line-height: 1.62; color: var(--fg); max-width: 64ch; }

.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; }
.fact { display: flex; flex-direction: column; gap: 4px; }
.fact-label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.fact strong { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--fg); }

.role-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.role-list li { padding: 13px 0 13px 22px; border-bottom: 1px solid var(--line-soft); font-size: 16px; line-height: 1.5; position: relative; }
.role-list li::before { content: "—"; position: absolute; left: 0; color: var(--fg-dim); font-family: var(--font-mono); font-size: 12px; }

.locked { padding: 22px; border: 1px solid var(--line); background: var(--signal-soft); }
.locked p { margin: 0 0 12px; font-size: 16px; line-height: 1.55; color: var(--fg); }
.locked p:last-child { margin-bottom: 0; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.action {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 11px 18px; border: 1px solid var(--line); color: var(--fg);
}
.action:hover { border-color: var(--fg); }
.action--primary { background: var(--signal); border-color: var(--signal); color: #fff; }

.site-footer { margin-top: 72px; border-top: 1px solid var(--line); }
.footer-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 28px 48px 44px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a:hover { color: var(--fg); }

/* ------------------------------------------------------------- Figures --- */
.figure { margin: 0; display: flex; flex-direction: column; }
.figure-head { display: flex; flex-direction: column; gap: 7px; padding-bottom: 14px; }
.figure-num { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg-dim); }
.figure-title {
  margin: 0; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(19px, 1.7vw, 25px); line-height: 1.16; letter-spacing: -0.012em;
  color: var(--fg); max-width: 34ch; text-wrap: balance;
}
.figure-take { margin: 0; font-family: var(--font-display); font-size: 16px; line-height: 1.45; color: var(--fg-mute); max-width: 62ch; }
.figure-frame { border: 1px solid var(--line); padding: 22px; background: var(--bg); }
.figure-frame svg { width: 100%; height: auto; }
.figure-frame img { display: block; width: 100%; height: auto; }
.figure-frame .figure-wide { display: block; }
.figure-frame .figure-tall { display: none; }
.figure-text { margin: 0; padding-top: 12px; font-size: 14.5px; line-height: 1.55; color: var(--fg-mute); max-width: 68ch; }
.figure-text b {
  display: block; margin-bottom: 4px; font-weight: 400;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--evidence);
}

.f-num { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; fill: var(--fg-dim); }
.f-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; fill: var(--fg); }
.f-note { font-family: var(--font-body); font-size: 12.5px; fill: var(--fg-mute); }
.f-decide-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; fill: var(--signal); }
.f-evidence-text { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.09em; fill: var(--evidence); }
.f-struct { stroke: var(--line); stroke-width: 1; fill: none; }
.f-emph { stroke: var(--fg); stroke-width: 1.6; fill: none; }
.f-decide { stroke: var(--signal); stroke-width: 1.8; fill: none; }
.f-evidence { stroke: var(--evidence); stroke-width: 1.8; fill: none; }
.f-evidence-dash { stroke: var(--evidence); stroke-width: 1.4; fill: none; stroke-dasharray: 4 4; }
.f-plate { fill: none; stroke: var(--line); stroke-width: 1; }
.f-plate-decide { fill: var(--signal-soft); stroke: var(--signal); stroke-width: 1.4; }
.f-plate-evidence { fill: var(--evidence-soft); stroke: var(--evidence); stroke-width: 1.4; }
.f-dot { fill: var(--fg); }
.f-dot-decide { fill: var(--signal); }
.figure-tall .f-note { font-size: 13px; }
.figure-tall .f-label, .figure-tall .f-decide-text, .figure-tall .f-evidence-text { font-size: 11.5px; }

/* ------------------------------------------------------------- Writing --- */
.writing-list { border-top: 1px solid var(--fg); }
.writing-entry {
  display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 28px; align-items: baseline;
  padding: 20px 0; border-bottom: 1px solid var(--line-soft);
}
.writing-entry:hover { background: var(--signal-soft); }
.writing-entry > span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.writing-entry .body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.writing-entry strong { font-family: var(--font-display); font-weight: 500; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.2; letter-spacing: -0.01em; }
.writing-entry p { margin: 0; max-width: 60ch; font-size: 15px; line-height: 1.5; color: var(--fg-mute); }
.writing-entry .go { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal); white-space: nowrap; }

.field-section { padding-top: 34px; border-top: 1px solid var(--line); margin-top: 34px; }
.field-section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.field-section-head h3 { margin: 0; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 500; }
.field-section-head p { margin: 0; max-width: 64ch; font-size: 15.5px; line-height: 1.55; color: var(--fg-mute); }
.field-app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; align-items: start; padding: 28px 0; border-top: 1px solid var(--line-soft); }
.field-app__meta { margin: 0 0 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.field-app__copy h4 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 500; font-size: clamp(19px, 1.6vw, 24px); line-height: 1.16; }
.field-app__brief { display: grid; gap: 12px; margin: 0; }
.field-app__brief dt { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 3px; }
.field-app__brief dd { margin: 0; font-size: 15px; line-height: 1.5; color: var(--fg-mute); }
/* A project figure sits in the same shell as every other figure, at the smaller
 * scale its half-width column allows. */
.figure--app .figure-title { font-size: clamp(17px, 1.4vw, 21px); }
.figure--app .figure-take { font-size: 15px; }
.figure--app .figure-frame { padding: 16px; }
.figure--app .figure-text { font-size: 14px; }
.field-support { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; margin-top: 32px; padding-top: 22px; border-top: 1px solid var(--line); }
.field-support > span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.field-support a { font-family: var(--font-display); font-size: 22px; font-weight: 500; }
.field-support p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--fg-mute); }

.post { max-width: 760px; margin: 0 auto; padding: 56px 48px 40px; }
.post__kicker, .post__meta { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.post__draft {
  display: inline-block; margin-bottom: 18px; padding: 5px 10px; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--fg-dim);
}
.post h1 {
  margin: 14px 0 16px; font-family: var(--font-display); font-weight: 500;
  font-size: clamp(30px, 3.4vw, 44px); line-height: 1.09; letter-spacing: -0.018em; text-wrap: balance;
}
.post__lede { margin: 0 0 24px; max-width: 58ch; font-size: 18px; line-height: 1.52; color: var(--fg-mute); }
.post__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.post__tags span { padding: 5px 9px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-mute); }
.post__body { display: grid; gap: 20px; padding-top: 28px; border-top: 1px solid var(--fg); }
.post__body p { margin: 0; font-size: 17px; line-height: 1.66; color: var(--fg); }
.post__body h2 { margin: 14px 0 0; font-family: var(--font-display); font-weight: 500; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.14; }
.post__figure { width: 100%; margin: 12px 0; }
.post__figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); background: var(--bg); }
.post__figure figcaption { margin-top: 10px; font-size: 14.5px; line-height: 1.5; color: var(--fg-mute); }
.post__process { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; width: 100%; margin: 8px 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.post__process li { padding: 18px 18px 18px 0; border-bottom: 1px solid var(--line-soft); }
.post__process span { display: block; margin-bottom: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--fg-dim); }
.post__process strong { display: block; margin-bottom: 8px; font-family: var(--font-display); font-size: 19px; font-weight: 500; }
.post__process p { margin: 0; font-size: 15px; line-height: 1.52; color: var(--fg-mute); }
.post blockquote {
  margin: 16px 0; padding: 20px 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line);
  font-family: var(--font-display); font-size: clamp(19px, 2vw, 26px); font-weight: 500; line-height: 1.24;
}
.post blockquote span { display: block; }
.post__end { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); text-align: center; }

/* ---------------------------------------------------------- Responsive --- */
@media (max-width: 900px) {
  .topbar-inner { padding: 11px 20px; grid-template-columns: 1fr auto; gap: 12px; }
  .brand .role { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none; grid-column: 1 / -1; flex-direction: column; gap: 0;
    justify-self: stretch; margin: 8px -20px -11px; padding: 0 20px; border-top: 1px solid var(--line);
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; font-size: 13px; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 860px) {
  .section { grid-template-columns: 1fr; gap: 14px; padding: 28px 0; }
  .section-rail { flex-direction: row; gap: 12px; align-items: baseline; }
  .field-app { grid-template-columns: 1fr; gap: 20px; }
  .field-support { grid-template-columns: 1fr; gap: 10px; }
  .writing-entry { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .writing-entry > span:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .shell { padding: 32px 20px 32px; }
  .post { padding: 32px 20px 32px; }
  .footer-row { padding: 24px 20px 36px; }
  .figure-frame .figure-wide { display: none; }
  .figure-frame .figure-tall { display: block; }
  .figure-frame { padding: 16px 14px; }
  .post__process { grid-template-columns: 1fr; }
}

@media (max-width: 400px) {
  .shell { padding: 28px 16px 28px; }
  .post { padding: 28px 16px 28px; }
  .topbar-inner { padding: 11px 16px; }
  .nav { margin: 8px -16px -11px; padding: 0 16px; }
  .footer-row { padding: 22px 16px 32px; }
}

/* A directory entry whose canonical figure lives on another page points at it
 * rather than maintaining a second explanation of the same system. */
.field-app__pointer { margin: 0; align-self: start; }
.field-app__pointer a {
  display: inline-block; padding: 14px 18px; border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--signal);
}
.field-app__pointer a:hover { border-color: var(--signal); }

/* ------------------------------------------------------------------------
   Spark tear-sheet visual contract. Loaded last for every Edge-rendered
   case, writing index, and fieldnote page.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: "Archivo Variable";
  src: url("/fonts/archivo-latin.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "League Gothic Variable";
  src: url("/fonts/league-gothic-latin.woff2") format("woff2-variations");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --paper: oklch(0.988 0.004 90);
  --paper-raised: oklch(0.997 0.002 90);
  --paper-sunk: oklch(0.962 0.005 90);
  --ink: #131a10;
  --ink-muted: oklch(0.47 0.016 255);
  --rule: oklch(0.82 0.012 255);
  --rule-soft: oklch(0.9 0.008 255);
  --blue: #2e5bd0;
  --red: #d8443c;
  --yellow: #f0b429;
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-mute: var(--ink-muted);
  --fg-dim: oklch(0.58 0.012 255);
  --line: var(--rule);
  --line-soft: var(--rule-soft);
  --signal: var(--blue);
  --signal-soft: oklch(0.93 0.035 265);
  --evidence: var(--red);
  --evidence-soft: oklch(0.94 0.035 28);
  --topbar-bg: var(--paper);
  --font-display: "League Gothic Variable", Impact, "Arial Narrow", sans-serif;
  --font-body: "Archivo Variable", Archivo, ui-sans-serif, system-ui, sans-serif;
  --font-mono: var(--font-body);
  --page-x: clamp(18px, 5vw, 104px);
  --gutter: clamp(16px, 2.2vw, 32px);
}

[data-theme="dark"] {
  --paper: oklch(0.17 0.01 255);
  --paper-raised: oklch(0.21 0.01 255);
  --paper-sunk: oklch(0.14 0.01 255);
  --ink: oklch(0.94 0.008 90);
  --ink-muted: oklch(0.7 0.014 255);
  --rule: oklch(0.36 0.014 255);
  --rule-soft: oklch(0.28 0.01 255);
  --blue: oklch(0.7 0.14 265);
  --red: oklch(0.7 0.14 28);
  --yellow: oklch(0.8 0.14 83);
  --bg: var(--paper);
  --fg: var(--ink);
  --fg-mute: var(--ink-muted);
  --fg-dim: oklch(0.58 0.012 255);
  --line: var(--rule);
  --line-soft: var(--rule-soft);
  --signal: var(--blue);
  --signal-soft: oklch(0.28 0.055 265);
  --evidence: var(--red);
  --evidence-soft: oklch(0.28 0.045 28);
  --topbar-bg: var(--paper);
}

html { background: var(--paper); scroll-padding-block-start: 88px; }
body { background: var(--paper); color: var(--ink); font-weight: 430; line-height: 1.55; }

.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  backdrop-filter: none;
}
.topbar::before { content: ""; display: block; height: 5px; background: var(--ink); }
.topbar-inner {
  max-width: none;
  min-height: 56px;
  padding: 0 var(--page-x);
  gap: clamp(16px, 2.4vw, 40px);
}
.brand { align-items: center; min-width: max-content; padding-block: 8px; }
.brand .name {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1;
  text-transform: uppercase;
}
.brand .role {
  align-self: stretch;
  display: flex;
  align-items: center;
  border-left: 1px solid var(--rule);
  padding-left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
}
.nav { justify-self: end; gap: 0; align-items: stretch; }
.nav a {
  --nav-accent: var(--blue);
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 50px;
  padding-inline: clamp(8px, 1vw, 14px);
  border-bottom: 2px solid transparent;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
}
.nav a::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--nav-accent);
}
.nav a:nth-child(1) { --nav-accent: var(--yellow); }
.nav a:nth-child(2) { --nav-accent: var(--ink); }
.nav a:nth-child(3) { --nav-accent: var(--blue); }
.nav a:nth-child(4) { --nav-accent: var(--red); }
.nav a:nth-child(5) { --nav-accent: var(--yellow); }
.nav a:nth-child(6) { --nav-accent: var(--blue); }
.nav a:hover,
.nav a.active { color: var(--ink); border-bottom-color: var(--nav-accent); }
.nav-toggle { display: none !important; }
.theme-toggle {
  min-width: 56px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--ink);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}
.theme-toggle:hover { border-color: var(--blue); background: var(--blue); color: var(--paper); }

.shell,
.post {
  max-width: none;
  margin: 0;
  padding: clamp(56px, 8vw, 118px) var(--page-x) clamp(48px, 7vw, 96px);
}
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(220px, 4fr);
  column-gap: var(--gutter);
  margin-bottom: 48px;
  padding-bottom: clamp(32px, 5vw, 68px);
  border-bottom: 2px solid var(--ink);
}
.page-head h1,
.post h1 {
  max-width: 12ch;
  margin: 14px 0 18px;
  font-family: var(--font-display);
  font-size: clamp(64px, 9vw, 144px);
  font-weight: 400;
  letter-spacing: .012em;
  line-height: .84;
  text-transform: uppercase;
}
.post h1 { max-width: 13ch; font-size: clamp(56px, 8vw, 118px); }
.page-num,
.post__kicker { color: var(--signal); font-weight: 750; }
.lede,
.post__lede { color: var(--ink-muted); font-size: clamp(18px, 1.4vw, 22px); }

.section {
  grid-template-columns: minmax(120px, 2fr) minmax(0, 10fr);
  gap: var(--gutter);
  padding: clamp(34px, 4vw, 58px) 0;
  border-top: 1px solid var(--rule);
}
.section-rail { border-top: 2px solid var(--ink); padding-top: 12px; }
.section-body h2,
.field-section-head h3,
.field-app__copy h4,
.writing-entry strong,
.post__body h2,
.post__process strong {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .92;
  text-transform: uppercase;
}
.figure-head {
  display: grid;
  grid-template-columns: minmax(120px, 2fr) minmax(0, 5fr) minmax(0, 5fr);
  gap: var(--gutter);
  padding: 14px 0 18px;
  border-top: 2px solid var(--ink);
}
.figure-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 3vw, 48px);
  font-weight: 400;
  letter-spacing: .01em;
  line-height: .92;
  text-transform: uppercase;
}
.figure-take { align-self: end; font-family: var(--font-body); font-size: 15px; }
.figure-frame {
  border: 1px solid var(--ink);
  background-color: var(--paper-raised);
  background-image:
    linear-gradient(var(--rule-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule-soft) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: clamp(16px, 2.4vw, 34px);
}
.figure-text { max-width: none; border-bottom: 1px solid var(--rule); }
.figure-text b { color: var(--red); font-family: var(--font-body); font-weight: 750; }

.writing-list { border-top: 2px solid var(--ink); }
.writing-entry {
  grid-template-columns: minmax(120px, 2fr) minmax(0, 8fr) minmax(80px, 2fr);
  gap: var(--gutter);
  padding-block: 22px;
  border-bottom-color: var(--rule);
}
.writing-entry:hover { background: var(--paper-sunk); }
.field-app { border: 1px solid var(--ink); padding: clamp(18px, 2.5vw, 32px); }
.post__body { border-top: 2px solid var(--ink); }
.post__tags span,
.post__draft,
.action,
.field-app__pointer a { border-radius: 0; border-color: var(--ink); }

.site-footer {
  margin-top: 72px;
  border-top: 5px solid var(--ink);
  background: var(--paper-sunk);
}
.footer-row { max-width: none; padding: 24px var(--page-x) 36px; font-weight: 650; }

@media (max-width: 1023px) {
  html { scroll-padding-block-start: 112px; }
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand actions" "nav nav";
    gap: 0 12px;
    padding: 0 var(--page-x);
  }
  .brand { grid-area: brand; }
  .topbar-actions { grid-area: actions; }
  .nav {
    grid-area: nav;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: auto;
    margin: 0 calc(var(--page-x) * -1);
    padding: 0;
    border-top: 1px solid var(--rule);
  }
  .nav a {
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    padding-inline: 2px;
    border-right: 1px solid var(--rule);
    font-size: 9px;
    letter-spacing: .04em;
  }
  .nav a:last-child { border-right: 0; }
  .page-head { grid-template-columns: 1fr; gap: 24px; }
  .figure-head { grid-template-columns: 80px minmax(0, 1fr); }
  .figure-take { grid-column: 2; }
}

@media (max-width: 560px) {
  :root { --page-x: 16px; }
  html { scroll-padding-block-start: 102px; }
  .brand .name { font-size: 27px; }
  .brand .role { display: none; }
  .theme-toggle { min-width: 50px; min-height: 38px; }
  .nav a { font-size: 8px; gap: 4px; }
  .shell,
  .post { padding: 42px var(--page-x) 56px; }
  .page-head h1,
  .post h1 { font-size: clamp(58px, 20vw, 88px); }
  .section { grid-template-columns: 1fr; gap: 12px; }
  .figure-head { grid-template-columns: 1fr; gap: 8px; }
  .figure-take { grid-column: 1; }
  .figure-frame { margin-inline: calc(var(--page-x) * -1); border-inline: 0; padding: 16px; }
  .writing-entry { grid-template-columns: 1fr; gap: 7px; }
  .field-app { grid-template-columns: 1fr; }
}
