/* Hallmark · macrostructure: Stat-Led · tone: engineered-luxury v3 (Dezerv-calm x Stratzy-data)
 * anchor hue: CompoundQuant blue 252 · full presentation rewrite — single coherent layout system */
@import url("tokens.css?v=17");

/* ============ reset & base ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body {
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 540;
  font-variation-settings: "opsz" 72;
  line-height: 1.08;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  min-width: 0;
  text-wrap: balance;
}
p { text-wrap: pretty; max-width: var(--measure); }
a { color: inherit; }
.tnum, .metric, td.num, .figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ============ layout system ============ */
:root { --container: 1160px; --gutter: clamp(1.25rem, 4vw, 2.5rem); }
.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
main.wrap > section + section, main.wrap > section + div, main.wrap > div + section { margin-top: clamp(3rem, 6vh, 4.5rem); }
.section { padding: 0; border: 0; }
.section-head { margin-bottom: clamp(1.75rem, 4vh, 2.75rem); max-width: 62ch; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: 0.6rem; }
.section-head p { color: var(--color-ink-2); font-size: 1.0625rem; }
.section-head .kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-accent);
  margin-bottom: 0.9rem;
}
.section-head .kicker::before { content: ""; width: 22px; height: 2px; background: var(--color-accent); border-radius: 2px; }

/* ============ nav ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg);
  max-width: none; width: 100%;
  padding: 0.9rem var(--gutter);
  background: color-mix(in oklch, var(--color-paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent);
}
.nav > * { flex-shrink: 0; }
.wordmark {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 620;
  letter-spacing: -0.02em; text-decoration: none;
}
.wordmark .brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: block;
  border: 1px solid color-mix(in oklch, var(--color-rule) 70%, transparent);
  transition: transform var(--dur-base) var(--ease-out);
}
.wordmark:hover .brand-mark { transform: scale(1.06); }
.wordmark .dot { color: var(--color-accent); display: inline-block; transition: transform var(--dur-base) var(--ease-out); }
.wordmark:hover .dot { transform: scale(1.4); }
@media (max-width: 480px) { .wordmark { font-size: 1.2rem; gap: 0.45rem; } .wordmark .brand-mark { width: 28px; height: 28px; } }
.nav-links { display: flex; gap: clamp(0.9rem, 2vw, 1.75rem); align-items: center; flex-wrap: wrap; }
.nav-links a {
  position: relative;
  font-weight: 600; font-size: 0.9rem; letter-spacing: 0;
  text-transform: none; text-decoration: none; color: var(--color-ink-2);
  padding: 0.25rem 0;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.nav-links a .idx { display: none; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  border-radius: 2px; background: var(--color-accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-base) var(--ease-out);
}
.nav-links a:hover { color: var(--color-ink); }
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--color-ink); }
.theme-toggle {
  font-family: var(--font-body); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.08em;
  background: var(--color-paper-2); border: 1px solid var(--color-rule);
  color: var(--color-ink-2); cursor: pointer;
  padding: 0.4rem 0.85rem; border-radius: 99px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.theme-toggle:hover { color: var(--color-ink); border-color: var(--color-muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.theme-toggle:active { transform: translateY(1px); }

/* ============ hero ============ */
.stat-hero { padding: clamp(3.5rem, 9vh, 6.5rem) 0 0; }
.grid-stage { position: relative; }
.grid-stage::before {
  content: ""; position: absolute; inset: -2rem -50vw 0; z-index: -1;
  background-image:
    linear-gradient(var(--color-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-grid) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 70% 90% at 30% 10%, black 25%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 30% 10%, black 25%, transparent 72%);
  animation: grid-pan 40s linear infinite;
}
@keyframes grid-pan { to { transform: translate3d(-46px, -46px, 0); } }
.stat-hero .figure {
  font-size: clamp(3.6rem, 11vw, 6.75rem);
  line-height: 1; letter-spacing: -0.045em; font-weight: 700;
}
.stat-hero .figure .unit { font-size: 0.34em; color: var(--color-muted); margin-left: 0.35rem; font-weight: 600; }
.stat-hero .qualifier {
  font-family: var(--font-display); font-weight: 480;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem); line-height: 1.4;
  color: var(--color-ink-2); max-width: 44ch; margin-top: 1.4rem;
}
.stat-hero .qualifier em { color: var(--color-accent); font-style: italic; font-variation-settings: "opsz" 40, "SOFT" 100; }
.stat-hero .fineprint { font-size: 0.8rem; color: var(--color-muted); max-width: 58ch; margin-top: 1rem; line-height: 1.6; }
.stat-hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); max-width: 20ch; }
.stat-hero p + p { margin-top: 1.25rem; }

/* ============ buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.01em;
  text-transform: none; text-decoration: none;
  padding: 0.8rem 1.6rem; border-radius: 99px;
  border: 1.5px solid var(--color-rule); color: var(--color-ink); background: var(--color-paper-2);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.btn:hover { border-color: var(--color-ink); transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn--accent {
  background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink);
  box-shadow: 0 6px 20px -8px color-mix(in oklch, var(--color-accent) 55%, transparent);
}
.btn--accent:hover {
  border-color: var(--color-accent); filter: brightness(1.06);
  box-shadow: 0 10px 26px -8px color-mix(in oklch, var(--color-accent) 65%, transparent);
}

/* ============ proof strip ============ */
.proof-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 1px; overflow: hidden;
  margin-top: clamp(3rem, 7vh, 5rem);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-rule);
  background: var(--color-rule);
}
.proof-strip .cell {
  background: var(--color-paper-2);
  padding: 1.4rem 1.5rem;
  border: 0;
  transition: background var(--dur-base) var(--ease-out);
}
.proof-strip .cell:hover { background: color-mix(in oklch, var(--color-accent) 7%, var(--color-paper-2)); }
.proof-strip .metric { display: block; font-size: clamp(1.6rem, 2.6vw, 2.1rem); transition: color var(--dur-fast) var(--ease-out); }
.proof-strip .cell:hover .metric { color: var(--color-accent); }
.proof-strip .label {
  display: block; margin-top: 0.35rem;
  font-size: 0.72rem; font-weight: 700; color: var(--color-muted);
  text-transform: uppercase; letter-spacing: 0.09em;
}

/* ============ cards ============ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 1.25rem; }
.card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.8rem;
  padding: 1.6rem;
  background: var(--color-paper-2);
  border: 1px solid color-mix(in oklch, var(--color-rule) 75%, transparent);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
a.card:hover, .card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--color-accent) 45%, var(--color-rule));
  box-shadow: 0 18px 44px -22px color-mix(in oklch, var(--color-ink) 40%, transparent);
}
.card:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.card .tier {
  align-self: flex-start;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-ink-2);
  background: color-mix(in oklch, var(--color-muted) 14%, transparent);
  padding: 0.28rem 0.7rem; border-radius: 99px;
}
.card .tier.t-core { color: var(--color-accent-ink); background: var(--color-accent); }
.card h3 { font-size: 1.35rem; }
.card .desc { font-size: 0.92rem; color: var(--color-ink-2); flex-grow: 1; line-height: 1.55; }
.card .spark { height: 52px; margin: 0.2rem 0; }
.card .spark svg path { stroke: var(--color-accent); fill: none; stroke-width: 1.75; transition: stroke-width var(--dur-fast) var(--ease-out); }
.card:hover .spark svg path { stroke-width: 2.5; }
.card .row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: 0.55rem; border-top: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent);
}
.card .row .k { font-size: 0.7rem; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.card .row .v { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.95rem; }

/* ============ tables ============ */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  background: var(--color-paper-2);
}
table.data { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.data th {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-muted); text-align: left;
  padding: 0.85rem 1.1rem; white-space: nowrap;
  border-bottom: 1px solid var(--color-rule);
  background: color-mix(in oklch, var(--color-paper-3) 55%, var(--color-paper-2));
}
table.data td { padding: 0.8rem 1.1rem; border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 55%, transparent); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { text-align: right; white-space: nowrap; }
table.data th.num { text-align: right; }
table.data tbody tr { transition: background var(--dur-fast) var(--ease-out); }
table.data tbody tr:hover { background: color-mix(in oklch, var(--color-accent) 6%, transparent); }
table.data tr.ours td { background: color-mix(in oklch, var(--color-accent) 9%, transparent); }
table.data .src { font-size: 0.72rem; color: var(--color-muted); font-weight: 600; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--color-ink); }
table.data th.sortable .arrow { color: var(--color-accent); }

/* ============ charts ============ */
.chart-frame {
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  padding: 1.4rem; background: var(--color-paper-2);
  transition: border-color var(--dur-base) var(--ease-out);
}
.chart-frame:hover { border-color: color-mix(in oklch, var(--color-accent) 40%, var(--color-rule)); }
.chart-frame h3 { font-size: 1.15rem; margin-bottom: 0.8rem; }
.chart-frame .legend { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: 0.78rem; font-weight: 600; color: var(--color-muted); margin-bottom: 0.7rem; }
.legend .key { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .swatch { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.chart-chips { display: flex; gap: 0.4rem; margin-bottom: 0.8rem; }
.chart-chips button {
  font-family: var(--font-body); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.05em;
  padding: 0.28rem 0.8rem; cursor: pointer;
  background: transparent; color: var(--color-muted);
  border: 1px solid var(--color-rule); border-radius: 99px;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.chart-chips button:hover { color: var(--color-ink); border-color: var(--color-muted); }
.chart-chips button.on { color: var(--color-accent-ink); background: var(--color-accent); border-color: var(--color-accent); }
.chart-chips button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ============ quiz ============ */
.quiz-step {
  border: 1px solid var(--color-rule); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--color-paper-2); max-width: 720px;
}
.quiz-step .qnum { font-weight: 800; color: var(--color-accent); font-size: 0.72rem; letter-spacing: 0.12em; }
.quiz-step h3 { font-size: clamp(1.35rem, 2.6vw, 1.8rem); margin-top: 0.5rem; }
.quiz-progress { font-size: 0.75rem; font-weight: 700; color: var(--color-muted); margin-bottom: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.quiz-opts { display: grid; gap: 0.6rem; margin: 1.4rem 0 0; }
.quiz-opts button {
  text-align: left; font-family: var(--font-body); font-size: 0.98rem; font-weight: 500;
  padding: 0.95rem 1.15rem;
  background: var(--color-paper); color: var(--color-ink);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.quiz-opts button:hover { border-color: var(--color-accent); transform: translateX(4px); }
.quiz-opts button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.quiz-opts button:active { transform: translateX(4px) scale(0.995); }
.quiz-opts button.selected { border-color: var(--color-accent); background: color-mix(in oklch, var(--color-accent) 9%, var(--color-paper)); }

/* ============ learn ============ */
.learn-toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1.25rem; }
.module {
  background: var(--color-paper-2);
  border: 1px solid color-mix(in oklch, var(--color-rule) 75%, transparent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.module:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklch, var(--color-accent) 45%, var(--color-rule));
  box-shadow: 0 18px 44px -22px color-mix(in oklch, var(--color-ink) 40%, transparent);
}
.module .mnum { font-weight: 800; color: var(--color-accent); font-size: 0.7rem; letter-spacing: 0.12em; }
.module h3 { font-size: 1.2rem; margin: 0.4rem 0 0.6rem; }
.module ul { padding-left: 1.1em; font-size: 0.9rem; color: var(--color-ink-2); line-height: 1.6; }
.module li { margin-bottom: 0.35rem; }
.module li::marker { color: var(--color-accent); }
article.lesson h2 { font-size: clamp(1.5rem, 2.8vw, 1.9rem); margin: 2.5rem 0 0.9rem; }
article.lesson h2:first-child { margin-top: 0; }
article.lesson ul { max-width: var(--measure); padding-left: 1.2em; }
article.lesson li { margin-bottom: 0.55rem; }
article.lesson li::marker { color: var(--color-accent); }

/* ============ footer ============ */
.footer { margin-top: clamp(4.5rem, 10vh, 8rem); padding: clamp(2.5rem, 6vh, 4rem) 0; background: var(--color-paper-2); border-top: 1px solid var(--color-rule); }
.footer .statement { font-family: var(--font-display); font-weight: 520; font-size: clamp(1.4rem, 3vw, 2rem); max-width: 26ch; line-height: 1.25; }
.footer .cols { display: flex; justify-content: space-between; gap: 2.5rem; flex-wrap: wrap; margin-bottom: 2rem; }
.footer .mono-links { display: flex; flex-direction: column; gap: 0.55rem; }
.footer .mono-links a {
  font-size: 0.85rem; font-weight: 600; color: var(--color-ink-2); text-decoration: none;
  text-transform: none; letter-spacing: 0; white-space: nowrap; display: inline-block;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.footer .mono-links a:hover { color: var(--color-accent); transform: translateX(4px); }
.footer .disclosure { font-size: 0.75rem; color: var(--color-muted); max-width: 82ch; line-height: 1.7; }

/* ============ reveal motion ============ */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.in { opacity: 1; transform: none; transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out); }

/* ============ responsive ============ */
@media (max-width: 768px) {
  .nav { flex-wrap: wrap; padding-block: 0.65rem; row-gap: 0.4rem; }
  .nav-links {
    order: 3; width: 100%;
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; gap: 1.15rem; padding-bottom: 0.15rem;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .theme-toggle { margin-left: auto; }
  .stat-hero { padding-top: 2.2rem; }
  .stat-hero .figure { font-size: clamp(3rem, 16vw, 4.2rem); }
  .footer .cols { flex-direction: column; }
  .proof-strip { grid-template-columns: 1fr 1fr; }
  .proof-strip .cell { padding: 1rem 1.1rem; }
  .chart-frame { padding: 1rem; }
  select { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
  .grid-stage::before { animation: none; }
  .card:hover, .module:hover, .quiz-opts button:hover, .footer .mono-links a:hover, .btn:hover { transform: none; }
}

/* ============ themed select ============ */
select, .select {
  appearance: none; -webkit-appearance: none;
  font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
  color: var(--color-ink); background-color: var(--color-paper-2);
  border: 1px solid var(--color-rule); border-radius: var(--radius-md);
  padding: 0.7rem 2.6rem 0.7rem 1rem; cursor: pointer; min-width: 260px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%23888" stroke-width="2" stroke-linecap="round"/></svg>');
  background-repeat: no-repeat; background-position: right 1rem center;
  transition: border-color var(--dur-fast) var(--ease-out);
}
select:hover { border-color: var(--color-muted); }
select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ============ hero split + flagship card ============ */
.hero-split {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-bottom: clamp(2rem, 5vh, 3.5rem);
}
.hero-card {
  display: flex; flex-direction: column; gap: 0.9rem;
  padding: 1.75rem;
  background: color-mix(in oklch, var(--color-paper-2) 88%, var(--color-accent) 3%);
  border: 1px solid color-mix(in oklch, var(--color-accent) 30%, var(--color-rule));
  border-radius: var(--radius-lg);
  text-decoration: none;
  box-shadow: 0 24px 60px -30px color-mix(in oklch, var(--color-ink) 50%, transparent);
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.hero-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in oklch, var(--color-accent) 60%, var(--color-rule));
  box-shadow: 0 32px 72px -30px color-mix(in oklch, var(--color-ink) 60%, transparent);
}
.hero-card .hc-top h3 { font-size: 1.5rem; margin-top: 0.6rem; }
.hero-card .hc-chart { height: 88px; }
.hero-card .hc-chart svg path { stroke: var(--color-accent); fill: none; stroke-width: 2; }
.hc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 1.2rem; }
.hc-stat { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent); padding-top: 0.45rem; }
.hc-stat .k { font-size: 0.7rem; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.07em; }
.hc-stat .v { font-weight: 700; font-size: 1rem; }
.hero-card .hc-cta { font-weight: 700; font-size: 0.88rem; color: var(--color-accent); margin-top: 0.2rem; }

/* ============ full-bleed band ============ */
.band { position: relative; padding-block: clamp(2.5rem, 6vh, 4rem); }
.band::before {
  content: ""; position: absolute; inset: 0 calc(50% - 50vw); z-index: -1;
  background: var(--color-paper-2);
  border-block: 1px solid color-mix(in oklch, var(--color-rule) 55%, transparent);
}
.band .chart-frame, .band .card, .band .proof-strip .cell, .band .table-scroll { background: var(--color-paper); }

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; }
  .hero-card { max-width: 460px; }
}

/* ============ rebalance simulator ============ */
.sim { border: 1px solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-paper-2); padding: 1.5rem; }
.sim-controls { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1.1rem; }
.sim-controls .btn { padding: 0.45rem 0.9rem; }
.sim-controls input[type="range"] { flex: 1; accent-color: var(--color-accent); height: 4px; cursor: pointer; }
.sim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.sim-date { font-size: 1.3rem; font-weight: 700; }
.sim-sleeve { color: var(--color-accent); font-weight: 700; font-size: 0.85rem; }
.sim-meta { color: var(--color-muted); font-size: 0.8rem; font-weight: 600; }
.sim-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.sim-panel h4 { font-family: var(--font-body); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; color: var(--color-muted); margin-bottom: 0.55rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-size: 0.78rem; font-weight: 600; padding: 0.28rem 0.65rem; border-radius: 99px;
  background: var(--color-paper); border: 1px solid var(--color-rule); color: var(--color-ink-2);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.chip:hover { transform: translateY(-1px); border-color: var(--color-accent); }
.chip.in { border-color: color-mix(in oklch, var(--color-accent) 55%, var(--color-rule)); color: var(--color-accent); background: color-mix(in oklch, var(--color-accent) 8%, var(--color-paper)); }
.chip.out { text-decoration: line-through; opacity: 0.62; }
.chip-none { opacity: 0.5; font-style: italic; }
@media (max-width: 640px) { .sim-panels { grid-template-columns: 1fr; } }

/* ============ app mode (APK / installed PWA) ============ */
body.app-mode { padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
body.app-mode .nav { padding-top: calc(0.65rem + env(safe-area-inset-top, 0px)); }
body.app-mode .nav-links a { display: none; }           /* tabs take over navigation */
body.app-mode .nav-links { gap: 0; order: 0; width: auto; overflow: visible; }
body.app-mode .nav { flex-wrap: nowrap; }
body.app-mode .footer .cols { display: none; }           /* compact footer: disclosure only */
body.app-mode .footer { margin-top: 3rem; padding: 1.5rem 0; }
body.app-mode { user-select: none; -webkit-tap-highlight-color: transparent; }
body.app-mode input, body.app-mode select { user-select: auto; }
body.app-mode main { animation: app-fade 240ms var(--ease-out); }
@keyframes app-fade { from { opacity: 0; transform: translateY(6px); } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: color-mix(in oklch, var(--color-paper) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid color-mix(in oklch, var(--color-rule) 70%, transparent);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.35rem 0.2rem; border-radius: var(--radius-md);
  text-decoration: none; color: var(--color-muted);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em;
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a:active { transform: scale(0.94); }
.tabbar a.active { color: var(--color-accent); }
@media (prefers-reduced-motion: reduce) { body.app-mode main { animation: none; } .tabbar a:active { transform: none; } }

/* ── Boot reveal ────────────────────────────────────────────────────────────
 * Full-bleed brand plate: the CQ mark draws itself open, then the plate
 * splits and the page rises into place. Runs on CSS alone so a JS failure
 * can never leave the plate up; app.js only downgrades it to a quick fade
 * on same-session navigation. */
#boot {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  pointer-events: none;
  animation: boot-clear 0s linear 3.05s forwards;
}
#boot .boot-panel {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: var(--color-brand-plate);
  animation: var(--dur-boot-panel, 620ms) var(--ease-in-out) 2.35s both;
}
#boot .boot-panel.is-top { top: 0; animation-name: boot-open-top; }
#boot .boot-panel.is-bottom { bottom: 0; animation-name: boot-open-bottom; }
#boot .boot-stage {
  position: relative; display: grid; justify-items: center; gap: var(--space-lg);
  animation: boot-mark-out 340ms var(--ease-in) 2.38s both;
}
#boot .boot-mark { width: min(64vw, 430px); height: auto; overflow: visible; }
#boot .boot-mark circle, #boot .boot-mark path {
  stroke-dasharray: 100; stroke-dashoffset: 100;
  animation: boot-draw 760ms var(--ease-out) both;
}
#boot .boot-mark .m-c { animation-delay: 120ms; }
#boot .boot-mark .m-q { animation-delay: 300ms; }
#boot .boot-mark .m-tail { animation-delay: 620ms; animation-duration: 420ms; }
#boot .boot-word {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(0.7rem, 1.8vw, 1.4rem);
  font-family: var(--font-body); font-weight: 700;
  font-size: clamp(0.72rem, 2.1vw, 1.2rem);
  color: oklch(96% 0.004 250);
  animation: boot-word-in 620ms var(--ease-out) 780ms both;
}
#boot .boot-word-text { letter-spacing: 0.42em; text-indent: 0.42em; }
#boot .boot-word b { color: var(--color-brand-lift); font-weight: 700; }
/* the two rules that flank the wordmark in the logo lockup */
#boot .boot-rule {
  flex: none; height: 2px; width: clamp(24px, 5.5vw, 62px); border-radius: 2px;
  background: var(--color-brand-lift);
  animation: boot-rule-in 520ms var(--ease-out) 940ms both;
}
#boot .boot-rule:first-child { transform-origin: right center; }
#boot .boot-rule:last-child { transform-origin: left center; }
@keyframes boot-draw      { to { stroke-dashoffset: 0; } }
@keyframes boot-word-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes boot-rule-in   { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes boot-mark-out  { to { opacity: 0; transform: scale(1.06); } }
@keyframes boot-open-top    { to { transform: translateY(-101%); } }
@keyframes boot-open-bottom { to { transform: translateY(101%); } }
@keyframes boot-clear     { to { visibility: hidden; } }
/* the page itself rises as the plate opens */
body > header, body > main, body > footer {
  animation: boot-rise 760ms var(--ease-out) 2.4s both;
}
@keyframes boot-rise { from { opacity: 0; transform: scale(0.988) translateY(10px); } to { opacity: 1; transform: none; } }

/* same-session navigation: no theatre, just a fast wipe */
body[data-boot="quick"] #boot { animation-delay: 0.34s; }
body[data-boot="quick"] #boot .boot-panel { animation-delay: 0.06s; animation-duration: 280ms; }
body[data-boot="quick"] #boot .boot-stage { animation: boot-mark-out 200ms var(--ease-in) both; }
body[data-boot="quick"] #boot .boot-mark circle, body[data-boot="quick"] #boot .boot-mark path { animation-duration: 220ms; animation-delay: 0s; }
body[data-boot="quick"] #boot .boot-word { animation: none; opacity: 1; }
body[data-boot="quick"] #boot .boot-rule { animation: none; transform: none; }
body[data-boot="quick"] > header, body[data-boot="quick"] > main, body[data-boot="quick"] > footer { animation-delay: 0.2s; animation-duration: 380ms; }

@media (prefers-reduced-motion: reduce) {
  #boot { animation-delay: 0.42s; }
  #boot .boot-panel { animation: boot-fade 300ms linear 0.12s both; }
  #boot .boot-stage, #boot .boot-word { animation: none; opacity: 1; }
  #boot .boot-rule { animation: none; transform: none; }
  #boot .boot-mark circle, #boot .boot-mark path { animation: none; stroke-dashoffset: 0; }
  body > header, body > main, body > footer { animation: boot-fade-in 150ms linear 0.12s both; }
  @keyframes boot-fade { to { opacity: 0; } }
  @keyframes boot-fade-in { from { opacity: 0; } to { opacity: 1; } }
}
