:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --band: #efe9df;
  --ink: #1b2430;
  --muted: #55606d;
  --line: #ddd5c8;
  --accent: #1d5c7a;
  --accent-ink: #ffffff;
  --navy: #14324a;
  --focus: #c46a1a;
  --will: #2a9461;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --surface: #18202a;
    --band: #151c24;
    --ink: #e8e4dc;
    --muted: #a3acb6;
    --line: #2b3643;
    --accent: #7fc0dc;
    --accent-ink: #0d1a22;
    --navy: #0c1117;
    --focus: #f0a35a;
    --will: #55c48c;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--sans);
}
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.prose > * { max-width: var(--measure); }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; top: 0.5rem; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin: 0.2em 0 0.35em; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0 0 1rem; }
h3 { font-size: 1.2rem; margin: 0 0 0.5rem; }
h3 a { color: var(--ink); text-decoration-color: var(--line); }
h3 a:hover { color: var(--accent); }

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 1rem; padding-bottom: 1rem; }
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.site-header ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding: 0.35rem 0; display: inline-block; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }

section { padding: 3.5rem 0; }
.band { background: var(--band); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero { padding: 4.5rem 0 3.5rem; }
.page-head { padding: 3.5rem 0 1.5rem; }
.eyebrow, .kicker, .date { font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.4rem; font-weight: 600; }
.eyebrow a { color: var(--muted); }
.lede { font-size: 1.2rem; max-width: var(--measure); color: var(--ink); }
.role { color: var(--muted); max-width: var(--measure); }
.sub { color: var(--muted); margin-top: -0.5rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.btn { display: inline-block; padding: 0.7rem 1.2rem; border-radius: 6px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; border: 2px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn-quiet { background: transparent; color: var(--accent); }

.grid3, .grid2 { display: grid; gap: 1.25rem; }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.plain { list-style: none; padding: 0; margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1.4rem 1.5rem; }
.card p { margin: 0.4rem 0 0; color: var(--muted); }
.card .kicker { margin: 0 0 0.4rem; }
.status { font-size: 0.9rem; font-style: italic; }

.checks { padding-left: 1.2rem; }
.checks li { margin-bottom: 0.85rem; }
.checks li::marker { color: var(--accent); }

.items dt { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; margin-top: 1.25rem; }
.items dd { margin: 0.25rem 0 0; color: var(--muted); }

.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 1.75rem 1.25rem; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 0.4rem; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.timeline p { margin: 0.25rem 0 0; }

.notice { margin-top: 2rem; padding: 1rem 1.25rem; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 8px 8px 0; }
.notice p { margin: 0; }

.site-footer { background: var(--navy); color: #d9dee4; padding: 2rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; }
.site-footer p { margin: 0; font-size: 0.9rem; }
.footer-links { list-style: none; display: flex; gap: 1.25rem; margin: 0; padding: 0; }
.site-footer a { color: #f4efe6; }

@media (max-width: 40rem) {
  body { font-size: 1rem; }
  section { padding: 2.5rem 0; }
  .hero { padding: 3rem 0 2.5rem; }
  .lede { font-size: 1.1rem; }
  .card { padding: 1.2rem; }
}
@media print {
  .site-header nav, .actions, .skip { display: none; }
  body { background: #fff; color: #000; }
}

.results { padding: 0 0 3rem; }
.stats { list-style: none; margin: 0; padding: 1.5rem 0 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-top: 1px solid var(--line); }
.stats li { display: flex; flex-direction: column; gap: 0.3rem; }
.num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.lbl { color: var(--muted); font-size: 0.95rem; }
.roles article { padding: 1.25rem 0; border-top: 1px solid var(--line); }
.roles article:last-child { border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.roles h3 { margin: 0; }
.roles .date { margin: 0.2rem 0 0.5rem; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }
.roles ul { margin: 0; padding-left: 1.2rem; }
.roles li { margin-bottom: 0.4rem; }
.roles li::marker { color: var(--accent); }

/* Hero with agent-workflow visualization */
.hero { padding: 3rem 0 3rem; }
.hero-grid { display: grid; gap: 0 3rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-areas: "head viz" "body viz"; align-items: start; }
.hero-head { grid-area: head; align-self: end; }
.hero-body { grid-area: body; }
.hero-body .lede { font-size: 1.1rem; }
.hero-viz { grid-area: viz; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1rem 0.9rem; box-shadow: 0 10px 30px -18px rgba(20, 50, 74, 0.45); align-self: center; }
.viz-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; }
.viz-note { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); font-size: 0.85rem; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--will); box-shadow: 0 0 0 0 rgba(47, 163, 107, 0.6); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(47, 163, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 163, 107, 0); } }
#flow { display: block; width: 100%; height: auto; touch-action: manipulation; margin-top: 0.25rem; }
.viz-caption { min-height: 3.2em; margin: 0.25rem 0 0; font-size: 0.95rem; color: var(--ink); }
.viz-counts { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.viz-counts b { color: var(--accent); font-variant-numeric: tabular-nums; font-size: 1rem; margin-right: 0.15rem; }

.viz-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid; margin-left: 0.5rem; }
.lg:first-child { margin-left: 0; }
.lg-will { border-color: var(--will); }
.lg-agent { border-color: var(--accent); }
.lg-both { border-color: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--will); }
.fl-out { font: 700 16px var(--sans); fill: var(--will); opacity: 0; }
#flow.compact .fl-out { font-size: 21px; }
.fl-out.show { animation: popout 2.2s ease-out; }
@keyframes popout { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

.fl-grid circle { fill: var(--line); }
.fl-edge { fill: none; stroke: var(--line); stroke-width: 2.5; transition: stroke 0.25s; }
.fl-edge.on { stroke: var(--accent); stroke-opacity: 0.7; }
.fl-edge.loop-redirect, .fl-edge.loop-reuse { stroke-dasharray: 6 6; }
.fl-arrow { fill: none; stroke: var(--muted); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.fl-arrow.loop-redirect { stroke: var(--focus); }
.fl-arrow.loop-reuse { stroke: var(--will); }
.fl-node { cursor: pointer; outline: none; }
.fl-core { fill: var(--surface); stroke: var(--accent); stroke-width: 3; transition: fill 0.25s; }
.fl-ring { fill: none; stroke: var(--will); stroke-width: 2.5; }
.who-will .fl-core { stroke: var(--will); }
.fl-halo { fill: var(--accent); opacity: 0; transition: opacity 0.25s; }
.who-will .fl-halo, .who-both .fl-halo { fill: var(--will); }
.fl-node.on .fl-core { fill: var(--accent); }
.who-will.on .fl-core { fill: var(--will); }
.fl-node.on .fl-halo { opacity: 0.16; }
.fl-node:focus-visible .fl-halo { opacity: 0.32; }
.fl-act .fl-core { stroke-dasharray: 4 3; }
.fl-act.busy .fl-core { animation: busy 0.9s ease-out; }
@keyframes busy { 0% { fill: var(--accent); } 100% { fill: var(--surface); } }
.fl-node.talk .fl-halo { animation: talk 1.2s ease-in-out; }
@keyframes talk { 0%, 100% { opacity: 0; } 30%, 70% { opacity: 0.35; } }
.fl-node.pulse .fl-halo { animation: pulse 0.7s ease-out; }
@keyframes pulse { 0% { opacity: 0.5; } 100% { opacity: 0; } }
.fl-label { font: 600 18px var(--sans); fill: var(--ink); pointer-events: none; }
.fl-packet { fill: var(--accent); }
.fl-packet.rework { fill: var(--focus); }
.fl-packet.saved { fill: var(--will); }
@media (prefers-color-scheme: dark) {
  .hero-viz { box-shadow: none; }
}
@media (max-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "viz" "body"; }
  .hero-viz { margin: 0.5rem 0 1.5rem; padding: 0.75rem 0.6rem 0.75rem; }
}
#flow.compact .fl-label { font-size: 23px; }
#flow.compact .fl-edge { stroke-width: 3; }
#flow.compact .fl-core { stroke-width: 3.5; }

/* Video channel + featured player */
.channel { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-bottom: 1.75rem; }
.channel > div { flex: 1 1 18rem; }
.channel h2 { margin: 0 0 0.25rem; }
.channel .sub { margin: 0; }
.channel-logo { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); flex: none; }
.player { display: grid; gap: 1.25rem 1.75rem; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); grid-template-areas: "stage rail" "now rail"; align-items: start; }
.stage { grid-area: stage; position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 22px 50px -24px rgba(20, 50, 74, 0.6); }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.facade { position: absolute; inset: 0; display: block; }
.facade img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease, filter 0.3s; }
.facade:hover img, .facade:focus-visible img { transform: scale(1.03); filter: brightness(0.85); }
.play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); transition: transform 0.2s; filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5)); }
.play svg path:first-child { fill: #212121; fill-opacity: 0.85; transition: fill 0.2s, fill-opacity 0.2s; }
.facade:hover .play svg path:first-child, .facade:focus-visible .play svg path:first-child { fill: #f00; fill-opacity: 1; }
.facade:hover .play { transform: translate(-50%, -50%) scale(1.1); }
.dur { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, 0.8); color: #fff; font-size: 0.75rem; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.dur.big { right: 12px; bottom: 12px; font-size: 0.85rem; padding: 2px 8px; }
.now { grid-area: now; }
.now .kicker { margin-bottom: 0.25rem; }
.now-title { font-size: 1.4rem; margin: 0 0 0.25rem; }
.now-meta { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.9rem; }
.now-desc { margin: 0; color: var(--muted); max-width: 60ch; }
.player.swap .now, .player.swap .stage { animation: swapin 0.35s ease-out; }
@keyframes swapin { from { opacity: 0.4; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.rail { grid-area: rail; list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.rail-item { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0.75rem; align-items: start; padding: 0.5rem; border-radius: 10px; border: 1px solid transparent; color: var(--ink); text-decoration: none; transition: background 0.2s, border-color 0.2s; }
.rail-item:hover { background: var(--surface); border-color: var(--line); }
.rail-item.is-active { background: var(--surface); border-color: var(--accent); }
.rail-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.rail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-text { display: flex; flex-direction: column; gap: 0.2rem; }
.rail-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; }
.rail-meta { font-size: 0.8rem; color: var(--muted); }
.rail-item.is-active .rail-meta::before { content: "Now showing \00b7  "; color: var(--accent); font-weight: 600; }
@media (max-width: 56rem) {
  .player { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "now" "rail"; }
  .rail-item { grid-template-columns: 8rem minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .facade img, .play, .player.swap .now, .player.swap .stage { transition: none; animation: none; }
}

/* GitHub section: GitHub dark look in both themes */
.gh { background: #0d1117; color: #e6edf3; border-top: 1px solid #30363d; border-bottom: 1px solid #30363d; position: relative; overflow: hidden; }
.gh::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60rem 20rem at 85% -10%, rgba(68, 147, 248, 0.14), transparent 60%), radial-gradient(40rem 18rem at 0% 110%, rgba(63, 185, 80, 0.10), transparent 60%); pointer-events: none; }
.gh .wrap { position: relative; }
.gh h2 { color: #f0f6fc; margin: 0 0 0.2rem; }
.gh-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-bottom: 1.75rem; }
.gh-head > div { flex: 1 1 18rem; }
.gh-avatar { width: 72px; height: 72px; border-radius: 50%; box-shadow: 0 0 0 1px #30363d, 0 0 0 4px #0d1117, 0 0 0 5px #3d444d; flex: none; }
.gh-handle { margin: 0; color: #9198a1; font: 0.9rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.gh-btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.55rem 1rem; border-radius: 6px; background: #238636; color: #fff; border: 1px solid rgba(240, 246, 252, 0.1); font-weight: 600; text-decoration: none; font-size: 0.95rem; }
.gh-btn:hover { background: #2ea043; }
.gh-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.repo { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.7rem; transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.repo:hover { border-color: #4493f8; transform: translateY(-2px); box-shadow: 0 12px 30px -18px rgba(68, 147, 248, 0.6); }
.repo-top { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0; font: 600 1rem var(--sans); color: #9198a1; }
.repo-top a { color: #4493f8; text-decoration: none; word-break: break-all; }
.repo-top a:hover { text-decoration: underline; }
.repo-badge { font-size: 0.72rem; font-weight: 500; color: #9198a1; border: 1px solid #3d444d; border-radius: 2em; padding: 0 0.5rem; line-height: 1.5; }
.repo-desc { margin: 0; color: #9198a1; font-size: 0.93rem; }
.repo-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.repo-tags li { font-size: 0.75rem; font-weight: 500; color: #4493f8; background: rgba(56, 139, 253, 0.1); border-radius: 2em; padding: 0.15rem 0.65rem; }
.repo-tags a { color: inherit; text-decoration: none; }
.repo-tags a:hover { text-decoration: underline; }
.repo-clone { display: flex; align-items: center; gap: 0.5rem; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 0.4rem 0.4rem 0.4rem 0.7rem; }
.repo-clone code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font: 0.78rem ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #e6edf3; scrollbar-width: none; }
.repo-clone code::before { content: "$ "; color: #3fb950; }
.copy { flex: none; font: 600 0.75rem var(--sans); color: #e6edf3; background: #21262d; border: 1px solid #3d444d; border-radius: 6px; padding: 0.3rem 0.65rem; cursor: pointer; }
.copy:hover { background: #30363d; }
.copy.ok { color: #3fb950; border-color: #3fb950; }
.repo-meta { margin: auto 0 0; display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: #9198a1; }
.lang { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.lang-py { background: #3572a5; }
.lang-sh { background: #89e051; }
.sep { width: 0.6rem; }
.gh :focus-visible { outline-color: #4493f8; }
@media (max-width: 40rem) { .gh-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Selected Work cards ---------- */
.case-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
.case-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.case-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 18px 40px -24px rgba(20, 50, 74, 0.55); }
.case-preview { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #0d1117; }
.case-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-scan { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--will); box-shadow: 0 0 18px 4px rgba(85, 196, 140, 0.6); animation: pvscan 4.5s linear infinite; }
@keyframes pvscan { from { left: 0; } to { left: 100%; } }
.pv-boxes i { position: absolute; border: 2px solid var(--will); border-radius: 4px; opacity: 0; animation: pvbox 4.5s infinite; }
.pv-boxes i:nth-child(1) { animation-delay: 0.4s; } .pv-boxes i:nth-child(2) { animation-delay: 1.4s; } .pv-boxes i:nth-child(3) { animation-delay: 1.9s; } .pv-boxes i:nth-child(4) { animation-delay: 2.9s; } .pv-boxes i:nth-child(5) { animation-delay: 3.4s; }
@keyframes pvbox { 0% { opacity: 0; } 8%, 70% { opacity: 1; } 85%, 100% { opacity: 0; } }
.pv-recall { display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; padding: 1.5rem; background: radial-gradient(30rem 16rem at 80% 0%, rgba(68, 147, 248, 0.18), transparent 60%), #0d1117; }
.pv-flow { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pv-node { font: 600 0.78rem var(--sans); color: #c9d1d9; border: 1.5px solid #3d6f8f; border-radius: 999px; padding: 0.3rem 0.7rem; animation: pvnode 6s infinite; }
.pv-node.pv-h { border-color: #55c48c; }
.pv-node:nth-child(1) { animation-delay: 0s; } .pv-node:nth-child(2) { animation-delay: 0.6s; } .pv-node:nth-child(3) { animation-delay: 1.2s; } .pv-node:nth-child(4) { animation-delay: 1.8s; } .pv-node:nth-child(5) { animation-delay: 2.4s; } .pv-node:nth-child(6) { animation-delay: 3s; } .pv-node:nth-child(7) { animation-delay: 3.6s; } .pv-node:nth-child(8) { animation-delay: 4.2s; }
@keyframes pvnode { 0%, 100% { background: transparent; color: #c9d1d9; } 6%, 14% { background: #7fc0dc; color: #0d1a22; } }
.pv-node.pv-h { animation-name: pvnodeh; }
@keyframes pvnodeh { 0%, 100% { background: transparent; color: #c9d1d9; } 6%, 14% { background: #55c48c; color: #0d1a22; } }
.pv-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pv-chips b { font: 700 0.7rem ui-monospace, Menlo, Consolas, monospace; padding: 0.25rem 0.55rem; border-radius: 4px; }
.case-body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; flex: 1; }
.case-body h3 { font-size: 1.35rem; margin: 0; }
.case-body p { margin: 0; color: var(--muted); }
.case-body .kicker { margin: 0; }
.case-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.case-tags span { font-size: 0.75rem; font-weight: 600; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 999px; padding: 0.15rem 0.6rem; }
.case-cta { margin-top: auto; padding-top: 0.4rem; font-weight: 700; text-decoration: none; }

/* decision chips (shared) */
.d-match { background: #1f7a4d; color: #fff; }
.d-confirm_applicability { background: #b7791f; color: #fff; }
.d-no_match { background: #5b6672; color: #fff; }
.d-escalate_review { background: #b4432f; color: #fff; }

/* ---------- Case pages ---------- */
.case-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem 1.5rem; margin: 1.75rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); max-width: none !important; }
.facts dt { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.facts dd { margin: 0.15rem 0 0; font-weight: 600; }
.page-head.case-head .wrap.prose > .facts { max-width: none; }
.demo-sec { padding-top: 1.5rem; }
.demo-foot { font-size: 0.8rem; color: var(--muted); margin: 0.75rem 0 0; }
.two-col { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.roles-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.roles-list li { padding: 0.6rem 0 0.6rem 1rem; border-left: 3px solid var(--accent); margin-bottom: 0.5rem; background: var(--surface); border-radius: 0 8px 8px 0; padding-right: 0.75rem; }
.human-list li { border-left-color: var(--will); }
.flow-steps { list-style: none; counter-reset: fs; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.flow-steps li { counter-increment: fs; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: 10px; padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.flow-steps li::before { content: counter(fs, decimal-leading-zero); font: 700 0.75rem ui-monospace, Menlo, monospace; color: var(--muted); }
.flow-steps li.human { border-top-color: var(--will); }
.flow-steps b { font-family: var(--serif); font-size: 1.1rem; }
.flow-steps span { color: var(--muted); font-size: 0.9rem; }

/* Photo-to-catalog demo */
.cap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; box-shadow: 0 18px 40px -26px rgba(20, 50, 74, 0.5); }
.cap-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.9rem; }
.cap-tabs button { font: 600 0.85rem var(--sans); border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 0.45rem 0.9rem; border-radius: 999px; cursor: pointer; }
.cap-tabs button[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.cap-tabs .cap-replay { margin-left: auto; background: transparent; }
.cap-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
.cap-stage { position: relative; border-radius: 10px; overflow: hidden; background: #000; }
.cap-stage img { display: block; width: 100%; height: auto; }
.cap-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.cap-scan { fill: #55c48c; opacity: 0.85; filter: drop-shadow(0 0 8px #55c48c); transition: x 0.45s ease; }
.cap-box rect { fill: rgba(85, 196, 140, 0.12); stroke: #55c48c; stroke-width: 3; vector-effect: non-scaling-stroke; animation: boxin 0.45s ease-out; transition: fill 0.2s; }
.cap-box.review rect { stroke: #f0a35a; fill: rgba(240, 163, 90, 0.14); stroke-dasharray: 8 5; }
.cap-box.hot rect { fill: rgba(85, 196, 140, 0.35); }
.cap-box.review.hot rect { fill: rgba(240, 163, 90, 0.4); }
@keyframes boxin { from { opacity: 0; transform: scale(1.04); transform-box: fill-box; transform-origin: center; } to { opacity: 1; } }
.cap-sheet { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.cap-sheet-bar { display: flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0.75rem; background: #1e6e42; color: #fff; font-size: 0.8rem; font-weight: 600; }
.cap-sheet-bar .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.45); }
.cap-sheet-name { margin-left: 0.4rem; }
.cap-scroll { max-height: 26rem; overflow: auto; }
.cap-sheet table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.cap-sheet th { position: sticky; top: 0; background: var(--surface); text-align: left; font-weight: 700; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.cap-sheet td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.cap-sheet td.a { color: var(--muted); }
.cap-row { animation: rowin 0.4s ease-out; }
.cap-row.hot td { background: color-mix(in srgb, var(--will) 14%, transparent); }
@keyframes rowin { from { opacity: 0; transform: translateY(-6px); background: color-mix(in srgb, var(--will) 25%, transparent); } to { opacity: 1; } }
.chip { display: inline-block; font-size: 0.7rem; font-weight: 700; padding: 0.1rem 0.5rem; border-radius: 999px; white-space: nowrap; }
.chip.ok { background: color-mix(in srgb, var(--will) 18%, transparent); color: var(--will); }
.chip.review { background: color-mix(in srgb, var(--focus) 18%, transparent); color: var(--focus); }
.cap-tally { margin: 0.75rem 0 0.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cap-note { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* Recall replay */
.rc { display: grid; gap: 1rem 1.25rem; grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 2fr); grid-template-areas: "steps panel" "foot foot"; }
.rc .demo-foot { grid-area: foot; margin: 0; }
.rc-steps { grid-area: steps; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.rc-stepbtn { width: 100%; display: flex; align-items: center; gap: 0.6rem; text-align: left; font: 600 0.88rem var(--sans); color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 0.45rem 0.6rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
.rc-stepbtn .n { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 0.75rem; border: 2px solid var(--accent); color: var(--accent); background: var(--surface); }
.rc-stepbtn.who-both .n { border-color: var(--will); color: var(--will); }
.rc-stepbtn.done { color: var(--ink); }
.rc-stepbtn.done .n { background: var(--accent); color: var(--accent-ink); }
.rc-stepbtn.who-both.done .n { background: var(--will); color: #fff; }
.rc-stepbtn.on { background: var(--surface); border-color: var(--line); color: var(--ink); }
.rc-stepbtn:hover { color: var(--ink); }
.rc-panel { grid-area: panel; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1.25rem 1.4rem 1rem; display: flex; flex-direction: column; gap: 0.6rem; min-height: 26rem; box-shadow: 0 18px 40px -26px rgba(20, 50, 74, 0.5); }
.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.rc-who { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.2rem 0.6rem; border-radius: 999px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rc-who.who-both { color: var(--will); background: color-mix(in srgb, var(--will) 16%, transparent); }
.rc-ctrl { display: flex; gap: 0.35rem; }
.rc-ctrl button { font: 600 0.85rem var(--sans); border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; padding: 0.3rem 0.7rem; cursor: pointer; }
.rc-step-title { font-size: 1.35rem; margin: 0.2rem 0 0; }
.rc-step-desc { margin: 0; color: var(--muted); }
.rc-view { margin-top: 0.4rem; flex: 1; }
.rc-view.swap > * { animation: swapin 0.35s ease-out; }
.rc-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.rc-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--will)); transition: width 0.4s ease; }
.rc-card { border: 1px solid var(--line); border-left: 4px solid var(--focus); border-radius: 8px; padding: 0.9rem 1rem; background: var(--bg); }
.rc-card p { margin: 0; }
.rc-k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.rc-title { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; margin-top: 0.3rem !important; }
.rc-sub { color: var(--muted); font-size: 0.88rem; margin-top: 0.2rem !important; }
.rc-ok { color: var(--will); font-weight: 600; font-size: 0.88rem; margin-top: 0.6rem !important; }
.rc-kv { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.25rem; margin: 0; padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 0.92rem; }
.rc-kv dt { color: var(--muted); font-weight: 600; }
.rc-kv dd { margin: 0; }
.rc-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; background: var(--bg); }
.rc-table th { text-align: left; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.rc-table td { padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.rc-table td:last-child { white-space: normal; min-width: 14rem; }
.rc-in { animation: rowin 0.45s ease-out both; }
.dchip { display: inline-block; font: 700 0.68rem ui-monospace, Menlo, Consolas, monospace; padding: 0.2rem 0.45rem; border-radius: 4px; margin-right: 0.4rem; }
.dwhy { color: var(--muted); font-size: 0.8rem; }
.rc-check { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.rc-check li { padding: 0.55rem 0.8rem 0.55rem 2.3rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); position: relative; animation: rowin 0.4s ease-out both; }
.rc-check li::before { position: absolute; left: 0.75rem; top: 0.5rem; font-weight: 800; }
.rc-check .c-done::before { content: "\2713"; color: var(--accent); }
.rc-check .c-human { border-color: var(--will); }
.rc-check .c-human::before { content: "\25CF"; color: var(--will); }
.rc-check .c-open::before { content: "\25CB"; color: var(--focus); }
.dgrid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.dcard p { margin: 0.6rem 0 0; color: var(--muted); font-size: 0.93rem; }
.conn { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.1fr) auto minmax(0, 1fr); align-items: stretch; }
.conn-col { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; }
.conn-col.core { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.conn-col h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.conn-col ul { margin: 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
.conn-col li { margin-bottom: 0.35rem; }
.conn-arrow { align-self: center; font-size: 1.6rem; color: var(--accent); }
@media (max-width: 56rem) {
  .cap-grid { grid-template-columns: minmax(0, 1fr); }
  .cap-scroll { max-height: 18rem; }
  .rc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "panel" "steps" "foot"; }
  .rc-steps { flex-direction: row; overflow-x: auto; gap: 0.25rem; padding-bottom: 0.25rem; }
  .rc-stepbtn .l { display: none; }
  .rc-stepbtn { width: auto; padding: 0.3rem; }
  .rc-panel { min-height: 0; }
  .conn { grid-template-columns: minmax(0, 1fr); }
  .conn-arrow { transform: rotate(90deg); justify-self: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pv-scan, .pv-boxes i, .pv-node, .cap-row, .rc-in, .rc-check li, .rc-view.swap > *, .cap-box rect { animation: none !important; }
  .pv-boxes i { opacity: 1; }
}
.rc-who { white-space: nowrap; }
.pv-recall { gap: 1.75rem; padding: 2rem; }
.pv-node { font-size: 0.9rem; padding: 0.4rem 0.85rem; }
.pv-chips b { font-size: 0.78rem; }

/* ---------- Living capability cards ---------- */
.caps { align-items: stretch; }
.cap-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s; }
.cap-card:hover, .cap-card:focus-within { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 20px 44px -26px rgba(20, 50, 74, 0.6); }
.cap-viz { height: 132px; padding: 10px 12px 6px; background: radial-gradient(22rem 9rem at 85% 0%, rgba(68, 147, 248, 0.16), transparent 60%), #0d141c; border-bottom: 1px solid var(--line); }
.cap-viz svg { width: 100%; height: 100%; display: block; }
.cap-body { padding: 1.2rem 1.4rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.cap-body h3 { margin: 0; }
.cap-body p { margin: 0; color: var(--muted); }
.cap-proof { border-top: 1px dashed var(--line); padding-top: 0.7rem; margin-top: 0.3rem; }
.cap-proof ul { margin: 0 0 0.5rem; padding-left: 1.05rem; font-size: 0.9rem; color: var(--ink); }
.cap-proof li { margin-bottom: 0.3rem; }
.cap-proof li::marker { color: var(--will); }
.cap-proof a { font-weight: 700; text-decoration: none; font-size: 0.92rem; }
@media (hover: hover) and (pointer: fine) {
  .cap-proof { max-height: 0; opacity: 0; overflow: hidden; padding-top: 0; border-top-color: transparent; transition: max-height 0.35s ease, opacity 0.3s, padding-top 0.3s; }
  .cap-card:hover .cap-proof, .cap-card:focus-within .cap-proof { max-height: 24rem; opacity: 1; padding-top: 0.7rem; border-top-color: var(--line); }
}
.vz-l { font: 600 9.5px var(--sans); fill: #c9d6e2; }
.vz-c { font: 700 9px var(--sans); fill: #55c48c; letter-spacing: 0.06em; text-transform: uppercase; }
/* timeline */
.tl-track { fill: #17222d; }
.tl-fill { fill: #2a7fa3; transform-box: fill-box; transform-origin: left; animation: tlfill 7s ease-in-out infinite; }
@keyframes tlfill { 0% { transform: scaleX(0); } 12% { transform: scaleX(1); } 80% { transform: scaleX(1); opacity: 1; } 95%, 100% { transform: scaleX(1); opacity: 0; } }
.tl-now { stroke: #55c48c; stroke-width: 2; stroke-dasharray: 3 3; animation: tlnow 7s linear infinite; }
@keyframes tlnow { from { transform: translateX(0); } 75% { transform: translateX(280px); } to { transform: translateX(280px); opacity: 0; } }
/* fleet */
.fl-bar { fill: #2b3a48; animation: flbar 7s ease-in-out infinite; }
.fl-bar.b-rep { --c: #f0a35a; } .fl-bar.b-fix { --c: #7fc0dc; } .fl-bar.b-keep { --c: #55c48c; }
@keyframes flbar { 0%, 4% { fill: #2b3a48; } 12%, 78% { fill: var(--c); } 90%, 100% { fill: #2b3a48; } }
.c-rep { fill: #f0a35a; } .c-fix { fill: #7fc0dc; } .c-keep { fill: #55c48c; }
.fl-base { stroke: #2f4052; }
.fl-scan { fill: #55c48c; opacity: 0.8; animation: flscan 7s linear infinite; }
@keyframes flscan { 0% { transform: translateX(0); opacity: 0.9; } 40% { transform: translateX(278px); opacity: 0.9; } 45%, 100% { transform: translateX(278px); opacity: 0; } }
/* loop */
.lp-ring { fill: none; stroke: #2f4052; stroke-width: 2; stroke-dasharray: 4 5; animation: lpring 20s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes lpring { to { transform: rotate(360deg); } }
.lp-n { fill: #0d141c; stroke: #7fc0dc; stroke-width: 2.5; }
.lp-n.n-both { stroke: #55c48c; }
.lp-pk { fill: #9fdcf2; filter: drop-shadow(0 0 5px #7fc0dc); }
@media (prefers-reduced-motion: reduce) {
  .tl-fill, .tl-now, .fl-bar, .fl-scan, .lp-ring { animation: none !important; }
  .fl-bar { fill: var(--c); } .tl-now, .fl-scan { display: none; }
}
.cap-tech { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.15rem 0 0 !important; }
.cap-tech span { font: 600 0.72rem var(--mono, ui-monospace, Menlo, monospace); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 0.12rem 0.45rem; }
