/* Tokens */
:root {
  color-scheme: dark;
  --bg: #0a0a10;
  --bg-soft: #0f0f17;
  --panel: #13131d;
  --panel-2: #181826;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .14);
  --text: #f3f4f6;
  --muted: #9b9daf;
  --faint: #84869c;
  --accent: #8f82f5;
  --accent-ink: #b9b0ff;
  --accent-soft: rgba(143, 130, 245, .14);
  --layer-fill: .24;
  --red: #f2555a;
  --red-soft: rgba(242, 85, 90, .14);
  --amber: #f3b24e;
  --green: #4ccb8a;
  --blue: #63a8ff;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), 0 0 0 1px var(--line);
  --term-bg: #0c0c13;
  --radius: 14px;
  --font: "Inter", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fbfbfd;
  --bg-soft: #f4f4f8;
  --panel: #ffffff;
  --panel-2: #f6f6fa;
  --line: rgba(16, 16, 32, .08);
  --line-2: rgba(16, 16, 32, .14);
  --text: #14141d;
  --muted: #5c5e70;
  --faint: #6b6d7c;
  --accent: #7c6cf2;
  --accent-ink: #5a49d6;
  --accent-soft: rgba(124, 108, 242, .1);
  --layer-fill: .14;
  --red: #e2474c;
  --red-soft: rgba(226, 71, 76, .1);
  --amber: #c98512;
  --green: #1f9d5c;
  --shadow: 0 30px 70px -35px rgba(30, 30, 60, .35), 0 0 0 1px var(--line);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--panel); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand b { color: var(--accent); font-weight: 800; }
.brand-mark { width: 26px; height: 26px; }
.brand.small { font-size: 15px; }
.brand.small .brand-mark { width: 20px; height: 20px; }
.nav-links { display: flex; gap: 22px; margin-left: 12px; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn .sun { display: none; }
:root[data-theme="light"] .icon-btn .sun { display: block; }
:root[data-theme="light"] .icon-btn .moon { display: none; }
.gh-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: 10px; border: 1px solid var(--line); font-size: 14px; font-weight: 500;
}
.gh-btn:hover { border-color: var(--line-2); background: var(--panel); }
.gh-btn svg { width: 16px; height: 16px; fill: currentColor; }
.stars { font-variant-numeric: tabular-nums; color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line); }

/* Hero */
.hero { position: relative; padding: clamp(56px, 9vw, 120px) 0 clamp(64px, 8vw, 110px); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--line-2) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 60% 40%, #000 20%, transparent 75%);
  opacity: .55;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px; }
.hero-inner > *, .steps > * { min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px;
  padding: 5px 12px 5px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--panel); font-size: 13px; color: var(--muted); font-weight: 500;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
h1 {
  margin: 0; font-size: clamp(40px, 5.4vw, 74px); line-height: 1.02; letter-spacing: -.045em; font-weight: 800;
  background: linear-gradient(180deg, var(--text) 30%, color-mix(in srgb, var(--text) 62%, var(--accent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin: 22px 0 30px; font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 34em; line-height: 1.55; }
.install {
  display: flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 6px 6px 6px 16px; border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow);
}
.install code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 13.5px; color: var(--text); scrollbar-width: none; }
.install code::-webkit-scrollbar { display: none; }
.install .prompt { color: var(--accent); user-select: none; margin-right: 4px; }
.copy {
  flex: none; height: 34px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text); font: 500 13px var(--font);
  transition: background .15s, border-color .15s, transform .1s;
}
.copy:hover { border-color: var(--accent); }
.copy:active { transform: scale(.96); }
.copy.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.hint { margin: 12px 0 0; font-size: 13.5px; color: var(--faint); }
.hint code { font-size: 12.5px; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.cta.center { justify-content: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 11px;
  font-weight: 600; font-size: 15px; transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; fill: currentColor; }
.btn.primary { background: var(--text); color: var(--bg); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px -10px var(--accent); }
.btn.ghost { border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--panel); }
.btn .stars { border-color: var(--line-2); }

/* Hero art: animated stack */
.hero-art { position: relative; margin: 0; aspect-ratio: 1; width: 100%; max-width: 480px; justify-self: center; cursor: pointer; }
.halo {
  position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 68%);
  filter: blur(10px);
}
.stack { position: relative; width: 100%; height: 100%; overflow: visible; }
.stack .layer { stroke: var(--accent); fill: var(--accent); fill-opacity: var(--layer-fill); }
.stack .link { stroke: var(--accent); stroke-width: 10; stroke-linecap: round; fill: none; }
.stack .node { fill: var(--accent); }
.stack .crumb { fill: var(--red); }
.stack .ring { fill: none; stroke: var(--red); stroke-width: 8; }
.stack .ring-pulse { fill: none; stroke: var(--red); stroke-width: 3; opacity: 0; }
.stack * { transform-box: fill-box; transform-origin: center; }

.stack.play .layer { animation: layer-in .7s cubic-bezier(.2, .8, .2, 1) both; }
.stack.play .l3 { animation-delay: .05s; }
.stack.play .l2 { animation-delay: .2s; }
.stack.play .l1 { animation-delay: .35s; }
.stack.play .n1 { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) 1s both; }
.stack.play .link { stroke-dasharray: 1; animation: draw .6s cubic-bezier(.6, 0, .3, 1) 1.2s both; }
.stack.play .n2 { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) 1.75s both; }
.stack.play .c1 { animation: crumb .35s ease-out 2.15s both; }
.stack.play .c2 { animation: crumb .35s ease-out 2.4s both; }
.stack.play .ring { animation: ring-in .6s cubic-bezier(.3, 1.5, .5, 1) 2.75s both, shake .4s ease-in-out 3.3s; }
.stack.play .ring-pulse { animation: pulse 2.4s ease-out 3.4s infinite; }

@keyframes layer-in { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes crumb { from { opacity: 0; transform: translateY(-8px) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes ring-in { from { opacity: 0; transform: scale(2.2); } to { opacity: 1; transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes pulse { 0% { opacity: .8; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.8); } }

.chip {
  position: absolute; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 9px; font: 500 12.5px var(--mono); white-space: nowrap;
  background: var(--panel); box-shadow: var(--shadow); color: var(--text);
  opacity: 0;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.chip i.ok { background: var(--accent); }
.chip.bad { color: var(--red); box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5), 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent); }
.chip-a { top: 10%; left: 62%; }
.chip-b { top: 45%; right: 70%; }
.chip-c { top: 84%; left: 60%; }
.stack.play ~ .chip-a { animation: chip-in .5s ease-out 1.1s forwards; }
.stack.play ~ .chip-b { animation: chip-in .5s ease-out 1.85s forwards; }
.stack.play ~ .chip-c { animation: chip-in .5s ease-out 2.95s forwards; }
@keyframes chip-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Sections */
section { position: relative; }
.section-head { max-width: 680px; margin-bottom: 56px; }
.kicker { margin: 0 0 12px; font: 600 13px var(--mono); color: var(--accent); letter-spacing: .02em; }
h2 { margin: 0; font-size: clamp(30px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -.035em; font-weight: 750; }
.section-head p:not(.kicker) { color: var(--muted); font-size: 18px; margin: 16px 0 0; }
.how, .term-section, .ci, .demo { padding: clamp(72px, 10vw, 130px) 0; border-top: 1px solid var(--line); }

/* How it works */
.steps { display: grid; grid-template-columns: .85fr 1.15fr; gap: 56px; }
.step-list { list-style: none; margin: 0; padding: 0; }
.step {
  min-height: 62vh; display: flex; flex-direction: column; justify-content: center;
  padding-left: 22px; border-left: 2px solid var(--line); opacity: .35;
  transition: opacity .4s, border-color .4s;
}
.step:last-child { min-height: 70vh; }
.step.active { opacity: 1; border-color: var(--accent); }
.step-num { font: 600 13px var(--mono); color: var(--accent); }
.step h3 { margin: 6px 0 10px; font-size: 26px; letter-spacing: -.02em; }
.step p { margin: 0; color: var(--muted); font-size: 16.5px; max-width: 30em; }
.step code { font-size: 14px; color: var(--accent-ink); }

.viz { position: relative; }
.viz-frame {
  position: sticky; top: calc(50vh - 250px); height: 500px;
  border-radius: 18px; background: var(--term-bg); box-shadow: var(--shadow); overflow: hidden;
  color: #e7e8f0; color-scheme: dark;
}
.viz-bar, .term-bar {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .07); font: 12.5px var(--mono); color: #8b8da0;
}
.viz-bar i, .term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #2a2a38; }
.viz-bar .viz-title, .term-bar span:first-of-type { margin-left: 10px; }
.viz-title::before { content: "~/acme"; }
.steps[data-step="2"] .viz-title::before { content: "skillmap.html"; }
.steps[data-step="3"] .viz-title::before { content: "skillmap.html: 3 errors"; }
.steps[data-step="4"] .viz-title::before { content: "Pull request #42: rename archive"; }

.scene { position: absolute; inset: 40px 0 0; padding: 26px; opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s; }
.steps[data-step="1"] .scene-scan,
.steps[data-step="2"] .scene-graph,
.steps[data-step="3"] .scene-graph,
.steps[data-step="4"] .scene-pr { opacity: 1; visibility: visible; }

/* Scene 1: scan */
.tree { list-style: none; margin: 0; padding: 0; font: 13.5px/1 var(--mono); }
.tree li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 8px; color: #c9cad6; }
.tree li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree li em { font-style: normal; font-size: 11.5px; color: #8f82f5; background: rgba(143, 130, 245, .14); padding: 3px 8px; border-radius: 6px; flex: none; }
.tree .dir { color: #fff; font-weight: 600; }
.steps[data-step="1"] .tree li { animation: scan-line .5s ease-out both; }
.steps[data-step="1"] .tree li:nth-child(2) { animation-delay: .15s; }
.steps[data-step="1"] .tree li:nth-child(3) { animation-delay: .3s; }
.steps[data-step="1"] .tree li:nth-child(4) { animation-delay: .45s; }
.steps[data-step="1"] .tree li:nth-child(5) { animation-delay: .6s; }
.steps[data-step="1"] .tree li:nth-child(6) { animation-delay: .75s; }
.steps[data-step="1"] .tree li:nth-child(7) { animation-delay: .9s; }
@keyframes scan-line {
  0% { opacity: 0; transform: translateX(-8px); background: transparent; }
  50% { background: rgba(143, 130, 245, .16); }
  100% { opacity: 1; transform: none; background: transparent; }
}
.scan-sum { margin: 18px 12px 0; font: 13px var(--mono); color: #4ccb8a; }
.steps[data-step="1"] .scan-sum { animation: fade-in .5s ease-out 1.25s both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Scene 2 and 3: graph */
.scene-graph { padding: 12px 18px 18px; display: flex; flex-direction: column; }
.scene-graph svg { width: 100%; flex: 1; min-height: 0; }
.discs circle { fill: rgba(143, 130, 245, .06); stroke: rgba(143, 130, 245, .28); stroke-width: 1.2; }
.discs text { fill: #8b8da0; font: 600 12px var(--mono); text-anchor: middle; letter-spacing: .06em; text-transform: uppercase; }
.edges .e { fill: none; stroke: rgba(143, 130, 245, .75); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; }
.edges .broken { stroke: #f2555a; stroke-dasharray: none; opacity: 0; }
.gn circle, .gn path, .gn rect { fill: #8f82f5; }
.gn text, .missing text { fill: #c9cad6; font: 11.5px var(--mono); text-anchor: middle; }
.gn { opacity: 0; }
.missing { opacity: 0; }
.miss-ring { fill: none; stroke: #f2555a; stroke-width: 3; }
.missing text { fill: #f2555a; }
.finding {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px;
  background: rgba(242, 85, 90, .1); border: 1px solid rgba(242, 85, 90, .35);
  font: 12.5px/1.5 var(--mono); color: #e7e8f0; opacity: 0; transform: translateY(10px);
}
.finding b { color: #fff; font-weight: 600; }
.finding em { color: #8b8da0; font-style: normal; }
.sev { flex: none; color: #fff; background: #f2555a; padding: 1px 7px; border-radius: 5px; font-weight: 600; }

.steps:is([data-step="2"], [data-step="3"]) .gn { animation: pop-in .4s cubic-bezier(.3, 1.5, .5, 1) calc(var(--d) * .12s) both; }
.steps:is([data-step="2"], [data-step="3"]) .gn * { transform-box: fill-box; transform-origin: center; }
.steps:is([data-step="2"], [data-step="3"]) .e:not(.broken) { animation: edge .7s cubic-bezier(.6, 0, .3, 1) both; }
.steps:is([data-step="2"], [data-step="3"]) .e1 { animation-delay: .55s; }
.steps:is([data-step="2"], [data-step="3"]) .e2 { animation-delay: .7s; }
.steps:is([data-step="2"], [data-step="3"]) .e3 { animation-delay: .85s; }
.steps:is([data-step="2"], [data-step="3"]) .e4 { animation-delay: 1s; }
.steps:is([data-step="2"], [data-step="3"]) .e5 { animation-delay: 1.15s; }
.steps:is([data-step="2"], [data-step="3"]) .e6 { animation-delay: 1.3s; }
.steps[data-step="3"] .gn, .steps[data-step="3"] .e:not(.broken) { animation: none; opacity: 1; stroke-dashoffset: 0; }
.steps[data-step="3"] .e:not(.broken) { opacity: .45; }
.steps[data-step="3"] .broken { animation: broken-in .9s ease-out .2s both; }
.steps[data-step="3"] .missing { animation: fade-in .4s ease-out .9s both; }
.steps[data-step="3"] .miss-ring { transform-box: fill-box; transform-origin: center; animation: ring-in .5s cubic-bezier(.3, 1.5, .5, 1) .9s both; }
.steps[data-step="3"] .finding { animation: rise .5s ease-out 1.3s both; }
@keyframes pop-in { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes edge { to { stroke-dashoffset: 0; } }
@keyframes broken-in {
  0% { opacity: 0; stroke-dasharray: 0 400; }
  60% { opacity: 1; stroke-dasharray: 220 400; }
  100% { opacity: 1; stroke-dasharray: 8 7; }
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* Scene 4: pull request */
.scene-pr { display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; }
.scene-pr > * { opacity: 0; transform: translateY(12px); }
.steps[data-step="4"] .scene-pr > * { animation: rise .5s ease-out both; }
.steps[data-step="4"] .scene-pr > :nth-child(2) { animation-delay: .25s; }
.steps[data-step="4"] .scene-pr > :nth-child(3) { animation-delay: .5s; }
.pr-check, .pr-comment, .pr-annot { border: 1px solid rgba(255, 255, 255, .09); border-radius: 10px; background: #12121b; }
.pr-check { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.pr-check div { display: flex; flex-direction: column; line-height: 1.35; }
.pr-check div span { color: #8b8da0; font-size: 12.5px; }
.req { margin-left: auto; font-size: 11.5px; color: #8b8da0; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; padding: 2px 9px; }
.x { flex: none; width: 18px; height: 18px; border-radius: 50%; background: #f2555a; position: relative; }
.x::before, .x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 2px; background: #fff; border-radius: 1px; transform: translate(-50%, -50%) rotate(45deg); }
.x::after { transform: translate(-50%, -50%) rotate(-45deg); }
.x.small { width: 14px; height: 14px; }
.x.small::before, .x.small::after { width: 7px; }
.pr-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); background: #161622; border-radius: 10px 10px 0 0; }
.avatar { width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #8f82f5, #5a49d6); }
.bot { font-size: 11px; border: 1px solid rgba(255, 255, 255, .15); border-radius: 999px; padding: 0 7px; color: #8b8da0; }
.muted { color: #8b8da0; }
.pr-body { padding: 12px 14px 14px; }
.pr-body h4 { margin: 0 0 4px; font-size: 15px; }
.pr-body p { margin: 0 0 10px; font-size: 12.5px; }
.pr-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 12.5px; border-top: 1px solid rgba(255, 255, 255, .06); }
.pr-row span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-row code { font-size: 11.5px; background: rgba(255, 255, 255, .06); padding: 2px 6px; border-radius: 5px; flex: none; }
.pr-annot { overflow: hidden; font: 12.5px var(--mono); }
.annot-file { padding: 9px 14px; color: #8b8da0; border-bottom: 1px solid rgba(255, 255, 255, .07); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.annot-line { display: flex; gap: 14px; padding: 7px 14px; background: rgba(242, 85, 90, .08); white-space: nowrap; overflow: hidden; }
.ln { color: #6b6d80; }
.annot-msg { display: flex; align-items: center; gap: 9px; margin: 8px 12px 12px; padding: 9px 12px; border-left: 3px solid #f2555a; background: rgba(242, 85, 90, .08); border-radius: 0 8px 8px 0; font-family: var(--font); }

/* Terminal */
.terminal { border-radius: var(--radius); background: var(--term-bg); box-shadow: var(--shadow); overflow: hidden; color-scheme: dark; }
.term-bar .exit { margin-left: auto; color: #f2555a; background: rgba(242, 85, 90, .12); padding: 2px 8px; border-radius: 6px; }
.term-body { margin: 0; padding: 20px 22px 24px; overflow-x: auto; font-size: 12.5px; line-height: 1.75; color: #d9dae4; }
.t-p { color: #8f82f5; }
.t-r { color: #f2555a; }
.t-y { color: #f3b24e; }
.t-dim { color: #6b6d80; }
.caret { display: inline-block; width: 8px; height: 15px; vertical-align: -2px; background: #d9dae4; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.rule-card { padding: 22px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.rule-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 500; color: var(--muted); }
.rule-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 14px; color: var(--muted); }
.rule-card code { display: block; color: var(--text); font-size: 13px; margin-bottom: 1px; }
.badge { font-weight: 600; font-size: 12.5px; padding: 3px 9px; border-radius: 6px; }
.badge.err { color: var(--red); background: var(--red-soft); }
.badge.warn { color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); }
.badge.info { color: var(--accent-ink); background: var(--accent-soft); }

/* Why link checkers miss these */
.why { padding: clamp(72px, 10vw, 130px) 0; border-top: 1px solid var(--line); }
.section-head p code { font-size: 15px; color: var(--accent-ink); }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.why-card { display: flex; flex-direction: column; padding: 24px; border-radius: 16px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.why-num { font: 600 13px var(--mono); color: var(--accent); }
.why-card h3 { margin: 8px 0 10px; font-size: 19px; letter-spacing: -.015em; line-height: 1.3; }
.why-card p { margin: 0 0 18px; color: var(--muted); font-size: 15px; }
.why-card p code, .why-note code, .proof-detail code { font-size: 13px; color: var(--accent-ink); }
.why-eg {
  margin-top: auto; padding: 12px 14px; border-radius: 10px; background: var(--term-bg); color: #d9dae4;
  font: 13px/1.6 var(--mono); color-scheme: dark;
}
.why-eg code { color: #f2555a; background: rgba(242, 85, 90, .12); padding: 1px 5px; border-radius: 4px; }
.why-path { color: #8b8da0; }
.proof { margin-top: 28px; padding: 26px; border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.proof-head { margin: 0 0 18px; font: 500 13px var(--mono); color: var(--faint); }
.proof-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.proof-stats div { padding: 16px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.proof-stats b { display: block; font-size: 30px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.proof-stats .err b { color: var(--red); }
.proof-stats span { display: block; margin-top: 6px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.proof-detail { margin: 18px 0 0; color: var(--muted); font-size: 15px; }
.why-note { margin: 22px 0 0; max-width: 62em; font-size: 14px; color: var(--faint); }
.why-note a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* Use it everywhere */
.everywhere { padding: clamp(72px, 10vw, 130px) 0; border-top: 1px solid var(--line); }
.ew-grid { display: grid; grid-template-columns: 1.45fr .75fr; gap: 24px; align-items: start; }
.ew-grid > * { min-width: 0; }
.tabs { border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.tab-list { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--line); }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 9px;
  border: 0; background: transparent; color: var(--muted); font: 500 14px var(--font); cursor: pointer; transition: background .15s, color .15s;
}
.tab-list button:hover { color: var(--text); background: var(--panel-2); }
.tab-list button[aria-selected="true"] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.tab-panel { padding: 22px; }
.tab-panel:focus-visible { outline-offset: -4px; }
.panel-lede { margin: 0 0 18px; color: var(--muted); font-size: 15.5px; max-width: 46em; }
.panel-lede code { font-size: 13.5px; color: var(--accent-ink); }
.panel-lede a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.snippet { border-radius: 12px; background: var(--term-bg); color: #d9dae4; overflow: hidden; color-scheme: dark; }
.snippet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 8px 7px 16px; border-bottom: 1px solid rgba(255, 255, 255, .07); font: 12.5px var(--mono); color: #8b8da0; }
.snippet-bar span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet-bar .copy { height: 30px; background: #181826; border-color: rgba(255, 255, 255, .14); color: #e7e8f0; }
.snippet pre { margin: 0; padding: 18px 20px 20px; overflow-x: auto; font-size: 13px; line-height: 1.75; }
.y-k { color: #b9b0ff; }
.y-s { color: #7fd6a8; }
.y-c { color: #6b6d80; }

/* Fix loop diagram */
.loop { margin: 0; padding: 22px; border-radius: 18px; background: var(--panel); box-shadow: 0 0 0 1px var(--line); }
.loop figcaption { font: 600 13px var(--mono); color: var(--accent); margin-bottom: 14px; }
.loop ol { position: relative; list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.loop ol::before { content: ""; position: absolute; left: 17px; top: 18px; bottom: 18px; width: 2px; background: var(--line-2); }
.loop li { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.loop li > div, .loop-ico svg { opacity: .45; animation: step-on 8s ease infinite; animation-delay: calc(var(--i) * 2s); }
.loop-ico {
  position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--accent);
}
.loop li.bad .loop-ico { color: var(--red); }
.loop li.good .loop-ico { color: var(--green); }
.loop-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loop li div { display: flex; flex-direction: column; padding-top: 1px; }
.loop li b { font-size: 15px; font-weight: 600; }
.loop li span:not(.loop-ico) { font-size: 13.5px; color: var(--muted); }
.loop li code { font-size: 12.5px; }
@keyframes step-on { 0%, 30% { opacity: 1; } 40%, 100% { opacity: .45; } }
.loop-ico { animation: ico-on 8s ease infinite; animation-delay: calc(var(--i) * 2s); }
@keyframes ico-on { 0% { transform: scale(.9); } 6%, 28% { transform: scale(1); box-shadow: inset 0 0 0 1px currentColor, 0 0 0 5px color-mix(in srgb, currentColor 16%, transparent); } 40%, 100% { transform: scale(1); } }

/* Demo */
.video { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); background: #000; aspect-ratio: 16 / 9; }
.video video { display: block; width: 100%; height: 100%; }

/* Final */
.final { padding: clamp(80px, 11vw, 150px) 0; border-top: 1px solid var(--line); text-align: center; }
.final-inner { display: flex; flex-direction: column; align-items: center; }
.final-mark { width: 72px; height: 72px; margin-bottom: 26px; }
.final h2 { margin-bottom: 30px; }
.final .install { width: min(640px, 100%); text-align: left; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0; font-size: 13.5px; color: var(--faint); }
.foot-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.foot-inner a { margin-left: auto; }
.foot-inner a:hover { color: var(--text); }
.foot .brand { color: var(--text); }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Responsive */
@media (min-width: 961px) and (max-width: 1199px) {
  .chip-a, .chip-c { left: auto; right: 0; }
  .chip-b { right: auto; left: 0; }
}
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-art { order: -1; max-width: 340px; }
  .nav-links { display: none; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .viz { order: -1; position: sticky; top: 60px; z-index: 2; padding: 10px 0 14px; background: linear-gradient(var(--bg) 85%, transparent); }
  .viz-frame { position: relative; top: 0; height: 330px; }
  .step-list { padding-top: 12px; }
  .step { min-height: 52vh; }
  .step:last-child { min-height: 60vh; }
  .rules, .why-grid, .ew-grid { grid-template-columns: 1fr; }
  .proof-stats { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) and (max-height: 700px) {
  .viz-frame { height: 280px; }
}
@media (max-width: 560px) {
  .chip { font-size: 11px; padding: 5px 9px; }
  .chip-a { left: auto; right: 0; top: 4%; }
  .chip-b { right: auto; left: 0; top: 40%; }
  .chip-c { left: 50%; translate: -50% 0; top: 98%; }
  .gh-btn span:not(.stars) { display: none; }
  .scene { padding: 16px; }
  .tree li { padding: 7px 8px; font-size: 11.5px; }
  .tree li em { display: none; }
  .finding { font-size: 11px; }
  .scene-pr { gap: 10px; font-size: 12px; }
  .pr-annot { display: none; }
  .foot-inner a { margin-left: 0; }
  .proof { padding: 20px; }
  .proof-stats { grid-template-columns: 1fr 1fr; }
  .proof-stats div:first-child { grid-column: 1 / -1; }
  .tab-list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .tab-panel { padding: 16px; }
}

/* Reduced motion: final states, no movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chip, .gn, .missing, .finding, .scene-pr > *, .js .reveal { opacity: 1 !important; transform: none !important; }
  .edges .e { stroke-dashoffset: 0; }
  .steps:not([data-step="3"]) .broken, .steps:not([data-step="3"]) .missing, .steps:not([data-step="3"]) .finding { opacity: 0 !important; }
  .steps[data-step="3"] .broken { opacity: 1; stroke-dasharray: 8 7; }
  .ring-pulse { display: none; }
  .loop li > div, .loop-ico svg { opacity: 1; }
}
