/* niraljshah.com
 *
 * One stylesheet for every page, in the designer's brand kit
 * (Niral-J-Shah-Brand-Kit/implementation/design-tokens.css): paper and ink,
 * orange for what you can do, mint for what is true, Inter for the words (bold
 * headings, as the kit sets them) and a monospace for labels. Tokens first; dark mode, and the always-dark sections
 * (the home hero, the ticker, the through-line panel), redefine the tokens
 * rather than patching rules.
 *
 * The content security policy is style-src 'self': no style="" in the HTML and
 * no data: URI here. See README.
 */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(/media/fonts/inter-latin-400-700.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(/media/fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* The kit's colours. */
  --ink: #0B1020;
  --ink-2: #121B30;
  --ink-3: #17233B;          /* the kit's "panel" */
  --ink-deep: #070B17;
  --ink-line: #34445E;       /* rule on dark */
  --on-dark: #F4F5F1;
  --on-dark-muted: #A9B7CD;
  --accent: #FF6B2C;         /* orange: buttons and the mark, never small text on paper */
  --accent-hover: #FF8246;
  --accent-ink: #0B1020;
  --mint: #2EE6A6;
  --blue: #6C85B1;
  --error: #9D2B24;

  /* Reading surfaces: paper in the light, ink in the dark. */
  --paper: #F4F5F1;
  --card: #F4F5F1;
  --tint: #E4E9E6;
  --field: #FFFFFF;
  --field-line: #73808D;
  --line: #D5DCE5;
  --text: #0B1020;
  --muted: #485A65;
  --soft: #5B6873;
  /* The kit's mint-on-light is #087953; text here is a shade darker, #07744F,
     so a label or link still reads at 4.5:1 on the tinted panels (#087953 gives
     4.4 there). The mark's dot and the focus ring keep the kit's own green. */
  --link: #07744F;
  --label: #07744F;
  --accent-text: #07744F;
  --dot: #087953;
  --focus: #087953;
  --bar: #66768A;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(11, 16, 32, 0.05), 0 12px 30px -16px rgba(11, 16, 32, 0.22);
  --shadow-lg: 0 2px 4px rgba(11, 16, 32, 0.05), 0 28px 60px -24px rgba(11, 16, 32, 0.32);

  --font-text: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-display: var(--font-text);
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --wrap: 1360px;
  --measure: 68ch;
  --article: 760px;   /* about 68 characters of body text, the kit's measure */
  --gutter: 24px;
  --head-h: 76px;
  color-scheme: light;
}

/* The dark reading surfaces, as one block of tokens: the system's choice
   unless the reader picked one with the switch in the header (js/theme.js
   sets data-theme before first paint), and always inside .on-ink. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0B1020; --card: #121B30; --tint: #121B30; --field: #17233B; --field-line: #61738D;
    --line: #34445E; --text: #F4F5F1; --muted: #A9B7CD; --soft: #93A2BA;
    --link: #2EE6A6; --label: #2EE6A6; --accent-text: #2EE6A6; --dot: #2EE6A6; --focus: #2EE6A6; --bar: #61738D; --error: #FF9C8F;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -16px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 60px -24px rgba(0, 0, 0, 0.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"], .on-ink, .hero, .ink-panel, .ticker {
  --paper: #0B1020; --card: #121B30; --tint: #17233B; --field: #17233B; --field-line: #61738D;
  --line: #34445E; --text: #F4F5F1; --muted: #A9B7CD; --soft: #93A2BA;
  --link: #2EE6A6; --label: #2EE6A6; --accent-text: #2EE6A6; --dot: #2EE6A6; --focus: #2EE6A6; --bar: #61738D; --error: #FF9C8F;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px -16px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 28px 60px -24px rgba(0, 0, 0, 0.8);
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 18px/1.65 var(--font-text);
  -webkit-font-smoothing: antialiased;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
}
img, svg, video, canvas { max-width: 100%; }
img { height: auto; }
strong, b { font-weight: 600; }
a { color: var(--link); text-decoration-thickness: 1.5px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2.5px; }
h1, h2, h3, h4 { font-family: var(--font-text); font-weight: 700; color: inherit; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.75rem); line-height: 1.06; letter-spacing: -0.035em; margin: 0 0 20px; }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; margin: 0 0 20px; }
h3 { font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.02em; }
p { margin: 0 0 1em; }
[id] { scroll-margin-top: calc(var(--head-h) + 20px); }
main:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
::selection { background: rgba(46, 230, 166, 0.35); }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only, .hp {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }
.muted { color: var(--soft); }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }

/* The kit's label: small monospace capitals, in green on paper and mint on ink. */
.label, .eyebrow {
  display: block; font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--label); margin: 0 0 14px;
}
.label a, .eyebrow a { color: inherit; text-decoration: none; display: inline-block; padding-block: 6px; margin-block: -6px; }
.label a:hover, .eyebrow a:hover { text-decoration: underline; }
.lede { font-size: clamp(1.15rem, 1.6vw, 1.375rem); line-height: 1.5; color: var(--muted); max-width: 34em; margin: 0; }
.h-small { font: 700 1.25rem/1.3 var(--font-text); letter-spacing: -0.015em; margin: 0 0 12px; }
.empty { color: var(--muted); font-size: 1.1rem; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 100;
  background: var(--paper); color: var(--text); padding: 10px 16px; border-radius: 10px;
  border: 2px solid var(--focus); font-weight: 600; text-decoration: none;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* --------------------------------------------------------------- buttons */

/* The kit's button: an orange pill, 48 px tall, with an arrow that leans in. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font: 600 17px/1.2 var(--font-text);
  padding: 12px 24px; min-height: 48px;
  border-radius: 999px; border: 1.5px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn .icon { width: 22px; height: 22px; transition: transform 0.15s ease; }
.btn:hover .icon { transform: translateX(3px); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-line, .btn-dark { background: transparent; color: var(--text); border-color: currentColor; }
.btn-line:hover, .btn-dark:hover { background: var(--text); color: var(--paper); border-color: var(--text); }
.btn-text { padding-inline: 4px; color: var(--text); background: transparent; }
.btn-text:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.btn-sm { padding: 8px 18px; min-height: 40px; font-size: 15px; gap: 8px; }
.btn-sm .icon { width: 18px; height: 18px; }

/* The kit's secondary action: words on the left, the arrow at the far right. */
.more { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-weight: 600; color: var(--text); text-decoration: none; }
.more .icon { transition: transform 0.15s ease; }
.more:hover span { text-decoration: underline; text-underline-offset: 0.2em; }
.more:hover .icon { transform: translateX(4px); }

/* ---------------------------------------------------------------- header */

.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  backdrop-filter: saturate(150%) blur(12px);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
}
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--head-h); position: relative; }
.head-row::after { content: ''; position: absolute; left: var(--gutter); right: var(--gutter); bottom: 0; height: 1px; background: var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 700 22px/1 var(--font-text); letter-spacing: -0.025em; }
.mark { width: 30px; height: 32px; flex: none; }
.mark-dot { fill: var(--dot); }
.head-right { display: flex; align-items: center; gap: 14px; }
.nav { display: flex; align-items: center; margin-right: 6px; }
.nav ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; font-size: 16px; padding-block: 10px; position: relative; }
.nav a:hover { color: var(--link); }
.nav a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: 3px; height: 2px; border-radius: 2px; background: var(--accent); }
.theme-toggle {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  transition: background-color 0.15s;
}
.theme-toggle:hover { background: var(--tint); }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle .i-sun, .theme-toggle[data-current="dark"] .i-moon { display: none; }
.theme-toggle[data-current="dark"] .i-sun { display: block; }
.head-cta { min-height: 44px; }

.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); }
.menu summary::-webkit-details-marker { display: none; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.2s ease, opacity 0.2s ease; }
.burger { position: relative; }
.burger::before, .burger::after { content: ''; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.menu[open] .burger { background: transparent; }
.menu[open] .burger::before { transform: translateY(6px) rotate(45deg); }
.menu[open] .burger::after { transform: translateY(-6px) rotate(-45deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 12px); width: min(280px, calc(100vw - 32px));
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--shadow-lg);
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu-panel a:hover, .menu-panel a[aria-current] { background: var(--tint); }
.menu-panel li:last-child a { background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-top: 6px; text-align: center; border-radius: 999px; }

/* ------------------------------------------------------------------ hero */

.hero { background: var(--ink); color: var(--text); padding-block: clamp(48px, 7vw, 104px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.pill-label {
  display: inline-block; margin: 0 0 28px; padding: 7px 12px; border-radius: 999px;
  font: 500 13px/1.3 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--mint); background: var(--ink-3);
}
.hero h1 { font-size: clamp(2.75rem, 6vw, 5rem); margin: 0 0 28px; max-width: 11em; }
.hero-lede { font-size: clamp(1.15rem, 1.7vw, 1.4rem); line-height: 1.55; color: var(--muted); max-width: 25em; margin: 0 0 36px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-bottom: 36px; }
.hero-signup { max-width: 540px; padding-top: 28px; border-top: 1px solid var(--line); }
.hero-signup-h { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.hero-signup-h .label { margin: 0 0 4px; }
.nl-compact .nl-row input { min-height: 48px; }
.nl-compact .nl-note { font-size: 13.5px !important; margin-top: 10px; }
.hero-art { min-width: 0; }
.hero-art .ev { max-width: 600px; margin-left: auto; }
.hero-art .sn { max-width: 620px; margin-left: auto; }
.hero-nl h1 { font-size: clamp(3rem, 7vw, 6rem); }
.hero-form { margin-top: 8px; max-width: 580px; }

.status { display: inline-flex; align-items: center; gap: 10px; font: 500 13px/1.4 var(--font-mono); color: var(--muted); margin: 0; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 230, 166, 0.55); } 80%, 100% { box-shadow: 0 0 0 10px rgba(46, 230, 166, 0); } }

.social { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.social a {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  color: var(--text); border: 1px solid var(--line); transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.social a:hover { background: var(--text); color: var(--paper); border-color: var(--text); }
.social .icon { width: 18px; height: 18px; }

/* ---------------------------------------------------------------- ticker */

.ticker {
  background: var(--ink); color: var(--text);
  border-top: 1px solid var(--line);
  overflow: hidden; font: 500 13px/1 var(--font-mono);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.ticker:focus-visible { outline-offset: -3px; }
.ticker-track { display: flex; width: max-content; animation: ticker 70s linear infinite; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
.ticker-list { display: flex; list-style: none; margin: 0; padding: 0; }
.ticker-list li { display: flex; align-items: center; gap: 12px; padding: 16px 30px; border-right: 1px solid var(--line); white-space: nowrap; }
.sym { color: var(--text); font-weight: 600; letter-spacing: 0.06em; }
.val { color: var(--muted); }
.chg { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.chg.up { border-bottom: 7px solid var(--mint); }
.chg.down { border-top: 7px solid var(--bar); }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ----------------------------------------------------------------- bands */

.band { padding-block: clamp(56px, 7vw, 104px); }
.band + .band > .wrap { position: relative; }
.band + .band:not(.band-panel):not(.band-tight) > .wrap::before { content: ''; position: absolute; left: var(--gutter); right: var(--gutter); top: calc(-1 * clamp(56px, 7vw, 104px)); height: 1px; background: var(--line); }
.band-flush { padding-top: 0; }
.band-tight { padding-block: 0; }
.band-panel { padding-block: clamp(24px, 3vw, 40px) clamp(56px, 7vw, 96px); }
.band-panel + .band { padding-top: clamp(24px, 3vw, 40px); }
.band-panel + .band > .wrap::before, .band-tight + .band > .wrap::before { display: none; }   /* a panel already separates them */
.sec-head { max-width: 820px; margin-bottom: 40px; }
.sec-head h2 { margin-bottom: 0; }
.sec-head .muted { margin: 12px 0 0; font-size: 1.05rem; }
.sec-head-row { max-width: none; display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ------------------------------------------------------------- page head */

.page-head { padding-block: clamp(48px, 7vw, 96px) clamp(40px, 5vw, 64px); }
.page-head h1 { margin: 0 0 22px; max-width: 14em; }
.page-head-grid.wrap { display: block; }
.with-side .page-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 5vw, 80px); align-items: center; }
.page-head-side { justify-self: end; }
.page-head .post-byline { margin-top: 18px; font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; }
.head-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin: 32px 0 0; }
/* "On this page": jump links under a long page's heading. */
.jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); max-width: 40em; }
.jump .label { margin: 0; }
.jump ul { display: flex; flex-wrap: wrap; gap: 4px 18px; list-style: none; margin: 0; padding: 0; }
.jump a { display: inline-block; padding-block: 6px; color: var(--text); font-weight: 500; font-size: 16px; text-decoration: none; border-bottom: 1.5px solid transparent; }
.jump a:hover { border-bottom-color: var(--accent); }
.page-head-narrow .page-head-grid, .article-wrap { max-width: calc(var(--article) + 2 * var(--gutter)); }

/* -------------------------------------------------------------- portrait */

.portrait-disc { width: 100%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 40px 80px -40px rgba(11, 16, 32, 0.55); }
.portrait-disc .pt { border-radius: 50%; }
.portrait-cut { width: clamp(220px, 30vw, 420px); }
.portrait-sm { width: clamp(180px, 22vw, 280px); }

/* ---------------------------------------------------------------- covers */

/* A cover: 3:2, the artwork always on ink, its lettering live text scaled
   with the card (container query units, with pixel sizes first for browsers
   without them). */
.cover { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: #0B1020; border-radius: var(--radius-sm); container-type: inline-size; color: #F4F5F1; }
.cover > img, .cover > .cover-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.cover-photo { background: var(--tint); }
/* A hairline, invisible against the artwork on paper, that keeps a cover's edge on a dark page. */
.cover::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); pointer-events: none; }
.cover-text { position: absolute; left: 5.5%; right: 5.5%; bottom: 6.5%; }
.cover .cover-label { margin: 0 0 4px; font: 500 10px/1.3 var(--font-mono); font-size: max(10px, 1.25cqi); letter-spacing: 0.06em; text-transform: uppercase; color: #2EE6A6; }
.cover .cover-title { margin: 0 0 4px; font: 700 20px/1.05 var(--font-text); font-size: clamp(18px, 4.3cqi, 56px); letter-spacing: -0.03em; color: #F4F5F1; }
.cover .cover-tag { margin: 0; font: 400 12px/1.35 var(--font-text); font-size: max(12px, 1.6cqi); color: #A9B7CD; }
.cover-next { display: grid; place-items: center; background: transparent; border: 1.5px dashed var(--line); }
.cover-next span { font: 300 64px/1 var(--font-text); color: var(--accent); }

/* -------------------------------------------------------------- the home */

.about-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.about-copy > p:not(.label):not(.previously) { font-size: 1.1rem; color: var(--muted); max-width: 36em; }
.previously { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 22px; margin: 28px 0 32px; font-weight: 600; letter-spacing: -0.01em; }
.previously .label { width: 100%; margin: 0 0 2px; }
.about-portrait { margin: 0; justify-self: center; width: min(100%, 460px); display: grid; justify-items: center; gap: 20px; }
.pull {
  margin: clamp(56px, 7vw, 88px) 0; padding: clamp(28px, 4vw, 48px); max-width: none;
  background: var(--tint); border-radius: var(--radius);
  font: 500 clamp(1.2rem, 2.1vw, 1.55rem)/1.45 var(--font-text); letter-spacing: -0.015em;
}
.pull p { margin: 0 0 12px; max-width: 42em; }
.pull footer { margin-top: 18px; font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.pull footer a { color: inherit; }
.timeline-h { font-size: clamp(1.6rem, 2.6vw, 2.25rem); letter-spacing: -0.03em; margin: 0 0 28px; }

/* The career: the kit's grid, each step under a rule. */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 32px; }
.timeline li { display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.tl-when { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }
.tl-what { font-weight: 700; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.02em; }
.tl-where { color: var(--muted); font-size: 16px; line-height: 1.4; }
.tl-now { border-top: 2px solid var(--accent) !important; }
.timeline-detail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tl-detail { margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.work-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.work-card .cover { border-radius: 0; }
.work-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 26px 28px 24px; }
.work-body h3 { font-size: 1.6rem; margin: 0; }
/* Status at a glance, as the Creditcrest site shows its own: what is built, and whether it is live. */
.work-status { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 2px !important; }
.pill-status { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); font: 500 12.5px/1.2 var(--font-mono); letter-spacing: 0.04em; color: var(--muted); }
.pill-built, .pill-live { color: var(--label); border-color: color-mix(in srgb, var(--label) 45%, transparent); }
.page-head .work-status { margin: 20px 0 0 !important; }
.pill-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.work-body p { color: var(--muted); font-size: 16.5px; margin: 0; }
.fine { font-size: 14.5px !important; }
.work-body .fine a { color: var(--link); }
.more-row { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }

.compare {
  margin: 28px 0 0; display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 20px 48px; align-items: center;
  padding: clamp(24px, 3.5vw, 40px); background: var(--tint); border-radius: var(--radius);
}
.compare-title { font-weight: 700; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
.compare-sub { color: var(--muted); font-size: 15px; margin: 8px 0 0; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.bars li { display: grid; grid-template-columns: 128px minmax(0, 1fr) 44px; align-items: center; gap: 14px; font-size: 15.5px; }
.bar { height: 12px; background: color-mix(in srgb, var(--text) 10%, transparent); border-radius: 999px; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: inherit; background: var(--bar); transform-origin: left; }
.fill-99 { width: 99%; }
.fill-78 { width: 78%; }
.fill-76 { width: 76%; background: var(--link); }
.bar-v { font: 600 15px/1 var(--font-mono); text-align: right; }
.bars .ours { font-weight: 600; }
.compare figcaption { grid-column: 1 / -1; font-size: 13.5px; color: var(--soft); margin: 0; }
.in-view .fill { animation: grow 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }

.now-updated { display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 500 13px/1.3 var(--font-mono); color: var(--soft); }
.now-lanes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.now-lane { background: var(--tint); border-radius: var(--radius); padding: 28px 30px 30px; }
.now-lane-h { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); margin: 0 0 20px; }
.now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: now; }
.now-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; counter-increment: now; }
.now-list li::before { content: counter(now, decimal-leading-zero); grid-row: span 2; font: 500 13px/1.9 var(--font-mono); color: var(--label); }
.now-list strong { font-size: 1.1rem; letter-spacing: -0.01em; }
.now-list span { color: var(--muted); font-size: 16px; line-height: 1.55; }

/* ----------------------------------------------------------------- cards */

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; }
.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 26px; display: flex; flex-direction: column; gap: 12px; }
.card-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--mint); }
.card-icon .icon { width: 24px; height: 24px; }
.card h3 { font-size: 1.3rem; margin: 6px 0 0; }
.card p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.card h2 a, .card h3 a { color: inherit; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.card .tags { margin-top: auto; padding-top: 8px; }
.tags li { font: 500 12.5px/1 var(--font-mono); }
.tags > li:not(:has(a)), .tags a { display: inline-block; padding: 7px 11px; border-radius: 999px; background: var(--tint); color: var(--muted); text-decoration: none; }
.tags a:hover { background: var(--text); color: var(--paper); }
.tags .count { opacity: 0.7; margin-left: 4px; }
.tags-lg li { font-size: 14px; }
.tags-lg a { padding: 10px 16px; }

/* -------------------------------------------------------------- projects */

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; }
.chip-btn {
  font: 500 15px/1 var(--font-text); padding: 10px 16px; min-height: 40px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--tint); color: var(--text); transition: background-color 0.15s, color 0.15s;
}
.chip-btn:hover { background: color-mix(in srgb, var(--text) 14%, var(--tint)); }
.chip-btn[aria-pressed="true"] { background: var(--text); color: var(--paper); }
.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 44px 28px; }
.projects-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.projects-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project { position: relative; display: flex; flex-direction: column; }
.project-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding-top: 20px; }
.project .project-meta { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); margin: 0; }
.project h2, .project h3 { font-size: 1.35rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0; }
.project h2 a, .project h3 a { color: inherit; text-decoration: none; }
.project h2 a::after, .project h3 a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-sm); }
.project h2 a:focus-visible, .project h3 a:focus-visible { outline: none; }
.project:has(:is(h2, h3) a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 8px; border-radius: var(--radius-sm); }
.project p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.project .project-link { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text); font-weight: 600; font-size: 16px; }
.project-link .icon { transition: transform 0.15s ease; }
.project:hover :is(h2, h3) a { text-decoration: underline; text-underline-offset: 0.18em; }
.project:hover .project-link .icon { transform: translateX(4px); }
.project:hover .cover > img, .project:hover .cover > .cover-art { transform: scale(1.025); }
.filter-empty:empty { display: none; }

/* ----------------------------------------------------------------- posts */

/* The kit's writing rows: the cover, then the date and topic, the title, the
   description and the way in, each row under a rule. */
.post-list { display: grid; }
.post-card { position: relative; }
.post-row { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 20px 40px; align-items: center; padding-block: 32px; border-bottom: 1px solid var(--line); }
.post-row:first-child { padding-top: 0; }
.post-card-body { display: flex; flex-direction: column; gap: 10px; }
.post-meta { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); margin: 0; }
.post-card h2, .post-card h3 { font-size: clamp(1.45rem, 2.4vw, 2.1rem); line-height: 1.15; margin: 0; }
.post-card h2 a, .post-card h3 a { color: inherit; text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ''; position: absolute; inset: 0; }
.post-card h2 a:focus-visible, .post-card h3 a:focus-visible { outline: none; }
.post-card:has(a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 6px; border-radius: var(--radius-sm); }
.post-desc { margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }
.post-more { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; font-weight: 600; }
.post-more .icon { margin-left: auto; transition: transform 0.15s ease; }
.post-card:hover h2 a, .post-card:hover h3 a { text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 2px; }
.post-card:hover .post-more .icon { transform: translateX(4px); }
.post-card:hover .cover > img { transform: scale(1.025); }
.post-ext { color: var(--link); }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 28px; }
.post-card.post-card { display: flex; flex-direction: column; gap: 20px; }
.post-row.post-card { display: grid; }
.post-grid .post-card h2, .post-grid .post-card h3 { font-size: 1.45rem; }

.away { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 40px; }
.away li { display: flex; flex-direction: column; gap: 4px; }
.away a { font-weight: 700; font-size: clamp(1.3rem, 2vw, 1.6rem); letter-spacing: -0.02em; line-height: 1.25; color: var(--text); text-decoration: none; }
.away a:hover { text-decoration: underline; }
.away .muted { font-size: 15px; }

/* ------------------------------------------------------------------ post */

.post-head { padding-top: clamp(48px, 6vw, 88px); }
.post-head h1 { font-size: clamp(2.2rem, 4.6vw, 3.75rem); max-width: 18em; margin: 0 0 22px; }
.post-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin: 0; color: var(--muted); font-size: 16px; }
.byline-who { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; display: block; background: var(--ink); }
.article-cover { margin: 36px 0 0; }
/* On a project page the text follows the cover in the same column: room between them. */
.article-cover + .prose { margin-top: 44px; }
.article-cover .cover { border-radius: var(--radius); }
.post-band { padding-block: clamp(40px, 5vw, 64px) clamp(56px, 7vw, 96px); }
/* The text sits in one centred column, as in the kit's article layout; the
   contents, where a post has them, hang in the margin beside it on a wide
   screen and sit above it on anything narrower. */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, var(--article)) minmax(0, 1fr); column-gap: 48px; }
.post-body { grid-column: 2; }
.toc { grid-column: 1; grid-row: 1; justify-self: end; width: 220px; position: sticky; top: calc(var(--head-h) + 24px); align-self: start; font-size: 15px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 6px 0 6px 14px; color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--text); border-left-color: var(--accent); }
.prose h2 .h-anchor, .prose h3 .h-anchor { margin-left: 0.35em; color: var(--soft); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity 0.15s; }
.prose h2:hover .h-anchor, .prose h3:hover .h-anchor { opacity: 1; }
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 55; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.post-note { background: var(--tint); border-radius: var(--radius-sm); padding: 16px 20px; font-size: 16px; line-height: 1.55; color: var(--muted); margin: 0 0 2.2em; }
.post-note p { margin: 0; }
.post-end { margin-top: 3em; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 20px; }
.post-share { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin: 0; }
.post-share .btn-text { color: var(--muted); }
.post-reply { padding: 24px 26px; background: var(--tint); border-radius: var(--radius); }
.post-reply p:last-child { margin: 0; font-size: 1.1rem; font-weight: 500; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.post-nav a { display: flex; flex-direction: column; gap: 6px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-weight: 600; font-size: 1.05rem; line-height: 1.35; }
.post-nav a:hover { border-color: var(--text); }
.post-nav .label { margin: 0; }
.post-nav-next { text-align: right; }

/* ----------------------------------------------------------------- prose */

.prose { font-size: 1.125rem; line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(1.55rem, 2.6vw, 2rem); letter-spacing: -0.025em; margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25em; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--label); }
.prose blockquote { margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--link); color: var(--muted); font-size: 1.15rem; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font: 0.86em/1 var(--font-mono); background: var(--tint); padding: 0.18em 0.42em; border-radius: 6px; }
.prose pre { background: var(--ink); color: #E9EDF8; padding: 20px 22px; border-radius: var(--radius-sm); overflow-x: auto; font: 14.5px/1.65 var(--font-mono); margin: 1.6em 0; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; line-height: inherit; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 3em 0; }
.prose figure { margin: 2.2em 0; }
.prose img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.prose figcaption { font-size: 14.5px; line-height: 1.5; color: var(--soft); margin-top: 12px; text-align: center; }
.table-wrap { overflow-x: auto; margin: 1.8em 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.4; }
.prose th, .prose td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font: 500 12.5px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft); background: var(--tint); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--tint) 55%, transparent); }
.prose .align-right { text-align: right; }
.prose .align-center { text-align: center; }
.prose td.align-right { font: 500 14px/1.4 var(--font-mono); }
.article-wrap .prose { max-width: none; }

/* ------------------------------------------------------------- newsletter */

.nl-panel {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 24px clamp(32px, 5vw, 72px); align-items: center;
  background: var(--tint); border-radius: var(--radius); padding: clamp(28px, 4.5vw, 64px);
}
.nl-panel h2 { font-size: clamp(1.9rem, 3.4vw, 2.75rem); margin: 0 0 14px; }
.nl-panel-copy p:not(.label) { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 34em; }
.nl-form { max-width: 580px; }
.nl-row { display: flex; gap: 12px; align-items: center; }
.nl-row input { flex: 1; min-width: 0; }
.nl-note { font-size: 14.5px !important; line-height: 1.5; color: var(--muted); margin: 14px 2px 0; }
.nl-note a { color: inherit; }
.hero .nl-row input { background: #F4F5F1; color: #0B1020; border-color: transparent; }
.hero .nl-row input::placeholder { color: #5B6873; }
.form-status { font-weight: 600; margin: 12px 2px 0; }
.form-status:empty { display: none; }
.form-status.ok::before { content: '✓ '; color: var(--link); }
.form-status.error { color: var(--error); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { display: flex; flex-direction: column; }
.step-n { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; color: var(--label); }
.steps h3 { font-size: clamp(1.6rem, 2.6vw, 2.25rem); letter-spacing: -0.03em; margin: 14px 0 10px; }
.steps p { color: var(--muted); margin: 0; max-width: 24em; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.checks li:first-child { padding-top: 0; }
.checks .icon { color: var(--label); margin-top: 2px; }

/* ---------------------------------------------------------------- contact */

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact-copy > p:not(.label) { font-size: 1.1rem; color: var(--muted); max-width: 30em; }
.contact-copy .btn { margin: 8px 0 22px; }
.contact-page h1 { font-size: clamp(2.4rem, 4.2vw, 3.75rem); margin-bottom: 28px; }
.contact-card { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); max-width: 26em; }
.contact-name { font-weight: 700; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; }
.contact-card .muted { margin: 2px 0 16px; }
.direct { font-size: 1.05rem; }
.contact-chat { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); max-width: 26em; }
.social-contact { margin-top: 18px; }
.contact-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.contact-form label { font-weight: 600; font-size: 16px; }
.req { font-weight: 400; color: var(--soft); }
input[type="text"], input[type="email"], input[type="date"], select, textarea {
  width: 100%; min-height: 48px; font: 17px/1.4 var(--font-text); color: var(--text);
  background: var(--field); border: 1px solid var(--field-line); border-radius: 8px; padding: 12px 14px;
  transition: border-color 0.15s;
}
textarea { resize: vertical; min-height: 150px; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url(/media/chevron.svg); background-repeat: no-repeat; background-position: right 14px center; background-size: 14px; }
input[type="text"]:hover, input[type="email"]:hover, input[type="date"]:hover, select:hover, textarea:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
input[aria-invalid="true"], textarea[aria-invalid="true"], .hero .nl-row input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 1px var(--error); }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500 !important; padding-block: 4px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: #087953; flex: none; margin: 0; }
.contact-form .btn { justify-self: start; }
.form-note { font-size: 14.5px; color: var(--soft); margin: 0; }

/* ---------------------------------------------------------------- privacy */

.policy { list-style: none; margin: 0; padding: 0; }
.policy li { display: grid; grid-template-columns: 56px minmax(0, 1fr); padding-block: 30px; border-bottom: 1px solid var(--line); }
.policy li:first-child { border-top: 1px solid var(--line); }
.policy .step-n { padding-top: 0.6em; }
.policy h2 { font-size: clamp(1.4rem, 2.2vw, 1.75rem); letter-spacing: -0.025em; margin: 0 0 10px; }
.policy p { color: var(--muted); margin: 0 0 0.8em; }
.policy p:last-child { margin: 0; }
.policy-date { margin-top: 28px; font-size: 15px; }

/* ------------------------------------------------------------------- bio */

.bio { max-width: 860px; }
.bio-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 999px; background: var(--tint); }
.bio-tabs [role="tab"] { font: 600 15px/1 var(--font-text); min-height: 40px; padding: 0 20px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.bio-tabs [role="tab"][aria-selected="true"] { background: var(--text); color: var(--paper); }
.bio-panel { background: var(--tint); border-radius: var(--radius); padding: 26px 28px; }
.bio-panel + .bio-panel { margin-top: 18px; }
.bio-tabbed .bio-panel + .bio-panel { margin-top: 0; }
.bio-h { font: 500 13px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); margin: 0 0 12px; }
.bio-tabbed .bio-h { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bio-text p { font-size: 1.06rem; line-height: 1.7; max-width: 68ch; }
.bio-text { margin-bottom: 18px; }
.bio-text p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ about page */

.ink-panel { background: var(--ink); color: var(--text); border-radius: var(--radius); padding: clamp(32px, 5vw, 64px); }
.ink-panel h2 { font-size: clamp(1.8rem, 3.6vw, 3rem); max-width: 19em; margin: 0; }
/* On a dark page the panel is the kit's lighter "panel" ink, so it still reads as one. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ink-panel { background: var(--ink-3); } }
:root[data-theme="dark"] .ink-panel { background: var(--ink-3); }
.story-grid { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.story-art { width: 100%; max-width: 560px; justify-self: end; border-radius: var(--radius); display: block; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 6vw, 80px); align-items: start; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.stack li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.stack h3 { font-size: 1.15rem; margin: 0 0 4px; }
.stack .muted { font: 500 13px/1.4 var(--font-mono); margin: 0 0 10px; }
.stack p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.skill-group h3 { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); margin: 0 0 12px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; color: var(--muted); }
.plain strong { color: var(--text); }

/* By the numbers (About): the career's biggest figures, large, each with where. */
.numbers { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 32px; }
.numbers li { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 2px solid var(--text); }
.num-figure { font-weight: 700; font-size: clamp(1.85rem, 3.6vw, 3.4rem); line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.num-text { color: var(--muted); font-size: 16px; line-height: 1.45; text-wrap: balance; }
.num-where { font: 500 13px/1.5 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--label); }

/* Beyond the desk (About): ink cards with a big figure, the fun side of the CV. */
.beyond { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.beyond > li { background: var(--ink); color: #F4F5F1; border-radius: var(--radius); padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 10px; }
.beyond-figure { margin: 0 0 6px; font-weight: 700; font-size: clamp(2.4rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -0.045em; color: #F4F5F1; }
.beyond-figure span { font: 500 13px/1 var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: #2EE6A6; margin-left: 4px; }
.beyond h3 { font-size: 1.2rem; margin: 0; color: #F4F5F1; }
.beyond p:not(.beyond-figure) { margin: 0; color: #A9B7CD; font-size: 16px; line-height: 1.55; }
.beyond-tags { list-style: none; margin: auto 0 0; padding: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.beyond-tags li { font: 500 14px/1 var(--font-mono); padding: 10px 14px; border-radius: 999px; background: #17233B; color: #F4F5F1; }
.beyond > li:last-child { background: #FF6B2C; }
.beyond > li:last-child h3, .beyond > li:last-child .beyond-figure, .beyond > li:last-child .beyond-figure span { color: #0B1020; }
.beyond > li:last-child .beyond-tags li { background: #0B1020; color: #F4F5F1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .beyond > li:not(:last-child) { background: var(--ink-3); } }
:root[data-theme="dark"] .beyond > li:not(:last-child) { background: var(--ink-3); }

/* ---------------------------------------------------------------- footer */

.site-foot { color: var(--muted); padding-block: 0 96px; font-size: 16px; }   /* room below for the chat button, so it never sits on the last line */
.foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.7fr) minmax(0, 0.7fr); gap: 40px; padding-top: 48px; position: relative; }
.foot-grid::before { content: ''; position: absolute; left: var(--gutter); right: var(--gutter); top: 0; height: 1px; background: var(--line); }
.foot-brand .brand { font-size: 20px; }
.foot-brand p { margin: 16px 0 22px; max-width: 26em; }
.foot-h { font: 500 13px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--label); margin: 4px 0 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.foot-col a { color: var(--text); text-decoration: none; display: inline-block; padding-block: 6px; }
.foot-col a:hover { text-decoration: underline; }
.foot-base { margin-top: 48px; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.foot-base p { margin: 0; }
.foot-url { font: 500 13px/1 var(--font-mono) !important; color: var(--text); }
.to-top { display: inline-block; padding-block: 8px; color: var(--muted); text-decoration: none; }
.to-top:hover { color: var(--text); text-decoration: underline; }

/* ------------------------------------------------------------- portrait */

/* The portrait (portrait() in lib/art.js). One 18-second clock, kept from the
   caricature it replaced: the sunglasses at 22–50%, a sparkle on them, the
   magnifying glass at 55–80%, a glint across the dome at 82–90%. He sways on
   a 6-second loop, the data line redraws every 9 seconds and the sparks drift
   on 12. Transforms on SVG parts use the drawing's own 400-unit grid. */
.pt { display: block; width: 100%; height: auto; }
.pt-person { transform-box: view-box; transform-origin: 200px 370px; animation: pt-sway 6s ease-in-out infinite; }
.pt-shades, .pt-glass, .pt-glint, .pt-sparkle { opacity: 0; }
.pt-shades { transform-box: view-box; animation: pt-shades 18s infinite; }
.pt-sparkle { transform-box: fill-box; transform-origin: center; animation: pt-sparkle 18s infinite; }
.pt-glass { transform-box: view-box; animation: pt-glass 18s infinite; }
.pt-glint { transform-box: view-box; animation: pt-glint 18s linear infinite; }
/* Each line drawn is dashed a little longer than itself (the signal line is 498
   units, the traces 133–245, the check 87, the clean lines 460–484) and the
   dash slid into place — the kit's own way, which needs no pathLength. */
.pt-signal { stroke-dasharray: 500; animation: pt-signal 9s ease-out infinite; }
.pt-spark { transform-box: view-box; transform-origin: 200px 200px; animation: pt-orbit 12s ease-in-out infinite alternate; }
.pt-search .pt-glass { opacity: 1; animation: pt-hunt 7s ease-in-out infinite; }

@keyframes pt-sway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-3px) rotate(-1deg); }
  42% { transform: translateY(-1px) rotate(0.6deg); }
  68% { transform: translateY(-2px) rotate(-0.4deg); }
}
@keyframes pt-shades {
  0%, 21% { transform: translateY(-80px); opacity: 0; }
  25% { transform: translateY(5px); opacity: 1; }
  26.5%, 46% { transform: translateY(0); opacity: 1; }
  50%, 100% { transform: translateY(-80px); opacity: 0; }
}
@keyframes pt-sparkle {
  0%, 29%, 35%, 100% { opacity: 0; transform: scale(0.2); }
  31% { opacity: 1; transform: scale(1.25); }
  33% { opacity: 0.9; transform: scale(0.9); }
}
@keyframes pt-glass {
  0%, 54% { transform: translate(110px, 150px); opacity: 0; }
  60% { transform: translate(0, 0); opacity: 1; }
  64% { transform: translate(-3px, 3px); opacity: 1; }
  68% { transform: translate(3px, -2px); opacity: 1; }
  72% { transform: translate(-2px, 2px); opacity: 1; }
  75% { transform: translate(0, 0); opacity: 1; }
  80%, 100% { transform: translate(110px, 150px); opacity: 0; }
}
@keyframes pt-glint {
  0%, 82% { transform: translateX(-90px); opacity: 0; }
  83% { transform: translateX(-70px); opacity: 1; }
  90% { transform: translateX(250px); opacity: 1; }
  90.5%, 100% { transform: translateX(250px); opacity: 0; }
}
@keyframes pt-hunt {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(-6px, 4px); }
  60% { transform: translate(5px, -3px); }
}
@keyframes pt-signal {
  0% { stroke-dashoffset: 500; opacity: 0; }
  25%, 85% { stroke-dashoffset: 0; opacity: 0.36; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes pt-orbit { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }

/* The pause control (motionToggle() in lib/templates.js): a small round button
   in the corner of each moving piece. One press pauses every animation on the
   page, the ticker included, and the button turns to play. */
.motion { position: relative; }
.motion-toggle {
  position: absolute; right: 2%; bottom: 2%; z-index: 2;
  width: 36px; height: 36px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 50%; border: 1px solid rgba(244, 245, 241, 0.28);
  background: rgba(11, 16, 32, 0.74); color: #F4F5F1; opacity: 0.8;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: opacity 0.15s, background-color 0.15s;
}
.motion-toggle:hover, .motion-toggle:focus-visible { opacity: 1; background: #0B1020; }
/* The diagrams fill their box to the corners, so their button sits just below them. */
.hero-art.motion { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.hero-art .motion-toggle { position: static; }
.motion-toggle:focus-visible { outline-color: #2EE6A6; }
.motion-toggle .icon { width: 16px; height: 16px; stroke-width: 2; }
.motion-toggle .i-play, .motion-paused .motion-toggle .i-pause { display: none; }
.motion-paused .motion-toggle .i-play { display: block; }
.motion-paused .pt *, .motion-paused .ev *, .motion-paused .sn *, .motion-paused .ticker-track, .motion-paused .live { animation-play-state: paused !important; }

/* ------------------------------------------------------- motion pieces */

/* The evidence trace and signal over noise (lib/art.js): the kit's motion
   pieces, looping. Text in them is live, set in the site's own faces. */
.ev, .sn { display: block; width: 100%; height: auto; overflow: visible; }
.ev-label, .ev-cap { font: 500 12px var(--font-mono); letter-spacing: 0.06em; fill: #A9B7CD; }
.ev-cap { fill: #0B1020; }
.ev-h { font: 700 23px var(--font-text); letter-spacing: -0.01em; fill: #0B1020; }
.ev-h2 { font-size: 30px; letter-spacing: -0.02em; }
.ev-trace { stroke-dasharray: 250; animation: ev-draw 8s ease-out infinite both; }
.ev-dot { transform-box: fill-box; transform-origin: center; animation: ev-dot 8s ease-out infinite both; }
.ev-result { animation: ev-result 8s ease-out infinite; }
.ev-check { stroke-dasharray: 90; animation: ev-check 8s ease-out infinite; }
/* Each loop starts part-way in, on the finished diagram, so the first thing a
   reader sees is the whole picture; then it clears and draws itself again.
   (After the rules above: their animation shorthand would reset a delay.) */
.ev-trace, .ev-dot, .ev-result, .ev-check { animation-delay: -3.2s; }
.ev-t1, .ev-d1 { animation-delay: -2.85s; }
.ev-t2, .ev-d2 { animation-delay: -2.5s; }
@keyframes ev-draw {
  0% { stroke-dashoffset: 250; opacity: 1; }
  20%, 86% { stroke-dashoffset: 0; opacity: 1; }
  94%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes ev-dot { 0%, 9%, 100% { transform: scale(1); } 3% { transform: scale(1.9); } }
@keyframes ev-result { 0%, 20% { opacity: 0.72; } 30%, 88% { opacity: 1; } 100% { opacity: 0.72; } }
@keyframes ev-check {
  0%, 28% { stroke-dashoffset: 90; opacity: 1; }
  38%, 88% { stroke-dashoffset: 0; opacity: 1; }
  96% { stroke-dashoffset: 0; opacity: 0; }
  100% { stroke-dashoffset: 90; opacity: 0; }
}

.sn-noise { transform-box: view-box; animation: sn-wave 4.5s ease-in-out infinite alternate; }
.sn-n1 { animation-delay: -0.9s; }
.sn-n2 { animation-delay: -1.8s; }
.sn-n3 { animation-delay: -2.7s; }
.sn-n4 { animation-delay: -3.6s; }
.sn-clear { stroke-dasharray: 490; animation: sn-draw 7s ease-out infinite both; }
.sn-dot { transform-box: fill-box; transform-origin: center; animation: sn-dot 7s ease-out infinite both; }
.sn-clear, .sn-dot { animation-delay: -2.8s; }   /* starts drawn, as the diagram does */
.sn-c1 { animation-delay: -2.55s; }
.sn-c2 { animation-delay: -2.3s; }
@keyframes sn-wave { from { transform: translateY(-8px); } to { transform: translateY(8px); } }
@keyframes sn-draw {
  0% { stroke-dashoffset: 490; opacity: 1; }
  30%, 86% { stroke-dashoffset: 0; opacity: 1; }
  95%, 100% { stroke-dashoffset: 0; opacity: 0; }
}
@keyframes sn-dot {
  0%, 26% { opacity: 0; transform: scale(0.4); }
  31% { opacity: 1; transform: scale(1.35); }
  35%, 86% { opacity: 1; transform: scale(1); }
  95%, 100% { opacity: 0; transform: scale(1); }
}

/* ------------------------------------------------------------------ chat */

.chat-launch {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom) + var(--chat-lift, 0px)); z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 7px 20px 7px 7px;
  border-radius: 999px; border: 0; cursor: pointer;
  background: var(--ink); color: #F4F5F1; font: 600 15px/1 var(--font-text);
  box-shadow: 0 14px 34px -10px rgba(11, 16, 32, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.chat-launch:hover { transform: translateY(-2px); }
.chat-covered .chat-launch { visibility: hidden; }
.chat-launch picture, .chat-avatar picture { display: block; }
.chat-launch img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }
.chat-launch .ping { position: absolute; left: 39px; top: 7px; width: 13px; height: 13px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); }
.chat-open .chat-launch { opacity: 0; pointer-events: none; transform: scale(0.9); }

.chat-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom) + var(--chat-lift, 0px)); z-index: 61;
  width: min(390px, calc(100vw - 32px)); height: min(620px, calc(100dvh - 40px - var(--chat-lift, 0px)));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--paper); color: var(--text); border-radius: 24px;
  box-shadow: 0 40px 90px -24px rgba(11, 16, 32, 0.55), 0 0 0 1px var(--line);
  animation: pop 0.22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(0.97); } }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--ink); color: #fff; }
.chat-avatar { position: relative; flex: none; }
.chat-avatar img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; display: block; }
.chat-avatar::after { content: ''; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); }
.chat-title { font: 700 16px/1.2 var(--font-display); margin: 0; }
.chat-sub { font-size: 12.5px; line-height: 1.3; color: var(--on-dark-muted); margin: 2px 0 0; }
.chat-x { margin-left: auto; width: 40px; height: 40px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.08); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 22px; line-height: 1; }
.chat-x:hover { background: rgba(255, 255, 255, 0.16); }
.chat-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--tint); overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; animation: rise 0.2s ease; margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg-bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg-me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg-me { background: var(--accent); color: var(--accent-ink); } }
:root[data-theme="dark"] .msg-me { background: var(--accent); color: var(--accent-ink); }
.msg a { color: var(--link); }
.msg-me a { color: inherit; }
.msg-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--soft); animation: blink 1.2s infinite ease-in-out; }
.msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 16px 12px; background: var(--tint); }
.chat-chips:empty { display: none; }
.chat-chip {
  font: 500 14px/1.2 var(--font-text); padding: 9px 13px; min-height: 38px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--accent); background: var(--paper); color: var(--text);
  transition: background-color 0.15s, color 0.15s;
}
.chat-chip:hover { background: var(--accent); color: var(--accent-ink); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px; border-top: 1px solid var(--line); background: var(--paper); }
.chat-form[hidden] { display: none !important; }
.chat-input { flex: 1; min-width: 0; resize: none; min-height: 46px; max-height: 140px; padding: 12px 14px; border-radius: 16px !important; line-height: 1.4; }
.chat-send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.chat-send:disabled { opacity: 0.5; cursor: default; }
.chat-send .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.chat-foot { font-size: 11.5px; line-height: 1.4; color: var(--soft); padding: 0 16px 12px; margin: 0; background: var(--paper); }
.chat-foot a { color: inherit; }
.chat-check { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 2px 4px; }
.chat-check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }


/* ------------------------------------------------------------ responsive */

@media (max-width: 1180px) {
  .cards-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .beyond, .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* No room in the margin: the contents go above the text. */
  .post-layout { grid-template-columns: minmax(0, var(--article)); justify-content: center; }
  .post-body { grid-column: 1; }
  .toc { grid-column: 1; grid-row: auto; justify-self: stretch; width: auto; position: static; margin-bottom: 36px; padding: 20px 22px; background: var(--tint); border-radius: var(--radius-sm); }
  .toc ol { border-left: 0; }
  .toc a { padding-left: 0; border-left: 0; }
}

@media (max-width: 960px) {
  :root { --head-h: 66px; }
  .nav { display: none; }
  .menu { display: block; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art .ev, .hero-art .sn { margin: 8px auto 0; max-width: 560px; }
  .about-grid, .contact-grid, .two-col, .compare, .nl-panel, .story-grid { grid-template-columns: minmax(0, 1fr); }
  .about-portrait { width: min(100%, 380px); order: -1; }
  .story-art { justify-self: start; }
  .now-lanes { grid-template-columns: minmax(0, 1fr); }
  .work-grid { gap: 20px; }
  .work-body { padding: 22px 22px 20px; }
  .projects-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .three-col { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .timeline, .timeline-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-row { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 16px 28px; }
  .with-side .page-head-grid { grid-template-columns: minmax(0, 1fr) clamp(160px, 28vw, 260px); gap: 24px; }
  .page-head-side { width: 100%; }
  .portrait-cut, .portrait-sm { width: 100%; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 640px) {
  :root { --gutter: 18px; }
  body { font-size: 17px; }
  .brand { font-size: 20px; gap: 10px; }
  .mark { width: 26px; height: 28px; }
  .head-cta { display: none; }
  .head-right { gap: 10px; }
  .hero { padding-top: 40px; }
  .hero-cta { gap: 8px 22px; }
  .projects-2, .projects-3, .post-grid, .cards-3, .cards-4, .skills, .field-row, .away, .work-grid { grid-template-columns: minmax(0, 1fr); }
  .numbers { gap: 20px 16px; }
  .beyond { grid-template-columns: minmax(0, 1fr); }
  .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .timeline-detail { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .tl-what { font-size: 1.08rem; }
  .tl-where { font-size: 14.5px; }
  /* Rows of cards on the home page swipe sideways on a phone, the next card
     showing at the edge, instead of stacking a screen per card. */
  .swipe {
    display: grid !important; grid-auto-flow: column; grid-template-columns: none !important; grid-auto-columns: 86%;
    gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    margin-inline: calc(-1 * var(--gutter)); padding: 4px var(--gutter) 16px; scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
  }
  .swipe::-webkit-scrollbar { display: none; }
  /* The project filters: one row a thumb swipes along, not four rows ahead of the first project.
     It runs to the screen's edge, so the chip cut off there says there are more. */
  .filters {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding: 2px var(--gutter) 4px; scroll-padding-inline: var(--gutter); margin-bottom: 28px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filters .chip-btn { flex: none; white-space: nowrap; }
  .swipe > * { scroll-snap-align: start; }
  .swipe .post-row { padding-block: 0; border-bottom: 0; align-content: start; }
  .swipe .post-card h3 { font-size: 1.3rem; }
  .post-row { grid-template-columns: minmax(0, 1fr); padding-block: 28px; }
  .post-row .cover { order: 0; }
  .with-side .page-head-grid { grid-template-columns: minmax(0, 1fr); }
  .page-head-side { justify-self: start; width: min(260px, 70vw); order: -1; }
  .about-portrait { width: min(100%, 320px); }
  .nl-row { flex-direction: column; align-items: stretch; }
  .nl-row .btn { width: 100%; }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav-next { text-align: left; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
  .bars li { grid-template-columns: 104px minmax(0, 1fr) 36px; font-size: 14.5px; }
  .policy li { grid-template-columns: 40px minmax(0, 1fr); }
  .site-foot { padding-bottom: 104px; }
  .ticker-list li { padding: 14px 22px; }
  /* On a phone the launcher is the portrait alone, so it covers less of the page. */
  .chat-launch { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom) + var(--chat-lift, 0px)); padding: 5px; }
  .chat-launch img { width: 50px; height: 50px; }
  .chat-launch .ping { left: 42px; top: 5px; }
  .chat-launch .chat-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .chat-panel { inset: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; right: 0; bottom: 0; }
  .chat-yield .chat-launch, .chat-away .chat-launch { opacity: 0; pointer-events: none; transform: translateY(16px); }
}

/* Touch screens: 44px targets for everything a thumb aims at. */
@media (pointer: coarse) {
  .chip-btn, .btn-sm, .bio-tabs [role="tab"] { min-height: 44px; }
  .theme-toggle, .motion-toggle { width: 44px; height: 44px; }
  .tags a { padding: 11px 14px; }
}

/* Every animation on the site loops by itself (the founder asked for that),
   and every one of them stops, on its finished frame, for a reader who has
   asked their system for less motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ticker-track { animation: none; }
  .ticker { overflow-x: auto; }
  .ticker-list[aria-hidden="true"] { display: none; }
  .live { animation: none; }
  .pt *, .ev *, .sn * { animation: none !important; }
  .pt-search .pt-glass { opacity: 1; }
  .motion-toggle { display: none !important; }
}

@media (forced-colors: active) {
  .btn, .chat-launch, .chip-btn { border: 1px solid ButtonText; }
  .cover-text { forced-color-adjust: none; }
}

/* On paper (the About page's "Save as a PDF" is a CV): the name and contact
   first, the screen's furniture gone, everything tighter, and no entry broken
   across a page. */
.print-only { display: none; }
@media print {
  @page { margin: 12mm 14mm 13mm; }
  body { font-size: 10.5pt; line-height: 1.5; }
  .print-only { display: block; }
  .print-card { padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid #000; }
  .print-card p { margin: 0; font-size: 10pt; }
  .print-name { font-weight: 700; font-size: 20pt !important; letter-spacing: -0.03em; }
  .bio .bio-panel[hidden] { display: block !important; }
  .skip, .bio-tabs, .head-actions, .jump, .read-progress, .theme-toggle, .to-top, [data-copy], .story-art, #bio, .site-foot, .motion-toggle { display: none !important; }
  .site-head, .chat-launch, .chat-panel, .ticker, .filters, .band-panel, .contact-form, .post-share, .post-reply, .hero-art, .page-head-side, .about-portrait { display: none !important; }
  body, .band, .hero, .page-head, .ink-panel, .site-foot { background: #fff !important; color: #000 !important; }
  .lede, .hero-lede, .muted { color: #333 !important; }
  .page-head { padding: 10px 0 6px !important; }
  .page-head h1 { font-size: 20pt; margin-bottom: 6px; }
  .lede { font-size: 10.5pt; }
  .band { padding-block: 6px !important; }
  .band + .band > .wrap::before { display: none; }
  .h-small { font-size: 11pt; margin-bottom: 4px; }
  h2 { font-size: 14pt; margin-bottom: 6px; }
  h3 { font-size: 11pt; }
  .sec-head { margin-bottom: 8px; }
  .sec-head .muted { font-size: 9.5pt; }
  .ink-panel { padding: 0 !important; }
  .ink-panel h2 { font-size: 12pt; }
  .ink-panel .label { color: #07744F !important; }
  .numbers { margin-top: 8px; gap: 6px 16px; grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .numbers li { padding-top: 6px; border-top-width: 1px; }
  .num-figure { font-size: 16pt; }
  .num-text { font-size: 9pt; }
  .num-where, .tl-when, .label { font-size: 8pt; }
  .story-grid { display: block; }
  .prose { font-size: 10pt; line-height: 1.5; }
  .prose p { margin-bottom: 0.6em; }
  .prose h2 { margin-top: 0; }
  .timeline, .timeline-detail { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 20px; }
  .timeline li { padding-top: 6px; }
  .tl-what { font-size: 11pt; }
  .tl-where, .tl-detail { font-size: 9pt; }
  .tl-detail { margin-top: 2px; }
  .beyond { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px 20px; }
  .beyond > li { background: none !important; color: #000 !important; padding: 0 !important; border-radius: 0; gap: 2px; }
  .beyond h3, .beyond-figure, .beyond-figure span, .beyond p:not(.beyond-figure) { color: #000 !important; }
  .beyond-figure { font-size: 14pt; margin: 0; }
  .beyond p:not(.beyond-figure) { font-size: 9pt; }
  .beyond-tags { padding-top: 2px; }
  .beyond-tags li { background: none !important; color: #000 !important; padding: 0 10px 0 0; font-size: 9pt; }
  .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 20px; }
  .stack { gap: 6px; }
  .stack li { background: none; border: 0; padding: 0; }
  .stack h3, .beyond h3 { font-size: 10.5pt; margin: 0; }
  /* Who gave the award: the text face, so 'Manufacturing IT, Maxim Integrated (Now Analog Devices)' is one line, not two. */
  .stack .muted { font: 8.5pt/1.35 var(--font-text); margin: 0 0 2px; }
  .stack p:last-child { font-size: 9pt; }
  .skills { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 10px; }
  .tags { gap: 2px 8px; }
  .tags > li:not(:has(a)), .tags a { background: none !important; padding: 0 !important; font-size: 8.5pt; }
  .skills .tags > li:not(:last-child)::after { content: ','; }
  .three-col { gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .plain { gap: 3px; font-size: 9pt; }
  .timeline li, .numbers li, .beyond > li, .stack li, .policy li, .skill-group, .plain li, .three-col > *, .card, .project, .post-card, .work-card { break-inside: avoid; }
  h2, h3, .sec-head { break-after: avoid; }
  a { color: #000; text-decoration: none; }
}

/* ======================================================= the writing desk */
/* /admin/ — worker/admin.js serves it, js/desk.js draws it. Private, so it is
   plainer than the site: the work is the writing. */

.desk-page { background: var(--tint); min-height: 100vh; }
.desk-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--ink); }
.desk-gate-card { width: min(440px, 100%); background: var(--paper); color: var(--text); border-radius: 22px; padding: 32px 30px; box-shadow: var(--shadow-lg); }
.desk-gate-card h1 { font-size: 2rem; letter-spacing: -0.03em; margin: 14px 0 18px; }
.desk-brand { color: var(--text); font-size: 15px; }
.desk-signin { display: grid; gap: 12px; }
.desk-signin label { font-weight: 600; font-size: 14.5px; }
.desk-note { background: var(--tint); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.desk-fine { font-size: 13.5px; color: var(--soft); margin: 4px 0 0; }

.desk-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 58px; padding-inline: 20px; background: var(--ink); color: #fff; border-bottom: 1px solid var(--ink-line); }
.desk-logo { color: #fff; text-decoration: none; font: 700 17px/1 var(--font-display); display: inline-flex; gap: 10px; align-items: center; }
/* The kit's mark; the desk's bar is always ink, so its dot is always mint. */
.desk-logo .mark { width: 26px; height: 28px; }
.desk-logo .mark-dot { fill: var(--mint); }
.desk-brand .mark { width: 22px; height: 24px; }
.desk-head-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.desk-head-nav a, .desk-link { color: #c9d1e6; text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; padding: 8px 0; }
.desk-head-nav a:hover, .desk-link:hover { color: #fff; }
.desk-who { color: var(--on-dark-muted); font-family: var(--font-mono); font-size: 12.5px; }
.desk-head-nav form { margin: 0; }

.desk-main { padding-block: 40px 80px; }
.desk-loading { color: var(--soft); }
.desk-top { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.desk-top h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.035em; margin: 0; }
.desk-banner { background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 14px 18px; margin-bottom: 14px; font-size: 15px; }
.desk-banner.error { border-left-color: #dc2626; }
.desk-section { margin-top: 34px; }
.desk-section h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 0 0 14px; }
.desk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.desk-item, .desk-pub { display: grid; gap: 4px; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; color: var(--text); text-decoration: none; }
a.desk-item:hover { border-color: var(--accent); }
.desk-pub { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.desk-pub .desk-item-meta { grid-column: 1; }
.desk-item-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 6px; align-items: center; }
.desk-item-title { font: 700 1.1rem/1.3 var(--font-display); }
.desk-item-meta { font: 500 12.5px/1.4 var(--font-mono); color: var(--soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { font: 600 11px/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 8px; border-radius: 999px; background: var(--tint); color: var(--muted); }
.pill-warn { background: #fff4e5; color: #9a4a00; }
.pill-live { background: #e6f9f1; color: #05734a; }
.desk-empty { color: var(--soft); }
.desk-help ul { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 6px; }

.desk-bar { position: sticky; top: 58px; z-index: 15; display: flex; align-items: center; gap: 10px; height: 57px; padding: 0 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.desk-bar .btn { min-height: 40px; padding-block: 8px; }
.desk-saved { font: 500 12.5px/1 var(--font-mono); color: var(--soft); }
.desk-bar-space { flex: 1; }
.desk-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100vh - 115px); }
.desk-write { padding: 28px clamp(18px, 3vw, 40px) 80px; background: var(--paper); border-right: 1px solid var(--line); }
/* The preview stays in view beside a long post and scrolls on its own. */
.desk-preview { position: sticky; top: 115px; height: calc(100vh - 115px); padding: 28px clamp(18px, 3vw, 44px) 80px; overflow: auto; overscroll-behavior: contain; }
.desk-preview article { max-width: var(--measure); }
.desk-title, .desk-desc, .desk-text { display: block; width: 100%; min-height: 0; border: 0 !important; background: transparent; resize: none; padding: 0; color: var(--text); overflow: hidden; }
.desk-title:focus-visible, .desk-desc:focus-visible, .desk-text:focus-visible { outline: none; }
.desk-title { font: 700 clamp(1.8rem, 3vw, 2.5rem)/1.12 var(--font-display) !important; letter-spacing: -0.03em; margin-bottom: 10px; }
.desk-desc { font: 400 1.08rem/1.5 var(--font-text) !important; color: var(--muted); }
.desk-count-line { font: 500 12px/1 var(--font-mono); color: var(--soft); margin: 6px 0 16px; }
.desk-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 14px; background: var(--tint); border: 1px solid var(--line); border-radius: 14px; }
.desk-meta label { display: grid; gap: 5px; font: 600 12px/1.2 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--soft); }
.desk-meta input { font: 400 15px/1.3 var(--font-text); padding: 9px 11px; text-transform: none; letter-spacing: 0; }
.desk-meta input:disabled { opacity: 0.65; cursor: not-allowed; }
.desk-slug-row { display: flex; align-items: center; gap: 4px; font: 500 14px var(--font-mono); text-transform: none; letter-spacing: 0; color: var(--muted); }
.desk-slug-row input { min-width: 0; font-family: var(--font-mono); font-size: 14px; }
.desk-wide { grid-column: 1 / -1; }
.desk-tags { grid-column: span 2; }
.desk-tools { position: sticky; top: 123px; z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; margin: 18px 0 12px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.desk-tools button { font: 600 13px/1 var(--font-text); min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }
.desk-tools button:hover { background: var(--tint); }
.desk-text { font: 400 1.06rem/1.8 var(--font-text) !important; min-height: 50vh; }
.desk-p-title { font-size: clamp(1.9rem, 3.4vw, 2.8rem); letter-spacing: -0.04em; line-height: 1.05; margin: 8px 0 10px; }
.desk-p-meta { margin-bottom: 26px; }

.desk-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 20px; padding: 26px 26px 20px; background: var(--paper); color: var(--text); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); }
.desk-dialog::backdrop { background: rgba(7, 11, 23, 0.55); }
.desk-dialog h2 { font-size: 1.4rem; margin: 0 0 12px; }
.desk-dialog pre { background: var(--ink); color: #e9edf8; padding: 12px 14px; border-radius: 10px; font: 13px/1.5 var(--font-mono); overflow-x: auto; }
.desk-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.desk-problems { color: #b91c1c; padding-left: 20px; }
.desk-progress { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.desk-progress.done .live { animation: none; }
.desk-menu { display: grid; justify-items: start; gap: 2px; }
.danger { color: #b91c1c !important; }
.desk-toast { position: fixed; left: 50%; bottom: 20px; z-index: 30; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14.5px; box-shadow: var(--shadow-lg); transition: transform 0.2s ease, visibility 0s linear 0.2s; margin: 0; }
.desk-toast.show { transform: translate(-50%, 0); visibility: visible; transition: transform 0.2s ease; }
.desk-toast.error { background: #7f1d1d; }
.desk-only-small { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .desk-problems, :root:not([data-theme="light"]) .danger { color: #ff8a8a !important; }
  :root:not([data-theme="light"]) .pill-warn { background: rgba(255, 170, 60, 0.16); color: #ffc27a; }
  :root:not([data-theme="light"]) .pill-live { background: rgba(40, 200, 140, 0.16); color: #6ee7b7; }
}
:root[data-theme="dark"] .desk-problems, :root[data-theme="dark"] .danger { color: #ff8a8a !important; }
:root[data-theme="dark"] .pill-warn { background: rgba(255, 170, 60, 0.16); color: #ffc27a; }
:root[data-theme="dark"] .pill-live { background: rgba(40, 200, 140, 0.16); color: #6ee7b7; }

@media (max-width: 1000px) {
  .desk-panes { grid-template-columns: minmax(0, 1fr); }
  .desk-preview { display: none; position: static; height: auto; }
  .desk-edit.show-preview .desk-preview { display: block; }
  .desk-edit.show-preview .desk-write { display: none; }
  .desk-only-small { display: inline-flex; }
  .desk-who { display: none; }
}
@media (max-width: 560px) {
  /* With the keyboard up a phone has little height: only the editing bar stays put. */
  .desk-head { position: static; }
  .desk-bar { top: 0; gap: 2px; padding: 0 8px; }
  .desk-bar .btn { padding-inline: 8px; }
  .desk-saved { white-space: nowrap; }
  .desk-long { display: none; }
  .desk-tools { position: static; flex-wrap: nowrap; overflow-x: auto; }
  .desk-tools button { flex: none; }
  .desk-meta { grid-template-columns: minmax(0, 1fr); }
  .desk-tags { grid-column: auto; }
  .desk-pub { grid-template-columns: minmax(0, 1fr); }
  .desk-item-actions { grid-row: auto; grid-column: 1; }
}
