/* ==========================================================================
   akilios.com — Akili Code OS
   Self-contained stylesheet. No CDNs, no remote fonts, no imports.
   Palette is taken from the Akili Code brand source
   (crates/akili-code-core/src/brand.rs), not eyeballed:
     GOLD #DC8D1F · GOLD_BRIGHT #F2B04A · BRONZE #793904
     INK  #0A0A0B · INK_RAISED #151517
     GREEN #5ABE6E · RED #DC6464 · AMBER #DC9650
   ========================================================================== */

/* ------------------------------- tokens ------------------------------- */
:root {
  --gold:        #DC8D1F;
  --gold-hi:     #F2B04A;
  --bronze:      #793904;
  --brand-green: #5ABE6E;
  --brand-red:   #DC6464;
  --brand-amber: #DC9650;

  /* dark is the default ground */
  --bg:        #0A0A0B;
  --bg-2:      #0E0E10;
  --surface:   #151517;
  --surface-2: #1B1B1E;
  --line:      #26262A;
  --line-2:    #34343A;
  --fg:        #ECECEF;
  --fg-mute:   #A3A3AB;
  --fg-dim:    #82828B;
  --accent:    #DC8D1F;   /* accent that reads on this ground */
  --accent-hi: #F2B04A;
  --link:      #F2B04A;
  --green:     #5ABE6E;
  --red:       #DC6464;
  --amber:     #DC9650;
  --code-bg:   #0F0F11;
  --paper:     #F7F4EC;   /* the sketch scene's paper, both themes */
  --paper-ink: #23201C;
  --shadow:    0 18px 50px rgba(0,0,0,.5);
  --shadow-sm: 0 6px 20px rgba(0,0,0,.35);

  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --wrap: 1140px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "Consolas", "SFMono-Regular", "Liberation Mono", Menlo, monospace;
}

[data-theme="light"] {
  --bg:        #FBF9F5;
  --bg-2:      #F4F1EA;
  --surface:   #FFFFFF;
  --surface-2: #F8F5EF;
  --line:      #E5DFD3;
  --line-2:    #D3CABA;
  --fg:        #17171A;
  --fg-mute:   #55555D;
  --fg-dim:    #6D6D75;
  --accent:    #A5650A;
  --accent-hi: #8A5207;
  --link:      #8A5207;
  --green:     #2F7D42;
  --red:       #B03A3A;
  --amber:     #99601C;
  --code-bg:   #F4F1EA;
  --bronze:    #793904;
  --shadow:    0 18px 44px rgba(80,62,30,.16);
  --shadow-sm: 0 6px 18px rgba(80,62,30,.10);
}

/* -------------------------------- base -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { line-height: 1.14; letter-spacing: -.021em; margin: 0 0 .5em; font-weight: 680; }
h1 { font-size: clamp(2.15rem, 5.4vw, 3.65rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.55rem, 3.3vw, 2.35rem); }
h3 { font-size: 1.09rem; letter-spacing: -.012em; }
p  { margin: 0 0 1em; }
a  { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
code, kbd, pre { font-family: var(--mono); font-size: .885em; }
/* Inline code only. A `code` inside a `pre` is a block of real lines: giving it
   a border and `nowrap` boxed it and collapsed its newlines into one line. */
:not(pre) > code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .08em .36em;
  color: var(--fg);
  white-space: nowrap;
}
svg { display: block; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--fg-dim); font-weight: 400; }
.small { font-size: .8rem; }
.gold  { color: var(--accent-hi); }
.mt    { margin-top: 1.05rem; }

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #1a1206; padding: 10px 16px; border-radius: 0 0 var(--r) 0; font-weight: 600;
}
.skip:focus { left: 0; }

/* ------------------------------- buttons ------------------------------ */
.btn {
  --btn-bg: var(--surface);
  display: inline-flex; align-items: center; gap: .55em;
  padding: .74em 1.3em;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--fg);
  font-weight: 600; font-size: .96rem; font-family: inherit;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); border-color: var(--accent); }
.btn:active { transform: translateY(0); }
.btn-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: var(--bronze);
  color: #1a1206;
  box-shadow: 0 8px 26px rgba(220,141,31,.28);
}
.btn-primary:hover { box-shadow: 0 12px 32px rgba(220,141,31,.4); }
[data-theme="light"] .btn-primary { background: linear-gradient(180deg, #C87D12, #A5650A); color: #fff; box-shadow: 0 8px 22px rgba(140,90,10,.28); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-sm { padding: .5em .9em; font-size: .87rem; border-radius: 9px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  background: var(--surface); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"]  .ico-moon { display: none; }
[data-theme="light"] .ico-sun  { display: none; }
[data-theme="dark"]  .light-only { display: none; }
[data-theme="light"] .dark-only  { display: none; }

/* -------------------------------- header ------------------------------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-in { display: flex; align-items: center; gap: 20px; min-height: 66px; }
.brand { display: flex; align-items: center; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { height: 30px; width: auto; }
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  color: var(--fg-mute); font-size: .9rem; font-weight: 560;
  padding: .42em .74em; border-radius: 8px; transition: color .16s ease, background .16s ease;
}
.site-nav a:hover { color: var(--fg); background: var(--surface); text-decoration: none; }
.head-act { display: flex; align-items: center; gap: 10px; }
.site-nav + .head-act { margin-left: 0; }
.head-in .site-nav { margin-left: auto; }

/* --------------------------------- hero -------------------------------- */
.hero { position: relative; padding: clamp(46px, 8vw, 92px) 0 clamp(30px, 5vw, 56px); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(760px 420px at 78% 6%, rgba(220,141,31,.16), transparent 68%),
    radial-gradient(620px 420px at 6% 88%, rgba(121,57,4,.20), transparent 70%);
}
[data-theme="light"] .hero::before {
  background:
    radial-gradient(760px 420px at 78% 6%, rgba(220,141,31,.17), transparent 68%),
    radial-gradient(620px 420px at 6% 88%, rgba(220,141,31,.10), transparent 70%);
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(24px, 4vw, 56px); align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .8rem; font-weight: 660; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-hi); margin: 0 0 1.1em;
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px rgba(220,141,31,.18);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.hero h1 { margin-bottom: .5em; }
.hero h1 .grad {
  background: linear-gradient(96deg, var(--gold-hi) 6%, var(--gold) 52%, #B4700E 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--fg-mute); max-width: 46ch; }
.lede strong { color: var(--fg); font-weight: 640; }
.lede em { color: var(--accent-hi); font-style: normal; font-weight: 640; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.5em 0 1.3em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 1.15em; padding: 0; }
.chips li {
  font-size: .795rem; font-weight: 560; color: var(--fg-mute);
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: .34em .82em;
}
.chips li::before { content: "◆"; color: var(--accent); font-size: .66em; margin-right: .5em; vertical-align: 1px; }
.fineprint { font-size: .845rem; color: var(--fg-dim); line-height: 1.55; margin: 0; max-width: 52ch; }

/* hero engine diagram */
.hero-art { display: grid; place-items: center; }
.engine { width: 100%; max-width: 460px; height: auto; overflow: visible; }
.engine .loop-dash {
  stroke-dasharray: 44 22; transform-origin: 230px 200px;
  animation: spin 14s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.engine .rail {
  stroke-dasharray: 190; stroke-dashoffset: 190;
  animation: draw 1.5s cubic-bezier(.2,.7,.25,1) forwards;
}
.engine .rail:nth-child(2) { animation-delay: .16s; }
.engine .rail:nth-child(3) { animation-delay: .32s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.engine .face {
  opacity: 0; animation: faceIn .6s cubic-bezier(.2,.7,.25,1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes faceIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.engine .base { opacity: 0; animation: faceIn .7s ease forwards; animation-delay: .6s; }
.engine .core { opacity: 0; animation: faceIn .7s ease forwards; animation-delay: .1s; }
.engine .svg-label  { fill: var(--fg-dim); font: 600 15px var(--font); letter-spacing: .04em; }
.engine .svg-face   { fill: var(--fg); font: 660 21px var(--font); }

/* The hero diagram carried its colours as SVG presentation attributes, which
   are fixed values and so stayed dark-theme in light mode — near-black text on
   a near-black panel, i.e. invisible. CSS `fill` beats a presentation
   attribute, so restating them as tokens fixes both themes from one place. */
.engine .face rect,
.engine .base rect { fill: var(--surface); stroke: var(--line-2); }
.engine .core > circle:first-of-type { fill: var(--surface); stroke: var(--bronze); }
[data-theme="light"] .engine .face rect,
[data-theme="light"] .engine .base rect,
[data-theme="light"] .engine .core > circle:first-of-type { stroke: var(--line-2); }
[data-theme="light"] .engine .svg-base-strong { fill: var(--accent); }

.engine .svg-base-strong { fill: var(--gold); font: 640 15px var(--font); }
.engine .svg-base   { fill: var(--fg-dim); font: 400 13px var(--font); }

/* ============================== SIMULATION ============================== */
.sim { padding: clamp(40px, 6vw, 74px) 0 clamp(44px, 6vw, 80px); position: relative; }
.sim-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 22px; flex-wrap: wrap; margin-bottom: 20px;
}
.sim-head h2 { margin-bottom: .28em; }
.sim-head .sub { color: var(--fg-mute); max-width: 62ch; margin: 0; font-size: 1.005rem; }
.sim-controls { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.sim-status {
  font-size: .78rem; font-weight: 640; letter-spacing: .07em; text-transform: uppercase;
  color: var(--fg-dim); min-width: 62px; font-variant-numeric: tabular-nums;
}
.sim-status.is-playing { color: var(--green); }
.sim-status.is-paused  { color: var(--amber); }

/* tabs */
.sim-tabs { position: relative; display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.sim-tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--fg-mute); font: 620 .95rem var(--font); padding: .68em 1.05em; margin-bottom: -1px;
  cursor: pointer; border-radius: 8px 8px 0 0; transition: color .16s ease, background .16s ease;
}
.sim-tab:hover { color: var(--fg); background: var(--surface); }
.sim-tab.is-active { color: var(--accent-hi); border-bottom-color: var(--accent); }
.sim-tab-ink { display: none; }
.sim-tab-progress {
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
}
.sim-tab-progress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-hi));
  box-shadow: 0 0 10px rgba(220,141,31,.6);
}

/* stage + window chrome */
.sim-stage { margin-top: 18px; }
.beat[hidden] { display: none; }
.win {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.win-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: .84rem;
}
.tl-dots { display: inline-flex; gap: 6px; }
.tl-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.tl-dots i:first-child { background: #DC6464; }
.tl-dots i:nth-child(2) { background: #DC9650; }
.tl-dots i:nth-child(3) { background: #5ABE6E; }
.win-title { color: var(--fg); font-weight: 560; }
.win-badge {
  margin-left: auto; font-size: .74rem; font-weight: 640; letter-spacing: .04em;
  color: var(--accent-hi); background: rgba(220,141,31,.12);
  border: 1px solid rgba(220,141,31,.3); border-radius: 999px; padding: .22em .68em; white-space: nowrap;
}
.win-body { display: grid; gap: 1px; background: var(--line); }
.build-body  { grid-template-columns: minmax(0,1.06fr) minmax(0,1.24fr) minmax(0,.78fr); }
.motion-body { grid-template-columns: minmax(0,1.62fr) minmax(0,.78fr); }
.work-body   { grid-template-columns: minmax(0,1fr) minmax(0,1.15fr) minmax(0,.78fr); }

.pane { background: var(--surface); padding: 14px 15px; min-width: 0; }
.pane-label {
  font-size: .7rem; font-weight: 680; letter-spacing: .11em; text-transform: uppercase;
  color: var(--fg-dim); margin: 0 0 .7em;
}
.pane-label.mt { margin-top: 1.15em; }

/* ---- build beat: transcript ---- */
.bubble {
  border-radius: 11px; padding: 9px 12px; font-size: .875rem; margin-bottom: 9px;
  opacity: 0; transform: translateY(7px); transition: opacity .42s ease, transform .42s ease;
}
.bubble.on { opacity: 1; transform: none; }
.bubble.user { background: var(--surface-2); border: 1px solid var(--line-2); color: var(--fg); }
.bubble.agent {
  background: rgba(220,141,31,.07); border: 1px solid rgba(220,141,31,.28);
  color: var(--fg); min-height: 62px; line-height: 1.55;
}
.caret {
  display: inline-block; width: 7px; height: 1.02em; background: var(--accent);
  vertical-align: text-bottom; margin-left: 1px; animation: blink 1s steps(1) infinite;
}
.caret.hide { display: none; }
@keyframes blink { 50% { opacity: 0; } }

.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: .6em; font-size: .855rem; color: var(--fg-mute);
  padding: .28em 0; transition: color .3s ease;
}
.checklist li.on { color: var(--fg); }
.checklist .check {
  flex: 0 0 auto; width: 15px; height: 15px; margin-top: .3em;
  border: 1.5px solid var(--line-2); border-radius: 4px; position: relative;
  transition: border-color .25s ease, background .25s ease;
}
.checklist li.on .check { background: var(--green); border-color: var(--green); }
.checklist li.on .check::after {
  content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
  border: solid #0A0A0B; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
[data-theme="light"] .checklist li.on .check::after { border-color: #fff; }
.checklist .check-txt { transition: opacity .3s ease; }

/* ---- build beat: code ---- */
.code {
  font-family: var(--mono); font-size: .755rem; line-height: 1.62;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 0; overflow: hidden; min-height: 254px;
}
.code-row { display: flex; padding: 0 12px; white-space: pre; }
.code-row.newly { animation: lineIn .34s ease; }
@keyframes lineIn { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: none; } }
.code-row .ln {
  flex: 0 0 2.1em; text-align: right; margin-right: 1em;
  color: var(--fg-dim); user-select: none;
}
.code-row .lc { color: #E4E4E8; }
.t-kw { color: #C58AF9; } .t-ty { color: #6FB3E0; } .t-fn { color: #F2B04A; }
.t-st { color: #8FCF8A; } .t-cm { color: #7A7A84; font-style: italic; }
.t-nu { color: #E09A5A; } .t-mc { color: #D9A0E8; } .t-pn { color: #9A9AA4; }
.t-va { color: #E4E4E8; }
[data-theme="light"] .code-row .lc { color: #26262A; }
[data-theme="light"] .t-kw { color: #8A3FB0; } [data-theme="light"] .t-ty { color: #1E6FA8; }
[data-theme="light"] .t-fn { color: #9A5D05; } [data-theme="light"] .t-st { color: #2F7D42; }
[data-theme="light"] .t-cm { color: #6D6D76; } [data-theme="light"] .t-nu { color: #98601C; }
[data-theme="light"] .t-mc { color: #7A3FA0; } [data-theme="light"] .t-pn { color: #6A6A73; }
[data-theme="light"] .t-va { color: #26262A; }

/* ---- side panes: diff, verify, policy ---- */
.diffstrip {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .8rem; font-weight: 620;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 9px 11px;
}
.diffstrip .d-add { color: var(--green); }
.diffstrip .d-del { color: var(--red); }
.diffstrip .d-files { margin-left: auto; color: var(--fg-dim); font-weight: 400; font-size: .74rem; }

.vchip {
  display: flex; align-items: center; gap: .6em;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px;
  font-size: .84rem; font-weight: 580; background: var(--surface-2);
  transition: border-color .3s ease, background .3s ease, color .3s ease;
}
.vchip .vdot { width: 9px; height: 9px; border-radius: 50%; background: var(--fg-dim); flex: 0 0 auto; }
.vchip.is-run { border-color: rgba(220,150,80,.5); color: var(--amber); }
.vchip.is-run .vdot { background: var(--amber); animation: pulse 1.1s ease-in-out infinite; }
.vchip.is-ok { border-color: rgba(90,190,110,.5); background: rgba(90,190,110,.09); color: var(--green); }
.vchip.is-ok .vdot { background: var(--green); box-shadow: 0 0 0 4px rgba(90,190,110,.18); }
.vchip.is-fail { border-color: rgba(220,100,100,.5); background: rgba(220,100,100,.09); color: var(--red); }
.vchip.is-fail .vdot { background: var(--red); }

.tiny-list { list-style: none; margin: 0; padding: 0; font-size: .8rem; }
.tiny-list li {
  display: flex; align-items: center; gap: .5em; padding: .24em 0; color: var(--fg-mute);
  opacity: 0; transform: translateX(-4px); transition: opacity .35s ease, transform .35s ease;
}
.tiny-list li.on { opacity: 1; transform: none; }
.tiny-list li .check {
  width: 13px; height: 13px; border: 1.5px solid var(--line-2); border-radius: 3px;
  flex: 0 0 auto; position: relative; transition: background .25s ease, border-color .25s ease;
}
.tiny-list li.on .check { background: var(--green); border-color: var(--green); }
.tiny-list li.on .check::after {
  content: ""; position: absolute; left: 3.5px; top: 0.5px; width: 4px; height: 7px;
  border: solid #0A0A0B; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
[data-theme="light"] .tiny-list li.on .check::after { border-color: #fff; }

.tag {
  font-size: .68rem; font-weight: 680; letter-spacing: .04em; text-transform: uppercase;
  border-radius: 999px; padding: .16em .55em; border: 1px solid transparent;
}
.tag-ok    { color: var(--green); background: rgba(90,190,110,.12); border-color: rgba(90,190,110,.34); }
.tag-block { color: var(--red);   background: rgba(220,100,100,.12); border-color: rgba(220,100,100,.34); }
.tiny-list li code { font-size: .74rem; padding: .05em .3em; }

.toolchip { margin-top: 11px; font-family: var(--mono); font-size: .74rem; color: var(--accent-hi); }
.toolchip:empty { display: none; }
.exportrow { display: flex; align-items: center; gap: .6em; margin-top: .8em; opacity: 0; transition: opacity .4s ease; }
.exportrow.on { opacity: 1; }

/* ---- motion beat: the player ---- */
.player { display: flex; flex-direction: column; gap: 11px; }
.stage {
  position: relative; background: #000; border-radius: var(--r-sm); overflow: hidden;
  aspect-ratio: 9 / 16; height: min(44vh, 408px); width: auto;
  flex: 0 0 auto; align-self: center; margin: 0 auto;
}
.scene-svg { width: 100%; height: 100%; display: block; }
.scene-svg .m-title { font: 700 96px var(--font); fill: #23201C; opacity: 0; transform: translateY(16px);
  transition: opacity .5s ease, transform .5s ease; }
.scene-svg .m-underline { stroke-dasharray: 1500; stroke-dashoffset: 1500; transition: stroke-dashoffset 1.1s ease .3s; }
.scene-svg .m-character path, .scene-svg .m-character circle { stroke-dasharray: 1500; stroke-dashoffset: 1500;
  transition: stroke-dashoffset 1.5s ease .1s; }
.scene-svg .m-shelf path { stroke-dasharray: 1500; stroke-dashoffset: 1500; transition: stroke-dashoffset .9s ease .5s; }
.scene-svg .m-arrow { stroke-dasharray: 1500; stroke-dashoffset: 1500; transition: stroke-dashoffset .85s ease .95s; }
.scene-svg .m-arrowhead { stroke-dasharray: 300; stroke-dashoffset: 300; transition: stroke-dashoffset .4s ease 1.65s; }
.scene-svg .m-hl { transform: scaleX(0); transform-origin: 300px center; opacity: 0;
  transition: transform .55s ease 1.9s, opacity .3s ease 1.9s; }
.scene-svg .m-cta { font: 640 62px var(--font); fill: #23201C; opacity: 0; transform: translateY(14px);
  transition: opacity .5s ease 2.3s, transform .5s ease 2.3s; }
.scene-svg .m-safe { opacity: 0; transition: opacity .3s ease; }
.scene-svg .m-safe-l { font: 640 34px var(--font); fill: #DC6464; opacity: 0; transition: opacity .3s ease; }
.stage.safe-on .scene-svg .m-safe, .stage.safe-on .scene-svg .m-safe-l { opacity: 1; }

.scene-svg.on .m-title { opacity: 1; transform: none; }
.scene-svg.on .m-underline, .scene-svg.on .m-character path, .scene-svg.on .m-character circle,
.scene-svg.on .m-shelf path, .scene-svg.on .m-arrow, .scene-svg.on .m-arrowhead { stroke-dashoffset: 0; }
.scene-svg.on .m-hl { transform: scaleX(1); opacity: 1; }
.scene-svg.on .m-cta { opacity: 1; transform: none; }

/* scrub by scene: a scene index picks which parts are "on" */
.scene-svg[data-scene="0"] .m-shelf, .scene-svg[data-scene="0"] .m-arrow,
.scene-svg[data-scene="0"] .m-arrowhead, .scene-svg[data-scene="0"] .m-cta { visibility: hidden; }
.scene-svg[data-scene="1"] .m-arrow, .scene-svg[data-scene="1"] .m-arrowhead,
.scene-svg[data-scene="1"] .m-cta { visibility: hidden; }
.scene-svg[data-scene="2"] .m-cta { visibility: hidden; }

.capband {
  position: absolute; left: 7%; right: 7%; bottom: 9%; text-align: center;
  font-size: clamp(.72rem, 1.5vw, 1.02rem); font-weight: 640; line-height: 1.34;
  color: #fff; opacity: 0; transition: opacity .22s ease; pointer-events: none;
}
.capband.on { opacity: 1; }
.capband span {
  background: rgba(10,10,11,.86); padding: .16em .5em; border-radius: 5px;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

.transport { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.tp-btn {
  appearance: none; background: var(--surface-2); color: var(--fg);
  border: 1px solid var(--line-2); border-radius: 8px; min-width: 34px; height: 32px;
  font: 620 .82rem var(--mono); cursor: pointer; padding: 0 .5em;
  transition: border-color .18s ease, color .18s ease;
}
.tp-btn:hover { border-color: var(--accent); }
.tp-btn.primary { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1206; border-color: var(--bronze); }
[data-theme="light"] .tp-btn.primary { background: linear-gradient(180deg,#C87D12,#A5650A); color: #fff; }
.tp-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-hi); }
.tp-btn.primary[aria-pressed="true"] { color: #1a1206; }
.tp-label { font-size: .8rem; color: var(--accent-hi); font-weight: 620; min-width: 148px; }
.track { flex: 1 1 90px; min-width: 70px; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.track > i { display: block; height: 100%; width: 0; background: var(--accent); }
.clock { font-size: .78rem; color: var(--fg-dim); font-variant-numeric: tabular-nums; min-width: 82px; text-align: right; }

/* ---- work beat: document + sheet ---- */
.docpage {
  background: #FFFFFF; color: #1E1E22; border-radius: var(--r-sm); padding: 15px 16px;
  box-shadow: var(--shadow-sm); border: 1px solid #E4E0D8; min-height: 250px;
}
.doc-h { font-size: 1rem; color: #12324F; margin: 0 0 .6em; letter-spacing: -.01em; }
.doc-p { font-size: .775rem; line-height: 1.6; margin: 0 0 .55em; color: #33333A; min-height: 1.6em; }
.doc-p:empty { min-height: 1.6em; }
.doc-p::after, .doc-ul li::after { content: ""; }
.doc-ul { margin: 0 0 .4em; padding-left: 1.15em; }
.doc-ul li { font-size: .775rem; line-height: 1.6; color: #33333A; }
.cursor {
  display: inline-block; width: 2px; height: 1em; background: #12324F;
  vertical-align: text-bottom; animation: blink 1s steps(1) infinite;
}
.sheet { width: 100%; border-collapse: collapse; font-size: .755rem; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td { border: 1px solid var(--line); padding: .36em .5em; text-align: right; }
.sheet thead th { background: var(--surface-2); font-weight: 700; color: var(--fg); text-align: right; }
.sheet thead th:first-child, .sheet tbody td:first-child { text-align: left; }
.sheet tbody td { color: var(--fg-mute); }
.sheet tbody tr.on td { color: var(--fg); }
.sheet tbody tr.on { background: rgba(220,141,31,.06); }
.sheet tr.total th, .sheet tr.total td { background: var(--surface-2); color: var(--fg); font-weight: 700; border-top: 2px solid var(--bronze); }
.sheet td.filled { transition: color .25s ease, background .25s ease; }
.sheet td.filled.flash { animation: cellFlash .55s ease; }
@keyframes cellFlash { from { background: rgba(220,141,31,.4); } to { background: transparent; } }
.formula {
  margin-top: 8px; font-family: var(--mono); font-size: .74rem; color: var(--accent-hi);
  background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 9px; min-height: 1.7em; opacity: 0; transition: opacity .35s ease;
}
.formula.on { opacity: 1; }
.chart { margin-top: 12px; color: var(--fg-dim); opacity: .32; transition: opacity .45s ease; }
.chart.on { opacity: 1; }
.chart-cap { font-size: .72rem; font-weight: 620; color: var(--fg-mute); margin: 0 0 .3em; }
.chart svg { width: 100%; height: auto; }
.chart .bars rect { fill: var(--gold); transition: y .6s cubic-bezier(.2,.7,.25,1), height .6s cubic-bezier(.2,.7,.25,1); }
.chart .bars rect:nth-child(2) { transition-delay: .08s; }
.chart .bars rect:nth-child(3) { transition-delay: .16s; }
.chart .bars rect:nth-child(4) { transition-delay: .24s; }
.chart .axis { fill: var(--fg-dim); }

/* ---- the persistent token-economy strip ---- */
.meterstrip {
  margin-top: 16px; display: grid; gap: 1px; background: var(--line);
  grid-template-columns: repeat(3, minmax(0,.7fr)) repeat(2, minmax(0,1.3fr));
  border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden;
}
.meter { background: var(--surface); padding: 10px 13px; min-width: 0; }
.meter-label { display: block; font-size: .665rem; font-weight: 680; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); }
.meter-val { font-family: var(--mono); font-size: .95rem; font-weight: 620; color: var(--fg); font-variant-numeric: tabular-nums; }
.meter-val.small { font-size: .74rem; color: var(--fg-mute); }
.meter-wide { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 3px 10px; align-items: center; }
.meter-wide .meter-label { grid-column: 1 / -1; }
.gauge { height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.gauge > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); }
.gauge.budget > i { background: linear-gradient(90deg, var(--brand-green), var(--gold)); }
.sim-note { margin: 12px 0 0; font-size: .82rem; color: var(--fg-dim); max-width: 96ch; }
.sim-note code { font-size: .76rem; }

/* ============================ MODULE SECTIONS ============================ */
.mod { padding: clamp(46px, 7vw, 88px) 0; border-top: 1px solid var(--line); }
.mod.alt { background: var(--bg-2); }
.mod-head { max-width: 74ch; margin-bottom: clamp(26px, 3.4vw, 40px); }
.mod-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.mod-head.center .sub { margin-left: auto; margin-right: auto; }
.mod-head h2 { margin-bottom: .34em; }
.mod-head .sub { color: var(--fg-mute); font-size: 1.03rem; margin: 0; }

.feats { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.feat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 26px 26px 24px; position: relative; overflow: hidden;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.feat::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), transparent 72%); opacity: .5;
  transition: opacity .25s ease;
}
.feat:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.feat:hover::before { opacity: 1; }
.feat h3 { margin-bottom: .7em; color: var(--fg); font-size: 1.06rem; letter-spacing: -.012em; }
.feat h3 code { font-size: .82em; }
.feat p { font-size: .92rem; line-height: 1.72; color: var(--fg-mute); margin-bottom: 1em; }
.feat p:last-child { margin-bottom: 0; }
.feat p strong { color: var(--fg); font-weight: 640; }
.feat p em { color: var(--fg); font-style: italic; }
.feat .why {
  margin-top: 1.15em; padding-top: 1em;
  border-top: 1px solid var(--line);
  font-size: .875rem; line-height: 1.65; font-style: italic; color: var(--fg-dim);
}
.feat .why strong { color: var(--fg-mute); font-style: normal; }
.feat .note {
  background: rgba(220,150,80,.07); border: 1px solid rgba(220,150,80,.27);
  border-radius: var(--r-sm); padding: .7em .85em; font-size: .855rem; color: var(--fg-mute);
}
.feat .note strong { color: var(--amber); }

/* ============================== HOW IT WORKS ============================== */
.how { padding: clamp(44px, 6vw, 80px) 0; border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: s; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 20px 18px;
}
.step-n {
  display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: .7em;
  border-radius: 9px; background: rgba(220,141,31,.12); border: 1px solid rgba(220,141,31,.32);
  color: var(--accent-hi); font: 700 .9rem var(--mono);
}
.step h3 { font-size: 1.02rem; margin-bottom: .4em; }
.step p { font-size: .885rem; color: var(--fg-mute); margin: 0; }

/* ============================== COMPARISON =============================== */
.compare { padding: clamp(44px, 6vw, 80px) 0; border-top: 1px solid var(--line); background: var(--bg-2); }
.tablewrap { overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
.ctable { width: 100%; border-collapse: collapse; min-width: 660px; font-size: .885rem; }
.ctable th, .ctable td { padding: .82em 1.05em; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.ctable thead th { background: var(--surface-2); font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--fg-dim); font-weight: 700; }
.ctable thead th.pick { color: var(--accent-hi); }
.ctable tbody th { font-weight: 620; color: var(--fg); width: 20%; }
.ctable tbody td { color: var(--fg-mute); }
.ctable tbody tr:last-child th, .ctable tbody tr:last-child td { border-bottom: 0; }
.ctable td.pick { color: var(--fg); background: rgba(220,141,31,.055); font-weight: 540; }
.ctable thead th.pick { background: rgba(220,141,31,.1); }

/* ================================ DOWNLOAD =============================== */
.dl { padding: clamp(48px, 6vw, 86px) 0; border-top: 1px solid var(--line); }
.dl-in { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(0,.75fr); gap: 30px; align-items: start; }
.dl-copy h2 { margin-bottom: .3em; }
.dl-copy > p { color: var(--fg-mute); max-width: 52ch; }
.dl-facts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.dl-facts li { display: flex; justify-content: space-between; gap: 14px; padding: .68em 1em; border-bottom: 1px solid var(--line); }
.dl-facts li:last-child { border-bottom: 0; }
.f-k { font-size: .72rem; font-weight: 680; letter-spacing: .09em; text-transform: uppercase; color: var(--fg-dim); }
.f-v { font-size: .86rem; color: var(--fg); text-align: right; }

/* ================================= FOOTER ================================ */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: clamp(34px, 4.5vw, 56px) 0 26px; }
.foot-in { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.4fr); gap: 30px; }
.foot-brand .brand-mark { height: 34px; margin-bottom: .7em; }
.tagline { font-size: .95rem; color: var(--accent-hi); font-weight: 600; margin: 0 0 .35em; }
.foot-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 22px; }
.foot-nav h4 { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: .8em; }
.foot-nav a { display: block; font-size: .875rem; color: var(--fg-mute); padding: .22em 0; }
.foot-nav a:hover { color: var(--accent-hi); text-decoration: none; }
.foot-fine {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  font-size: .795rem; color: var(--fg-dim);
}
.foot-fine p { margin: 0; max-width: 74ch; }
.foot-fine code { font-size: .95em; }

/* ============================== RESPONSIVE =============================== */
@media (max-width: 1080px) {
  .build-body  { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); }
  .build-body .pane-side { grid-column: 1 / -1; }
  .work-body   { grid-template-columns: minmax(0,1fr) minmax(0,1.1fr); }
  .work-body .pane-side { grid-column: 1 / -1; }
  .meterstrip { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .meter-wide { grid-column: span 3; grid-template-columns: auto 1fr; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 380px; margin: 0 auto; }
  .engine { max-width: 340px; }
  .motion-body { grid-template-columns: 1fr; }
  .dl-in { grid-template-columns: 1fr; }
  .foot-in { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .meterstrip { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .meter-wide { grid-column: span 2; }
}
@media (max-width: 660px) {
  body { font-size: 16px; }
  .build-body, .work-body { grid-template-columns: 1fr; }
  .build-body .pane-side, .work-body .pane-side { grid-column: auto; }
  .meterstrip { grid-template-columns: 1fr; }
  .meter-wide { grid-column: auto; }
  .sim-head { flex-direction: column; align-items: flex-start; }
  .win-badge { display: none; }
  .tp-label { min-width: 0; flex: 1 0 100%; order: 5; }
  .clock { min-width: 0; }
  .hero { padding-top: 34px; }
  :not(pre) > code { white-space: normal; word-break: break-word; }
}
@media (max-width: 420px) {
  .wrap { padding: 0 15px; }
  .brand-mark { height: 25px; }
  .btn { font-size: .9rem; padding: .68em 1.05em; }
}

/* =============================== A11Y / MOTION =========================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .engine .rail, .engine .face, .engine .base, .engine .core { opacity: 1; stroke-dashoffset: 0; }
  .scene-svg .m-title, .scene-svg .m-cta { opacity: 1; transform: none; }
  .scene-svg .m-underline, .scene-svg .m-character path, .scene-svg .m-character circle,
  .scene-svg .m-shelf path, .scene-svg .m-arrow, .scene-svg .m-arrowhead { stroke-dashoffset: 0; }
  .scene-svg .m-hl { transform: scaleX(1); opacity: 1; }
  .bubble, .tiny-list li, .formula, .exportrow { opacity: 1; transform: none; }
  .chart { opacity: 1; }
}
@media print {
  .site-head, .sim-controls, .sim-tabs, .hero-art, .meterstrip { display: none; }
  body { background: #fff; color: #000; }
}


/* The header lockup: the mark as an image, the wordmark as live text so it
   stays crisp at any size and follows the theme without a second asset. */
.brand { gap: 9px; }
.brand-word {
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -.01em;
  color: var(--fg);
}
.head-signin {
  font-size: .89rem;
  font-weight: 600;
  color: var(--fg-mute);
  text-decoration: none;
  padding: 0 4px;
}
.head-signin:hover { color: var(--fg); text-decoration: none; }
@media (max-width: 560px) { .head-signin { display: none; } }
