/* Page styles: home, about, style guide, stubs. */

/* ---------- home hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60% 70% at 85% 10%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%),
    radial-gradient(50% 60% at 10% 100%, color-mix(in srgb, var(--brand-1) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-sunken) 100%); }
.hero-bg::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 85%); -webkit-mask-image: radial-gradient(80% 80% at 60% 40%, #000 30%, transparent 85%); opacity: .55; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--s10); align-items: center; padding-top: var(--s16); padding-bottom: var(--s16); }
.hero-title { font-size: clamp(2.3rem, 1.2rem + 3.6vw, var(--t-5xl)); line-height: 1.04; letter-spacing: -.035em; margin-bottom: var(--s5); font-weight: 700; }
.hero-arrow { display: inline-block; vertical-align: .06em; }
.hero-arrow svg { display: inline; width: 1.05em; height: .55em; }
.hero .lede { margin-bottom: var(--s8); }
.hero .lede em { font-style: normal; color: var(--fg); font-weight: 500; }
.hero-cta { display: flex; gap: var(--s3); flex-wrap: wrap; }
.hero-note { display: flex; align-items: center; gap: var(--s2); margin: var(--s6) 0 0; font-size: var(--t-xs); color: var(--fg-3); }
.hero-figure { margin: 0; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--s4) var(--s4) var(--s3); box-shadow: var(--shadow-lg); backdrop-filter: blur(6px); }
.hero-chart { width: 100%; min-height: 240px; }
.hero-cap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); font-size: var(--t-xs); color: var(--fg-3); padding: var(--s2) var(--s1) 0; }
.hero-cap .swatch-line { width: 22px; }
.hero-cap .swatch-line.brand { border: 0; height: 3px; border-radius: 2px; background: var(--brand-grad); }
.lib-key { display: inline-flex; align-items: center; gap: var(--s2); opacity: 0; transition: opacity 600ms var(--ease); }
.lib-key.in { opacity: 1; }
.lib-key .swatch-line { --c: var(--fg-3); border-top-width: 1.5px; opacity: .6; }
.hero-svg { width: 100%; height: auto; font-family: var(--font-sans); }
.hg-grid { stroke: var(--grid); }
.hg-tick { fill: var(--fg-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.hg-unit { font-weight: 600; }
.hg-ref { stroke: var(--ref-line); stroke-dasharray: 3 5; }
.hg-ref-l { fill: var(--fg-3); font-size: 11px; font-weight: 600; }
.hg-lib path { fill: none; stroke: var(--fg-3); stroke-width: 1; opacity: 0; transition: opacity 900ms var(--ease); }
.hg-lib.in path { opacity: .2; }
.hg-path { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.hg-glow { fill: none; stroke-width: 10; opacity: .35; }
.hg-area { opacity: 0; transition: opacity 900ms var(--ease); }
.hg-ann { opacity: 0; transition: opacity 600ms var(--ease) 100ms; }
.done .hg-ann, .done .hg-area { opacity: 1; }
.hg-peak { fill: var(--bg); stroke: var(--brand-a); stroke-width: 2.5; }
.hg-land { fill: var(--bg); stroke: var(--brand-b); stroke-width: 2.5; }
.hg-label { fill: var(--fg-2); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.hg-head { fill: #fff; filter: drop-shadow(0 0 6px var(--brand-b)); transition: opacity 400ms; }
.hg-head.fade { opacity: 0; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--s8); padding-top: var(--s10); padding-bottom: var(--s10); }
}
@media (max-width: 640px) {
  .hero-grid { padding-top: var(--s8); }
  .hero-cta .btn-lg { width: 100%; }
  .hero-figure { padding: var(--s3) var(--s2) var(--s2); }
}

/* ---------- home stats, cards, steps ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s6); padding-top: var(--s10); padding-bottom: var(--s10); border-bottom: 1px solid var(--line); }
.stats-band .stat { padding-left: var(--s4); border-left: 2px solid var(--line-strong); }
.stats-band .stat:first-child { border-image: var(--brand-grad) 1; }
@media (max-width: 860px) { .stats-band { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .stats-band .stat-value { font-size: var(--t-2xl); } }
.entry { min-height: 260px; }
.entry-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; margin-bottom: var(--s5); color: var(--fg); background: linear-gradient(135deg, color-mix(in srgb, var(--brand-1) 22%, transparent), color-mix(in srgb, var(--brand-2) 22%, transparent)); border: 1px solid var(--line-strong); }
.entry-grid .entry:first-child { border-color: color-mix(in srgb, var(--brand-2) 45%, var(--line)); box-shadow: var(--glow); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s6); counter-reset: s; }
.steps .card { position: relative; padding-top: var(--s8); }
.steps p { color: var(--fg-2); font-size: var(--t-sm); margin: 0; }
.step-n { position: absolute; top: var(--s4); right: var(--s5); font: 700 var(--t-3xl)/1 var(--font-display); color: transparent; -webkit-text-stroke: 1px var(--line-strong); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s12); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + var(--s6)); display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { color: var(--fg-3); text-decoration: none; font-size: var(--t-sm); padding: var(--s1) var(--s4); margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--fg); }
.toc a.on { color: var(--fg); border-left-color: var(--accent); }
.prose { max-width: 74ch; }
.prose section { margin-bottom: var(--s12); }
.prose h2 { font-size: var(--t-xl); margin-bottom: var(--s4); }
.prose p, .prose li { color: var(--fg-2); }
.prose li { margin-bottom: var(--s2); }
.prose li strong, .prose p strong { color: var(--fg); }
.prose .dl dd { color: var(--fg-2); }
.prose .table-wrap { max-width: 420px; }
.lic-list { padding-left: var(--s5); }
.src-list { padding-left: var(--s5); }
.fund { display: flex; gap: var(--s4); align-items: flex-start; margin-bottom: var(--s4); }
.cite-box { position: relative; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); }
.cite-box pre { margin: 0 0 var(--s3); font: 12.5px/1.6 var(--font-mono); color: var(--fg-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.team { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.team li { display: flex; align-items: center; gap: var(--s3); margin: 0; }
.team li > span:last-child { display: grid; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; font: 600 var(--t-sm)/1 var(--font-display); color: var(--fg-on-brand); background: var(--brand-grad); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; gap: var(--s6); } .toc { display: none; } .team { grid-template-columns: 1fr; } }

/* ---------- style guide ---------- */
.sg-grad { flex: 1; min-width: 160px; height: 40px; border-radius: var(--radius); background: var(--brand-grad); }
.sg-brand { gap: var(--s6); }
.sg-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.sg-tok { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-xs); }
.sg-tok span { width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); flex: none; }
.sg-keys { display: grid; gap: var(--s2); font-size: var(--t-sm); }
.sg-key { display: flex; align-items: center; gap: var(--s3); color: var(--fg-2); }
.sg-key .swatch-line { width: 28px; border-top-width: 3px; }
.sg-key code { margin-left: auto; }
.sg-map-ctl { margin-top: var(--s4); justify-content: space-between; gap: var(--s6); }
.sg-play { flex: 1; min-width: 220px; max-width: 420px; }

/* ---------- emulate ---------- */
.emulate-head { margin-bottom: var(--s8); }
.results-empty { margin-top: var(--s2); }
.results-empty .caption { max-width: 80ch; font-family: var(--font-mono); }
.emulate.page { padding-top: var(--s8); }
.emulate-head { margin-bottom: var(--s6); }
.emulate-head h1 { font-size: var(--t-2xl); margin-bottom: var(--s2); }
.emulate-head .lede { font-size: var(--t-md); margin: 0; }
