/* vishwatejavangari.com
   Layout: a control-plane ledger. One 1080px column, mono eyebrow labels,
   generous vertical rhythm, mechanism diagrams drawn in currentColor. */

:root {
  --bg: #0B0E14;
  --bg-2: #11161F;
  --bg-3: #171D28;
  --line: #242B38;
  --line-2: #303948;
  --fg: #E9E7E1;
  --fg-2: #C3C7CF;
  --muted: #8F98A6;
  --accent: #F0A63A;
  --accent-ink: #0B0E14;
  --accent-2: #7FB0FF;
  --ok: #5FD3A3;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font-display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 6px;
  --wrap: 1080px;
  --gutter: 20px;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #F3F3F0;
  --bg-2: #FFFFFF;
  --bg-3: #E9EAE6;
  --line: #D9DBD6;
  --line-2: #C6C9C3;
  --fg: #15181F;
  --fg-2: #3A3F49;
  --muted: #5F6672;
  --accent: #9A5A06;
  --accent-ink: #FFFFFF;
  --accent-2: #245DB5;
  --ok: #1F7A55;
  --shadow: 0 24px 60px rgba(20, 24, 32, 0.14);
  color-scheme: light;
}

* { box-sizing: border-box; }

/* Anchor targets land below the sticky header. site.js keeps --header-h equal to the header's real height. */
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h, 60px) + 16px); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
img { display: block; height: auto; }

a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.008em;
  margin: 0;
  text-wrap: balance;
  color: var(--fg);
}
/* Large headings use the display cut of Bricolage Grotesque: optical size 96. */
h1 { font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-variation-settings: "opsz" 96; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.15rem); font-variation-settings: "opsz" 96; }
h3 { font-size: 1.25rem; }
p { margin: 0; }
p + p { margin-top: 1em; }
.lede { font-size: 1.15rem; color: var(--fg-2); max-width: 62ch; }
.measure { max-width: 66ch; }
.muted { color: var(--muted); }

.mono, .eyebrow, .tag, .meta, .type {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 12px;
}
.eyebrow .nb { white-space: nowrap; }
.eyebrow::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--accent);
  flex: none;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; }
.brand .mark { width: 26px; height: 26px; flex: none; }
.brand .name { font-family: var(--font-display); font-size: 1.18rem; font-weight: 600; font-variation-settings: "opsz" 96; letter-spacing: -0.005em; line-height: 1; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 6px 22px; margin-left: auto; }
.nav a { color: var(--fg-2); font-size: 0.95rem; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a:hover { color: var(--fg); text-decoration: none; }
.icon-btn {
  appearance: none;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  color: var(--fg-2);
  width: 36px; height: 36px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.icon-btn { flex: none; }
.icon-btn:hover { color: var(--fg); border-color: var(--muted); }
.icon-btn svg { width: 16px; height: 16px; }
:root:not([data-theme="light"]) .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }

/* Hero */
.hero { padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 72px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero h1 { max-width: 23ch; font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
/* The line above the headline carries name and place, so it is set a little smaller to stay on one line on a desktop. */
.hero .eyebrow { font-size: 0.72rem; letter-spacing: 0.1em; }
.hero .lede { font-size: 1.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--line-2);
  color: var(--fg);
  background: var(--bg-2);
  text-decoration: none;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.hero-photo {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  background: var(--bg-3);
  aspect-ratio: 4 / 5;
  max-width: 360px;
  margin: 0;
  justify-self: end;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.now-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-size: 0.97rem;
  color: var(--fg-2);
}
.now-line .pulse {
  width: 8px; height: 8px; border-radius: 999px; background: var(--ok);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent);
  margin-top: 9px; flex: none;
}

/* Signals: four measured facts under the hero */
.signals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: clamp(32px, 5vw, 56px);
}
.signal { background: var(--bg-2); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.signal .n { font-family: var(--font-display); font-weight: 600; font-variation-settings: "opsz" 96; letter-spacing: -0.008em; font-size: 2rem; line-height: 1; color: var(--fg); font-variant-numeric: tabular-nums; }
.signal .d { color: var(--fg-2); font-size: 0.92rem; line-height: 1.45; }

/* Sections */
.section { padding-block: clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); }
.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px 48px;
  align-items: start;
  margin-bottom: clamp(28px, 4vw, 44px);
}
.section-head .eyebrow { margin-bottom: 14px; }
.section-head p { color: var(--fg-2); }
.section-head .aside { padding-top: 6px; }

/* Stack figure */
.figure { margin: 0; }
.figure svg { width: 100%; height: auto; display: block; color: var(--fg-2); }
.figure figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 70ch;
}
.figure .hi { stroke: var(--accent); }
.figure .hi-fill { fill: var(--accent); }
.figure .hi2 { stroke: var(--accent-2); }
.figure .hi2-fill { fill: var(--accent-2); }
.figure .ok-fill { fill: var(--ok); }
.figure .band { fill: var(--bg-2); stroke: var(--line-2); }
.figure .band-accent { fill: color-mix(in srgb, var(--accent) 14%, var(--bg-2)); stroke: var(--accent); }
.figure .node { fill: var(--bg-3); stroke: var(--line-2); }
.figure text { font-family: var(--font-mono); font-size: 11.5px; fill: currentColor; }
.figure text.lbl { font-size: 10px; fill: var(--muted); letter-spacing: 0.06em; }
.figure text.title { font-family: var(--font-body); font-weight: 600; font-size: 12.5px; fill: var(--fg); }
.figure .edge { stroke: var(--line-2); stroke-width: 1.2; fill: none; }
.figure .edge.dash { stroke-dasharray: 4 4; }
/* Wide figures scroll sideways at their drawn size instead of shrinking their labels. */
.scroll-x .scroller { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
.scroll-x .scroller > svg { min-width: var(--fig-min, 720px); }
.scroll-x .scroller.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.scroll-x .scroller.fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
.scroll-x .scroller.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
.scroll-hint {
  display: none; margin: 8px 0 0; color: var(--muted);
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase;
}
.scroll-x.can-scroll .scroll-hint { display: block; }
.scroll-x.has-scrolled .scroll-hint { visibility: hidden; }

/* Platforms */
.platforms { display: grid; gap: clamp(36px, 5vw, 56px); }
.platform {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.platform:first-child { border-top: 0; padding-top: 0; }
.platform-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.platform-copy h3 { font-size: 1.45rem; }
.platform-copy dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
.platform-copy dt { font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.platform-copy dd { margin: 0; color: var(--fg-2); }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.lg { width: 13px; height: 13px; flex: none; color: var(--fg-2); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--fg-2);
  background: var(--bg-2);
  white-space: nowrap;
}
.platform .figure { min-width: 0; }
.platform .figure svg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 12px; }
/* The platform figures sit in a narrow column, so their labels are drawn larger than the wide figures'. */
.platform .figure text { font-size: 12.5px; }
.platform .figure text.lbl { font-size: 11.5px; }
.platform .figure text.title { font-size: 13.5px; }

/* Principles */
/* Four rules fill a two-by-two grid; each cell puts the rule beside its reason. */
.principles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.principle {
  background: var(--bg-2); padding: 26px 26px 28px; min-width: 0;
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px 18px; align-content: start;
}
.principle .k { grid-row: 1 / span 2; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); padding-top: 5px; }
.principle h3 { font-size: 1.15rem; }
.principle p { color: var(--fg-2); font-size: 0.97rem; }

/* Writing list */
.post-list { display: grid; border-top: 1px solid var(--line); }
.post {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 8px 24px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.post .meta { color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.post .type { color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; }
.post h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; letter-spacing: 0; line-height: 1.35; }
.post h3 a { color: var(--fg); }
.post h3 a:hover { color: var(--accent); text-decoration: none; }
.post .desc { color: var(--fg-2); margin-top: 4px; font-size: 0.97rem; }
.post .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.post .tags .tag { font-size: 0.7rem; padding: 2px 7px; }
.post .read { color: var(--muted); white-space: nowrap; }
.post .ext { color: var(--muted); font-size: 0.72rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filters button {
  appearance: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2);
}
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.more { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }

/* Open source */
.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.repo {
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  min-width: 0;
}
.repo .name { font-family: var(--font-mono); font-size: 0.92rem; color: var(--fg); display: flex; gap: 8px; align-items: center; }
.repo .name svg { width: 14px; height: 14px; color: var(--muted); }
.repo p { color: var(--fg-2); font-size: 0.95rem; }
.repo .lang { color: var(--muted); }

/* Timeline */
.timeline { display: grid; gap: 0; border-top: 1px solid var(--line); }
.row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 6px 24px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.row .when { color: var(--muted); font-variant-numeric: tabular-nums; }
.row .what { color: var(--fg); font-weight: 600; }
.row .where { color: var(--fg-2); }
.row .note { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }

/* Career: employers on a spine, roles nested under each, education and certifications beside */
.career { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.career-list, .roles { list-style: none; margin: 0; padding: 0; }
.career-list { border-top: 1px solid var(--line); }
.employer { padding: 22px 0 8px; border-bottom: 1px solid var(--line); }
.employer-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 20px; margin-bottom: 6px; }
.employer-head .org { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.008em; color: var(--fg); }
.employer-head .place { display: block; color: var(--muted); font-size: 0.92rem; }
.employer-head .span { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; white-space: nowrap; }
.roles { position: relative; margin-left: 7px; padding-left: 22px; border-left: 1px solid var(--line-2); }
.job { position: relative; padding: 14px 0 18px; }
.job::before {
  content: ""; position: absolute; left: -27px; top: 22px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--line-2);
}
.job.current::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.job-head { display: grid; gap: 4px; }
.job-head .when { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; }
.job-head h3 { font-size: 1.12rem; margin: 0; }
.dur { color: var(--muted); opacity: 0.85; }
.dur:not(:empty)::before { content: "\00b7  "; }
.job .sum { color: var(--fg-2); margin: 8px 0 6px; }
.job ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 0.95rem; }
.job ul li { margin: 4px 0; }
.job .stack { margin-top: 12px; }
.career-side { display: grid; gap: 28px; padding-top: 22px; position: sticky; top: calc(var(--header-h, 60px) + 24px); }
.side-block .eyebrow { margin-bottom: 10px; }
.edu { padding: 12px 0; border-top: 1px solid var(--line); }
.edu h3 { font-size: 1.05rem; margin: 0 0 4px; }
.edu .where, .side-block .where { color: var(--fg-2); margin: 0; }
.edu .when { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.04em; margin: 4px 0 0; }
.certs { list-style: none; margin: 0; padding: 0; }
.certs li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.certs .cert { color: var(--fg); font-weight: 600; font-size: 0.98rem; }
.certs .issuer { color: var(--muted); font-size: 0.85rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.contact {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); min-width: 0;
}
.contact .k { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.contact .v { font-size: 1rem; word-break: break-word; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.copy { appearance: none; cursor: pointer; border: 1px solid var(--line-2); background: var(--bg-3); color: var(--fg-2); border-radius: 999px; padding: 3px 10px; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; }
.copy:hover { color: var(--fg); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 34px 48px; color: var(--muted); font-size: 0.92rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 28px; align-items: center; }
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--fg-2); }

/* Article pages */
.page { padding-block: clamp(40px, 6vw, 80px); }
.article-reading { padding-block: clamp(28px, 4vw, 52px); }
.article-page { max-width: 740px; }
.article-page .article-head { gap: 14px; margin-bottom: 18px; }
.article-page .draft-banner { margin-bottom: 16px; }
.article-head { display: flex; flex-direction: column; gap: 18px; max-width: 760px; margin-bottom: 40px; }
.article-head .meta { color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px 18px; }
.article-head .deck { font-size: 1.2rem; color: var(--fg-2); }
.prose { max-width: 700px; font-size: 1.06rem; line-height: 1.75; }
.prose h2 { font-size: 1.5rem; margin: 2.2em 0 0.7em; }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; font-family: var(--font-body); font-weight: 600; }
.prose p { margin: 0 0 1.1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { margin: 1.4em 0; padding: 0.2em 0 0.2em 1.1em; border-left: 2px solid var(--accent); color: var(--fg-2); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; background: var(--bg-3); padding: 0.12em 0.4em; border-radius: 4px; }
.prose pre { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; overflow-x: auto; font-size: 0.86rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.author-card {
  margin-top: 56px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2);
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; align-items: center; max-width: 700px;
}
.author-card img { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; object-position: center top; }
.author-card p { color: var(--fg-2); font-size: 0.95rem; }
.pager { display: flex; justify-content: space-between; gap: 20px; margin-top: 36px; max-width: 700px; flex-wrap: wrap; }
.pager a { color: var(--fg-2); }
.pager .k { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: start; }
.about-side { display: flex; flex-direction: column; gap: 18px; }
.about-side img { border-radius: 10px; border: 1px solid var(--line-2); }
.facts { display: grid; gap: 10px; font-size: 0.95rem; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; }
.facts .k { color: var(--muted); font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }

/* Now */
.now-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.now-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.now-card h2 { font-size: 1.2rem; }
.now-card p, .now-card li { color: var(--fg-2); font-size: 0.98rem; }
.now-card ul { margin: 0; padding-left: 1.1em; }

/* Pillars: the four things I work on */
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.pillar {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: inherit;
  min-width: 0;
}
a.pillar:hover { border-color: var(--muted); text-decoration: none; }
.pillar .k, .card .k, .thesis .n {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent);
}
.pillar h3 { font-size: 1.2rem; }
.pillar p { color: var(--fg-2); font-size: 0.97rem; }
.pillar .go { margin-top: auto; padding-top: 6px; font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--accent); }

/* Cards: a plain grid for short, equal-weight items */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  min-width: 0;
}
.card h3 { font-size: 1.15rem; }
.card p, .card li { color: var(--fg-2); font-size: 0.97rem; }
.card ul { margin: 0; padding-left: 1.1em; }
.card li + li { margin-top: 0.35em; }

/* Note: a scoped statement the reader should not miss */
.note {
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 14px 18px;
  color: var(--fg-2);
  font-size: 0.95rem;
  max-width: 78ch;
}
.note strong { color: var(--fg); }
.section .note { margin-top: 24px; }

/* Theses: numbered positions, statement on the left, argument on the right */
.theses { display: grid; border-top: 1px solid var(--line); }
.thesis {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 8px 32px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.thesis .n { padding-top: 6px; }
.thesis h3 { font-size: 1.35rem; }
.thesis p { color: var(--fg-2); }
.thesis > div { min-width: 0; }
.src { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.03em; line-height: 1.6; color: var(--muted); }
.thesis .src, .card .src { margin-top: 10px; color: var(--muted); font-size: 0.74rem; }
.src a { color: var(--fg-2); text-decoration: underline; text-decoration-color: var(--line-2); }
.src a:hover { color: var(--accent); }

/* Ledger: label, what it answers, example */
.ledger { display: grid; border-top: 1px solid var(--line); }
.ledger-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 28px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
  align-items: start;
}
.ledger-row.head { padding-block: 10px; }
.ledger-row.head span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ledger-row .name { color: var(--fg); font-weight: 600; }
.ledger-row .name small { display: block; font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); margin-top: 2px; }
.ledger-row p { color: var(--fg-2); font-size: 0.97rem; margin: 0; }
.ledger-row .eg { color: var(--muted); }

/* Stepper: one question walked through the layers */
.stepper { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; }
.stepper-q { padding: 18px 22px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; line-height: 1.35; letter-spacing: -0.01em; color: var(--fg); }
.stepper-q .k { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.stepper [role="tablist"] { display: none; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.stepper.is-ready [role="tablist"] { display: flex; }
.stepper [role="tab"] {
  appearance: none; cursor: pointer; flex: none;
  background: none; border: 0; border-right: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--fg-2);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
  white-space: nowrap;
}
.stepper [role="tab"]:hover { color: var(--fg); }
.stepper [role="tab"][aria-selected="true"] { background: var(--accent); color: var(--accent-ink); }
.stepper [role="tab"]:focus-visible { outline-offset: -3px; }
.stepper [role="tabpanel"] {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px 32px;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.stepper [role="tabpanel"]:last-child { border-bottom: 0; }
.stepper [role="tabpanel"][hidden] { display: none; }
.stepper.is-ready [role="tabpanel"] { border-bottom: 0; min-height: 210px; }
.stepper h3 { font-size: 1.2rem; margin-bottom: 10px; }
.stepper h3 .k { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.stepper p { color: var(--fg-2); font-size: 0.97rem; }
.stepper pre {
  margin: 0; padding: 14px 16px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6; color: var(--fg-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.stepper pre b { color: var(--fg); font-weight: 500; }
.stepper pre i { color: var(--ok); font-style: normal; }

/* Long-form pages: learning notes, engineering harness */
.page-hero { padding-block: clamp(44px, 7vw, 88px) clamp(36px, 5vw, 60px); }
.page-hero .article-head { max-width: 820px; margin-bottom: 0; }
.page-hero .note { margin-top: 28px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.toc a {
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--fg-2);
}
.toc a:hover { color: var(--fg); border-color: var(--muted); text-decoration: none; }
.section .figure + .cards, .section .cards + .figure, .section .figure + .ledger, .section .ledger + .figure,
.section .stepper + .figure, .section .figure + .stepper,
.section .cards + .cards { margin-top: 28px; }
.framed svg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 14px; }
.next-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; align-items: center; }

/* Series */
.series-hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px 48px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  margin-bottom: 28px;
}
.series-hub h2, .series-hub h3 { font-size: 1.45rem; }
.series-hub .eyebrow { margin-bottom: 12px; }
.series-hub p { color: var(--fg-2); font-size: 0.97rem; margin-top: 10px; }
.series-hub p.eyebrow { color: var(--muted); font-size: 0.78rem; margin-top: 0; }
.series-parts { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--line); }
.series-parts li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding-block: 11px;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.series-parts .p { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.series-parts .t { color: var(--fg); font-weight: 600; }
.series-parts a.t:hover { color: var(--accent); text-decoration: none; }
.series-parts .s { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.series-box {
  max-width: 700px;
  margin: 0 0 32px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  font-size: 0.95rem;
}
.series-box .k { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.series-box ol { margin: 8px 0 0; padding-left: 1.4em; color: var(--fg-2); }
.series-box li + li { margin-top: 0.25em; }
.series-box li[aria-current="page"] { color: var(--fg); font-weight: 600; }
/* Keep the series link visible without repeating the title above the article. */
.article-page .series-box { display: block; margin-bottom: 20px; padding: 10px 14px; }
.article-page .series-box ol { display: block; margin: 6px 0 0; padding-left: 0; list-style: none; }
.article-page .series-box li[aria-current="page"] { display: none; }
.draft-banner {
  max-width: 700px; margin: 0 0 24px; padding: 10px 14px;
  border: 1px dashed var(--accent); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.76rem; letter-spacing: 0.06em; color: var(--accent);
}
.post-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; max-width: 700px; }
.post-actions .btn { font-size: 0.9rem; padding: 9px 16px; }

/* Prose: tables and figures */
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; line-height: 1.5; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; border-bottom-color: var(--line-2); }
.prose td:first-child { color: var(--fg); }
.prose td { color: var(--fg-2); }
.prose figure { margin: 2em 0; width: min(960px, calc(100vw - 2 * var(--gutter))); }
.prose figure figcaption { max-width: 700px; }
.prose figure svg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 14px; }
/* Wide diagrams can use more room while staying centered on the reading column. */
.article-page .prose figure { margin-left: 50%; transform: translateX(-50%); }
.prose figcaption { font-size: 0.9rem; line-height: 1.55; }
.prose strong { color: var(--fg); }
.prose blockquote p:last-child { margin-bottom: 0; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; align-items: start; }
  .hero-photo { max-width: 300px; justify-self: start; }
  .section-head { grid-template-columns: 1fr; }
  .platform { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-side { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .about-side img { max-width: 240px; }
  .signals, .pillars, .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thesis { grid-template-columns: 44px minmax(0, 1fr); }
  .thesis p, .thesis > div { grid-column: 2; }
  .ledger-row { grid-template-columns: 150px minmax(0, 1fr); }
  .ledger-row .eg { grid-column: 2; }
  .ledger-row.head span:last-child { display: none; }
  .series-hub { grid-template-columns: 1fr; }
  .stepper [role="tabpanel"] { grid-template-columns: 1fr; }
}
/* The one-row header needs about 820 px, so the two-row header starts a little above that. */
@media (max-width: 840px) {
  .site-header .wrap { flex-wrap: wrap; gap: 6px 12px; padding-block: 10px 0; }
  .site-header .icon-btn { order: 2; margin-left: auto; width: 32px; height: 32px; }
  .nav {
    order: 3; width: 100%; margin-left: 0;
    gap: 0 20px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { font-size: 0.9rem; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand { gap: 8px; }
  .brand .name { font-size: 1.12rem; }
  .brand .mark { width: 24px; height: 24px; }
  .hero-photo { max-width: 260px; }
  .principles, .repos, .two-col, .contact-grid, .now-grid, .career { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 1fr; padding: 20px 18px 22px; }
  .principle .k { grid-row: auto; padding-top: 0; }
  .career-side { padding-top: 0; position: static; }
  .signals, .pillars, .cards, .cards.three, .cards.four { grid-template-columns: 1fr; }
  .ledger-row { grid-template-columns: 1fr; gap: 4px; }
  .ledger-row .eg { grid-column: 1; }
  .ledger-row.head { display: none; }
  .series-parts li { grid-template-columns: 58px minmax(0, 1fr); }
  .series-parts .s { grid-column: 2; }
  .series-hub { padding: 18px; }
  .prose table { display: block; overflow-x: auto; }
  .post { grid-template-columns: 1fr; gap: 6px; }
  .post .meta { flex-direction: row; gap: 12px; }
  .post .read { justify-self: start; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .platform-copy dl { grid-template-columns: 1fr; gap: 4px; }
  .platform-copy dt { padding-top: 10px; }
  .author-card { grid-template-columns: 1fr; }
}

/* Animated figures. A pulse rides each solid edge in turn, and dotted lines drift along
   their own direction. The reduced-motion rule at the top of this file switches both off. */
.figure .pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 24 176;
  stroke-dashoffset: 24;
  animation: pulse-travel 3.6s linear infinite;
}
@keyframes pulse-travel {
  0% { stroke-dashoffset: 24; }
  18% { stroke-dashoffset: -100; }
  100% { stroke-dashoffset: -100; }
}
.figure .edge.drift { animation: dash-drift 1.1s linear infinite; }
@keyframes dash-drift { to { stroke-dashoffset: -8; } }
.figure[data-animate].is-offscreen .pulse,
.figure[data-animate].is-offscreen .drift,
.figure[data-animate].is-offscreen .glow,
.figure[data-animate].is-offscreen svg * { animation-play-state: paused; }

/* Sequenced figures: an 8 s cycle in which nodes light up in turn as a question passes through.
   Each node carries its own animation-delay; .alt lights up in the second accent. */
.figure .pulse.seq { animation: pulse-seq 8s linear infinite; }
@keyframes pulse-seq {
  0% { stroke-dashoffset: 24; }
  7% { stroke-dashoffset: -100; }
  100% { stroke-dashoffset: -100; }
}
.figure .glow { animation: node-glow 8s ease-in-out infinite; }
.figure .glow.alt { animation-name: node-glow-alt; }
@keyframes node-glow {
  0%, 100% { stroke: var(--line-2); stroke-width: 1; fill: var(--bg-3); }
  5%, 20% { stroke: var(--accent); stroke-width: 1.6; fill: color-mix(in srgb, var(--accent) 16%, var(--bg-3)); }
  32% { stroke: var(--line-2); stroke-width: 1; fill: var(--bg-3); }
}
@keyframes node-glow-alt {
  0%, 100% { stroke: var(--line-2); stroke-width: 1; fill: var(--bg-3); }
  5%, 20% { stroke: var(--accent-2); stroke-width: 1.6; fill: color-mix(in srgb, var(--accent-2) 16%, var(--bg-3)); }
  32% { stroke: var(--line-2); stroke-width: 1; fill: var(--bg-3); }
}

/* Figure accents that have to win over .edge and .node */
.figure .edge.hi { stroke: var(--accent); }
.figure .edge.hi2 { stroke: var(--accent-2); }
.figure .node.hi { stroke: var(--accent); }
.figure .node.hi2 { stroke: var(--accent-2); }
.figure .node.ok { stroke: var(--ok); }
.figure .node.ghost { fill: none; stroke-dasharray: 4 4; }
.figure text.hi-text { fill: var(--accent); }
.figure text.ok-text { fill: var(--ok); }
.figure text.strong { fill: var(--fg); }
.figure .arrow { fill: currentColor; }
.figure .arrow.hi { fill: var(--accent); stroke: none; }
