/* Home page sections: the request graph, the features flow and the stats (plus older demo styles). */

/* These pages are dark in both themes: use the dark palette and dark-theme images throughout. */
.demo-dark {
  color-scheme: dark;
  --bg: #121213; --dot: #252527; --surface: #1a1a1c; --surface-2: #212124;
  --line: #2c2c30; --line-strong: #3b3b40; --ink: #eeebe7; --ink-2: #c8c4bf; --muted: #8f8b86;
  --accent: #ed2658; --accent-hover: #d61f4e; --accent-soft: #3a2025;
  background: #121213; color: var(--ink);
}
.demo-dark .on-light { display: none !important; }
.demo-dark .on-dark { display: block !important; }
.demo-dark .i-moon { display: none; }
.demo-dark .i-sun { display: block; }
.demo-dark #theme-btn { display: none; }
.src, .graph { position: relative; isolation: isolate; padding: 120px 0 140px; }
.graph { background: #121213; color: #eeebe7; padding-top: 0; }
.graph-line { margin-bottom: 56px; background: rgba(255, 255, 255, .3); }
.src::before, .graph::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 14px 14px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 280px, #000 calc(100% - 280px), transparent);
          mask-image: linear-gradient(to bottom, transparent, #000 280px, #000 calc(100% - 280px), transparent);
}
.demo-title .light { font-weight: 300; letter-spacing: -.03em; }
.graph-intro { max-width: 760px; margin: 22px auto 0; text-align: center; color: #c8c4bf; font-size: clamp(17px, 1.6vw, 21px); line-height: 1.5; text-wrap: balance; }
.graph-intro + .graph-sub { margin-top: 28px; font-size: 15px; color: #8f8b86; }
.demo-tag { margin: 0 0 14px; text-align: center; color: #8f8b86; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.demo-title { margin: 0; text-align: center; color: #eeebe7; font-size: clamp(34px, 4.6vw, 64px); letter-spacing: -.035em; line-height: 1.05; }
.orb { display: block; }

/* ---------- Sources ---------- */
.src-stage { position: relative; display: grid; grid-template-columns: 1.15fr .9fr 1fr; align-items: center; gap: 24px; margin-top: 72px; }
.src-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.src-lines path { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.65, 0, .35, 1); }
.src-lines path.out { stroke: rgba(255, 255, 255, .45); }
.src-lines path.on { stroke-dashoffset: 0; }

.src-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.src-item { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 18px; opacity: .15; translate: -12px 0; transition: opacity .6s ease, translate .6s ease; }
.src-item.in, .still .src-item { opacity: 1; translate: 0 0; }
.src-label { text-align: right; color: #b9b5b0; font-size: 15px; }
.src-card { height: 92px; overflow: hidden; padding: 12px 14px; border-radius: var(--r); background: #e9e7e3; color: #1b1a19; font-size: 12px; }
.src-card i { display: block; height: 5px; margin-top: 7px; border-radius: 3px; background: #cfccc6; }
.src-card i.short { width: 60%; }
.mail-from { display: flex; align-items: center; gap: 8px; }
.av { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: #6f8fe0; color: #fff; font-size: 9px; font-weight: 700; }
.mail-subj { display: block; margin-top: 6px; }
.doc-head { display: flex; justify-content: space-between; align-items: center; }
.pdf { padding: 2px 6px; border-radius: 4px; background: #d4314f; color: #fff; font-size: 10px; font-weight: 700; }
.portal { padding: 0; }
.url { display: flex; align-items: center; gap: 4px; padding: 5px 10px; background: #d9d6d1; color: #6b6762; font-size: 10px; }
.url span { width: 6px; height: 6px; border-radius: 999px; background: #a9a59f; }
.url span:last-of-type { margin-right: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 8px; padding: 7px 10px 0; }
.fields em { padding: 3px 6px; border: 1px solid #c6c3bd; border-radius: 4px; font-style: normal; font-size: 10px; color: #6b6762; }
.btn-fake { display: block; width: 80px; margin: 6px 10px 0 auto; padding: 3px 0; border-radius: 4px; background: #d4314f; color: #fff; text-align: center; font-size: 10px; }
.sheet { padding: 0; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
.sheet th { padding: 5px 8px; background: #1f7a4d; color: #fff; text-align: left; font-weight: 600; }
.sheet td { padding: 4px 8px; border-bottom: 1px solid #d6d3ce; }
.call { background: #232326; color: #b9b5b0; }
.call-head { display: flex; justify-content: space-between; font-size: 11px; }
.wave { display: flex; align-items: center; gap: 2px; height: 50px; margin-top: 8px; }
.wave s { flex: 1; height: var(--h); border-radius: 2px; background: #8f8b86; text-decoration: none; }
.policy b { display: block; letter-spacing: .06em; font-size: 11px; margin-bottom: 6px; }
.policy div { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #d6d3ce; font-size: 11px; }

.src-orb { width: 100%; aspect-ratio: 1; position: relative; z-index: 1; }

.proc { position: relative; z-index: 1; padding: 26px 28px; border-radius: var(--r-lg); background: #1a1a1c; border: 1px solid #2c2c30; opacity: 0; translate: 16px 0; transition: opacity .6s ease, translate .6s ease; }
.proc.in, .still .proc { opacity: 1; translate: 0 0; }
.proc header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.proc h3 { margin: 0; font-size: 22px; color: #eeebe7; }
.proc header span { color: #8f8b86; font-size: 13px; }
.proc ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.proc li { counter-increment: s; display: flex; gap: 14px; align-items: flex-start; color: #c8c4bf; font-size: 16px; opacity: 0; translate: 0 6px; transition: opacity .4s ease, translate .4s ease; }
.proc li.in, .still .proc li { opacity: 1; translate: 0 0; }
.proc li::before { content: counter(s); display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 999px; border: 1px solid #3b3b40; font-size: 12px; color: #c8c4bf; }
.proc li.hl { color: #eeebe7; }
.proc li.hl::before { border-color: #ed2658; color: #ff5a7f; }

@media (max-width: 900px) {
  .src-stage { grid-template-columns: 1fr; margin-top: 48px; }
  .src-item { grid-template-columns: 1fr; gap: 6px; }
  .src-label { text-align: left; }
  .src-orb { width: 220px; margin: 8px auto; }
}

/* ---------- Graph ---------- */
.graph-sub { max-width: 760px; margin: 18px auto 0; text-align: center; color: #b9b5b0; font-size: 18px; min-height: 2.9em; transition: opacity .3s; }
.graph-sub b { color: #fff; font-weight: 600; white-space: nowrap; }
.graph-stage { position: relative; width: min(100%, 1280px); aspect-ratio: 1280 / 1043; margin: -40px auto 0; }
.graph-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; font-family: inherit; }
.graph-orb { position: absolute; left: 51.8%; top: 51.3%; width: 12%; aspect-ratio: 1; translate: -50% -50%; }
/* The robot artwork has its antenna above the head, so it is nudged up to sit visually centred in the ring. */
.graph-bot { position: absolute; left: 51.8%; top: 51.3%; width: 6.2%; z-index: 1; height: auto; translate: -50% -58.5%; }
.graph-bot.bump { animation: bot-bump .6s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bot-bump { 40% { scale: 1.12; } }
@media (prefers-reduced-motion: reduce) { .graph-bot.bump { animation: none; } }
.spoke { fill: none; stroke: rgba(255, 255, 255, .2); stroke-width: 1.3; transition: stroke .4s; }
.spoke.lit { stroke: rgba(255, 255, 255, .55); }
.glow { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: .22 2; stroke-dashoffset: .22; opacity: .95; }
.node { fill: #48484e; transition: fill .4s, r .4s; }
.node.lit { fill: #fff; r: 8px; }
.label { fill: #8e8d93; font-size: 17px; transition: fill .4s; }
.label.lit { fill: #fff; }
.group { fill: #5f5e64; font-size: 13.5px; letter-spacing: .16em; }
@media (max-width: 640px) { .graph-sub { font-size: 16px; } }

/* Phones: the radial map is replaced by the request as a short vertical path. */
.graph-steps { display: none; }
@media (max-width: 640px) {
  .graph-stage { display: none; }
  .graph-steps { display: grid; gap: 0; list-style: none; margin: 36px auto 0; padding: 0; max-width: 340px; }
  .graph-steps li { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: var(--r-lg); background: #1a1a1c; border: 1px solid #2c2c30; transition: border-color .4s, background .4s; }
  .graph-steps li + li { margin-top: 36px; }
  .graph-steps li + li::before { content: ""; position: absolute; left: 50%; top: -37px; height: 36px; width: 1px; background: #3b3b40; transition: background .4s; }
  .graph-steps li.lit { border-color: rgba(237, 38, 88, .6); background: #1f1a1c; }
  .graph-steps li.lit::before { background: #ed2658; }
  .gs-k { color: #8f8b86; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
  .gs-v { color: #eeebe7; font-size: 18px; font-weight: 600; }
}

/* Centre of the request graph: a glowing rose ring just behind the robot. Ripples are added by demo-graph.js
   each time a light runs along a line, so the pulses are timed with the lines. */
.graph-pulse { --ring: 237, 38, 88; position: absolute; left: 51.8%; top: 51.3%; width: 9%; aspect-ratio: 1; translate: -50% -50%; }
.graph-pulse .core, .graph-pulse .ripple { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.graph-pulse .core {
  border: 2px solid rgba(var(--ring), .95);
  box-shadow: 0 0 6px rgba(var(--ring), .85), 0 0 22px rgba(var(--ring), .5), inset 0 0 16px rgba(var(--ring), .3);
}
.graph-pulse .ripple { border: 1px solid rgba(var(--ring), .75); box-shadow: 0 0 10px rgba(var(--ring), .35); animation: ring-ripple 1.6s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes ring-ripple { 0% { scale: 1; opacity: .85; } 100% { scale: 2.8; opacity: 0; } }
.graph-pulse.flash .core { animation: ring-flash .7s ease-out; }
@keyframes ring-flash { 30% { scale: 1.1; box-shadow: 0 0 12px rgba(var(--ring), 1), 0 0 50px rgba(var(--ring), .85), inset 0 0 26px rgba(var(--ring), .55); } }
@media (prefers-reduced-motion: reduce) { .graph-pulse .ripple { display: none; } .graph-pulse.flash .core { animation: none; } }

/* ---------- Features flow (Why AIE section): boxes → robot → panel ---------- */
.ff { margin-top: 64px; }
.ff-stage { position: relative; display: grid; grid-template-columns: 1.25fr .6fr 1fr; align-items: center; gap: 28px; }
.ff-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.ff-line { fill: none; stroke: rgba(255, 255, 255, .16); stroke-width: 1.2; transition: stroke .4s; }
.ff-line.on { stroke: rgba(255, 255, 255, .5); }
.ff-glow { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: .25 2; stroke-dashoffset: .25; }
.ff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; position: relative; z-index: 1; }
.ff-item { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 18px; }
.ff-label { text-align: right; color: #b9b5b0; font-size: 15px; line-height: 1.3; }
.ff-card {
  position: relative; display: block; width: 100%; aspect-ratio: 400 / 110; padding: 0; overflow: hidden; cursor: pointer; text-align: left;
  border-radius: var(--r); border: 1px solid #2e2e33; background: #1c1c1f; transition: border-color .3s, transform .3s, box-shadow .3s;
}
.ff-card:hover { border-color: #4a4a50; }
.ff-card[aria-selected="true"] { border-color: rgba(237, 38, 88, .75); box-shadow: 0 0 0 1px rgba(237, 38, 88, .35), 0 0 24px rgba(237, 38, 88, .18); }
.ff-card img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Light theme: light cards carrying the light screenshots. */
:root:not([data-theme="dark"]) .ff-card:has(img) { background: #f7f6f4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ff-card:has(img) { background: #1c1c1f; } }
.ff-ph { display: flex; flex-direction: column; justify-content: center; gap: 7px; height: 100%; padding: 14px 16px 14px 64px; position: relative; }
.ff-ph .ic { position: absolute; left: 14px; top: 50%; translate: 0 -50%; }
.ff-ph i { display: block; height: 6px; border-radius: 3px; background: #2e2e33; }
.ff-ph i.short { width: 55%; }
.ff-hub { position: relative; justify-self: center; width: 100%; max-width: 170px; aspect-ratio: 1; z-index: 1; }
.ff-ring { --ring: 237, 38, 88; position: absolute; inset: 14%; }
.ff-ring .core, .ff-ring .ripple { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.ff-ring .core { border: 2px solid rgba(var(--ring), .95); box-shadow: 0 0 6px rgba(var(--ring), .85), 0 0 22px rgba(var(--ring), .5), inset 0 0 16px rgba(var(--ring), .3); background: #121213; }
.ff-ring .ripple { border: 1px solid rgba(var(--ring), .75); box-shadow: 0 0 10px rgba(var(--ring), .35); animation: ring-ripple 1.6s cubic-bezier(.2, .6, .3, 1) forwards; }
.ff-ring.flash .core { animation: ring-flash .7s ease-out; }
.ff-bot { position: absolute; left: 50%; top: 50%; width: 52%; height: auto; translate: -50% -58.5%; z-index: 1; }
.ff-bot.bump { animation: bot-bump .6s cubic-bezier(.34, 1.56, .64, 1); }
.ff-panel { position: relative; z-index: 1; padding: 30px 32px; border-radius: var(--r-lg); background: #1a1a1c; border: 1px solid #2c2c30; min-height: 250px; transition: opacity .18s; }
.ff-panel.swap { opacity: 0; }
.ff-panel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.ff-panel .ic { width: 48px; height: 48px; }
.ff-count { color: #8f8b86; font-size: 13px; }
.ff-title { margin: 0; font-size: 26px; letter-spacing: -.02em; color: #eeebe7; }
.ff-mtext { display: none; }
.ff-text { margin: 12px 0 0; color: #c8c4bf; font-size: 17px; line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .ff-ring .ripple { display: none; } .ff-card, .ff-panel { transition: none; } }
@media (max-width: 900px) {
  .ff-stage { grid-template-columns: 1fr; gap: 20px; }
  .ff-hub { display: none; }
  .ff-item { grid-template-columns: 1fr; gap: 6px; }
  .ff-label { text-align: left; }
  .ff-card { cursor: default; }
  .ff-card[aria-selected="true"] { border-color: #2e2e33; box-shadow: none; }
  .ff-panel { display: none; }
  .ff-mtext { display: block; margin: 4px 0 10px; color: #b9b5b0; font-size: 15px; line-height: 1.5; }
}

/* Stats (inc/stats.php): two chart cards and a strip of AIE facts. Light and dark from the site tokens.
   stats.js empties each chart (.st-pre bars, .st-gpre grid) and fills it when it scrolls into view. */
.stats { padding-top: 40px; }
.stats-line { margin-bottom: 64px; }
.stats-title { margin: 0 auto 48px; max-width: 980px; text-align: center; font-size: clamp(32px, 4.2vw, 58px); line-height: 1.06; letter-spacing: -.04em; font-weight: 600; }
.stats-title .light { font-weight: 300; }
.stats-cards { display: grid; gap: 16px; }
@media (min-width: 960px) { .stats-cards { grid-template-columns: 1fr 1fr; } }
.st-card { display: flex; flex-direction: column; padding: clamp(22px, 3vw, 36px); border-radius: 24px; border: 1px solid var(--line); background: var(--surface); }
.st-eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.st-head { margin: 0; font-size: clamp(22px, 2.2vw, 28px); line-height: 1.15; letter-spacing: -.025em; font-weight: 600; color: var(--ink); text-wrap: balance; }
.st-source { margin: auto 0 0; padding-top: 22px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.st-source a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.st-source a:hover { text-decoration-color: currentColor; }

/* Bars */
.st-bars { position: relative; display: flex; align-items: flex-end; gap: clamp(16px, 4vw, 40px); height: 260px; margin: 28px 0 0; padding: 0 4px 30px; border-bottom: 1px solid var(--line); }
.st-bar { position: relative; flex: 1; max-width: 160px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.st-bar i { display: block; width: 100%; height: var(--h); border-radius: 12px 12px 4px 4px; background: var(--line-strong); transition: height .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .18s); }
.st-bar.last i { background: var(--ink); }
.st-val { margin-bottom: 8px; font-size: clamp(22px, 2.4vw, 30px); font-weight: 650; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.st-bar:not(.last) .st-val { color: var(--muted); }
.st-year { position: absolute; bottom: -28px; font-size: 13px; color: var(--muted); }
.st-callout { position: absolute; left: calc(100% + 10px); top: calc(100% - var(--h) - 4px); white-space: nowrap; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #fff; background: var(--accent); transition: opacity .4s ease .9s; }
@media (max-width: 520px) { .st-callout { left: auto; right: 6px; top: calc(100% - var(--h) + 10px); } }
.st-uses { display: grid; gap: 10px; margin-top: 30px; }
.st-sub { margin: 0 0 4px; font-size: 13px; color: var(--muted); }
.st-use { display: grid; grid-template-columns: 112px 1fr 52px; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.st-use-bar { height: 8px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.st-use-bar i { display: block; height: 100%; width: var(--w); border-radius: 8px; background: var(--accent); transition: width .9s cubic-bezier(.2, .7, .2, 1) calc(var(--i) * .18s); }
.st-use:not(:first-child) .st-use-bar i { background: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.st-use-v { text-align: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Grid */
.st-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 24px; }
.st-top > div:first-child { flex: 1 1 240px; }
.st-counters { display: flex; gap: 22px; }
.st-counters p { margin: 0; display: flex; flex-direction: column; align-items: flex-end; }
.st-counters strong { font-size: clamp(30px, 3.2vw, 42px); line-height: 1; font-weight: 650; letter-spacing: -.04em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.st-counters .rose strong { color: var(--accent); }
.st-counters .st-c-l { margin-top: 6px; font-size: 12.5px; color: var(--muted); text-align: right; max-width: 110px; line-height: 1.3; }
.st-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: clamp(4px, .6vw, 7px); width: 100%; max-width: 420px; aspect-ratio: 1; margin: 26px auto 0; }
.st-grid i { border-radius: 22%; border: 1px solid var(--line-strong); background: transparent; transition: background-color .2s, border-color .2s, scale .25s; }
.st-grid i.on { background: var(--accent); border-color: var(--accent); }
.st-more { list-style: none; display: grid; gap: 6px; margin: 22px 0 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.st-more strong { color: var(--ink); }

/* Facts: four tiles with a big rose figure and a faint ring in the corner (echoing the robot's pulse).
   Dark tiles in the dark theme, light tiles in the light theme. */
.st-facts { --tile: var(--surface); --tile-line: var(--line); --tile-ink: var(--ink); --tile-ink-2: var(--muted); --tile-ring: .35;
  list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 0; padding: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .st-facts { --tile: #101114; --tile-line: #1f2025; --tile-ink: #eeebe7; --tile-ink-2: #b9b5b0; --tile-ring: .5; } }
:root[data-theme="dark"] .st-facts { --tile: #101114; --tile-line: #1f2025; --tile-ink: #eeebe7; --tile-ink-2: #b9b5b0; --tile-ring: .5; }
.st-facts li {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; min-height: 200px; padding: 64px 26px 26px;
  border-radius: 20px; border: 1px solid var(--tile-line); background: var(--tile); color: var(--tile-ink);
}
.st-facts li::before {
  content: ""; position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  border: 1px solid rgba(237, 38, 88, var(--tile-ring));
  box-shadow: 0 0 0 18px rgba(237, 38, 88, calc(var(--tile-ring) * .12)), 0 0 0 36px rgba(237, 38, 88, calc(var(--tile-ring) * .06));
}
.st-facts strong { display: flex; align-items: flex-end; min-height: 44px; font-size: 44px; line-height: 1; letter-spacing: -.045em; font-weight: 650; color: var(--accent); font-variant-numeric: tabular-nums; }
.st-fact-t { margin-top: 12px; font-size: 16px; font-weight: 600; color: var(--tile-ink); }
.st-fact-d { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--tile-ink-2); }
@media (max-width: 520px) { .st-facts li { min-height: 170px; } }

/* Before the section is seen (JS only) */
.st-pre .st-bar i { height: 0; }
.st-pre .st-use-bar i { width: 0; }
.st-pre .st-callout { opacity: 0; }
.st-gpre .st-grid i.on { background: transparent; border-color: var(--line-strong); }
.st-gpre .st-grid i.lit { background: var(--accent); border-color: var(--accent); scale: 1.08; }

/* Request graph, light theme: the same section on the light page (it was dark in both themes). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .graph { background: var(--bg); color: var(--ink); }
  :root:not([data-theme="dark"]) .graph::before { background-image: radial-gradient(var(--dot) 1px, transparent 1px); }
  :root:not([data-theme="dark"]) .graph-line { background: color-mix(in srgb, var(--ink) 30%, transparent); }
  :root:not([data-theme="dark"]) .graph .demo-title { color: var(--ink); }
  :root:not([data-theme="dark"]) .graph-intro { color: var(--ink-2); }
  :root:not([data-theme="dark"]) .graph-intro + .graph-sub, :root:not([data-theme="dark"]) .graph-sub { color: var(--muted); }
  :root:not([data-theme="dark"]) .graph-sub b { color: var(--ink); }
  :root:not([data-theme="dark"]) .spoke { stroke: rgba(27, 26, 25, .18); }
  :root:not([data-theme="dark"]) .spoke.lit { stroke: rgba(27, 26, 25, .5); }
  :root:not([data-theme="dark"]) .glow { stroke: #ed2658; }
  :root:not([data-theme="dark"]) .node { fill: #c9c6c0; }
  :root:not([data-theme="dark"]) .node.lit { fill: #ed2658; }
  :root:not([data-theme="dark"]) .label { fill: #8a8580; }
  :root:not([data-theme="dark"]) .label.lit { fill: #1b1a19; }
  :root:not([data-theme="dark"]) .group { fill: #a29e98; }
  :root:not([data-theme="dark"]) .graph-pulse .core { background: var(--bg); }
  :root:not([data-theme="dark"]) .graph-steps li { background: var(--surface); border-color: var(--line); }
  :root:not([data-theme="dark"]) .graph-steps li + li::before { background: var(--line-strong); }
  :root:not([data-theme="dark"]) .graph-steps li.lit { background: var(--accent-soft); }
  :root:not([data-theme="dark"]) .gs-k { color: var(--muted); }
  :root:not([data-theme="dark"]) .gs-v { color: var(--ink); }
}
:root[data-theme="light"] .graph { background: var(--bg); color: var(--ink); }
:root[data-theme="light"] .graph::before { background-image: radial-gradient(var(--dot) 1px, transparent 1px); }
:root[data-theme="light"] .graph-line { background: color-mix(in srgb, var(--ink) 30%, transparent); }
:root[data-theme="light"] .graph .demo-title { color: var(--ink); }
:root[data-theme="light"] .graph-intro { color: var(--ink-2); }
:root[data-theme="light"] .graph-intro + .graph-sub, :root[data-theme="light"] .graph-sub { color: var(--muted); }
:root[data-theme="light"] .graph-sub b { color: var(--ink); }
:root[data-theme="light"] .spoke { stroke: rgba(27, 26, 25, .18); }
:root[data-theme="light"] .spoke.lit { stroke: rgba(27, 26, 25, .5); }
:root[data-theme="light"] .glow { stroke: #ed2658; }
:root[data-theme="light"] .node { fill: #c9c6c0; }
:root[data-theme="light"] .node.lit { fill: #ed2658; }
:root[data-theme="light"] .label { fill: #8a8580; }
:root[data-theme="light"] .label.lit { fill: #1b1a19; }
:root[data-theme="light"] .group { fill: #a29e98; }
:root[data-theme="light"] .graph-pulse .core { background: var(--bg); }
:root[data-theme="light"] .graph-steps li { background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] .graph-steps li + li::before { background: var(--line-strong); }
:root[data-theme="light"] .graph-steps li.lit { background: var(--accent-soft); }
:root[data-theme="light"] .gs-k { color: var(--muted); }
:root[data-theme="light"] .gs-v { color: var(--ink); }

/* Why AIE band and its features flow, light theme (the band was dark in both themes; the footer stays dark). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .band { --band-card: var(--surface); --band-line: var(--line); --band-ink: var(--ink); --band-ink-2: var(--ink-2); background-color: var(--bg); }
  :root:not([data-theme="dark"]) .band::before { background-image: radial-gradient(var(--dot) 1px, transparent 1px); }
  :root:not([data-theme="dark"]) .band-line { background: color-mix(in srgb, var(--ink) 30%, transparent); }
  :root:not([data-theme="dark"]) .band .ic { background: var(--accent-soft); color: var(--accent); }
  :root:not([data-theme="dark"]) .ff-line { stroke: rgba(27, 26, 25, .16); }
  :root:not([data-theme="dark"]) .ff-line.on { stroke: rgba(27, 26, 25, .45); }
  :root:not([data-theme="dark"]) .ff-glow { stroke: #ed2658; }
  :root:not([data-theme="dark"]) .ff-label { color: var(--ink-2); }
  :root:not([data-theme="dark"]) .ff-card { border-color: var(--line); background: var(--surface); }
  :root:not([data-theme="dark"]) .ff-card:hover { border-color: var(--line-strong); }
  :root:not([data-theme="dark"]) .ff-ph i { background: var(--line); }
  :root:not([data-theme="dark"]) .ff-ring .core { background: var(--bg); }
  :root:not([data-theme="dark"]) .ff-panel { background: var(--surface); border-color: var(--line); }
  :root:not([data-theme="dark"]) .ff-count { color: var(--muted); }
  :root:not([data-theme="dark"]) .ff-title { color: var(--ink); }
  :root:not([data-theme="dark"]) .ff-text { color: var(--ink-2); }
  :root:not([data-theme="dark"]) .ff-mtext { color: var(--ink-2); }
}
:root[data-theme="light"] .band { --band-card: var(--surface); --band-line: var(--line); --band-ink: var(--ink); --band-ink-2: var(--ink-2); background-color: var(--bg); }
:root[data-theme="light"] .band::before { background-image: radial-gradient(var(--dot) 1px, transparent 1px); }
:root[data-theme="light"] .band-line { background: color-mix(in srgb, var(--ink) 30%, transparent); }
:root[data-theme="light"] .band .ic { background: var(--accent-soft); color: var(--accent); }
:root[data-theme="light"] .ff-line { stroke: rgba(27, 26, 25, .16); }
:root[data-theme="light"] .ff-line.on { stroke: rgba(27, 26, 25, .45); }
:root[data-theme="light"] .ff-glow { stroke: #ed2658; }
:root[data-theme="light"] .ff-label { color: var(--ink-2); }
:root[data-theme="light"] .ff-card { border-color: var(--line); background: var(--surface); }
:root[data-theme="light"] .ff-card:hover { border-color: var(--line-strong); }
:root[data-theme="light"] .ff-ph i { background: var(--line); }
:root[data-theme="light"] .ff-ring .core { background: var(--bg); }
:root[data-theme="light"] .ff-panel { background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] .ff-count { color: var(--muted); }
:root[data-theme="light"] .ff-title { color: var(--ink); }
:root[data-theme="light"] .ff-text { color: var(--ink-2); }
:root[data-theme="light"] .ff-mtext { color: var(--ink-2); }
@media (max-width: 900px) and (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .ff-card[aria-selected="true"] { border-color: var(--line); } }
@media (max-width: 900px) { :root[data-theme="light"] .ff-card[aria-selected="true"] { border-color: var(--line); } }
