/* ==========================================================================
   aaronkinder — site stylesheet
   Design tokens, base, layout primitives, components, page modules.
   Tokens (sections 1 and 1b) are in the theme's tokens.css, which loads before this file.
   ========================================================================== */

/* 2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--ink-3); }
a:active { opacity: .6; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-size: 14px; }
.skip-link:focus { top: 12px; color: var(--bg); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}

/* 3. Typography helpers
   -------------------------------------------------------------------------- */
.serif { font-family: var(--serif); font-weight: 400; }
.eyebrow { font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { color: var(--muted); }
.eyebrow a:hover { color: var(--ink); }
.lede { font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; text-wrap: pretty; }
.meta { font-size: 15px; color: var(--muted); }
.muted { color: var(--muted); }
.body-text { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.page-title { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; letter-spacing: 0; text-wrap: balance; }
.section-title { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
.sub-title { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; }

/* 4. Layout
   -------------------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: max(clamp(20px, 4vw, 32px), env(safe-area-inset-right)); }
main { padding-top: 64px; flex: 1 0 auto; }
.site-footer { margin-top: auto; }
.hero { padding: 40px 0 24px; }
.hero .meta { margin-top: 10px; max-width: 60ch; }
.hero .lede { margin-top: 10px; }
.hero .page-title { margin-top: 10px; }
.hero .page-title:first-child { margin-top: 0; }
.section { border-top: 1px solid var(--rule-strong); padding: 20px 0 28px; scroll-margin-top: 72px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px; }
.section-intro { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--muted); max-width: 80ch; }
.section--last { padding-bottom: 56px; }
.cols { margin-top: 12px; columns: 2; column-gap: var(--col-gap); }
.cols > * { break-inside: avoid; }
.cols p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; }
.cols p:last-child { margin-bottom: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: var(--col-gap); row-gap: 12px; }
.split > div { display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; row-gap: 12px; }
.split h2, .split h3 { align-self: end; }
.section > .split:first-child { margin-top: 0; }
.section .section-head + .split, .section .section-intro + .split { margin-top: 12px; }
.split p { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-bottom: 12px; }
.split p:last-child { margin-bottom: 0; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: clamp(16px, 3vw, 32px); }
@media (max-width: 759px) {
  .hero { padding: 32px 0 20px; }
  .cols { columns: 1; }
  .split { grid-template-columns: 1fr; grid-template-rows: auto; }
  .split > div { grid-row: auto; grid-template-rows: auto; }
}

/* 5. Header / navigation
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  padding-top: env(safe-area-inset-top);
  background: var(--header-bg-0);
  border-bottom: 1px solid transparent;
  transition: background .4s ease, border-color .4s ease;
}
.site-header.is-scrolled {
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom-color: var(--rule);
}
.nav-bar { height: 64px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
.nav-links--right { justify-self: end; }
.nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1.5px; text-underline-offset: .35em; }
.res-btn:hover, .res-btn[aria-expanded="true"] { color: var(--ink-3); }
.nav-pill { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 1px solid var(--ink); border-radius: 999px; padding: 8px 16px; line-height: 1.2; transition: background .25s ease, color .25s ease; }
.nav-pill:hover { background: var(--ink); color: var(--bg); }

/* Resources dropdown */
.nav-links--right { position: relative; }
.res { display: flex; align-items: center; align-self: stretch; }
.res-btn { font: inherit; font-size: 14px; font-weight: 500; color: var(--ink); background: transparent; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; transition: color .25s ease; }

.res-chev { display: inline-block; font-size: 14px; line-height: 1; transform: translateY(-3px); transition: transform .25s ease; }
.res-btn[aria-expanded="true"] .res-chev { transform: translateY(-3px) rotate(180deg); }
.res-panel { position: absolute; top: calc(100% - 8px); right: 0; max-width: calc(100vw - 40px); background: var(--pop-bg); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--pop-shadow); padding: 16px 24px 18px; display: grid; grid-auto-flow: column; gap: 0 40px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s ease, transform .25s var(--ease-out); z-index: 20; }
.res.is-open .res-panel { opacity: 1; transform: none; pointer-events: auto; }
/* Resources panel hangs from its own button (the Résumé panel stays pinned to the right edge of the nav) */
.res:not(.res--resume) { position: relative; }
.res:not(.res--resume) .res-panel { right: auto; left: -24px; }
.res-group { display: grid; gap: 2px; align-content: start; }
.res-group .res-head { font-size: 15px; font-weight: 400; color: var(--muted); padding: 0 0 6px; white-space: nowrap; display: block; }
.res-group a.res-head { font-size: 13px; }
.res-group a.res-head:hover { color: var(--ink); }
.res-group a:not(.res-head) { display: block; font-size: 15px; font-weight: 400; padding: 6px 10px; margin: 0 -10px; border-radius: 8px; color: var(--ink); white-space: nowrap; transition: background .15s ease; }
.res-group a:not(.res-head):hover { background: var(--rule); color: var(--ink); }

/* Résumé dropdown: the nav pill doubles as the menu button */
.res-btn.nav-pill { border: 1px solid var(--ink); padding: 8px 12px 8px 16px; min-height: 0; gap: 6px; }
.res-btn.nav-pill:hover, .res-btn.nav-pill[aria-expanded="true"] { background: var(--ink); color: var(--bg); }
.res-btn.nav-pill .res-chev { transform: translateY(-2px); }
.res-btn.nav-pill[aria-expanded="true"] .res-chev { transform: translateY(-2px) rotate(180deg); }
.res-panel--resume { grid-auto-flow: row; min-width: 200px; }

.wordmark { font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: -.01em; display: inline-flex; align-items: baseline; white-space: nowrap; line-height: 1; }
.wordmark:hover { color: var(--ink); }
.wordmark span { display: inline-block; }
.wordmark .wm-l { overflow: hidden; vertical-align: baseline; max-width: 1.1em; opacity: 1; transform: none; transition: max-width .55s var(--ease-io) var(--d), opacity .3s ease var(--d), transform .5s var(--ease-io) var(--d); }
.is-scrolled .wordmark .wm-l { max-width: 0; opacity: 0; transform: translateY(-.25em); }

.burger { display: none; margin-left: auto; justify-self: end; grid-column: 3; gap: 6px; place-content: center; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 0; }
.burger span { display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .35s var(--ease-io); }
.burger[aria-expanded="true"] span:first-child { transform: translateY(3.75px) rotate(45deg); }
.burger[aria-expanded="true"] span:last-child { transform: translateY(-3.75px) rotate(-45deg); }

.menu-sheet {
  position: fixed; inset: 0; z-index: 9; background: var(--bg);
  padding: calc(96px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  display: flex; flex-direction: column; gap: 24px; overflow-y: auto; -webkit-overflow-scrolling: touch;
  opacity: 0; transform: translateY(-12px); pointer-events: none;
  transition: opacity .3s ease, transform .4s var(--ease-out);
}
.menu-sheet.is-open { opacity: 1; transform: none; pointer-events: auto; }
.menu-sheet nav { display: grid; gap: 4px; font-family: var(--serif); font-size: clamp(32px, 9vw, 40px); line-height: 1.15; letter-spacing: -.01em; }
.menu-sheet nav a { display: block; padding: 6px 0; }
.menu-sheet nav a[aria-current="page"] { color: var(--accent-ink); }
.menu-sheet .sheet-resources { display: grid; gap: 20px; padding-top: 8px; border-top: 1px solid var(--rule); margin-top: 8px; }
.menu-sheet .sheet-group { display: grid; gap: 2px; }
.menu-sheet .sheet-head { font-size: 13px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding-bottom: 4px; }
.menu-sheet .sheet-head a { color: var(--muted); }
.menu-sheet .sheet-group a:not(.sheet-head a) { display: flex; align-items: center; padding: 8px 0; font-size: 17px; line-height: 1.3; min-height: 44px; }
.menu-sheet .sheet-meta { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--rule); font-size: 15px; color: var(--muted); }
.menu-sheet .sheet-meta a { color: var(--ink); display: flex; align-items: center; min-height: 44px; }
.btn-primary { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); border-radius: 999px; padding: 14px 22px; font-size: 17px; font-weight: 500; width: max-content; min-height: 48px; transition: background .25s ease, color .25s ease; }
.btn-primary:hover { background: var(--accent-ink); color: var(--bg); }
.menu-sheet .btn-primary { margin-top: auto; }
body.menu-open { overflow: hidden; }

@media (max-width: 759px) {
  .nav-bar { display: flex; }
  .nav-links { display: none; }
  .wordmark { margin-right: auto; }
  .burger { display: grid; }
}

/* Link labels ("Case study →", "Read the guide →"): small secondary buttons, Anthropic-style.
   Rest: panel fill, hairline border, ink-2 text. Hover (own or via parent link): fill deepens, text goes ink, arrow nudges. */
.link-label, .work-card .more, .work-row .more, .guide-card .read, .link-more, .rule-list .tag {
  display: inline-flex; align-items: center; gap: 6px; width: max-content;
  padding: 5px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--rule); color: var(--ink-2);
  font-size: 13px; font-weight: 500; line-height: 1.3;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.link-label > span:last-child, .work-card .more > span:last-child, .work-row .more > span:last-child, .guide-card .read > span:last-child, .link-more > span:last-child, .rule-list .tag .arrow { display: inline-block; transition: transform .25s var(--ease-out); }
a:hover .link-label, .work-card .more:hover, .work-row .more:hover, .guide-card:hover .read, .link-more:hover, .rule-list a.tag:hover { background: var(--rule); border-color: var(--panel-2); color: var(--ink); }
a:hover .link-label > span:last-child, .work-card .more:hover > span:last-child, .work-row .more:hover > span:last-child, .guide-card:hover .read > span:last-child, .link-more:hover > span:last-child, .rule-list a.tag:hover .arrow { transform: translateX(3px); }

/* Block links (whole rows / cards): text keeps its color on hover; only the pill button responds */
.work-row:hover, .work-card:hover, .guide-card:hover, .post-row:hover, .guide-feature:hover { color: inherit; }

/* Guides */
.guide-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--panel); border-radius: 16px; overflow: hidden; color: inherit; margin-bottom: 40px; }
.guide-feature:hover { background: var(--panel-2); }
.guide-feature { transition: background .25s ease; }
.guide-feature .text { display: grid; gap: 12px; align-content: center; padding: clamp(20px, 3vw, 32px); }
.guide-feature .kicker { font-size: 13px; font-weight: 500; color: var(--accent-ink); }
.guide-feature h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 3vw, 36px); line-height: 1.15; text-wrap: balance; }
.guide-feature .text > p:not(.kicker):not(.meta) { font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 50ch; }
.guide-feature .meta { font-size: 13px; }
.guide-feature img { display: block; width: 100%; height: 100%; object-fit: cover; }
.guides-body { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.guide-topics { position: sticky; top: 80px; }
.guide-topics .eyebrow { padding-bottom: 8px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 clamp(24px, 3vw, 40px); padding-bottom: 64px; min-width: 0; }
.guide-grid > li[hidden] { display: none; }
.guide-card { display: grid; gap: 10px; align-content: start; height: 100%; padding: 20px 0 24px; border-top: 1px solid var(--rule-strong); color: inherit; box-sizing: border-box; }
.guide-card .meta-row { font-size: 13px; color: var(--muted); display: flex; gap: 10px; }
.guide-card h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; text-wrap: balance; }
.guide-card > p:not(.meta-row):not(.read) { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.guide-card .read { margin-top: auto; }
@media (max-width: 759px) {
  .guide-feature { grid-template-columns: minmax(0, 1fr); }
  .guides-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .guide-topics { position: static; }
}

/* Guide article */
.guide-hero { padding: 28px 0 18px; }
.guide-hero h1 { font-size: clamp(28px, 3vw, 36px); max-width: 26ch; }
.guide-hero .lede { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-top: 8px; }
.guide-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.guide-facts > div { display: flex; gap: 6px; }
.guide-facts dt { font-weight: 600; color: var(--ink); }
.guide-facts dd { margin: 0; }
.guide-layout { padding-top: 16px; }
.guide-prose { max-width: 72ch; min-width: 0; padding-bottom: 48px; }
.guide-prose h2 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.2; border-top: 1px solid var(--rule-strong); padding-top: 12px; margin-top: 24px; scroll-margin-top: 80px; }
.guide-prose h2.first { border-top: 0; padding-top: 0; margin-top: 0; }
.guide-prose p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-top: 8px; }
.guide-prose strong { font-weight: 600; color: var(--ink); }
.guide-prose .bullets { display: grid; gap: 6px; margin-top: 12px; padding-left: 18px; list-style: disc; font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.guide-prose .bullets--loose { gap: 8px; }
.guide-prose code { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; background: var(--panel); padding: 1px 5px; border-radius: 4px; }
.guide-prose .steps { display: grid; margin-top: 12px; border-bottom: 1px solid var(--rule); }
.guide-prose .steps > li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; padding: 12px 0; border-top: 1px solid var(--rule); }
.guide-prose .steps .n { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 24px; line-height: 1; color: var(--muted); padding-top: 2px; }
.guide-prose .steps > li > div { min-width: 0; }
.guide-prose .steps h3 { font-family: var(--serif); font-weight: 400; font-size: 21px; line-height: 1.25; }
.guide-prose .note { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); padding: 8px 0; margin-top: 10px; font-size: 14px; line-height: 1.5; }
.guide-prose .note strong { margin-right: 4px; }
.code { position: relative; background: var(--panel); border-radius: 10px; margin: 10px 0 0; }
.code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 0 14px; }
.code-head span { font-size: 12px; font-weight: 500; color: var(--muted); }
.code-head button { font: inherit; font-size: 12px; font-weight: 500; color: var(--muted); background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 3px 10px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.code-head button:hover { color: var(--ink); border-color: var(--ink); }
.code pre { margin: 0; padding: 4px 14px 12px; overflow-x: auto; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.code pre code { font-size: inherit; background: transparent; padding: 0; }
.output { border: 1px solid var(--rule); border-radius: 12px; margin-top: 10px; }
.output p { font-size: 12px; font-weight: 500; color: var(--muted); padding: 8px 16px 0; margin: 0; }
.output pre { margin: 0; padding: 6px 16px 14px; overflow-x: auto; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
/* Links written inside running text (blog posts, guides) get the same treatment without needing a class. */
.inline-link, .prose p a, .guide-prose p a, .guide-prose li p a, .guide-prose .bullets a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .12em; }
.inline-link:hover, .prose p a:hover, .guide-prose p a:hover, .guide-prose .bullets a:hover { color: var(--ink-3); }
.guide-pager { border-top: 1px solid var(--rule-strong); margin-top: 28px; padding-top: 10px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.guide-pager a { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; min-height: 44px; }
.guide-pager .next { text-align: right; }
.guide-pager .dir { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide-pager .t { font-family: var(--serif); font-size: 20px; line-height: 1.2; }
@media (max-width: 759px) {
  .guide-hero { padding: 24px 0 16px; }
  .guide-layout { padding-top: 12px; }
}

/* 6. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--foot-bg); color: var(--foot-ink); border-top: 1px solid var(--foot-rule); padding: 40px max(clamp(20px, 4vw, 32px), env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) var(--gutter); }
.site-footer a:hover { color: var(--foot-ink); }
/* Guides that are not written yet render as plain blocks, not links (build.py: href "#"). */
.guide-card--soon:hover .read { background: var(--panel); border-color: var(--rule); color: var(--ink-3); }
.guide-card--soon .read { color: var(--ink-3); }
.guide-feature--soon:hover { background: var(--panel); }
.foot { max-width: calc(var(--max) - 64px); /* --max less the 32px side padding, so the footer lines up with .wrap */ margin: 0 auto; display: grid; grid-template-columns: 220px minmax(0, 1fr) 280px; gap: clamp(40px, 6vw, 96px); min-height: 300px; }
.foot-brand { display: flex; flex-direction: column; gap: 40px; }
.foot-brand .brand { font-size: 15px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.foot-brand .legal { margin-top: auto; display: grid; gap: 6px; }
.foot-brand .legal p { font-size: 12px; color: var(--muted-2); }
.foot-social { display: flex; gap: 4px; margin-left: -12px; }
.foot-social a { color: var(--muted-2); display: grid; place-items: center; width: 44px; height: 44px; }
.foot-nav { display: grid; align-content: start; border-top: 1px solid var(--rule-dark); }
.foot-nav a { color: var(--muted-2); display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule-dark); font-size: 14px; }
.foot-nav a span:last-child { font-size: 13px; }
.foot-nav:hover a { color: #8f8d86; }
.foot-nav a:hover { color: var(--foot-ink); }
.foot-aside { display: grid; gap: 28px; align-content: start; }
.foot-aside h2 { font-size: 14px; font-weight: 400; margin-bottom: 6px; font-family: var(--sans); }
.foot-aside p { font-size: 13px; color: var(--muted-2); line-height: 1.5; }
.foot-aside ul { display: grid; font-size: 13px; }
.foot-aside ul a { color: var(--muted-2); display: block; padding: 5px 0; }

/* Appearance: "paper and ink". One button with two swatches in the page colors, beside the LinkedIn icon
   in the footer and at the bottom of the mobile menu. The swatch on top is the current theme; side by side
   means "match the device". Positions and the caption follow data-theme-choice on <html>, which the inline
   head script sets, so the control stays hidden when JavaScript is off (it could not do anything). */
[data-theme-switch] { display: none; }
[data-theme-choice] [data-theme-switch] { display: inline-flex; align-items: center; gap: 4px; }
.swatches { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 6px; }
.sw { position: absolute; width: 19px; height: 19px; border-radius: 3px; border: 1px solid var(--sw-edge); transition: left .35s var(--ease-out), top .35s var(--ease-out); }
.sw-paper { background: #faf9f5; }
.sw-ink { background: #141413; }
/* auto: side by side */
.sw-paper { left: 6px; top: 13px; z-index: 1; }
.sw-ink { left: 19px; top: 13px; z-index: 2; }
[data-theme-choice="dark"] .sw-paper { left: 7px; top: 7px; z-index: 1; }
[data-theme-choice="dark"] .sw-ink { left: 18px; top: 18px; z-index: 2; }
[data-theme-choice="light"] .sw-ink { left: 7px; top: 7px; z-index: 1; }
[data-theme-choice="light"] .sw-paper { left: 18px; top: 18px; z-index: 2; }
.sw-cap { font-size: 12px; color: var(--sw-cap); white-space: nowrap; opacity: 0; transition: opacity .25s ease; }
.sw-cap::after { content: "Matches your device"; }
[data-theme-choice="dark"] .sw-cap::after { content: "Ink"; }
[data-theme-choice="light"] .sw-cap::after { content: "Paper"; }
.theme-sw:hover .sw-cap, .theme-sw:focus-within .sw-cap, .menu-sheet .sw-cap { opacity: 1; }
@media (hover: none) { .sw-cap { opacity: 1; } }
.site-footer .theme-sw { --sw-edge: #87867f; --sw-cap: var(--muted-2); }
.menu-sheet .theme-sw { --sw-edge: var(--muted); --sw-cap: var(--muted); margin-left: -6px; }
.menu-sheet .sw-cap { font-size: 15px; }
@media (max-width: 759px) {
  .foot { grid-template-columns: minmax(0, 1fr); gap: 48px; min-height: 0; }
  .foot-brand { order: 3; }
}

/* 7. Components
   -------------------------------------------------------------------------- */
/* Jump navigation under a hero */
.jump-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding: 4px 0; border-top: 1px solid var(--rule); }
.jump-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: 14px; font-weight: 500; color: var(--muted); }
.jump-nav a:hover { color: var(--ink); }
.jump-nav .sep { color: var(--rule); }

/* Stats row */
.stats { border-top: 1px solid var(--rule-strong); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0 var(--col-gap); }
.stats > div { padding: 20px 0; }
.stats .num { font-family: var(--serif); font-weight: 400; font-size: clamp(40px, 4.4vw, 56px); line-height: .95; color: var(--ink); }
.resolution-stat { container-type: inline-size; }
.stats .resolution-stat .num { font-size: min(clamp(40px, 4.4vw, 56px), 15cqi); white-space: nowrap; }
.stats .label { margin-top: 8px; color: var(--muted); font-size: 14px; }
.stats--inline { border-top: 1px solid var(--rule-strong); border-bottom: 1px solid var(--rule); grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 0 24px; margin: 4px 0; }
.stats--inline > div { padding: 12px 0; }
.stats--inline .num { font-size: 32px; line-height: 1; }
.stats--inline .label { font-size: 13px; margin-top: 4px; }

/* Rule-list: list items separated by hairlines */
.rule-list { margin-top: 14px; }
.rule-list > li { border-top: 1px solid var(--rule); padding: 10px 0; font-size: 16px; line-height: 1.5; color: var(--ink); }
.rule-list > li.lead { font-size: 17px; color: var(--ink); }
/* Only the pill is the link; the bullet text stays plain, selectable text. ::after widens the tap target to 44px. */
.rule-list > li.has-link { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rule-list .tag { flex: none; white-space: nowrap; margin-top: 1px; position: relative; }
.rule-list a.tag::after { content: ""; position: absolute; inset: -8px -6px; }
ol.rule-list > li { font-family: var(--serif); font-size: 19px; line-height: 1.25; color: var(--ink); }
.rule-list--cols { columns: 2; column-gap: var(--col-gap); }
.rule-list--cols > li { break-inside: avoid; }
@media (max-width: 999px) { .rule-list--cols { columns: 1; } }

/* Decision cards (h3 + p) inside .cols */
.decision { border-top: 1px solid var(--rule); padding: 10px 0 14px; }
.decision p { margin-top: 6px; margin-bottom: 0; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 500; }
.chips li { border: 1px solid var(--rule); border-radius: 999px; padding: 5px 12px; }

/* Figures */
figure { display: grid; gap: 8px; align-content: start; }
figure img { width: 100%; border-radius: 12px; background: var(--panel); }
figure.framed img { padding: clamp(10px, 1.5vw, 16px); }
figcaption { font-size: 13px; color: var(--muted); }
/* Dark theme only (both tokens are no-ops in light): dim images a little, restore on hover, and give them an edge. */
figure img, .work-card img, .work-row img, .guide-feature img { filter: var(--img-filter); outline: 1px solid var(--img-edge); outline-offset: -1px; transition: filter .25s ease; }
figure:hover img, .work-card:hover img, .work-row:hover img, .guide-feature:hover img { filter: none; }
img[src^="https://placehold.co"], figure:hover img[src^="https://placehold.co"], .work-row:hover img[src^="https://placehold.co"], .work-card:hover img[src^="https://placehold.co"], .guide-feature:hover img[src^="https://placehold.co"] { filter: var(--ph-filter); }
.figure-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: clamp(16px, 3vw, 32px); margin-top: 20px; }
.figure-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.figure-single { margin-top: 20px; }

/* Prev / next */
.pager { border-top: 1px solid var(--rule-strong); padding: 12px 0 56px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; min-height: 44px; }
.pager a.next { text-align: right; margin-left: auto; }
.pager .dir { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pager .title { font-family: var(--serif); font-size: 20px; line-height: 1.2; }

/* Filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); }
.filters button { font-size: 13px; font-weight: 500; cursor: pointer; border-radius: 999px; padding: 0 14px; min-height: 36px; border: 1px solid var(--rule); background: transparent; color: var(--ink); transition: background .2s ease, border-color .2s ease, color .2s ease; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* Callout / quote */
.quote { margin: 8px 0; padding: 4px 0 4px 20px; border-left: 1px solid var(--ink); font-family: var(--serif); font-size: 24px; line-height: 1.3; color: var(--ink); text-wrap: balance; }
.quote cite { display: block; margin-top: 10px; font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--muted); }

/* Flow steps (process) */
.flow { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 0 var(--col-gap); }
.flow li { border-top: 1px solid var(--rule); padding: 10px 0 14px; }
.flow .step { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.flow h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; margin-top: 4px; }
.flow p { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 4px; }

/* Two-column feature blocks */
.feature-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 var(--col-gap); }
.feature-grid > div { border-top: 1px solid var(--rule); padding: 12px 0 16px; }
.feature-grid h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; }
.feature-grid p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-top: 6px; }
.feature-grid ul { margin-top: 8px; display: grid; gap: 4px; font-size: 15px; color: var(--ink-2); }
.feature-grid ul li::before { content: "–"; color: var(--muted); margin-right: 8px; }

/* 8. Page: Home
   -------------------------------------------------------------------------- */
/* Headline across the full width, then the intro on the left with the facts beside it (same idea as .hero--case),
   so there is no empty area above the facts. */
.home-hero { padding: 56px 0 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 0 clamp(32px, 6vw, 96px); align-items: baseline; }
.home-hero > .eyebrow, .home-hero > h1 { grid-column: 1 / -1; }
.home-hero h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.06; letter-spacing: -.005em; text-wrap: pretty; }   /* no max-width and no balance: the lines run to the right edge */
.home-hero .lede { margin-top: 18px; font-size: 17px; max-width: 58ch; }
.home-hero .actions { display: flex; flex-wrap: wrap; gap: 10px 14px; margin-top: 24px; align-items: center; }
.home-hero .actions .nav-pill { padding: 12px 20px; font-size: 15px; font-weight: 500; }
.home-hero .actions .btn-primary { font-size: 15px; padding: 12px 20px; min-height: 0; }
/* At-a-glance facts beside the intro, in the style of the case-study facts (.case-meta). The one portrait is on /about/. */
.home-facts { display: grid; gap: 6px; margin: 18px 0 0; font-size: 14px; color: var(--muted); }
.home-facts > div { display: flex; gap: 16px; }
.home-facts dt { flex: none; min-width: 4.75em; font-weight: 600; color: var(--ink); }
.home-facts dd { margin: 0; text-wrap: pretty; }
.work-cards { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(20px, 3vw, 40px); }
/* Each card spans five shared rows (image, eyebrow, title, summary, pill) so the parts line up across cards. */
.work-card { display: grid; grid-row: span 5; grid-template-rows: subgrid; row-gap: 10px; align-content: start; align-items: start; color: inherit; }
.work-card img { aspect-ratio: 8 / 5; object-fit: cover; border-radius: 12px; background: var(--panel); transition: transform .4s var(--ease-out), filter .25s ease; }
.work-card .work-thumb:hover img { transform: translateY(-2px); }
.work-card .work-thumb[href="/work/support-queue-dashboard/"] { overflow: hidden; border-radius: 12px; }
.work-card .work-thumb[href="/work/support-queue-dashboard/"] img { scale: 2.2; transform-origin: 44% 53%; }
.work-card .eyebrow { margin-top: 4px; }
.work-card h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.work-card p { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.work-card .more { margin-top: 2px; position: relative; }
.work-card .more::after { content: ""; position: absolute; inset: -8px -6px; }
.link-more { padding: 8px 16px; font-size: 14px; }
.testimonials { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 0 var(--col-gap); }
.testimonials blockquote { margin: 0; border-top: 1px solid var(--rule); padding: 14px 0 18px; font-family: var(--serif); font-size: 20px; line-height: 1.35; color: var(--ink); text-wrap: pretty; }
.testimonials cite { display: block; margin-top: 12px; font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.5; }
.testimonials cite strong { font-weight: 500; color: var(--ink); display: block; }
.skills { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 0 var(--col-gap); }
.skills > div { border-top: 1px solid var(--rule); padding: 12px 0 16px; }
.skills h3 { font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.25; }
.skills p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-top: 6px; }
.certs { margin-top: 16px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.certs strong { font-weight: 500; color: var(--ink); }
.cta { border-top: 1px solid var(--rule-strong); padding: 32px 0 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px var(--col-gap); align-items: end; }
.cta h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 40px); line-height: 1.1; text-wrap: balance; }
.cta p { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin-top: 12px; max-width: 52ch; }
.cta .contact-lines { display: grid; gap: 2px; font-size: 15px; justify-items: start; }
.cta .contact-lines a { display: inline-flex; align-items: center; min-height: 36px; }
@media (max-width: 759px) {
  .home-hero { grid-template-columns: minmax(0, 1fr); padding: 32px 0 24px; }
}

/* 9. Page: Work index
   -------------------------------------------------------------------------- */
.work-list { border-top: 1px solid var(--rule-strong); display: grid; padding-bottom: 56px; }
.work-list > li { border-bottom: 1px solid var(--rule); }
.work-list > li[hidden] { display: none; }
.work-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px clamp(20px, 3vw, 40px); align-items: center; padding: 16px 0; color: inherit; }
.work-row .head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.work-row h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; }
.work-row .when { font-size: 13px; color: var(--muted); }
.work-row p { margin-top: 4px; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
/* Only the pill and the thumbnail are links; ::after widens the pill's tap target to 44px. */
.work-row .more { margin-top: 10px; position: relative; }
.work-row .more::after { content: ""; position: absolute; inset: -8px -6px; }
.work-thumb { display: block; }
.work-row img { width: clamp(96px, 14vw, 160px); aspect-ratio: 8 / 5; object-fit: cover; border-radius: 8px; background: var(--panel); }
.work-list-sub { margin-top: 0; }
.work-list-sub .work-row { padding: 12px 0; }
.work-list-sub .work-row h2 { font-size: 19px; }

/* 10. Page: Case study
   -------------------------------------------------------------------------- */
.case-meta { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-top: 14px; font-size: 14px; color: var(--muted); }
.case-meta > div { display: flex; gap: 6px; }
.case-meta dt { font-weight: 600; color: var(--ink); }
/* Case-study and project hero: intro on the left, facts listed on the right, on the same two columns as the body below.
   The facts span two rows so a project's link button sits directly under the intro. */
.hero--case { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--col-gap); align-items: baseline; }
.hero--case > .eyebrow, .hero--case > .page-title { grid-column: 1 / -1; }
.hero--case > .lede { max-width: none; margin-top: 14px; }
.hero--case > .case-meta { flex-direction: column; flex-wrap: nowrap; gap: 6px; grid-row: span 2; }
.hero--case > .case-meta > div { gap: 16px; }
.hero--case > .case-meta dt { flex: none; min-width: 4.75em; }
.hero--case > .case-meta dd { text-wrap: pretty; }
/* Sub-heading with its one paragraph beside it, on the same two columns */
.sub-row { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--col-gap); align-items: baseline; }
.sub-row p { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
@media (max-width: 999px) {
  .hero--case { grid-template-columns: minmax(0, 1fr); }
  .hero--case > .lede { max-width: 70ch; margin-top: 10px; }
  .hero--case > .case-meta { grid-row: auto; }
}
@media (max-width: 759px) {
  .sub-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
}
.case-hero-figure { padding: 0 0 28px; }
.case-hero-figure img { aspect-ratio: 16 / 7; object-fit: cover; object-position: center top; }
.case-hero-figure figure.framed img { aspect-ratio: auto; object-fit: contain; }
.case-hero-figure img[src*="/support-queue-dashboard/wallboard."] { object-position: center 42%; }   /* keep the wallboard in frame, not the ceiling; matches any file extension */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: clamp(12px, 2vw, 24px); margin-top: 20px; }
.gallery figure img { aspect-ratio: 4 / 3; object-fit: cover; }
.before-after { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: var(--col-gap); }
.before-after > div { border-top: 1px solid var(--rule); padding: 12px 0; }
.before-after h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.before-after ol { margin-top: 10px; display: grid; gap: 6px; }
.before-after ol li { font-size: 14px; color: var(--ink-2); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 12px; }
.before-after ol li.host { background: var(--panel); border-color: var(--panel); }
.before-after p { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* 10b. Page: Project (short form): story beside one photo, then pictures and related work
   -------------------------------------------------------------------------- */
.project-links { margin-top: 16px; }
.project-lead { border-top: 1px solid var(--rule-strong); padding: 24px 0 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px var(--col-gap); align-items: start; }
.project-story { display: grid; gap: 22px; align-content: start; }
.project-section h2 { font-size: 21px; }
.project-section p { margin-top: 6px; font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 60ch; }
.project-figure img { aspect-ratio: 4 / 3; object-fit: cover; }
.project-figure figure.framed img { aspect-ratio: auto; object-fit: contain; }
.project-stats { margin: 0; }
.related-list { margin-top: 12px; padding-bottom: 28px; border-top-color: var(--rule); }
.work-list-sub .work-row img { width: clamp(88px, 11vw, 128px); }
@media (max-width: 759px) {
  .project-lead { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 0 24px; }
  .project-figure { order: -1; }
}

/* 11. Page: Experience
   -------------------------------------------------------------------------- */
.role-years { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 22px; line-height: 1; color: var(--muted); }
.role-org { margin-top: 6px; font-size: 15px; color: var(--muted); max-width: 80ch; }
.role-org strong { font-weight: 600; color: var(--ink); }
.edu { border-top: 1px solid var(--rule-strong); padding: 16px 0 56px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-size: 15px; }
.edu .eyebrow { margin-right: 8px; }
.edu .degree { font-family: var(--serif); font-size: 20px; line-height: 1.2; }

/* 12. Page: About
   -------------------------------------------------------------------------- */
.about-page { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; }
.about-rail { position: sticky; top: 88px; padding: 40px 0 0; }
.about-rail .avatar { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; background: var(--panel); }
.about-rail .name { font-family: var(--serif); font-size: 22px; line-height: 1.15; margin-top: 14px; }
.about-rail .role { font-size: 14px; color: var(--muted); margin-top: 4px; }
.rail-links { display: grid; margin-top: 14px; border-top: 1px solid var(--rule); font-size: 14px; font-weight: 500; }
.rail-links a { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); min-height: 44px; color: var(--ink); }
.rail-links:hover a { color: var(--muted); }
.rail-links a:hover { color: var(--ink); }
.rail-links a span:last-child { font-size: 13px; }
.about-body .hero p { font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.about-body .hero .text { display: grid; gap: 14px; margin-top: 16px; max-width: 68ch; }
.about-figures { border-top: 1px solid var(--rule-strong); padding: 24px 0 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: clamp(20px, 3vw, 40px); }
.about-figures .frame { border-radius: 12px; background: var(--panel); aspect-ratio: 16 / 9; overflow: hidden; display: grid; place-items: center; }
.about-figures .frame img { width: 100%; height: 100%; object-fit: cover; outline: 0; }
.about-figures .frame.zoom img { transform: scale(1.5); transform-origin: center; object-fit: contain; }
.about-figures figure p { font-size: 15px; line-height: 1.55; color: var(--ink-2); margin-top: 4px; }
@media (max-width: 759px) {
  .about-page { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .about-rail { position: static; padding: 32px 0 0; order: 2; margin-bottom: 48px; }
}

/* 13. Page: Blog
   -------------------------------------------------------------------------- */
.blog-hero-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-top: 10px; }
.year-block { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 clamp(24px, 4vw, 48px); border-top: 1px solid var(--rule-strong); }
.year-block .year { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 28px; line-height: 1; color: var(--muted); padding: 16px 0 8px; }
.post-list > li { border-top: 1px solid var(--rule); }
.post-list > li:first-child { border-top: 0; }
.post-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 4px clamp(16px, 3vw, 40px); padding: 14px 0; color: inherit; align-items: baseline; }
.post-row .date { font-size: 13px; color: var(--muted); white-space: nowrap; }
.post-row .body { min-width: 0; display: grid; gap: 4px; }
.post-row h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.2; text-wrap: balance; }
.post-row p { font-size: 15px; line-height: 1.5; color: var(--ink-2); max-width: 70ch; }
.post-row .read { font-size: 13px; color: var(--muted); }
.blog-note { border-top: 1px solid var(--rule); margin-top: 24px; padding: 16px 0 56px; font-size: 14px; color: var(--muted); max-width: 60ch; }
@media (max-width: 759px) {
  .year-block { grid-template-columns: minmax(0, 1fr); }
  .year-block .year { border-bottom: 1px solid var(--rule); }
}

/* Blog post */
.post-hero h1 { font-size: clamp(30px, 3.6vw, 44px); margin-top: 8px; max-width: 24ch; }
.post-hero .lede { font-size: 17px; max-width: 62ch; }
.post-hero .byline { font-size: 13px; color: var(--muted); margin-top: 12px; }
.post-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); border-top: 1px solid var(--rule-strong); padding-top: 24px; align-items: start; }
.post-toc { position: sticky; top: 88px; }
.post-toc ul { display: grid; border-top: 1px solid var(--rule); padding-top: 4px; }
.post-toc ul a { display: flex; align-items: center; min-height: 34px; font-size: 14px; color: var(--ink); }
.post-toc ul:hover a { color: var(--muted); }
.post-toc ul a:hover { color: var(--ink); }
.post-toc .share { margin-top: 24px; border-top: 1px solid var(--rule); padding-top: 10px; display: grid; gap: 2px; }
.post-toc .share p { font-size: 13px; color: var(--muted); }
.post-toc .share a { font-size: 14px; min-height: 36px; display: flex; align-items: center; gap: 6px; }
.post-toc .share button { font-size: 14px; min-height: 36px; display: flex; align-items: center; background: none; border: 0; padding: 0; cursor: pointer; transition: color .25s ease; }
.post-toc .share button:hover { color: var(--ink-3); }
.prose { max-width: 68ch; min-width: 0; padding-bottom: 48px; display: grid; gap: 14px; }
.prose p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.prose h2 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; margin-top: 16px; scroll-margin-top: 80px; }
.prose h3 { font-family: var(--serif); font-weight: 400; font-size: 20px; line-height: 1.25; margin-top: 8px; }
.prose ul, .prose ol { display: grid; gap: 6px; padding-left: 20px; font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose figure { margin: 8px 0; }
.prose pre { background: var(--panel); border-radius: 12px; padding: 16px 20px; font-size: 14px; line-height: 1.5; overflow-x: auto; margin: 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; }
.prose p code { background: var(--panel); padding: 2px 6px; border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 8px 0; }
.prose .pager { margin-top: 16px; padding-bottom: 0; }
@media (max-width: 759px) {
  .post-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .post-toc { position: static; }
}

/* 14. Page: Contact
   -------------------------------------------------------------------------- */
.contact-hero { padding: 72px 0 120px; min-height: calc(100vh - 64px - 300px); display: grid; align-content: center; box-sizing: border-box; }
.contact-hero h1 { font-family: var(--serif); font-weight: 400; font-size: min(76px, calc((100vw - 2 * var(--gutter)) / 15.8)); line-height: 1.08; letter-spacing: -.01em; white-space: nowrap; }
.contact-hero h1 a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .12em; text-decoration-color: var(--accent); white-space: nowrap; }
.contact-hero h1 a:hover { color: var(--ink-3); text-decoration-thickness: 2px; }
@media (max-width: 759px) { .contact-hero { padding: 40px 0 72px; min-height: 0; } }

/* 15. Error pages (404.html and the other status codes; ERROR_PAGES in build.py)
   The status code is the display type; the links reuse the footer's arrow rows in the page colors.
   -------------------------------------------------------------------------- */
.errpage { padding: 56px 0 96px; min-height: calc(100vh - 64px - 300px); display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: var(--col-gap); align-items: end; align-content: center; }
.err-code { font-family: var(--serif); font-weight: 300; font-size: clamp(132px, 25vw, 340px); line-height: .74; letter-spacing: -.03em; font-variant-numeric: lining-nums; color: var(--ink); margin-left: -.04em; animation: rise .8s var(--ease-out) both; }
.err-body { animation: rise .8s var(--ease-out) .12s both; }
.err-body .page-title { margin-top: 10px; }
.err-text { margin-top: 10px; font-size: 16px; line-height: 1.5; color: var(--ink-2); max-width: 44ch; text-wrap: pretty; }
.err-links { margin-top: 24px; border-top: 1px solid var(--rule-strong); }
.err-links a { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 16px; }
.err-links a span:last-child { color: var(--accent); }
.err-links:hover a { color: var(--muted); }      /* same as .foot-nav: the other rows dim, the hovered one stays ink */
.err-links a:hover { color: var(--ink); }
@media (max-width: 759px) {
  .errpage { grid-template-columns: minmax(0, 1fr); row-gap: 28px; padding: 40px 0 64px; min-height: 0; }
  .err-code { font-size: clamp(120px, 42vw, 220px); }
}

/* 16. Print
   -------------------------------------------------------------------------- */

/* Work: collapsed early hands-on group and project groups */
.more-projects[hidden], .early-work[hidden] { display: none; }
.early-work { border-top: 1px solid var(--rule-strong); margin-top: 28px; padding-bottom: 56px; }
.early-work summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 20px 0 6px; }
.early-work summary::-webkit-details-marker { display: none; }
.early-work summary:hover .early-title { color: var(--ink-2); }
.early-work .early-title { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
.early-work .early-count { font-size: 13px; color: var(--muted); }
.early-work .early-chev { margin-left: auto; font-size: 20px; line-height: 1; color: var(--muted); transition: transform .25s var(--ease-out); }
.early-work[open] .early-chev { transform: rotate(180deg); }
.early-work > .meta { max-width: 70ch; padding-bottom: 14px; }
.early-work .work-list { border-top-color: var(--rule); padding-bottom: 0; }

@media print {
  .site-header, .menu-sheet, .site-footer, .jump-nav, .filters, .pager, .skip-link { display: none !important; }
  main { padding-top: 0; }
  body { font-size: 12pt; }
  a { color: inherit; }
}

/* 17. Ask: "highlight to ask" (design preview; behaviour and sample answers in ask.js)
   Selecting text in <main> shows .ask-tag; clicking it opens .ask-card pinned under the selection.
   Both are appended to <body> and positioned in page coordinates, below the header's z-index.
   -------------------------------------------------------------------------- */
::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); }
::highlight(ask) { background-color: color-mix(in srgb, var(--accent) 34%, transparent); }
.ask-tag, .ask-card { position: absolute; z-index: 8; }
.ask-tag[hidden], .ask-card[hidden], .ask-rel[hidden] { display: none; }
.ask-caret { flex: none; width: 1.5px; height: 1.05em; background: var(--accent); animation: ask-blink 1.1s steps(1) infinite; }
.ask-tag { --ask-bg: var(--ink); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 8px 15px; border: 0; border-radius: 999px; background: var(--ask-bg); color: var(--bg); font-size: 13px; font-weight: 500; line-height: 1.2; cursor: pointer; box-shadow: var(--pop-shadow); animation: ask-in .22s var(--ease-out); transition: background .25s ease; }
.ask-tag:hover { --ask-bg: var(--ink-3); }
.ask-tag::after { content: ""; position: absolute; left: var(--ask-arrow, 20px); top: 100%; border: 6px solid transparent; border-top-color: var(--ask-bg); transition: border-color .25s ease; }
.ask-tag.is-below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--ask-bg); }
.ask-card { width: min(360px, calc(100vw - 24px)); padding: 16px 18px 14px; background: var(--pop-bg); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--pop-shadow); animation: ask-in .25s var(--ease-out); }
.ask-card:focus { outline: none; }
.ask-x { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; transition: color .25s ease; }
.ask-x:hover { color: var(--ink); }
.ask-about { font-size: 11px; padding-right: 28px; overflow-wrap: anywhere; }
.ask-think { display: none; margin-top: 8px; }
.ask-lines { display: grid; gap: 15px; padding: 10px 0 4px; }
.ask-lines i { display: block; height: 1.5px; background: var(--accent); transform-origin: left; transform: scaleX(0); animation: ask-ink 2.4s var(--ease-out) infinite; }
.ask-lines i:nth-child(2) { animation-delay: .3s; }
.ask-lines i:nth-child(3) { animation-delay: .6s; width: 62%; }
.ask-status { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--muted); }
.ask-stage { animation: fade .35s ease; }
.ask-mark { position: absolute; z-index: 7; pointer-events: none; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--accent) 60%, transparent) 50%, transparent) no-repeat; background-size: 60% 100%; animation: ask-shimmer 1.3s ease-in-out infinite; }
.ask-text .ask-caret { display: inline-block; margin-left: 3px; vertical-align: -.16em; }
.ask-card.is-thinking .ask-think { display: block; }
.ask-card.is-thinking .ask-body { display: none; }
.ask-body { margin-top: 8px; animation: fade .3s ease; }
.ask-text { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.ask-rel { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 14px; font-weight: 500; }
.ask-rel span:last-child { color: var(--accent-ink); }
.ask-more { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-strong); transition: border-color .25s ease; }
.ask-more:focus-within { border-bottom-color: var(--accent-ink); }
.ask-more:focus-within .ask-caret { display: none; }
.ask-more input { flex: 1; min-width: 0; padding: 2px 0; border: 0; background: none; font-family: var(--serif); font-size: 17px; color: var(--ink); caret-color: var(--accent); outline: none; }
.ask-more input::placeholder { font-style: italic; color: var(--muted); opacity: 1; }
@keyframes ask-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes ask-blink { 50% { opacity: 0; } }
@keyframes ask-ink { 0% { transform: scaleX(0); opacity: 1; } 45%, 80% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes ask-shimmer { from { background-position: -150% 0; } to { background-position: 250% 0; } }
@media (prefers-reduced-motion: reduce) { .ask-lines i { transform: none; } }
@media print { .ask-tag, .ask-card, .ask-mark { display: none !important; } }

/* 17b. Ask: who the answer is from, and suggested follow-up questions */
.ask-by { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ask-by[hidden], .ask-suggest[hidden] { display: none; }
.ask-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ask-suggest button { border: 1px solid var(--rule); background: transparent; color: var(--ink); border-radius: 999px; padding: 4px 11px; font: 500 13px var(--sans); cursor: pointer; text-align: left; }
.ask-suggest button:hover { border-color: var(--ink); }

/* One-off spacing, as classes: the site's Content-Security-Policy allows no style="" attributes. */
.u-m-0 { margin: 0 !important; }
.u-mt-14 { margin-top: 14px !important; }
.u-mt-16 { margin-top: 16px !important; }
.u-mt-20 { margin-top: 20px !important; }
.u-mt-28 { margin-top: 28px !important; }
.u-pb-0 { padding-bottom: 0 !important; }
.u-flat-top { border-top: 0 !important; padding-top: 28px !important; }
.u-rule-top { border-top-color: var(--rule) !important; }
.u-cols-auto { grid-template-columns: minmax(0, 1fr) auto !important; }

/* A locked page's password form (pages/locked.php), on the error-page layout. */
.lockpage .err-code { font-size: clamp(96px, 16vw, 220px); letter-spacing: .02em; color: var(--muted-2); }
.lock-form { margin-top: 24px; border-top: 1px solid var(--rule-strong); padding-top: 18px; max-width: 44ch; }
.lock-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.lock-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lock-form input[type="password"] { flex: 1 1 200px; min-width: 0; min-height: 48px; padding: 10px 16px; font: inherit; font-size: 17px; color: var(--ink); background: var(--bg); border: 1px solid var(--muted-2); border-radius: 999px; }
.lock-form input[type="password"]:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; border-color: var(--ink); }
.lock-form .btn-primary { border: 0; cursor: pointer; font-family: inherit; }
.lock-error { margin-top: 12px; font-size: 15px; color: var(--ink); border-left: 2px solid var(--accent); padding-left: 12px; }
