/* v2: single-column redesign. Geist + Geist Mono only, light/dark tokens.
   Theme resolves in this order: data-theme on <html> (set from localStorage by the
   inline head script), then the OS preference. */

:root {
  --bg: #ffffff;
  --fg: #0b0b0b;
  --fg-2: #3d3d3d;
  --muted: #6b6b6b;
  --faint: #a3a3a3;
  --rule: #ebebeb;
  --surface: #f6f6f5;
  --accent: #c8102e;
  --accent-wash: #fbe8ec;
  --selection: #fbe8ec;

  --font-sans: 'Geist', ui-sans-serif, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --col: 640px;
  --col-wide: 760px;
  --gutter: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --fg: #ededed;
    --fg-2: #c4c4c4;
    --muted: #8f8f8f;
    --faint: #5c5c5c;
    --rule: #1f1f1f;
    --surface: #131313;
    --accent: #ff4d5e;
    --accent-wash: #2a0d12;
    --selection: #3a1219;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #ededed;
  --fg-2: #c4c4c4;
  --muted: #8f8f8f;
  --faint: #5c5c5c;
  --rule: #1f1f1f;
  --surface: #131313;
  --accent: #ff4d5e;
  --accent-wash: #2a0d12;
  --selection: #3a1219;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}
::selection { background: var(--selection); }
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: calc(var(--col) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }

/* Small mono label used for section heads, dates, stat names */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.fine { font-size: 12px; line-height: 1.55; color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  max-width: calc(var(--col) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 28px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-name { font-weight: 600; font-size: 15px; text-decoration: none; letter-spacing: -0.01em; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--fg); }
.site-nav .nav-cta { color: var(--fg); font-weight: 500; }

.theme-toggle {
  width: 32px; height: 32px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--faint); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---------- Homepage sections ---------- */
main { padding-bottom: 40px; }
.section { padding: 36px 0; }
.section + .section { border-top: 1px solid var(--rule); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.section-head a { font-family: var(--font-mono); font-size: 12px; color: var(--muted); text-decoration: none; }
.section-head a:hover { color: var(--fg); }

.intro { padding-top: 32px; }
.intro h1 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 4px; }
.intro .role { color: var(--muted); font-size: 15px; margin-bottom: 24px; }
.intro p { color: var(--fg-2); margin-bottom: 14px; }
.intro .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border-radius: 8px;
  font: 500 14px var(--font-sans);
  text-decoration: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
}
.btn:hover { border-color: var(--faint); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { opacity: 0.88; border-color: var(--fg); }

/* Performance */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.stat { background: var(--bg); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-family: var(--font-mono); font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.stat .v.neg { color: var(--accent); }
.stat .label { font-size: 11px; }
.spark { margin-top: 16px; }
.spark svg { width: 100%; height: 90px; display: block; }
.spark .line { stroke: var(--fg); }
.spark .base { stroke: var(--rule); }
.spark .dot { fill: var(--accent); }
.asof { margin-top: 10px; }
.perf-foot { margin-top: 12px; }

/* Plain dated lists: letters, resources, videos */
.list { list-style: none; }
.list a {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.list li:first-child a { border-top: 1px solid var(--rule); }
.list .meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.list .t { color: var(--fg); }
.list .side { font-family: var(--font-mono); font-size: 12px; color: var(--faint); }
.list a:hover .t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.list.resources a { grid-template-columns: 1fr auto; }
.list .d { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }

/* Videos: the markup inside youtube:start/end is written by scripts/sync-youtube.js,
   so these selectors follow its class names. */
.videos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
.videos .kd-stream-card:nth-child(n+5) { display: none; }
.kd-stream-card { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.kd-stream-thumb { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); aspect-ratio: 16 / 9; background: var(--surface); }
.kd-stream-thumb img { width: 100%; height: 100%; object-fit: cover; }
.kd-stream-play { display: none; }
.kd-stream-body { display: flex; flex-direction: column; gap: 2px; }
.kd-stream-title { font-size: 14px; line-height: 1.4; }
.kd-stream-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.kd-stream-tag { color: var(--accent); }
.kd-stream-card:hover .kd-stream-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:first-of-type { border-top: 1px solid var(--rule); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 0;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-mono); color: var(--muted); }
.faq details[open] summary::after { content: '\2212'; }
.faq details p { color: var(--fg-2); padding: 0 0 14px; }

/* Subscribe */
.subscribe h2 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.subscribe p { color: var(--fg-2); margin-bottom: 16px; }
.sub-form { display: flex; gap: 8px; }
.sub-form input[type="email"] {
  flex: 1; min-width: 0;
  height: 38px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--bg); color: var(--fg);
  font: 14px var(--font-sans);
}
.sub-form input[type="email"]:focus { outline: none; border-color: var(--faint); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.sub-status { margin-top: 12px; font-size: 14px; color: var(--fg-2); }
[hidden] { display: none !important; }
.sub-fine { margin-top: 12px; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: calc(var(--col) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 32px var(--gutter) 48px;
  border-top: 1px solid var(--rule);
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; margin-bottom: 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--fg); }
.footer-meta { margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--faint); }

/* ---------- Letters archive ---------- */
.kd-archive { max-width: calc(var(--col) + var(--gutter) * 2); margin: 0 auto; padding: 32px var(--gutter) 40px; }
.kd-article-eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kd-archive-h { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 10px; }
.kd-archive-sub { color: var(--fg-2); margin-bottom: 32px; }
.kd-start { margin-bottom: 36px; }
.kd-start .kd-eyebrow, .kd-eyebrow { font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.kd-start-sub { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.kd-start-list { display: flex; flex-direction: column; }
.kd-start-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.kd-start-row:first-child { border-top: 1px solid var(--rule); }
.kd-start-n { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 3px; }
.kd-start-title { display: block; }
.kd-start-why { display: block; font-size: 14px; color: var(--muted); }
.kd-start-row:hover .kd-start-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

.kd-archive-filters { display: flex; gap: 6px; margin-bottom: 12px; }
.kd-filter {
  font: 500 12px var(--font-mono);
  padding: 5px 10px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.kd-filter:hover { color: var(--fg); }
.kd-filter.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.kd-archive-list { display: flex; flex-direction: column; }
.kd-archive-row {
  display: grid; grid-template-columns: 48px 56px 1fr auto; gap: 12px; align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.kd-archive-row:first-child { border-top: 1px solid var(--rule); }
.kd-archive-row[hidden] { display: none; }
.kd-archive-n, .kd-archive-date, .kd-archive-cat { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.kd-archive-cat { color: var(--faint); }
.kd-archive-row:hover .kd-archive-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.kd-archive-cta { margin-top: 28px; }
.kd-archive-cta a { font-weight: 500; }

/* ---------- Letter page ---------- */
.kd-letter { max-width: calc(var(--col) + var(--gutter) * 2); margin: 0 auto; padding: 32px var(--gutter) 40px; }
.kd-letter-eyebrow { display: flex; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.kd-letter-cat { color: var(--accent); }
.kd-letter h1 { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -0.025em; margin-bottom: 14px; }
.kd-letter-standfirst { font-size: 18px; line-height: 1.5; color: var(--fg-2); margin-bottom: 28px; }
.kd-letter-tldr {
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 28px;
}
.kd-letter-tldr ul { margin: 8px 0 0 18px; font-size: 15px; color: var(--fg-2); }
.kd-letter-tldr li { margin-bottom: 6px; }
.kd-letter-cover { border-radius: 10px; border: 1px solid var(--rule); margin-bottom: 32px; }
.kd-letter > p { font-size: 17px; line-height: 1.7; color: var(--fg-2); margin-bottom: 20px; }
.kd-letter > p strong { color: var(--fg); }
.kd-letter h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; margin: 40px 0 14px; }
.kd-letter h3 { font-size: 17px; font-weight: 600; margin: 28px 0 10px; }
.kd-letter-list { margin: 0 0 20px 22px; font-size: 17px; line-height: 1.7; color: var(--fg-2); }
.kd-letter-list li { margin-bottom: 8px; }
.kd-letter-figure { margin: 32px 0; }
.kd-letter-figure img { border-radius: 10px; border: 1px solid var(--rule); }
.kd-letter-figcaption { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.kd-letter-quote { border-left: 2px solid var(--rule); padding-left: 18px; margin: 24px 0; color: var(--fg-2); font-size: 17px; line-height: 1.7; }
.kd-letter-quote p { margin-bottom: 12px; }
.kd-letter-pull { border-left: 2px solid var(--accent); padding-left: 18px; margin: 32px 0; font-size: 21px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
.kd-letter-author { border-top: 1px solid var(--rule); padding-top: 20px; margin-top: 40px; font-size: 15px; color: var(--fg-2); }
.kd-letter-disclaimer { margin-top: 18px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.kd-letter-disclaimer p { margin-bottom: 8px; }
.kd-letter-subscribe {
  margin-top: 32px; padding: 20px; border: 1px solid var(--rule); border-radius: 10px;
}
.kd-letter-subscribe-h { font-weight: 600; margin: 4px 0 6px; }
.kd-letter-subscribe p { color: var(--fg-2); font-size: 15px; margin-bottom: 14px; }
.kd-letter-subscribe-btn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 16px;
  border-radius: 8px; background: var(--fg); color: var(--bg);
  font-weight: 500; font-size: 14px; text-decoration: none;
}
.kd-letter-subscribe-btn:hover { opacity: 0.88; }
.kd-letter-nav { display: flex; justify-content: space-between; margin-top: 28px; font-size: 14px; }
.kd-letter-nav a { color: var(--muted); text-decoration: none; }
.kd-letter-nav a:hover { color: var(--fg); }

/* ---------- Ambient side animation (assets/v2-ambient.js) ---------- */
.ambient { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.site-header, main, .site-footer, .kd-archive, .kd-letter { position: relative; z-index: 1; }

.site-nav .ext { font-size: 11px; color: var(--faint); }
.site-nav a:hover .ext { color: var(--accent); }
.section-lede { color: var(--fg-2); margin-bottom: 16px; }

/* ---------- About ---------- */
.about-photo { width: 120px; border-radius: 10px; border: 1px solid var(--rule); margin-bottom: 20px; filter: grayscale(1); }

/* ===================== Flair layer (2026-10-06) =====================
   Motion only runs when <html> has .motion (set in the head boot script when the
   visitor has not asked for reduced motion), so the page is complete at rest. */

/* ---------- Hero ---------- */
.intro .hero-name {
  font-size: clamp(40px, 7.2vw, 60px);
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: -0.045em;
  margin-bottom: 12px;
}
.intro .role { margin-bottom: 14px; }
.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: 4px 11px 4px 10px; margin-bottom: 26px;
  background: var(--bg);
}
.live-pill .pulse { position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.live-pill .pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: kd-pulse 2.2s cubic-bezier(.2,.7,.2,1) infinite;
}
@keyframes kd-pulse { from { transform: scale(1); opacity: .55; } to { transform: scale(3.4); opacity: 0; } }

/* ---------- Entrance ---------- */
@keyframes kd-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
html.motion .site-header { animation: kd-rise .8s cubic-bezier(.2,.7,.2,1) both; }
html.motion .intro > * { animation: kd-rise .9s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 80ms + 120ms); }
.intro > :nth-child(1) { --i: 0; } .intro > :nth-child(2) { --i: 1; } .intro > :nth-child(3) { --i: 2; }
.intro > :nth-child(4) { --i: 3; } .intro > :nth-child(5) { --i: 4; } .intro > :nth-child(6) { --i: 5; }
.section { transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
html.motion .section.pending { opacity: 0; transform: translateY(22px); }
html.motion .kd-letter > *, html.motion .kd-archive > * { animation: kd-rise .9s cubic-bezier(.2,.7,.2,1) both; }
html.motion .kd-letter > :nth-child(n+5), html.motion .kd-archive > :nth-child(n+5) { animation: none; }
html.motion .kd-letter > :nth-child(2), html.motion .kd-archive > :nth-child(2) { animation-delay: 80ms; }
html.motion .kd-letter > :nth-child(3), html.motion .kd-archive > :nth-child(3) { animation-delay: 160ms; }
html.motion .kd-letter > :nth-child(4), html.motion .kd-archive > :nth-child(4) { animation-delay: 240ms; }

/* ---------- Links: underline draws left to right ---------- */
.site-nav a, .footer-links a, .section-head a, .kd-letter-nav a {
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size .4s cubic-bezier(.2,.7,.2,1), color .2s;
}
.site-nav a:hover, .footer-links a:hover, .section-head a:hover, .kd-letter-nav a:hover { background-size: 100% 1px; }
.site-nav .ext { display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1), color .2s; }
.site-nav a:hover .ext { transform: translate(2px, -2px); }

/* ---------- Lists: rows lean in, arrows nudge ---------- */
.list .t, .list .side, .kd-archive-title, .kd-start-title { display: inline-block; transition: transform .35s cubic-bezier(.2,.7,.2,1), color .2s; }
.list a:hover .t, .kd-archive-row:hover .kd-archive-title, .kd-start-row:hover .kd-start-title { transform: translateX(4px); text-decoration: none; }
.list a:hover .side { transform: translateX(3px); color: var(--accent); }

/* ---------- Buttons ---------- */
.btn { transition: transform .25s cubic-bezier(.2,.7,.2,1), border-color .2s, opacity .2s, background-color .2s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.28), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
.btn-primary:hover::after { animation: kd-sheen .9s cubic-bezier(.2,.7,.2,1); }
@keyframes kd-sheen { to { left: 130%; } }
:root[data-theme="dark"] .btn-primary::after { background: linear-gradient(100deg, transparent, rgba(0,0,0,.18), transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary::after { background: linear-gradient(100deg, transparent, rgba(0,0,0,.18), transparent); } }

/* ---------- Stats, FAQ, video cards ---------- */
.stat { transition: background-color .3s; }
.stat:hover { background: var(--surface); }
.faq summary::after { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.faq summary:hover::after { color: var(--fg); }
html.motion .faq details[open] p { animation: kd-rise .45s cubic-bezier(.2,.7,.2,1) both; }
.kd-stream-thumb img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.kd-stream-card:hover .kd-stream-thumb img { transform: scale(1.03); }

/* ---------- Theme toggle ---------- */
.theme-toggle { transition: color .2s, border-color .2s; }
.theme-toggle svg { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.theme-toggle:hover svg { transform: rotate(30deg); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- Living equity curve ---------- */
.spark { position: relative; cursor: crosshair; }
html.motion .spark svg.draw { clip-path: inset(0 100% 0 0); }
html.motion .spark svg.draw.drawn { clip-path: inset(0 0 0 0); transition: clip-path 1.8s cubic-bezier(.65,0,.35,1); }
.spark-x, .spark-dot, .spark-tip, .spark-end { position: absolute; pointer-events: none; }
.spark-x { top: 0; height: 90px; width: 1px; background: var(--faint); opacity: 0; transition: opacity .2s; }
.spark-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--fg);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 4px var(--bg); opacity: 0; transition: opacity .2s;
}
.spark-tip {
  top: -10px; transform: translate(-50%, -100%);
  font-family: var(--font-mono); font-size: 11px; white-space: pre;
  background: var(--fg); color: var(--bg); padding: 3px 8px; border-radius: 6px;
  opacity: 0; transition: opacity .2s;
}
.spark.hover .spark-x { opacity: .6; }
.spark.hover .spark-dot, .spark.hover .spark-tip { opacity: 1; }
.spark-end {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  transform: translate(-50%, -50%) scale(0); transition: transform .5s cubic-bezier(.2,.7,.2,1.4);
}
.spark-end::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: kd-pulse 2.2s cubic-bezier(.2,.7,.2,1) infinite;
}
.spark.ended .spark-end { transform: translate(-50%, -50%) scale(1); }
.spark.hover .spark-end { opacity: .35; }

@media (prefers-reduced-motion: reduce) {
  .live-pill .pulse::after, .spark-end::after { animation: none; }
  .btn:hover { transform: none; }
}

/* ---------- Scroll progress bar (from the original kieranduff.com) ---------- */
.kd-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 100;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- Handbook lightbox (homepage; 40% scroll or exit intent, 7-day dismiss) ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lb[hidden] { display: none !important; }
.lb-card {
  position: relative; width: 100%; max-width: 460px;
  background: var(--bg); border: 1px solid var(--rule); border-radius: 14px;
  padding: 32px 28px 26px;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.04);
}
.lb-close {
  position: absolute; top: 10px; right: 12px; width: 32px; height: 32px;
  border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 8px;
}
.lb-close:hover { color: var(--fg); background: var(--surface); }
.lb-h { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 10px; }
.lb-sub { color: var(--fg-2); font-size: 15px; margin-bottom: 18px; }
.lb-sub a { text-decoration-color: var(--accent); }
.lb-accent { color: var(--accent); }
.lb-fine { margin-top: 12px; }
@keyframes kd-lb-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes kd-lb-card { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
html.motion .lb.is-open { animation: kd-lb-in .35s ease both; }
html.motion .lb.is-open .lb-card { animation: kd-lb-card .5s cubic-bezier(.2,.7,.2,1) both; }
@media (max-width: 520px) {
  .lb-form { flex-direction: column; }
  .lb-form input[type="email"], .lb-form .btn { flex: none; height: 44px; }  /* flex: 1 collapses the field in a column */
  .lb-form .btn { justify-content: center; }
  .lb-card { padding: 28px 20px 22px; }
}

/* ===================== Homepage panels, featured, proof (2026-10-06) ===================== */

/* Panels: on pages with <body data-ambient="full"> the dot field runs the full width,
   and each section, the header and the footer sit on a solid panel. The dots and the
   cursor glow show only in the gaps between sections. */
body[data-ambient="full"] .site-header,
body[data-ambient="full"] .site-footer,
body[data-ambient="full"] .section {
  background: var(--bg);
}
body[data-ambient="full"] .section {
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
}
body[data-ambient="full"] .section + .section { border-top: 0; margin-top: 64px; }
body[data-ambient="full"] main { padding-bottom: 64px; }
body[data-ambient="full"] .site-footer { border-top: 0; }
@media (max-width: 899px) {
  /* Phones keep the panel gaps (the dot field animates behind them), a little tighter. */
  body[data-ambient="full"] .section + .section { margin-top: 44px; }
  body[data-ambient="full"] main { padding-bottom: 44px; }
}

/* "Coming soon" loading bar: fills in uneven steps (quick, stall, quick), holds,
   fades, and starts again. Static at 40% under reduced motion. */
.coming-soon { margin-bottom: 12px; }
.cs-bar { width: 100%; max-width: 280px; height: 3px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.cs-bar span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent); transform-origin: 0 50%; transform: scaleX(.4); }
html.motion .cs-bar span { animation: kd-load 6s cubic-bezier(.45,0,.25,1) infinite; }
@keyframes kd-load {
  0%   { transform: scaleX(0);    opacity: 1; }
  14%  { transform: scaleX(.22);  opacity: 1; }
  24%  { transform: scaleX(.26);  }
  42%  { transform: scaleX(.58);  }
  54%  { transform: scaleX(.62);  }
  74%  { transform: scaleX(.91);  }
  84%  { transform: scaleX(1);    opacity: 1; }
  93%  { transform: scaleX(1);    opacity: 0; }
  100% { transform: scaleX(0);    opacity: 0; }
}

/* Button external-arrow */
.btn .ext { font-size: 12px; color: var(--faint); display: inline-block; transition: transform .3s cubic-bezier(.2,.7,.2,1), color .2s; }
.btn:hover .ext { transform: translate(2px, -2px); color: var(--accent); }

/* Featured in: thumbnail rows */
.list.featured a { grid-template-columns: 96px 1fr auto; align-items: center; gap: 14px; }
.list.featured .pod-thumb { position: relative; display: block; width: 96px; border-radius: 6px; }
.list.featured img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface); }
.list.featured .show { display: block; font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 1px; }
.list.featured .t { line-height: 1.4; }
@media (max-width: 520px) {
  .list.featured a { grid-template-columns: 72px 1fr; }
  .list.featured .pod-thumb { width: 72px; }
  .list.featured .side { display: none; }
}

/* What people are saying */
.quotes { columns: 2; column-gap: 14px; }
.quote {
  break-inside: avoid; margin: 0 0 14px;
  border: 1px solid var(--rule); border-radius: 10px; padding: 16px 16px 14px;
  transition: border-color .2s;
}
.quote:hover { border-color: var(--faint); }
.quote blockquote { color: var(--fg-2); font-size: 15px; line-height: 1.55; margin-bottom: 12px; }
.quote figcaption { display: flex; flex-direction: column; gap: 2px; }
.quote .who { font-size: 14px; font-weight: 500; }
@media (max-width: 560px) { .quotes { columns: 1; } }

/* About page (v2) */
.about .about-photo { width: 132px; margin-bottom: 22px; }
.about-intro .label { margin-bottom: 6px; }
.about-standfirst { font-size: 18px; line-height: 1.5; color: var(--fg-2); }
.about .section > p { color: var(--fg-2); margin-bottom: 14px; }
.about-pull { border-left: 2px solid var(--accent); padding-left: 16px; margin: 20px 0 4px; font-size: 19px; line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; }
.about .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.about-disclosure { margin-top: 16px; }

/* ===================== Round 3 (2026-10-06 late) ===================== */

/* Sticky header. Sits above the panels; gains a hairline once the page scrolls (v2.js). */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  padding-top: 18px; padding-bottom: 18px;
  box-shadow: 0 1px 0 transparent;
  transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 1px 0 var(--rule); }
.section { scroll-margin-top: 84px; }

/* Performance hangs off the hero: one panel, no gap. */
body[data-ambient="full"] .intro + #performance { margin-top: 0; padding-top: 12px; }
.intro + #performance { border-top: 0; padding-top: 12px; }

/* What people are saying: on hover the quote types itself out while a red line
   runs round the card (v2.js). The full text is always in the DOM. */
.quote { position: relative; }
.quote:hover { border-color: var(--rule); }
.q-trace { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.q-trace rect { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: opacity .25s; }
.typing .q-trace rect { opacity: 1; }
.typing .q-rest { color: transparent; }
.typing:not(.typed) .q-typed.q-on::after {
  content: ''; display: inline-block; width: 2px; height: 1em; margin-right: -2px;
  vertical-align: -2px; background: var(--accent);
}

/* Footer: page links left, social icons right. */
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.footer-top .footer-links { margin-bottom: 0; }
.footer-social { display: flex; gap: 4px; }
.footer-social a {
  width: 34px; height: 34px; display: inline-grid; place-items: center;
  border-radius: 8px; color: var(--muted);
  transition: color .2s, background-color .2s, transform .25s cubic-bezier(.2,.7,.2,1);
}
.footer-social a:hover { color: var(--fg); background: var(--surface); transform: translateY(-1px); }
.footer-social svg { width: 17px; height: 17px; }

/* Legal pages */
.legal-intro .hero-name { font-size: clamp(34px, 6vw, 48px); }
.legal-intro .label { margin-bottom: 8px; }
.legal-body h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; margin: 28px 0 8px; }
.legal-body h2:first-child, .legal-body .risk-box + h2 { margin-top: 0; }
.legal-body p, .legal-body li { color: var(--fg-2); font-size: 15px; line-height: 1.7; }
.legal-body p { margin-bottom: 12px; }
.legal-body ul, .legal-body ol { margin: 0 0 14px 20px; }
.legal-body li { margin-bottom: 4px; }
.legal-body strong { color: var(--fg); }
.legal-body a { text-decoration-color: var(--accent); }
.risk-box { border-left: 2px solid var(--accent); background: var(--accent-wash); border-radius: 0 8px 8px 0; padding: 16px 18px; margin-bottom: 28px; }
.risk-box p { color: var(--fg); margin-bottom: 6px; }
.risk-box p:last-child { margin-bottom: 0; }

/* Hover-typing boxes beyond the quotes (outline host must be positioned) */
.stat { position: relative; }
.kd-stream-thumb .q-trace { z-index: 1; }
.kd-stream-card.typing .kd-stream-title { text-decoration: none; }

/* About intro: colour portrait to the right of the name, no hover effect. */
.about-intro { display: grid; grid-template-columns: 1fr 168px; column-gap: 32px; align-items: end; }
.about-intro > * { grid-column: 1; }
.about-intro .about-photo {
  grid-column: 2; grid-row: 1 / span 3; align-self: end;
  position: relative; display: block; width: 100%; margin: 0;
  border: 0; border-radius: 12px; overflow: hidden; filter: none;
}
.about-photo img { display: block; width: 100%; height: auto; }
@media (max-width: 560px) {
  .about-intro { grid-template-columns: 1fr 92px; column-gap: 18px; }
  .about-intro .about-photo { grid-row: 1 / span 2; border-radius: 10px; }
  .about-intro .about-standfirst { grid-column: 1 / -1; margin-top: 8px; }
}

/* Header on phones: never wrap; the nav Subscribe link (.hide-sm) drops out,
   the page's own sign-up forms cover it. */
.site-name, .site-nav a { white-space: nowrap; }
@media (max-width: 480px) {
  .hide-sm { display: none !important; }
  .site-nav { gap: 16px; }
}
.about-sub { margin-top: 36px; }

/* ===================== Mobile pass (2026-10-07) ===================== */

/* Performance stats: two columns on phones (four rows), so nothing is cut off. */
@media (max-width: 560px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* Hamburger menu (≤640px). v2.js adds .has-menu to the header and builds the button
   and panel from the existing nav links, so without JS the plain nav still shows. */
.menu-btn { display: none; }
.menu-panel { display: none; }
@media (max-width: 640px) {
  .site-header.has-menu .site-nav > a { display: none; }
  .site-header.has-menu .menu-btn {
    width: 32px; height: 32px; display: inline-grid; place-items: center;
    border: 1px solid var(--rule); border-radius: 8px; background: transparent;
    color: var(--fg); cursor: pointer; padding: 0;
  }
  .menu-btn span, .menu-btn span::before, .menu-btn span::after {
    display: block; width: 14px; height: 1.5px; background: currentColor; border-radius: 1px;
    position: relative; transition: transform .3s cubic-bezier(.2,.7,.2,1), background-color .2s;
  }
  .menu-btn span::before, .menu-btn span::after { content: ''; position: absolute; left: 0; }
  .menu-btn span::before { top: -5px; }
  .menu-btn span::after { top: 5px; }
  .menu-open .menu-btn span { background: transparent; }
  .menu-open .menu-btn span::before { transform: translateY(5px) rotate(45deg); }
  .menu-open .menu-btn span::after { transform: translateY(-5px) rotate(-45deg); }

  .site-header.has-menu .menu-panel {
    display: flex; flex-direction: column; gap: 2px;
    position: absolute; left: 0; right: 0; top: 100%;
    padding: 8px var(--gutter) 20px;
    background: var(--bg); border-bottom: 1px solid var(--rule);
    box-shadow: 0 18px 30px -24px rgba(0,0,0,.35);
    visibility: hidden; opacity: 0; transform: translateY(-6px);
    transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.2,1), visibility 0s .3s;
  }
  .site-header.has-menu.menu-open .menu-panel { visibility: visible; opacity: 1; transform: none; transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.2,1); }
  .menu-panel a:not(.btn) {
    display: flex; justify-content: space-between; align-items: center;
    padding: 13px 0; font-size: 17px; text-decoration: none; color: var(--fg);
    border-bottom: 1px solid var(--rule);
  }
  .menu-panel a:not(.btn) .ext { font-size: 13px; color: var(--faint); }
  .menu-panel .btn { margin-top: 16px; justify-content: center; height: 44px; font-size: 15px; }
}

/* Phone tap targets: small text links get an invisible hit area of about 44px
   (no layout change); icon buttons and filter pills grow. */
@media (max-width: 640px) {
  .footer-links a, .footer-meta a, .section-head a, .site-name, .kd-archive-cta a, .kd-letter-nav a { position: relative; }
  .footer-links a::before, .footer-meta a::before, .section-head a::before, .site-name::before,
  .kd-archive-cta a::before, .kd-letter-nav a::before {
    content: ''; position: absolute; inset: -11px -6px;
  }
  .footer-links { gap: 10px 22px; }
  .footer-social a { width: 42px; height: 42px; }
  .footer-social svg { width: 19px; height: 19px; }
  .site-header.has-menu .menu-btn, .theme-toggle { width: 40px; height: 40px; }
  .kd-filter { padding: 9px 14px; }
}
