/* Explainer engine styles. Brand-neutral: every color, face, radius and shadow comes from the
   --x-* tokens a brand's brand.css sets (contract: brands/_template/brand.css). Load brand.css first. */
:root { accent-color: var(--x-accent); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--x-ground); color: var(--x-ink); font-family: var(--x-font-sans); font-weight: 400; }
body.texture-dots { background-image: radial-gradient(var(--x-ground-mark) 1.5px, transparent 1.5px); background-size: 22px 22px; }
body.deck { overflow: hidden; }
:focus-visible { outline: 3px solid var(--x-accent-ink); outline-offset: 2px; }
::selection { background: var(--x-highlight); color: var(--x-ink); }
b, strong { font-weight: 600; }
a { color: var(--x-accent-ink); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
.kicker { text-transform: uppercase; letter-spacing: var(--x-tracking-label); font-weight: 600; font-size: .7rem; }

/* App shell */
.app { display: flex; flex-direction: column; height: 100vh; }
header { display: flex; align-items: center; gap: 16px; padding: 0 24px; height: 60px; flex: none; background: var(--x-header-bg); border-bottom: var(--x-header-rule) solid var(--x-chrome); }
header .count { font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; border: var(--x-chrome-w) solid var(--x-chrome); border-radius: calc(var(--x-radius-sm) * 1px); padding: 2px 8px; background: var(--x-panel); white-space: nowrap; }
header h1 { margin: 0; font-family: var(--x-font-display); font-weight: var(--x-display-weight); letter-spacing: var(--x-tracking-display); font-size: clamp(18px, 2vw, 26px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header nav.links { margin-left: auto; display: flex; gap: 10px; }
.ds-btn { display: inline-block; border: var(--x-chrome-w) solid var(--x-chrome); box-shadow: var(--x-btn-shadow); border-radius: calc(var(--x-radius-sm) * 1px); padding: 6px 12px;
  font: 600 .75rem/1.2 var(--x-font-sans); text-transform: uppercase; letter-spacing: .025em; cursor: pointer; background: var(--x-panel); color: var(--x-ink);
  text-decoration: none; white-space: nowrap; transition: transform .08s ease-out, filter .08s ease-out; }
.ds-btn:hover { filter: brightness(.94); }
.ds-btn:active { transform: translateY(1px) scale(.99); }

/* The board: the one hero object */
.stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 18px 28px 8px; cursor: pointer; }
.board { height: 100%; max-width: 100%; aspect-ratio: 1600 / 820; background: var(--x-board); border: var(--x-chrome-w) solid var(--x-chrome); box-shadow: var(--x-board-shadow); border-radius: calc(var(--x-radius) * 1px); }
svg { width: 100%; height: 100%; display: block; }
.caption { padding: 10px 28px 6px; min-height: 104px; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.5; max-width: 1180px; margin: 0 auto; text-align: center; }
.caption b { font-weight: 600; }
.caption code { font-family: var(--x-font-mono); font-size: .86em; background: var(--x-recessed); border: 1px solid var(--x-chrome); border-radius: calc(var(--x-radius-sm) * 1px); padding: 0 4px; }
.caption a { font-weight: 500; }
.caption .src { margin-top: 6px; font-size: 12px; color: var(--x-ink-soft); }
.caption .src a { color: var(--x-ink-soft); font-weight: 500; }
nav.ctl { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 0 0 16px; font-size: 13px; color: var(--x-ink-soft); flex: none; }
.dots { display: flex; gap: 6px; }
.dots span { width: 12px; height: 12px; border-radius: calc(var(--x-radius-sm) * .5px); border: var(--x-chrome-w) solid var(--x-chrome); background: var(--x-panel); cursor: pointer; }
.dots span.seen { background: var(--x-muted); }
.dots span.cur { background: var(--x-accent); border-color: var(--x-accent); }

/* Elements: 3Blue1Brown-style progressive reveal */
.el { opacity: 0; transition: opacity .5s ease, transform 1.1s cubic-bezier(.6,.05,.25,1); transform-box: view-box; }
.el.on { opacity: 1; }
.el.faded { opacity: .25; }
.el .draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s cubic-bezier(.65, 0, .35, 1); }
.el.on .draw, .el.faded .draw { stroke-dashoffset: 0; }
/* highlight = lift: the surface rises (depth is motion, no glows) */
.el .shape { transition: transform .35s cubic-bezier(.16, 1, .3, 1); }
.el.hl .shape { transform: translate(-3px, -3px); }
/* Diagram text: the 1600-wide canvas shows at about 50 to 70%, so these read as 12 to 21px on screen. */
.t-title { font-family: var(--x-font-display); font-weight: var(--x-display-weight); font-size: 30px; letter-spacing: var(--x-tracking-display); }
.t-box { font-family: var(--x-font-box); font-weight: var(--x-box-weight); font-size: 30px; }
.t-big { font-family: var(--x-font-display); font-weight: var(--x-display-weight); letter-spacing: var(--x-tracking-display); }
.t-sub { font-family: var(--x-font-sans); font-weight: 400; font-size: 24px; }
.t-label { font-family: var(--x-font-sans); font-weight: 400; font-size: 23px; }
.t-num { font-family: var(--x-font-sans); font-weight: 600; font-variant-numeric: tabular-nums; }
.t-kick, .t-band { font-family: var(--x-font-sans); font-weight: 600; font-size: 19px; letter-spacing: var(--x-tracking-label); text-transform: uppercase; }
.t-hand { font-family: var(--x-font-hand); font-weight: var(--x-hand-weight); font-size: 26px; font-variation-settings: var(--x-hand-settings); font-style: var(--x-hand-style); }
.t-mono { font-family: var(--x-font-mono); font-weight: 600; font-size: 22px; }
@media (prefers-reduced-motion: reduce) { .el, .el .draw, .el .shape { transition: none !important; } }
