/* Home page — "clinical record meets developer terminal".
   Adapted from the Claude Design handoff, baked to a single look:
   paper theme · editorial type · b&w photo · airy density · subtle healthcare nods. */

:root {
  /* Palette — paper */
  --bg: #f6f4ef;
  --bg-elev: #fbf9f4;
  --fg: #1a1a1a;
  --muted: #7a7468;
  --line: #d8d2c4;
  --line-soft: #e6e1d4;
  --accent: #c9462c;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);

  /* Type stacks */
  --display: "Instrument Serif", Georgia, serif;
  --sans: "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Density */
  --gap-section: 64px;
  --gap-block: 24px;
  --rail-width: 280px;
  --max-width: 1180px;
  --pad-x: 56px;

  /* Photo */
  --photo-filter: grayscale(1) contrast(1.05);

  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* ----- Top metadata bar ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.topbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 10px var(--pad-x);
  display: flex;
  gap: 28px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}
.topbar .dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: var(--accent);
  display: inline-block;
  margin-right: 8px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.topbar .sep { color: var(--line); }
.topbar .right { margin-left: auto; display: flex; gap: 20px; }

/* ----- Layout ----- */
.shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--pad-x) 120px;
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
  column-gap: 72px;
}

/* ----- Left rail ----- */
.rail { position: sticky; top: 56px; align-self: start; }
.rail-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--line-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.rail-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: var(--photo-filter);
  transition: filter 0.2s ease;
}

.rail-id {
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.rail-name {
  margin-top: 6px;
  font-family: var(--display);
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
}
.rail-role {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-nav {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.rail-nav a {
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.15s ease, padding 0.15s ease;
}
.rail-nav a:hover { color: var(--accent); padding-left: 6px; }
.rail-nav a.is-current { color: var(--accent); }
/* Active-page highlight, driven by a page-<section> class on <body> */
.page-home .rail-nav a[href="/"],
.page-career .rail-nav a[href="/career"],
.page-projects .rail-nav a[href="/projects"],
.page-wiki .rail-nav a[href="/wiki"],
.page-writing .rail-nav a[href="/blog"] { color: var(--accent); }
.page-home .rail-nav a[href="/"] .num,
.page-career .rail-nav a[href="/career"] .num,
.page-projects .rail-nav a[href="/projects"] .num,
.page-wiki .rail-nav a[href="/wiki"] .num,
.page-writing .rail-nav a[href="/blog"] .num { color: var(--accent); }
.rail-nav a .num { color: var(--muted); font-size: 10px; }
.rail-nav a:hover .num { color: var(--accent); }

.rail-contact {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rail-contact-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.rail-contact a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--fg);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.rail-contact a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.rail-contact a .arrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* ----- Main ----- */
main { min-width: 0; }

/* Hero */
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}
.hero-eyebrow .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  background: var(--bg-elev);
}
.hero-eyebrow .tag .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 6.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-lede {
  margin-top: 28px;
  font-size: 19px;
  line-height: 1.55;
  max-width: 62ch;
  color: var(--fg);
  text-wrap: pretty;
}
.hero-lede + .hero-lede { margin-top: 18px; color: var(--muted); }
.hero-lede a { border-bottom: 1px solid currentColor; }

/* Vitals strip — subtle data row */
.vitals {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.vital {
  padding: 18px 18px 18px 0;
  border-right: 1px solid var(--line-soft);
}
.vital:last-child { border-right: none; }
.vital-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.vital-value {
  margin-top: 4px;
  font-family: var(--display);
  font-size: 36px;
  line-height: 1.05;
}
.vital-value .unit { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-left: 6px; letter-spacing: 0.02em; }
.vital-foot {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Chart entries */
.chart {
  margin-top: var(--gap-section);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chart-section {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.chart-section:last-child { border-bottom: 1px solid var(--line); }
.chart-key {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.chart-key .index { color: var(--accent); }
.chart-prose {
  font-size: 17px;
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
}
.chart-prose em { font-family: var(--display); font-style: italic; font-size: 1.08em; }

/* Quick links footer */
.qlinks {
  margin-top: var(--gap-section);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.qlink {
  display: block;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.qlink:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.qlink-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qlink-label .arrow {
  transition: transform 0.15s ease;
}
.qlink:hover .qlink-label .arrow { transform: translateX(4px); color: var(--accent); }
.qlink-title {
  margin-top: 14px;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.qlink-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

/* Footer */
.footer {
  grid-column: 2;
  margin-top: var(--gap-section);
  padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  gap: 12px;
  flex-wrap: wrap;
}
.footer .ekg-mini {
  color: var(--accent);
  opacity: 0.7;
}

/* ----- Page hero (smaller than home hero) ----- */
.page-hero { margin-bottom: var(--gap-section); }
.page-hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}
.page-hero-eyebrow .index { color: var(--accent); }
.page-hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.page-hero-title em { font-style: italic; color: var(--accent); }
.page-hero-sub {
  margin-top: 28px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 60ch;
  text-wrap: pretty;
}
.page-vitals .vitals { margin-top: 0; }

/* ----- Career timeline ----- */
.timeline { display: flex; flex-direction: column; }
.tl-entry {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  align-items: start;
}
.tl-entry:last-child { border-bottom: 1px solid var(--line); }
.tl-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tl-date .from { color: var(--fg); font-size: 14px; }
.tl-date .arrow { color: var(--line); }
.tl-date .now { color: var(--accent); }
.tl-body { min-width: 0; }
.tl-company {
  font-family: var(--display);
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.tl-company-sub {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}
.tl-roles { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 18px; }
.tl-role {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}
.tl-role.is-current {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.tl-notes {
  font-size: 16px;
  line-height: 1.6;
  max-width: 62ch;
  text-wrap: pretty;
  color: var(--fg);
}
.tl-notes em { font-family: var(--display); font-style: italic; }
.tl-notes-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ----- Projects grid ----- */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.proj-card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--bg-elev);
  transition: background 0.15s ease;
  gap: 12px;
}
.proj-card:hover { background: var(--bg); }
.proj-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.proj-card-head .index { color: var(--accent); }
.proj-card-title {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
}
.proj-card-blurb {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
}
.proj-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.proj-tag {
  font-family: var(--mono);
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.proj-tag.is-primary { color: var(--accent); border-color: var(--accent); }
.proj-link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  margin-top: 2px;
}
.proj-card:hover .proj-link { color: var(--accent); }

/* ----- Wiki topics ----- */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.topic-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  background: var(--bg-elev);
  gap: 10px;
  min-height: 200px;
}
.topic-head {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.topic-head .count { color: var(--accent); }
.topic-title {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.topic-sub { font-size: 14px; line-height: 1.5; color: var(--muted); margin: 4px 0 0; }
.topic-entries { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.topic-entries a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg);
  padding: 4px 0;
  border-bottom: 1px dashed transparent;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.topic-entries a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.topic-entries a .meta { color: var(--muted); font-size: 10px; }

/* ----- Writing post list ----- */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid;
  grid-template-columns: 110px 1fr 80px;
  gap: 28px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  align-items: baseline;
  transition: padding 0.15s ease;
}
.post-row:last-child { border-bottom: 1px solid var(--line); }
.post-row:hover { padding-left: 8px; }
.post-row:hover .post-arrow { color: var(--accent); transform: translateX(4px); }
.post-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-transform: uppercase;
}
.post-title {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
.post-excerpt { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); max-width: 60ch; }
.post-arrow {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
  transition: color 0.15s ease, transform 0.15s ease;
}

/* ----- Markdown article (detail pages) ----- */
.prose-back {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 28px;
}
.prose-back:hover { color: var(--accent); }
.prose { font-size: 17px; line-height: 1.7; max-width: 70ch; text-wrap: pretty; }
.prose h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
}
.prose h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 1.6em 0 0.4em;
}
.prose h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
  margin: 1.6em 0 0.4em;
}
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: 0.3em 0; }
.prose img { width: 100%; max-width: 100%; height: auto; display: block; margin: 1.6em 0; border: 1px solid var(--line); }
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}
.prose pre {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 0 0 1.4em;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose blockquote {
  margin: 0 0 1.2em;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1.4em; font-size: 15px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.prose th { background: var(--bg-elev); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* ============================================================
   Mobile — phone treatment (ID card header + bottom tab bar).
   Ported from the Claude Design "Mobile.html" handoff.
   ============================================================ */
@media (max-width: 880px) {
  /* ----- Top metadata strip ----- */
  .topbar-inner {
    gap: 10px;
    padding: 8px 20px;
    font-size: 10px;
  }
  .topbar .loc,
  .topbar .loc + .sep,
  .topbar .right { display: none; }

  /* ----- Shell becomes a single scrolling column; the rail's
     children join the flow via display:contents and are reordered. ----- */
  .shell {
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .rail { display: contents; }
  main { order: 1; }
  .rail-contact { order: 2; }
  .footer { order: 3; }

  /* ----- ID card (home only) ----- */
  .rail-idcard {
    display: flex;
    gap: 16px;
    align-items: stretch;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 28px;
  }
  .rail-photo {
    width: 88px;
    height: 110px;
    aspect-ratio: auto;
    flex-shrink: 0;
    margin: 0;
  }
  .rail-idbody {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 2px;
    min-width: 0;
  }
  .rail-id { margin-top: 0; font-size: 9px; }
  .rail-name { margin-top: 4px; font-size: 32px; line-height: 1.02; }
  .rail-role { margin-top: 6px; font-size: 10px; }
  body:not(.page-home) .rail-idcard,
  body:not(.page-home) .rail-contact { display: none; }

  /* ----- Bottom tab bar (the rail nav, pinned) ----- */
  .rail-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 20;
    margin-top: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: color-mix(in oklab, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .rail-nav a {
    flex-direction: column-reverse;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 10px 4px 8px;
    border-bottom: none;
    border-top: 2px solid transparent;
  }
  .rail-nav a:hover { padding-left: 4px; }
  .rail-nav a span:first-child {
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  .rail-nav a .num { font-size: 9px; }
  .page-home .rail-nav a[href="/"],
  .page-career .rail-nav a[href="/career"],
  .page-projects .rail-nav a[href="/projects"],
  .page-wiki .rail-nav a[href="/wiki"],
  .page-writing .rail-nav a[href="/blog"] { border-top-color: var(--accent); }

  /* ----- Contact (relocated below content on home) ----- */
  .rail-contact {
    margin-top: 0;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    gap: 0;
  }
  .rail-contact-label { margin-bottom: 10px; }
  .rail-contact a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .rail-contact a:last-child { border-bottom: none; }

  /* ----- Home hero ----- */
  header#home { margin-bottom: 28px; }
  .hero-eyebrow { margin-bottom: 18px; }
  .hero-title { font-size: 38px; line-height: 1.05; letter-spacing: -0.01em; }
  .hero-lede { margin-top: 18px; font-size: 15px; }
  .hero-lede + .hero-lede { margin-top: 14px; }

  /* ----- Vitals (2-col with rules) ----- */
  .vitals { grid-template-columns: 1fr 1fr; margin: 0 0 28px; }
  .vital {
    padding: 14px 14px 14px 0;
    border-right: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
  }
  .vital:nth-child(2n) {
    border-right: none;
    padding-right: 0;
    padding-left: 14px;
  }
  .vital:nth-last-child(-n+2):nth-child(2n+1),
  .vital:nth-last-child(-n+1):nth-child(2n) { border-bottom: none; }
  .vital-label { font-size: 9px; }
  .vital-value { font-size: 28px; }
  .vital-value .unit { font-size: 11px; }
  .vital-foot { font-size: 9px; }

  /* ----- Chart (key stacks above prose) ----- */
  .chart { margin: 0 0 28px; gap: 0; }
  .chart-section { grid-template-columns: 1fr; gap: 8px; padding: 18px 0; }
  .chart-key { flex-direction: row; gap: 10px; align-items: baseline; padding-top: 0; }
  .chart-prose { font-size: 15px; }

  /* ----- Quick links ----- */
  .qlinks { grid-template-columns: 1fr; gap: 10px; margin: 0 0 28px; }
  .qlink { padding: 16px; }
  .qlink-title { margin-top: 10px; font-size: 22px; }
  .qlink-sub { margin-top: 6px; font-size: 12.5px; }

  /* ----- Page hero (sub-pages) ----- */
  .page-hero { margin-bottom: 28px; }
  .page-hero-eyebrow { gap: 12px; margin-bottom: 14px; font-size: 10px; }
  .page-hero-title { font-size: 36px; line-height: 1.08; }
  .page-hero-sub { margin-top: 16px; font-size: 14px; }

  /* ----- Career timeline ----- */
  .tl-entry { grid-template-columns: 1fr; gap: 0; padding: 22px 0; }
  .tl-date {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
    padding-top: 0;
    margin-bottom: 10px;
  }
  .tl-date .from { font-size: 11px; }
  .tl-company { font-size: 28px; }
  .tl-company-sub { font-size: 10px; margin-bottom: 14px; }
  .tl-roles { margin: 0 0 14px; }
  .tl-notes { font-size: 14px; }
  .tl-notes-label { font-size: 9px; }

  /* ----- Projects (single column) ----- */
  .proj-grid { grid-template-columns: 1fr; }
  .proj-card { padding: 18px; gap: 10px; }
  .proj-card-title { font-size: 22px; }
  .proj-card-blurb { font-size: 13px; }

  /* ----- Wiki topics (single column) ----- */
  .topic-grid { grid-template-columns: 1fr; }
  .topic-card { padding: 20px; min-height: 0; gap: 8px; }
  .topic-title { font-size: 24px; }
  .topic-sub { font-size: 13px; }
  .topic-entries { gap: 0; }
  .topic-entries a { padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
  .topic-entries a:last-child { border-bottom: none; }

  /* ----- Writing posts (stacked rows) ----- */
  .post-row { display: flex; flex-direction: column; gap: 4px; padding: 18px 0; }
  .post-row:hover { padding-left: 0; }
  .post-date { color: var(--accent); font-size: 10px; }
  .post-title { font-size: 22px; margin: 0; }
  .post-excerpt { font-size: 13px; }
  .post-arrow { display: none; }

  /* ----- Footer ----- */
  .footer { margin-top: 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
  .footer .ekg-mini { display: none; }

  /* ----- Markdown detail pages ----- */
  .prose { font-size: 16px; }
  .prose h1 { font-size: 32px; }
  .prose h2 { font-size: 24px; }
}
