/* davidwkennedy.com: clean and professional, with a few engineer's-workbench touches. */

/* ---------- tokens ---------- */
:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --ink: #14202e;
  --muted: #566476;
  --line: #dde3ea;
  --navy: #0f2a44;
  --accent: #0e7c74;
  --accent-ink: #ffffff;
  --accent-soft: #e2f2ef;
  --code-bg: #eef2f6;
  --shadow: 0 1px 2px rgba(15, 42, 68, .06), 0 8px 24px rgba(15, 42, 68, .06);
  --radius: 14px;
  --wrap: 1080px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --warm: #f5b041;
  --draft-bg: #fff6e0; --draft-line: #d99a1e; --draft-ink: #7a4f00;   /* draft posts (preview builds only) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1420; --surface: #111e2f; --ink: #e5ecf4; --muted: #9db0c4; --line: #21334a;
    --navy: #d3e3f3; --accent: #2dd4bf; --accent-ink: #062320; --accent-soft: #10302e; --code-bg: #0e1b2b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --draft-bg: #2a2113; --draft-line: #c08a2a; --draft-ink: #f5c86a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1420; --surface: #111e2f; --ink: #e5ecf4; --muted: #9db0c4; --line: #21334a;
  --navy: #d3e3f3; --accent: #2dd4bf; --accent-ink: #062320; --accent-soft: #10302e; --code-bg: #0e1b2b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --draft-bg: #2a2113; --draft-line: #c08a2a; --draft-ink: #f5c86a;
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .wrap { padding: 0 28px; } }
.muted { color: var(--muted); }
.mono, .eyebrow, .tag, .date { font-family: var(--mono); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 62px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--navy); font-weight: 700; text-decoration: none; }
.brand-mark { font-family: var(--mono); font-size: 13px; background: var(--navy); color: var(--bg); border-radius: 8px; padding: 4px 7px; letter-spacing: .04em; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
.site-nav a:hover, .site-nav a[aria-current] { background: var(--accent-soft); color: var(--accent); }
.theme-toggle { margin-left: 6px; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { fill: currentColor; stroke: none; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
}
.nav-toggle { display: none; }
.theme-label { display: none; }
@media (max-width: 720px) {
  .nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px;
    border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; padding: 0 10px; }
  .nav-toggle span { height: 2px; background: var(--ink); border-radius: 2px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 62px; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px; font-size: 16px; }
  .theme-toggle { margin: 6px 0 0; width: 100%; height: 44px;; display: flex; gap: 10px; font: inherit; font-size: 15px; }
  .theme-label { display: inline !important; }
}

/* ---------- buttons, tags ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface); min-height: 44px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
/* Not-yet-available action: a span, not a link, so it looks and acts inactive. */
.btn[aria-disabled="true"], .btn[aria-disabled="true"]:hover { opacity: .5; cursor: default; border-color: var(--line); color: var(--ink); user-select: none; }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.eyebrow { font-size: 13px; color: var(--accent); letter-spacing: .02em; margin-bottom: 10px; display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 12px; background: var(--code-bg); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }

/* ---------- sections ---------- */
section { padding: 64px 0; }
@media (max-width: 700px) { section { padding: 44px 0; } }
.section-head { margin-bottom: 28px; max-width: 720px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: center; }
.hero .lead { font-size: clamp(1.15rem, 2.2vw, 1.35rem); color: var(--navy); font-weight: 600; margin-bottom: .6em; }
.hero .intro { color: var(--muted); font-size: 1.08rem; max-width: 620px; }
.prompt { font-family: var(--mono); font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.prompt b { color: var(--accent); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: 5px 12px; margin-bottom: 18px; font-weight: 600; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 25%, transparent); }
.portrait { position: relative; justify-self: center; }
/* Even frame: a surface-colored mat with a thin accent ring, centered on the photo. */
.portrait img { width: 300px; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 5px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent), var(--shadow); }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .portrait { order: -1; justify-self: start; }
  .portrait img { width: 148px; border-radius: 50%; }
}

/* ---------- hero: "Blueprint" navy band + engineering grid over a blurred photo ----------
   To change the photo, replace assets/img/hero-bg.jpg (any landscape photo; it is blurred and tinted). */
.hero { position: relative; overflow: hidden; isolation: isolate; color: #e8eef5; padding: 64px 0 56px;
  background: #0f2a44; border-bottom: 1px solid rgba(45,212,191,.35); }
.hero::before { content: ""; position: absolute; inset: -60px; z-index: -2;
  background: url(../img/hero-bg.jpg) center 35% / cover; filter: blur(6px) saturate(1.2); transform: scale(1.08); }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(1100px 480px at 85% 10%, rgba(23,103,154,.55) 0%, transparent 60%),
    linear-gradient(160deg, rgba(11,31,53,.68) 0%, rgba(15,42,68,.51) 55%, rgba(12,59,74,.4) 100%); }
.hero h1 { color: #fff; }
.hero .lead { color: #bfe9e3; }
.hero .intro { color: #c3d0dd; }
.hero .prompt { color: #8fa3b8; } .hero .prompt b { color: #2dd4bf; }
.hero .status { background: rgba(74,222,128,.15); color: #4ade80; }   /* "open to work" green */
.hero .btn { background: rgba(255,255,255,.06); color: #e8eef5; border-color: rgba(255,255,255,.35); }
.hero .btn:hover { color: #fff; border-color: #fff; }
.hero .btn.primary { background: #2dd4bf; border-color: #2dd4bf; color: #062320; }
.hero .btn.primary:hover { color: #062320; }
/* Hero buttons: the main CTA spans both columns; the two secondary buttons share the row below.
   On narrow phones they stack, full width. */
.hero-cta { display: grid; grid-template-columns: auto auto; gap: 10px; width: max-content; max-width: 100%; }
.hero-cta .cta-main { grid-column: 1 / -1; justify-content: center; }
.hero-cta .btn { justify-content: center; }
@media (max-width: 480px) { .hero-cta { grid-template-columns: 1fr; width: 100%; } }
/* Small label inside a button, e.g. "demo" on the Ask-an-AI button. */
.btn-tag { font: 600 10px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 6px; border-radius: 999px;
  background: #f5b041; color: #2a1800; }
.hero .portrait img { border-color: #0f2a44; box-shadow: 0 0 0 2px #2dd4bf, 0 20px 50px rgba(0,0,0,.45); }
.hero .stats { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.12); }
.hero .stat { background: rgba(11,31,53,.62); }
.hero .stat b { color: #fff; } .hero .stat span { color: #a9bccf; }
.hero .stat:nth-child(3) b { color: #4ade80; }   /* matches the open-to-work green */
/* Dark page: a touch brighter so the band still stands apart. */
:root[data-theme="dark"] .hero::after { background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(1100px 480px at 85% 10%, rgba(23,103,154,.6) 0%, transparent 60%),
    linear-gradient(160deg, rgba(13,39,66,.71) 0%, rgba(17,53,83,.55) 55%, rgba(14,74,85,.45) 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hero::after { background:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px) 0 0 / 28px 28px,
    radial-gradient(1100px 480px at 85% 10%, rgba(23,103,154,.6) 0%, transparent 60%),
    linear-gradient(160deg, rgba(13,39,66,.71) 0%, rgba(17,53,83,.55) 55%, rgba(14,74,85,.45) 100%); } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; margin-top: 40px; }
.stat { background: var(--surface); padding: 20px 18px; }
.stat b { display: block; font-size: 1.9rem; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 14px; }
@media (max-width: 820px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .grid.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.alt .card { background: var(--bg); box-shadow: none; }
.card h3 { margin-bottom: .35em; }
.card p { color: var(--muted); margin-bottom: 0; }
.card .icon { font-family: var(--mono); font-size: 13px; color: var(--accent); margin-bottom: 8px; display: block; }
.card.feature { grid-column: 1 / -1; display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.card.feature .btn-row { margin-top: 16px; }
@media (max-width: 760px) { .card.feature { grid-template-columns: 1fr; } }
.card .links { margin-top: 12px; font-size: 15px; }

/* ---------- timeline ---------- */
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 26px; }
.role { position: relative; padding-bottom: 30px; }
.role:last-child { padding-bottom: 0; }
.role::before { content: ""; position: absolute; left: -33px; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent); }
.role-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.role-head h3 { margin: 0; }
.role .date { font-size: 13px; color: var(--muted); }
.role .org { color: var(--muted); margin: 2px 0 8px; }
.role ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink); }
.role li { margin-bottom: 6px; }
.employer { margin: 44px 0 18px; padding-top: 28px; border-top: 1px solid var(--line); }
.employer h3 { margin: 0; font-size: 1.3rem; }
.employer p { margin: 4px 0 0; color: var(--muted); }
.company { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin: 0 0 14px; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.company .mono { font-size: 13px; font-weight: 400; color: var(--muted); }

/* ---------- photo placeholders (swap in real photos later) ---------- */
.photo-band { height: clamp(180px, 28vw, 320px); position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, #0f2a44 0%, #12486a 45%, #0e7c74 100%); }
.photo-band img { width: 100%; height: 100%; object-fit: cover; }
.photo-band.placeholder::before { content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 32px 32px; }
.photo-band .caption { position: absolute; left: 16px; bottom: 14px; font-family: var(--mono); font-size: 13px; color: rgba(255,255,255,.85);
  background: rgba(0,0,0,.25); padding: 4px 10px; border-radius: 6px; }
@media (min-width: 700px) { .photo-band .caption { left: 28px; } }

/* ---------- lists of posts / patents ---------- */
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.post-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.post-list a.title { font-weight: 700; font-size: 1.1rem; color: var(--navy); text-decoration: none; }
.post-list a.title:hover { color: var(--accent); }
.post-list .date { font-size: 13px; color: var(--muted); display: block; margin-bottom: 2px; }
.post-list p { margin: 4px 0 0; color: var(--muted); }
.post-list li[hidden] { display: none; }
/* Draft posts exist only in preview builds (build.js --preview); live builds leave them out. */
.post-list li.draft { background: var(--draft-bg); border-color: var(--draft-line); border-left-width: 5px; }
.draft-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--draft-ink); border: 1px solid var(--draft-line); border-radius: 999px; padding: 0 8px; line-height: 18px; }
.draft-note { background: var(--draft-bg); border: 1px solid var(--draft-line); border-left-width: 5px; border-radius: 10px;
  color: var(--draft-ink); padding: 10px 14px; margin: 0 0 18px; font-size: 14px; }
.post-meta .author-badge { margin-left: 0; }
/* Word-processor squiggles, for posts that talk about them: red = spelling, green = grammar. */
.squiggle-red, .squiggle-green { text-decoration-line: underline; text-decoration-style: wavy;
  text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-skip-ink: none; }
.squiggle-red { text-decoration-color: #e5484d; }
.squiggle-green { text-decoration-color: #2f9e44; }
/* Tag colors: each tag sets --tc (text/strong) and --tb (soft background), keyed by its slug, on badges
   (data-t) and filter buttons (data-tag). A tag missing here falls back to the accent color. */
[data-t="musings"], .tag-filter [data-tag="musings"]               { --tc: #6b3fa0; --tb: #f1e9fb; }
[data-t="travel"], .tag-filter [data-tag="travel"]                 { --tc: #4d6b12; --tb: #eaf3d9; }
[data-t="project"], .tag-filter [data-tag="project"]               { --tc: #0a6b64; --tb: #e2f2ef; }
[data-t="back-to-basics"], .tag-filter [data-tag="back-to-basics"] { --tc: #1f5fae; --tb: #e3eefb; }
[data-t="security"], .tag-filter [data-tag="security"]             { --tc: #8a5a00; --tb: #fbf0d4; }
[data-t="ai"], .tag-filter [data-tag="ai"]                         { --tc: #a3236f; --tb: #fbe6f1; }
:root[data-theme="dark"] [data-t="musings"], :root[data-theme="dark"] .tag-filter [data-tag="musings"] { --tc: #c9adf2; --tb: #2a1f3d; }
:root[data-theme="dark"] [data-t="travel"], :root[data-theme="dark"] .tag-filter [data-tag="travel"] { --tc: #b5d67a; --tb: #232f12; }
:root[data-theme="dark"] [data-t="project"], :root[data-theme="dark"] .tag-filter [data-tag="project"] { --tc: #2dd4bf; --tb: #10302e; }
:root[data-theme="dark"] [data-t="back-to-basics"], :root[data-theme="dark"] .tag-filter [data-tag="back-to-basics"] { --tc: #93bdf2; --tb: #152a45; }
:root[data-theme="dark"] [data-t="security"], :root[data-theme="dark"] .tag-filter [data-tag="security"] { --tc: #f0c46a; --tb: #352a10; }
:root[data-theme="dark"] [data-t="ai"], :root[data-theme="dark"] .tag-filter [data-tag="ai"] { --tc: #f39acb; --tb: #3a1830; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-t="musings"], :root:not([data-theme="light"]) .tag-filter [data-tag="musings"] { --tc: #c9adf2; --tb: #2a1f3d; }
  :root:not([data-theme="light"]) [data-t="travel"], :root:not([data-theme="light"]) .tag-filter [data-tag="travel"] { --tc: #b5d67a; --tb: #232f12; }
  :root:not([data-theme="light"]) [data-t="project"], :root:not([data-theme="light"]) .tag-filter [data-tag="project"] { --tc: #2dd4bf; --tb: #10302e; }
  :root:not([data-theme="light"]) [data-t="back-to-basics"], :root:not([data-theme="light"]) .tag-filter [data-tag="back-to-basics"] { --tc: #93bdf2; --tb: #152a45; }
  :root:not([data-theme="light"]) [data-t="security"], :root:not([data-theme="light"]) .tag-filter [data-tag="security"] { --tc: #f0c46a; --tb: #352a10; }
  :root:not([data-theme="light"]) [data-t="ai"], :root:not([data-theme="light"]) .tag-filter [data-tag="ai"] { --tc: #f39acb; --tb: #3a1830; }
}
/* Tag badges beside a post's date (list items and post pages). */
.tag-badge { display: inline-block; vertical-align: 1px; margin-left: 2px; padding: 1px 8px; border-radius: 999px;
  font: 500 11px/1.6 var(--mono); background: var(--tb, var(--accent-soft)); color: var(--tc, var(--accent)); text-decoration: none; white-space: nowrap; }
a.tag-badge:hover, a.tag-badge:focus-visible { background: var(--tc, var(--accent)); color: var(--surface); }
.post-list .tag-badge { position: relative; z-index: 1; }   /* above the card-wide title link */
/* Author pill at the card's top right: the date line becomes a wrapping flex row, and the pill is pushed
   to its right end (it wraps to the next line, still right-aligned, when space runs out). */
.post-list .date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.post-list .date .tag-badge { margin-left: 0; }
.author-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px 1px 2px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font: 500 11px/1.6 var(--mono); text-decoration: none; white-space: nowrap; position: relative; z-index: 1;
  transition: border-color .2s ease, color .2s ease; }
.author-badge .author-ico { width: 18px; height: 18px; border-radius: 50%; flex: none; }
/* Two avatars side by side (David + Hank), a little space between them. */
.author-pair { display: inline-flex; flex: none; gap: 5px; }
a.author-badge:hover, a.author-badge:focus-visible { border-color: var(--accent); color: var(--accent); }
.prose .author-badge img { margin: 0; }
/* On cards the pill is a plain label: under the card-wide link, so a click anywhere opens the post. */
span.author-badge { z-index: auto; }
/* "ai_note:" box at the top of a post: tinted like the post's author tier, thick left border like drafts. */
.ai-note { background: var(--tb, var(--accent-soft)); border: 1px solid color-mix(in srgb, var(--tc, var(--accent)) 45%, transparent);
  border-left: 5px solid var(--tc, var(--accent)); border-radius: 10px; padding: 10px 14px; margin: -8px 0 22px; font-size: 15px; }
.ai-note p { margin: 0; color: var(--ink); }
/* Author tier colors (David, 2026-12-01): 100% Human blue, AI Editor green, AI Co-Author orange. They set
   --tc/--tb like the tags, so the badges and the sidebar's author filter buttons share them. The orange is
   kept clearly redder than the draft amber. */
[data-a="human"], .tag-filter [data-author="human"]         { --tc: #1d4ed8; --tb: #e6eeff; }
[data-a="ai-edit"], .tag-filter [data-author="ai-edit"]     { --tc: #2b7a3d; --tb: #e3f4e6; }
[data-a="ai-assist"], .tag-filter [data-author="ai-assist"] { --tc: #b4500f; --tb: #fdebdc; }
[data-a="ai-team"], .tag-filter [data-author="ai-team"]     { --tc: #475569; --tb: #eef1f5; }   /* slate: the AI team's byline */
:root[data-theme="dark"] [data-a="human"], :root[data-theme="dark"] .tag-filter [data-author="human"] { --tc: #9cbcff; --tb: #172544; }
:root[data-theme="dark"] [data-a="ai-edit"], :root[data-theme="dark"] .tag-filter [data-author="ai-edit"] { --tc: #8fd39d; --tb: #16301c; }
:root[data-theme="dark"] [data-a="ai-assist"], :root[data-theme="dark"] .tag-filter [data-author="ai-assist"] { --tc: #ffad73; --tb: #3a2312; }
:root[data-theme="dark"] [data-a="ai-team"], :root[data-theme="dark"] .tag-filter [data-author="ai-team"] { --tc: #b8c4d4; --tb: #1e2633; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-a="human"], :root:not([data-theme="light"]) .tag-filter [data-author="human"] { --tc: #9cbcff; --tb: #172544; }
  :root:not([data-theme="light"]) [data-a="ai-edit"], :root:not([data-theme="light"]) .tag-filter [data-author="ai-edit"] { --tc: #8fd39d; --tb: #16301c; }
  :root:not([data-theme="light"]) [data-a="ai-assist"], :root:not([data-theme="light"]) .tag-filter [data-author="ai-assist"] { --tc: #ffad73; --tb: #3a2312; }
  :root:not([data-theme="light"]) [data-a="ai-team"], :root:not([data-theme="light"]) .tag-filter [data-author="ai-team"] { --tc: #b8c4d4; --tb: #1e2633; }
}
.author-badge[data-a] { background: var(--tb); color: var(--tc); border-color: color-mix(in srgb, var(--tc) 35%, transparent); }
a.author-badge[data-a]:hover, a.author-badge[data-a]:focus-visible { background: var(--tc); color: var(--surface); border-color: var(--tc); }

/* Blog index: tag filter in a left column; a wrapping row of chips on phones. */
.blog-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 64px; }
.tag-filter button { margin-left: -12px; }   /* labels line up with the page heading */
@media (max-width: 760px) { .tag-filter button { margin-left: 0; } }
.tag-filter[hidden] { display: none; }
.blog-side { position: sticky; top: 84px; }   /* the filters + RSS link scroll together */
.rss-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 22px;
  font: 12px var(--mono); color: var(--muted); text-decoration: none; }
.rss-link:hover, .rss-link:focus-visible { color: var(--accent); text-decoration: underline; }
.rss-link svg { flex: none; }
.tag-filter ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tag-filter .filter-head { font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.tag-filter ul + .filter-head { margin-top: 26px; }
.tag-filter button { width: 100%; display: flex; justify-content: flex-start; align-items: center; gap: 10px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--ink); background: transparent; border: 1px solid transparent;
  border-radius: 8px; padding: 8px 12px; cursor: pointer; text-align: left;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.tag-filter button:hover { background: var(--tb, var(--accent-soft)); color: var(--tc, var(--accent)); }
.tag-filter button[aria-pressed="true"] { background: var(--tb, var(--accent-soft)); color: var(--tc, var(--accent)); border-color: var(--tc, var(--accent)); font-weight: 600; }
.tag-filter .n { font: 12px var(--mono); color: var(--tc, var(--muted)); min-width: 2ch; text-align: right; }   /* count left of the name, in the tag's color */
.tag-filter button[aria-pressed="true"] .n { color: var(--tc, var(--accent)); }
.tag-empty { padding: 18px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) {
  .blog-layout { grid-template-columns: 1fr; gap: 18px; }
  .tag-filter, .blog-side { position: static; }
  .rss-link { margin-top: 14px; }
  .tag-filter ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .tag-filter ul + .filter-head { margin-top: 16px; }
  .tag-filter button { width: auto; border-color: var(--line); border-radius: 999px; padding: 6px 14px; gap: 7px; }
  .tag-filter .n { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .tag-filter button { transition: none; } }
.plain-list { margin: 0; padding-left: 20px; }
.plain-list li { margin-bottom: 8px; }
.plain-list .mono { font-size: 14px; }

/* ---------- prose (about, blog posts) ---------- */
.page-head { padding-top: 52px; padding-bottom: 8px; }   /* keep .wrap's side padding */
.prose { max-width: 720px; padding-bottom: 64px; }
.prose p, .prose li { color: var(--ink); }
.prose pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 14px/1.5 var(--mono); }
.prose iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; margin: 0 0 1em; background: #000; }
.prose img { border-radius: 10px; margin: 8px 0 16px; }
.prose figure { margin: 0 0 1.4em; }
.prose figcaption { font-size: 14px; color: var(--muted); margin-top: -6px; }
.prose blockquote { margin: 0 0 1em; padding-left: 16px; border-left: 3px solid var(--accent); color: var(--muted); }
.post-meta { font-family: var(--mono); font-size: 14px; color: var(--muted); margin-bottom: 24px; }
/* Project pages (living documents): status pill + "Updated <date>", then the stack tags. */
.project-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 4px 0 12px; }
.project-meta .status { font-family: var(--sans); }
.page-head .tags { margin-bottom: 8px; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 32px; font-size: 15px; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact .btn-row { justify-content: center; }
.contact p { color: var(--muted); max-width: 560px; margin: 0 auto 22px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 32px; font-size: 15px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }
.footer-name { font-weight: 700; color: var(--navy); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-fine { font-size: 13px; margin-top: 14px; }

/* project screenshot */
.shot { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.shot img { width: 100%; height: auto; transition: transform .3s; }
.shot:hover img { transform: scale(1.02); }

/* ---------- headline under the name ---------- */
.hero .headline { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; color: #fff; line-height: 1.3;
  margin: -.15em 0 .5em; max-width: 640px; letter-spacing: -.01em; }
.hero .lead { font-family: var(--mono); font-size: 14px; font-weight: 400; color: #7fded0; margin-bottom: 1em; }

/* ---------- "what I do" cards with icons and an accent edge ---------- */
.card.skill { position: relative; border-top: 3px solid var(--accent); }
.card.skill .ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.card.skill .ico svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- experience: summary, metric chips, "also" line ---------- */
.role-sum { margin: 6px 0 10px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chips span { font-size: 14px; background: var(--accent-soft); color: var(--ink); border-radius: 999px; padding: 4px 12px; }
.chips b { color: var(--accent); font-family: var(--mono); margin-right: 4px; }
.role .also { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.role .also b { color: var(--ink); }

/* ---------- testimonials ---------- */
.quotes { align-items: stretch; }
.quote { margin: 0; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 22px 20px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 16px; position: relative; }
.quote::before { content: "\201C"; position: absolute; top: -6px; left: 16px; font: 700 64px/1 Georgia, serif; color: var(--accent); opacity: .35; }
.quote blockquote { margin: 18px 0 0; font-size: 1.02rem; color: var(--ink); }
.quote figcaption b { display: block; color: var(--navy); }
.quote figcaption span { font-size: 14px; color: var(--muted); }
.quote.placeholder { border-style: dashed; background: transparent; }
.card.placeholder { border-style: dashed; background: transparent; box-shadow: none; }
.card.placeholder h3, .card.placeholder p { color: var(--muted); font-style: italic; }
/* Clickable testimonial cards: same hover as a.link-card; layout untouched. */
.quote.has-link { position: relative; transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease, background-color .25s ease; }
.quote.has-link .card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.quote.has-link figcaption a { position: relative; z-index: 2; }
.quote.has-link:hover, .quote.has-link:has(.card-link:focus-visible) { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--bg)); }
.quote.has-link .card-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .quote.has-link { transition: none; } .quote.has-link:hover { transform: none; } }
.quote.placeholder blockquote { color: var(--muted); font-style: italic; }

/* ---------- project card variety ---------- */
.card.term { background: #0d1726; border-color: #1d2d44; color: #cfe0f2; }
.card.term h3 { color: #fff; } .card.term p { color: #9fb3c8; }
.card.term .icon { color: #2dd4bf; }
.card.term .tag { background: #13233a; border-color: #1d2d44; color: #9fb3c8; }
.term-bar { display: flex; align-items: center; gap: 6px; margin: -8px -8px 14px; padding: 0 0 10px; border-bottom: 1px solid #1d2d44; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; } .term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: 8px; font: 12px var(--mono); color: #6f86a0; }
.card.term pre { margin: 12px 0 0; padding: 10px 12px; background: #08111d; border-radius: 8px; font: 13px/1.5 var(--mono); color: #7fded0; overflow-x: auto; }
.card.photo-card { padding-top: 0; overflow: hidden; }
.card.photo-card img { margin: 0 -22px 16px; width: calc(100% + 44px); max-width: none; height: 140px; object-fit: cover; object-position: 50% 60%; border-bottom: 1px solid var(--line); }
.card.slide { aspect-ratio: auto; background: linear-gradient(145deg, var(--navy) 0%, #12486a 100%); color: #e8eef5; border: 0; }
:root[data-theme="dark"] .card.slide { background: linear-gradient(145deg, #12304f 0%, #0e4a55 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card.slide { background: linear-gradient(145deg, #12304f 0%, #0e4a55 100%); } }
.card.slide h3 { color: #fff; font-size: 1.35rem; } .card.slide p { color: #c3d0dd; } .card.slide .icon { color: #7fded0; }
/* Clickable slide card: the slide has no border, so the hover shows a light-teal ring (plus the usual lift)
   and keeps the title readable on the dark gradient. */
.card.slide.has-link:hover, .card.slide.has-link:has(.card-link:focus-visible) { box-shadow: 0 0 0 2px #7fded0, var(--shadow); }
.card.slide.has-link:hover h3 { color: #7fded0; }
.slide-foot { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.2);
  font: 12px var(--mono); color: #9fb3c8; }

/* ---------- patents ---------- */
/* Patent cards reuse a.link-card's hover (lift, accent border, tint);
   the arrow points out (new tab). */
.patent-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-right: 52px; }
.patent-card .num { font: 600 13px var(--mono); color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
.patent-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.4; }
.patent-card .sole { font-size: 12px; font-family: var(--mono); background: var(--warm); color: #2a1800; border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
a.link-card.patent-card::after { content: "\2197"; }

/* ---------- patents (full width) + speaking (own section) ---------- */
.talk-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.talk-notes p { font-size: 1.05rem; }
@media (max-width: 820px) { .talk-row { grid-template-columns: 1fr; gap: 18px; } }

/* photo at the top of a card (e.g. the 8088 build) */
.card .card-photo { display: block; margin: -22px -22px 16px; width: calc(100% + 44px); max-width: none; height: 160px;
  object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.card.term { overflow: hidden; }
.card.term .card-photo + .term-bar { margin-top: 0; }

/* 8086 feature card: photo beside the text */
.card.feature.term { align-items: stretch; }
.feature-photo { width: 100%; height: 100%; min-height: 220px; object-fit: cover; border-radius: 12px; }
.card.feature.term .term-bar { margin: 0 0 14px; }

/* LinkedIn "in" logo (official In-Bug shape from LinkedIn's logo pack), drawn in the text color of
   whatever it sits in: white on dark buttons, dark on bright ones. */
.li-bug { display: inline-block; flex: none; width: 19px; height: 18px; background: currentColor;
  -webkit-mask: url(../img/linkedin-bug.png) center / contain no-repeat; mask: url(../img/linkedin-bug.png) center / contain no-repeat; }
.li-link { display: inline-flex; align-items: center; gap: 6px; }
.li-link .li-bug { width: 15px; height: 14px; }

/* testimonial author row with photo */
.quote figcaption { display: flex; align-items: center; gap: 14px; }
.quote figcaption img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.quote figcaption span { display: block; }
.quote figcaption .rel { font-size: 13px; font-family: var(--mono); color: var(--muted); opacity: .85; margin-top: 2px; }
.grid.two.quotes .quote blockquote { font-size: 1.08rem; }
.quote figcaption .rel a { color: inherit; text-decoration-style: dotted; }
.quote figcaption .rel a:hover { color: var(--accent); }
.quote figcaption .rel .src { display: block; }

/* Testimonial caption layout: photo | name+title, then relation/source.
   Desktop: everything to the right of the photo. Phones: relation/source span the full card width. */
.quote figcaption { display: grid; grid-template-columns: 56px 1fr; column-gap: 14px; align-items: center; }
.quote figcaption .who { grid-column: 2; }
.quote figcaption .rel { grid-column: 2; }
.quote figcaption img { grid-row: 1 / span 2; align-self: center; }
@media (max-width: 560px) {
  .quote figcaption img { grid-row: 1; }
  .quote figcaption .rel { grid-column: 1 / -1; margin-top: 10px; }
}

/* 8086 feature card: split 50/50 on the same line as the two-card row below it (16px gutter), and run the
   photo to the card's top, right and bottom edges, like the full-bleed bike photo in the card underneath. */
.card.feature.term { grid-template-columns: 1fr 1fr; column-gap: 16px; overflow: hidden; }
.card.feature.term .feature-photo { margin: -22px -22px -22px 0; width: calc(100% + 22px); height: calc(100% + 44px);
  max-width: none; border-radius: 0; min-height: 260px; }
.card.feature.term > div { padding-right: 8px; }
@media (max-width: 760px) {
  .card.feature.term { grid-template-columns: 1fr; }
  .card.feature.term .feature-photo { margin: 8px -22px -22px; width: calc(100% + 44px); height: 220px; min-height: 0; }
}
/* Three narrow quote cards: relation/source lines run full width under the photo row (as on phones). */
.grid.three.quotes .quote figcaption img { grid-row: 1; }
.grid.three.quotes .quote figcaption .rel { grid-column: 1 / -1; margin-top: 10px; }
.grid.three.quotes .quote figcaption .rel { font-size: 12px; }
.quote figcaption .rel .src { font-size: inherit; }
.quote figcaption .rel .nw { white-space: nowrap; display: inline; font-size: inherit; }
.hero .lead span { display: block; }
@media (max-width: 480px) { .hero .lead { font-size: 12px; } }

/* Blog post cards: the whole card is clickable (the title link stretches over it), with a fade on hover. */
.post-list li { position: relative; transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease,
  border-left-width .25s ease, padding-left .25s ease; }
.post-list a.title { transition: color .25s ease; }
.post-list a.title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.post-list li:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); box-shadow: var(--shadow); transform: translateY(-2px); }
/* Hover: the thick left border the drafts have (David, 2026-12-01); the padding gives back the 4px so the
   text doesn't move. Drafts already have it, and keep their amber on hover. */
.post-list li:not(.draft):hover { border-left-width: 5px; padding-left: 16px; }
.post-list li.draft:hover { border-color: var(--draft-line); background: var(--draft-bg); }
.post-list li:hover a.title { color: var(--accent); }
.post-list a.title:focus-visible { outline: none; }
.post-list li:has(a.title:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .post-list li, .post-list a.title { transition: none; } .post-list li:hover { transform: none; } }

/* QA round 2 (Bobby): stat labels that wrap kept the body's 28px line-height (inline 14px span). */
.stat span { display: block; line-height: 1.4; margin-top: 4px; }
/* QA round 2: between 641 and 900px the projects grid is 2 columns, so the 3rd small card sat alone. Let it span the row. */
@media (min-width: 641px) and (max-width: 900px) {
  #projects .grid.three > .card:not(.feature):nth-child(4) { grid-column: 1 / -1; }
}

/* Company icons next to testimonial titles: transparent, no tile. Single-color logos (logoMono) are drawn
   in the heading color via a mask, so they show in light and dark mode. */
.quote figcaption .who img.org { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px;
  border: 0; box-shadow: none; border-radius: 0; padding: 0; background: none; object-fit: contain; }
.quote figcaption .org-mono { display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; background: var(--navy);
  -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }

/* Hero stats are links: the whole cell is clickable, with a fade + arrow on hover/focus. */
a.stat { position: relative; display: block; text-decoration: none; color: inherit;
  transition: background-color .25s ease, box-shadow .25s ease; }
a.stat b { transition: color .25s ease; }
a.stat::after { content: "\2192"; position: absolute; right: 16px; top: 18px; font: 600 18px var(--mono); color: #2dd4bf;
  opacity: 0; transform: translateX(-6px); transition: opacity .25s ease, transform .25s ease; }
.hero a.stat:hover, .hero a.stat:focus-visible { background: rgba(45, 212, 191, .14); box-shadow: inset 0 -2px 0 #2dd4bf; outline: none; }
.hero a.stat:hover b, .hero a.stat:focus-visible b { color: #2dd4bf; }
.hero a.stat:hover::after, .hero a.stat:focus-visible::after { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { a.stat, a.stat b, a.stat::after { transition: none; } }

/* "What I do" cards are links: whole card clickable, fade + lift + arrow on hover/focus. */
a.link-card { display: block; position: relative; text-decoration: none; color: inherit;
  transition: border-color .25s ease, background-color .25s ease, box-shadow .25s ease, transform .25s ease; }
a.link-card h3 { transition: color .25s ease; }
a.link-card::after { content: "\2192"; position: absolute; right: 20px; top: 22px; font: 600 20px var(--mono); color: var(--accent);
  opacity: 0; transform: translateX(-6px); transition: opacity .25s ease, transform .25s ease; }
a.link-card:hover, a.link-card:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px);
  background: color-mix(in srgb, var(--accent-soft) 45%, var(--bg)); outline: none; }
a.link-card:hover h3, a.link-card:focus-visible h3 { color: var(--accent); }
a.link-card:hover::after, a.link-card:focus-visible::after { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { a.link-card, a.link-card h3, a.link-card::after { transition: none; } a.link-card:hover { transform: none; } }

/* Project cards as links: an invisible link covers the card; real links/buttons inside stay clickable on top. */
.card.has-link { position: relative; transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease; }
.card.has-link .card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.card.has-link a:not(.card-link), .card.has-link .btn { position: relative; z-index: 2; }
.card.has-link h3 { transition: color .25s ease; }
.card.has-link:hover, .card.has-link:has(.card-link:focus-visible) { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card.has-link:hover h3 { color: var(--accent); }
.card.has-link .card-link:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .card.has-link, .card.has-link h3 { transition: none; } .card.has-link:hover { transform: none; } }

/* Chat transcript (blog posts) */
.chat { display: grid; gap: 14px; margin: 28px 0; }
.chat .msg { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px 4px; background: var(--surface); }
.chat .msg .who { font: 600 13px var(--mono); letter-spacing: .02em; margin-bottom: 8px; color: var(--muted); }
.chat .msg .who span { font-weight: 400; opacity: .8; }
.chat .from-david { border-left: 4px solid var(--warm); background: color-mix(in srgb, var(--warm) 8%, var(--surface)); }
.chat .from-david .who { color: #b7791f; }
.chat .from-hank { border-left: 4px solid var(--accent); }
.chat .from-hank .who { color: var(--accent); }
.chat .from-team { border-left: 4px solid #7c8ea6; background: color-mix(in srgb, #7c8ea6 8%, var(--surface)); }
.chat .msg p, .chat .msg li { font-size: 1rem; }
.chat .msg ul, .chat .msg ol { padding-left: 22px; margin: 0 0 1em; }
.chat .msg blockquote { margin: 0 0 1em; }
:root[data-theme="dark"] .chat .from-david .who { color: var(--warm); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat .from-david .who { color: var(--warm); } }
/* chat header: avatar, name, timestamp */
.chat .msg .who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chat .msg .who .av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; margin: 0; }
.chat .msg .who .nm { flex: 1; }
.chat .msg .who time { font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Avoid single-word last lines (e.g. "findings" alone on phones). Browsers without support ignore it. */
.stat span, .hero .headline, .hero .intro, .section-head p, .card p { text-wrap: pretty; }

/* Bigger profile photo on desktop (phones keep the smaller size). */
@media (min-width: 821px) {
  .hero-grid { grid-template-columns: 1fr 360px; }
  .portrait img { width: 360px; }
}

/* Blog posts (article.prose only, not the About page): justified paragraphs
   with hyphenation to avoid rivers. Left-aligned on phones, where the narrow
   column would leave big gaps, and in chat bubbles. */
@media (min-width: 641px) {
  article.prose > p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
}
.prose figure img { width: 100%; }
.about-photo { margin: 32px 0; }
.about-photo img { display: block; height: auto; border-radius: 12px; margin: 0 0 8px; }
/* TEMPORARY password gate (see layout.html). While locked, everything except the gate is hidden. */
html.site-locked body > *:not(.site-gate) { display: none !important; }
.site-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: linear-gradient(145deg, var(--navy) 0%, #12486a 100%); }
:root[data-theme="dark"] .site-gate { background: linear-gradient(145deg, #0b1420 0%, #12304f 100%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-gate { background: linear-gradient(145deg, #0b1420 0%, #12304f 100%); } }
.site-gate-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 18px 48px rgba(6, 20, 40, .35); padding: 28px; display: grid; gap: 12px; text-align: center; }
.site-gate-card .brand-mark { justify-self: center; }
.site-gate-card h1 { margin: 4px 0 0; font-size: 1.5rem; }
.site-gate-card p { margin: 0; color: var(--muted); }
.site-gate-card input { font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
.site-gate-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.site-gate-card .btn { justify-content: center; }
.site-gate-err { color: #b3261e !important; font-size: 14px; }
:root[data-theme="dark"] .site-gate-err { color: #f4a19b !important; }
/* /ask/ mock chat (placeholder; no backend). */
.ask-wrap { max-width: 760px; padding-bottom: 64px; }
.ask-banner { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 16px; color: var(--ink); }
.chat-mock { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.chat-log { display: grid; gap: 12px; padding: 20px; min-height: 160px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 14px; line-height: 1.55; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }   /* replies are plain text with line breaks */
.bubble.err { border-color: var(--accent); color: var(--muted); }
.ask-notice { font-size: .85rem; color: var(--muted); margin: 8px 0 0; }
.bubble p + p { margin-top: .6em; }
.bubble .who { display: block; font: 600 11px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.bubble .who em { text-transform: none; font-weight: 400; }
.bubble.bot { background: var(--bg); border: 1px solid var(--line); justify-self: start; border-top-left-radius: 4px; }
.bubble.you { background: var(--accent-soft); justify-self: end; border-top-right-radius: 4px; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 16px; }
.chat-suggest button { font: inherit; font-size: 14px; color: var(--accent); background: transparent; border: 1px solid var(--accent);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chat-suggest button:hover { background: var(--accent-soft); }
.bubble.typing { color: var(--muted); font-style: italic; }
.chat-input { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg); }
.chat-input input { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.chat-input input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Floating demo chat window (lower right; a bottom sheet on phones). Built by site.js. */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 50; width: 360px; height: min(520px, calc(100vh - 100px));
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(6, 20, 40, .28); overflow: hidden; }
.chat-widget[hidden] { display: none; }
.chat-widget-bar { display: flex; align-items: center; gap: 4px; padding: 10px 10px 10px 16px; background: var(--navy); color: #fff; }
:root[data-theme="dark"] .chat-widget-bar { background: #12304f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-widget-bar { background: #12304f; } }
.chat-widget-title { flex: 1; font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.chat-widget-bar { cursor: move; touch-action: none; user-select: none; }   /* drag handle (desktop) */
.chat-widget.dragging { opacity: .92; box-shadow: 0 24px 60px rgba(6, 20, 40, .38); }
@media (max-width: 600px) { .chat-widget-bar { cursor: default; } }
/* Resize hit areas (desktop): they straddle the border, so the window doesn't clip (overflow: visible)
   and its parts round their own corners instead. Corners sit above edges. */
.chat-widget { overflow: visible; }
.chat-widget-bar { border-radius: 14px 14px 0 0; }
.chat-widget .chat-input { border-radius: 0 0 14px 14px; }
.chat-resize { position: absolute; z-index: 3; touch-action: none; }
.chat-resize-n { top: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.chat-resize-s { bottom: -4px; left: 12px; right: 12px; height: 8px; cursor: ns-resize; }
.chat-resize-e { right: -4px; top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }
.chat-resize-w { left: -4px; top: 12px; bottom: 12px; width: 8px; cursor: ew-resize; }
.chat-resize-ne, .chat-resize-sw, .chat-resize-se { width: 16px; height: 16px; z-index: 4; }
.chat-resize-ne { top: -4px; right: -4px; cursor: nesw-resize; }
.chat-resize-sw { bottom: -4px; left: -4px; cursor: nesw-resize; }
.chat-resize-se { bottom: -4px; right: -4px; cursor: nwse-resize; }
@media (max-width: 600px) { .chat-resize { display: none; } .chat-widget { overflow: hidden; } }
/* Resize grip, top-left corner over the title bar (desktop). Three short diagonal lines. */
.chat-widget-grip { position: absolute; left: 0; top: 0; width: 16px; height: 16px; cursor: nwse-resize; touch-action: none; z-index: 4;
  background: linear-gradient(315deg, transparent 45%, rgba(255,255,255,.75) 45% 52%, transparent 52% 64%, rgba(255,255,255,.75) 64% 71%, transparent 71% 83%, rgba(255,255,255,.75) 83% 90%, transparent 90%);
  opacity: .7; }
.chat-widget-grip:hover { opacity: 1; }
@media (max-width: 600px) { .chat-widget-grip { display: none; } }
.chat-widget-btn { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: #fff; cursor: pointer; }
.chat-widget-btn:hover, .chat-widget-btn:focus-visible { background: rgba(255,255,255,.15); }
.chat-widget-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-widget-note { margin: 0; padding: 6px 16px; font-size: 12px; color: var(--muted); background: var(--accent-soft); }
.chat-widget .chat-log { flex: 1; overflow-y: auto; min-height: 0; padding: 14px; gap: 10px; align-content: start; }
.chat-widget .bubble { font-size: 14px; max-width: 92%; }
.chat-widget .chat-input { padding: 10px 12px; }
@media (max-width: 600px) {
  .chat-widget { left: 0; right: 0; bottom: 0; width: auto; height: 70vh; border-radius: 14px 14px 0 0; }
}
/* Collapsed chat (phones, after navigating): a small pill in the lower right. */
.chat-launcher { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 999px; border: 0; background: #2dd4bf; color: #062320; font: 600 15px/1 inherit;
  font-family: inherit; box-shadow: 0 8px 24px rgba(6, 20, 40, .3); cursor: pointer; }
.chat-launcher[hidden] { display: none; }
.chat-launcher svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat-widget { box-shadow: 0 18px 48px rgba(0,0,0,.6); } }
/* External-link icon (build.js adds class "ext" to links that leave the site). A mask filled with
   currentColor, so it matches each link's color in both themes and on hover. */
a.ext .ext-tail { white-space: nowrap; display: inline; }   /* beats e.g. ".quote figcaption span { display: block }" */
.btn.ext .ext-tail::after { margin-left: -2px; }
a.ext .ext-tail::after { content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .25em; vertical-align: .05em;
  background-color: currentColor; -webkit-mask: url("../img/external-link.svg") no-repeat center / contain;
  mask: url("../img/external-link.svg") no-repeat center / contain; }
/* A small logo before a link's text (e.g. ShellCon). */
.inline-icon { width: 1em; height: 1em; vertical-align: -0.12em; margin: 0 4px 0 0; border-radius: 3px; display: inline-block; }
.prose img.inline-icon { margin: 0 4px 0 0; border-radius: 3px; }
/* Video thumbnail that opens the video elsewhere (for videos that can't be embedded). */
.video-link { position: relative; display: block; border-radius: 10px; overflow: hidden; margin: 8px 0 10px; }
.prose .video-link img { display: block; width: 100%; height: auto; margin: 0; border-radius: 0; transition: transform .3s ease, filter .3s ease; }
.video-link .play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%;
  background: rgba(0,0,0,.62); box-shadow: 0 0 0 3px rgba(255,255,255,.85); transition: background-color .2s ease, transform .2s ease; }
.video-link .play::after { content: ""; position: absolute; left: 29px; top: 22px; border-style: solid; border-width: 14px 0 14px 22px;
  border-color: transparent transparent transparent #fff; }
.video-link:hover img, .video-link:focus-visible img { transform: scale(1.02); filter: brightness(.9); }
.video-link:hover .play, .video-link:focus-visible .play { background: var(--accent); transform: scale(1.06); }
.video-note { font-size: 15px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .prose .video-link img, .video-link .play { transition: none; } }

/* Phones: wide banner photo at the top of the hero (replaces the circular portrait there).
   To change the photo, replace assets/img/hero-banner.jpg (a wide/landscape image works best). */
.hero-banner { display: none; }
@media (max-width: 820px) {
  .hero { padding-top: 0; }
  .hero-banner { display: block; position: relative; margin-bottom: 22px; }
  .hero-banner img { display: block; width: 100%; height: clamp(220px, 62vw, 340px); object-fit: cover; object-position: 50% 35%; }
  /* fade the photo itself into the hero background (no seam) */
  .hero-banner img { -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, #000 62%, transparent 100%); }
  .hero .portrait { display: none; }
}

/* "Open to new opportunities" badge: one gentle pulse, 2 s after the page loads. */
@keyframes status-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); transform: scale(1); }
  30%  { transform: scale(1.04); }
  100% { box-shadow: 0 0 0 14px rgba(74, 222, 128, 0); transform: scale(1); }
}
.hero .status { animation: status-pulse 1.2s ease-out 2s 1 both; }
@media (prefers-reduced-motion: reduce) { .hero .status { animation: none; } }

/* Inline slideshow (.slideshow; site.js drives it). Images and captions are
   two tracks that slide together; each track is as tall as its tallest item,
   so the caption box keeps one height and the page below never jumps.
   .ss-notes caps long captions (talk speaker notes) and lets them scroll. */
.slideshow { margin: 0 0 1.4em; }
.ss-stage { position: relative; }
.ss-viewport, .ss-caps { overflow: hidden; }
.ss-track { display: flex; transition: transform .35s ease; }
.ss-slide, .ss-cap { flex: 0 0 100%; min-width: 0; }
.ss-slide { display: flex; align-items: center; }
.prose .ss-slide img { display: block; width: 100%; height: auto; margin: 0; }
.ss-cap { margin: 10px 0 0; padding: 0 2px; font-size: 14px; color: var(--muted); }
.ss-cap p { margin: 0 0 .6em; }
.ss-notes .ss-cap { max-height: 18em; overflow-y: auto; font-size: 15px;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; box-sizing: border-box; color: var(--ink); }
.ss-notes .ss-cap:empty { background: transparent; border-color: transparent; }
.ss-notes .ss-cap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ss-count { margin: 6px 0 0; font: 13px var(--mono); color: var(--muted); text-align: center; }
.ss-btn { position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-size: 28px; line-height: 1; cursor: pointer; opacity: .92; }
.ss-btn:hover { opacity: 1; color: var(--accent); }
.ss-btn:disabled { opacity: .35; cursor: default; color: var(--muted); }
.ss-prev { left: 8px; }
.ss-next { right: 8px; }
.ss-btn:focus-visible, .ss-viewport:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.slideshow:not(.is-ready) .ss-btn, .slideshow:not(.is-ready) .ss-count { display: none; }
.slideshow:not(.is-ready) .ss-viewport, .slideshow:not(.is-ready) .ss-caps {
  overflow-x: auto; scroll-snap-type: x mandatory; }
.slideshow:not(.is-ready) .ss-slide, .slideshow:not(.is-ready) .ss-cap { scroll-snap-align: start; }
@media (prefers-reduced-motion: reduce) { .ss-track { transition: none; } }
/* Full screen (data-fullscreen; site.js). The slide is sized to fit the screen's height, with
   the notes below it; the chat widget is hidden while it's open. */
.ss-full-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; opacity: .92; }
.ss-full-btn:hover { opacity: 1; color: var(--accent); }
.ss-full-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.ss-full-btn svg { width: 20px; height: 20px; }
.ss-full-btn .i-exit, .ss-full .ss-full-btn .i-enter { display: none; }
.ss-full .ss-full-btn .i-exit { display: block; }
.slideshow.ss-full { position: fixed; inset: 0; z-index: 1000; margin: 0; padding: 12px 16px;
  box-sizing: border-box; background: var(--bg); display: flex; flex-direction: column;
  justify-content: center; overflow: hidden; }
/* --ss-ratio: the slides' width / height (16:9 unless the slideshow sets it), so the slide fits
   the screen's height in full screen. */
.ss-full .ss-stage, .ss-full .ss-caps {
  width: min(100%, calc((100vh - 26vh - 70px) * var(--ss-ratio, 16 / 9))); margin-left: auto; margin-right: auto; }
@supports (height: 100dvh) {
  .ss-full .ss-stage, .ss-full .ss-caps {
    width: min(100%, calc((100dvh - 26dvh - 70px) * var(--ss-ratio, 16 / 9))); }
}
.ss-full.ss-notes .ss-cap { max-height: 24vh; }
/* Full screen is already the big view: a slide's link to its full-size image would navigate away
   and drop out of full screen, so slide links are inert there (they work normally otherwise). */
.ss-full .ss-slide a { pointer-events: none; cursor: default; }
.ss-full .ss-count { margin-top: 4px; }
html.ss-full-open .chat-widget, html.ss-full-open .chat-launcher { display: none !important; }

/* /projects/ (David, 2026-11-30): every card full width, one per row, at all sizes. */
.projects-all .grid.two, .projects-all .grid.three { grid-template-columns: 1fr; }
/* /projects/: the bike rack photo sits on the right half, edge to edge, like the 8088 photo. */
@media (min-width: 761px) {
  .projects-all .card.photo-card { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px;
    align-content: start; padding-top: 22px; }
  .projects-all .card.photo-card > :not(img):not(.card-link) { grid-column: 1; }
  .projects-all .card.photo-card { position: relative; min-height: 260px; }
  .projects-all .card.photo-card img { position: absolute; top: 0; right: 0; bottom: 0; width: calc(50% - 8px); height: 100%;
    margin: 0; border-bottom: 0; object-position: 50% 50%; }
}
