/* Catio x AWS value calculator. Brand type: Basement Grotesque (text, titles, figures) and Bungee (labels).
   Both ship one heavy cut, so a hairline in the colour of the surface behind the text trims every glyph:
   --thin is set per family, --thin-bg wherever a solid background is set. */

@font-face {
  font-family: "Basement Grotesque";
  src: url("/fonts/BasementGrotesque-Black_v1.202.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bungee";
  src: url("/fonts/Bungee-Regular.latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root,
[data-theme="light"] {
  --bg: #fbf9f4;
  --bg-2: #f3efe6;
  --surface: #ffffff;
  --fg: #0b0c0d;
  --fg-2: #23272b;
  --fg-3: #3b4147;
  --fg-4: #5a6066;
  --line: #e6e0d4;
  --line-strong: #cfc7b8;
  --track: #e8e2d5;
  --accent: #ff6800;
  --accent-hot: #ff7a1f;
  --accent-ink: #b03e00;
  --accent-soft-solid: #ffe8d6;
  --accent-soft-2: #fff4ea;
  --accent-wash: rgba(255, 104, 0, 0.13);
  --cell: #ffc8a1;
  --today: #a39b8c;
  --lane-today: #f3efe6;
  --lane-catio: #fff3e9;
  --warn: #8f5400;
  --warn-wash: #fcefd8;
  --panel: #ffffff;
  --panel-2: #f5f1e8;
  --panel-fg: #0b0c0d;
  --panel-fg-2: #2f353a;
  --panel-fg-3: #575d63;
  --panel-line: #e3ddd1;
  --panel-edge: #d3cbbb;
  --panel-track: #ebe5d9;
  --panel-num: #ff6800;
  --panel-a: #b03e00;
  --panel-b: #94480e;
  --panel-shadow: 0 1px 2px rgba(8, 9, 10, 0.06), 0 26px 54px -30px rgba(8, 9, 10, 0.34);
  --delta-bg: #ffe8d6;
  --delta-fg: #b03e00;
  --delta-neg-bg: #eee8dd;
  --delta-neg-fg: #3d4349;
  --aws-ink: #252f3e;
  --dot: rgba(11, 12, 13, 0.07);
  --shadow: 0 1px 2px rgba(8, 9, 10, 0.05), 0 18px 40px -24px rgba(8, 9, 10, 0.28);
  --focus: #b03e00;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0d0f11;
  --bg-2: #15181c;
  --surface: #171a1e;
  --fg: #f6f3ed;
  --fg-2: #dcd8d0;
  --fg-3: #aea9a1;
  --fg-4: #8c8881;
  --line: #262a2f;
  --line-strong: #3b4046;
  --track: #2a2e34;
  --accent-ink: #ff8a3d;
  --accent-soft-solid: #2f1d11;
  --accent-soft-2: #1d1610;
  --accent-wash: rgba(255, 104, 0, 0.18);
  --cell: #70380f;
  --today: #7a8188;
  --lane-today: #1d2125;
  --lane-catio: #22180f;
  --warn: #ffb74d;
  --warn-wash: #2c2314;
  --panel: #1c2024;
  --panel-2: #272c31;
  --panel-fg: #f6f3ed;
  --panel-fg-2: rgba(246, 243, 237, 0.76);
  --panel-fg-3: rgba(246, 243, 237, 0.56);
  --panel-line: rgba(246, 243, 237, 0.13);
  --panel-edge: rgba(246, 243, 237, 0.13);
  --panel-track: rgba(255, 255, 255, 0.07);
  --panel-num: #ff7a1f;
  --panel-a: #ff7a1f;
  --panel-b: #ffb27a;
  --panel-shadow: 0 34px 70px -34px rgba(0, 0, 0, 0.6);
  --delta-bg: #3a2414;
  --delta-fg: #ffa463;
  --delta-neg-bg: #2f2a22;
  --delta-neg-fg: #d9c7a6;
  --aws-ink: #ffffff;
  --dot: rgba(246, 243, 237, 0.055);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  --focus: #ff8a3d;
  color-scheme: dark;
}

:root {
  --ff-sans: "Basement Grotesque", ui-sans-serif, system-ui, sans-serif;
  --ff-sign: "Bungee", "Basement Grotesque", ui-sans-serif, sans-serif;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
  --bar: 60px;
  --gutter: 16px;
  --maxw: 1240px;
  --thin-sans: 0.02em;
  --thin-title: 0.035em;
  --thin-display: 0.03em;
  --thin-sign: 0.028em;
  --thin: var(--thin-sans);
  --thin-bg: var(--bg);
}
[data-theme="dark"] {
  --thin-sans: 0.055em;
  --thin-title: 0.043em;
  --thin-display: 0.037em;
  --thin-sign: 0.058em;
}
@media (min-width: 768px) { :root { --gutter: 32px; } }
@media (min-width: 1280px) { :root { --gutter: 48px; } }

*, ::before, ::after { box-sizing: border-box; -webkit-text-stroke: var(--thin) var(--thin-bg); }

/* ---------- base ---------- */
html {
  background: var(--bg);
  color: var(--fg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-height: 100svh;
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1px, transparent 1.3px);
  background-size: 22px 22px;
  --thin-bg: var(--bg);
  color: var(--fg);
  font-family: var(--ff-sans);
  font-weight: 900;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; font-weight: 900; }
b, strong { font-weight: 900; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { touch-action: manipulation; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px;
  background: var(--panel); --thin-bg: var(--panel); color: var(--panel-fg); text-decoration: none; transition: top 0.2s;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--ff-sign);
  --thin: var(--thin-sign);
  font-weight: 400;
  font-size: 11.5px;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-4);
}
.display {
  --thin: var(--thin-display);
  font-size: clamp(40px, 4.9vw + 4px, 80px);
  line-height: 1.02;
  letter-spacing: -0.024em;
}
.lead { font-size: clamp(17px, 0.45vw + 13px, 20px); line-height: 1.55; color: var(--fg-3); max-width: 58ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 22px; border-radius: 14px; border: 1px solid transparent;
  font-size: 16px; line-height: 1.1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.25s var(--ease-out), background-color 0.25s, border-color 0.25s, box-shadow 0.25s, color 0.2s;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); --thin-bg: var(--accent); color: #fff; box-shadow: 0 12px 26px -12px rgba(255, 104, 0, 0.75); }
.btn-primary:hover { background: var(--accent-hot); --thin-bg: var(--accent-hot); transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(255, 104, 0, 0.85); }
.btn-primary:hover svg { animation: nudge 0.9s var(--ease-out) infinite; }
.btn-ghost { border-color: var(--line-strong); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg-3); transform: translateY(-2px); }
.btn-quiet {
  min-height: 42px; padding: 0 14px; border-radius: 12px; font-size: 14px;
  background: var(--surface); --thin-bg: var(--surface); border-color: var(--line); color: var(--fg-3);
}
.btn-quiet:hover { color: var(--fg); border-color: var(--line-strong); }
.btn-quiet svg { width: 16px; height: 16px; }
.btn-quiet.spin svg { animation: spin 0.7s var(--ease-out); }
.btn-quiet.done { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--fg-2); flex: none;
  transition: border-color 0.2s, transform 0.2s var(--ease-out);
}
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-area: 1 / 1; transition: transform 0.5s var(--ease-spring), opacity 0.3s; }
.theme-btn .sun { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"] .theme-btn .sun { opacity: 1; transform: none; }
[data-theme="dark"] .theme-btn .moon { opacity: 0; transform: rotate(90deg) scale(0.5); }

.pill {
  display: inline-flex; align-items: center; gap: 9px; align-self: flex-start;
  font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10.5px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 999px; padding: 6px 12px 6px 10px; line-height: 1.2;
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--bg-2); --thin-bg: var(--bg-2); color: var(--fg-3); font-size: 13.5px; line-height: 1.25;
}
.chip b { color: var(--fg); font-size: 15px; }
.chip-accent { background: var(--accent-soft-solid); --thin-bg: var(--accent-soft-solid); color: var(--accent-ink); }
.chip-accent b { color: var(--accent-ink); }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 40; height: var(--bar);
  background: color-mix(in srgb, var(--bg) 86%, transparent); --thin-bg: var(--bg);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s;
}
.bar.scrolled { border-bottom-color: var(--line); }
.bar-in { max-width: calc(var(--maxw) + 2 * var(--gutter)); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); min-width: 0; }
.mark { width: 22px; height: 22px; }
.brand-name { font-size: 17px; letter-spacing: -0.01em; white-space: nowrap; }
.brand-name i { font-style: normal; color: var(--accent); }
.aws-logo { display: block; height: 25px; width: auto; flex: none; margin: 7px 0 0 -2px; }
.aws-logo .aws-ink { fill: var(--aws-ink); }
.aws-logo .aws-smile { fill: #ff9900; fill-rule: evenodd; }
.brand-sub { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10.5px; color: var(--fg-4); padding-left: 11px; border-left: 1px solid var(--line-strong); text-transform: uppercase; white-space: nowrap; }
.nav { position: relative; display: flex; gap: 2px; margin-left: auto; }
.nav a { position: relative; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; color: var(--fg-3); text-decoration: none; transition: color 0.2s; white-space: nowrap; }
.nav a:hover, .nav a.on { color: var(--fg); }
.nav-ind { position: absolute; left: 0; bottom: 1px; height: 2px; width: 0; border-radius: 2px; background: var(--accent); opacity: 0; transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity 0.3s; }
.nav-ind.on { opacity: 1; }
.theme-btn { margin-left: 4px; }
.bar-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.bar-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffb27a); transform-origin: left; transform: scaleX(0); }
@media (max-width: 999px) { .nav { display: none; } .theme-btn { margin-left: auto; } }
@media (max-width: 480px) { .brand-sub { display: none; } }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(36px, 6vh, 72px) var(--gutter) 40px; }
.hero-in {
  position: relative; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 0.96fr); gap: clamp(32px, 4vw, 64px); align-items: center;
}
.hero-glow {
  position: absolute; right: -6%; top: -4%; width: min(62vw, 860px); aspect-ratio: 1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 104, 0, 0.14), rgba(255, 104, 0, 0.05) 55%, transparent);
  animation: drift 16s ease-in-out infinite alternate;
}
.hero-copy { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.hero-copy h1 { max-width: 13ch; }
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 0.04em 0.1em; margin: 0 -0.04em -0.1em; }
.w > span { display: inline-block; transform: translateY(108%); animation: rise 0.95s var(--ease-out) forwards; }
.w.accent > span { color: var(--accent); }
.w:nth-child(1) > span { animation-delay: 0.08s; }
.w:nth-child(2) > span { animation-delay: 0.15s; }
.w:nth-child(3) > span { animation-delay: 0.22s; }
.w:nth-child(4) > span { animation-delay: 0.29s; }
.w:nth-child(5) > span { animation-delay: 0.36s; }
.w:nth-child(6) > span { animation-delay: 0.43s; }
.w:nth-child(7) > span { animation-delay: 0.5s; }
.w:nth-child(8) > span { animation-delay: 0.57s; }
.hero-eyebrow, .hero-lead, .hero-pill, .hero-ctas, .hero-card { animation: fadeUp 0.9s var(--ease-out) both; }
.hero-eyebrow { animation-delay: 0s; }
.hero-lead { animation-delay: 0.55s; }
.hero-pill { animation-delay: 0.68s; }
.hero-ctas { animation-delay: 0.8s; }
.hero-card { animation-delay: 0.35s; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.hero-card {
  position: relative; min-width: 0; padding: clamp(20px, 2.2vw, 30px);
  background: var(--surface); --thin-bg: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow);
}
.hero-stat { display: flex; flex-direction: column; gap: 10px; }
.hero-total { font-size: clamp(64px, 7.4vw, 112px); color: var(--accent); margin: 2px 0 0; }
.hero-stat-sub { color: var(--fg-3); font-size: 16px; }
.hero-stat-sub b { color: var(--fg); }
.hero-stat .chips { margin-top: 6px; }

/* odometer */
.odo { --thin: var(--thin-display); display: flex; align-items: flex-start; line-height: 1; letter-spacing: 0; white-space: nowrap; font-variant-numeric: lining-nums; }
.od-ch { display: inline-block; height: 1.04em; line-height: 1.04em; }
.od-col { display: inline-block; height: 1.04em; overflow: hidden; text-align: center; transition: width 0.7s var(--ease-out); -webkit-mask-image: linear-gradient(transparent, #000 11%, #000 89%, transparent); mask-image: linear-gradient(transparent, #000 11%, #000 89%, transparent); }
.od-strip { display: flex; flex-direction: column; transition: transform 0.95s var(--ease-out); will-change: transform; }
.od-strip > span { display: block; height: 1.04em; line-height: 1.04em; }

/* race */
.race { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.race-title { color: var(--fg-3); }
.lane { margin-top: 12px; }
.lane-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lane-name { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }
.lane-today .lane-name { color: var(--fg-3); }
.lane-catio .lane-name { color: var(--accent-ink); }
.lane-stat { font-size: 13px; color: var(--fg-4); }
.lane-stat b { color: var(--fg-2); }
.lane-catio .lane-stat b { color: var(--accent-ink); }
.lane-track { position: relative; height: clamp(62px, 8vh, 80px); margin-top: 6px; border-radius: 14px; background: var(--lane-today); overflow: hidden; }
.lane-catio .lane-track { background: var(--lane-catio); }
.lane-track canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.race-note { margin-top: 12px; font-size: 12.5px; line-height: 1.45; color: var(--fg-4); }

@media (max-width: 999px) {
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-copy h1 { max-width: 16ch; }
  .hero-glow { width: 120vw; right: -40%; top: 20%; }
}

/* ---------- sections ---------- */
.sec { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(88px, 11vh, 128px) var(--gutter) 0; }
.sec-head { display: flex; flex-direction: column; gap: 14px; }
.num-eyebrow { display: flex; align-items: center; gap: 10px; color: var(--fg-3); }
.num-eyebrow span { color: var(--accent); }
.num-eyebrow::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--line-strong); }
.sec-h { --thin: var(--thin-title); font-size: clamp(32px, 2.8vw + 10px, 54px); line-height: 1.06; letter-spacing: -0.02em; max-width: 22ch; }
.sec-sub { color: var(--fg-3); font-size: 17px; max-width: 70ch; }
.sec-sub b { color: var(--fg); }

.card { background: var(--surface); --thin-bg: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }

/* spotlight that follows the pointer */
.glow { isolation: isolate; }
.glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(440px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 104, 0, 0.1), transparent 62%);
  opacity: 0; transition: opacity 0.45s;
}
.glow:hover::after { opacity: 1; }

/* ---------- calculator ---------- */
.cases-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 30px; }
.seg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px; border-radius: 17px; background: var(--bg-2); --thin-bg: var(--bg-2); border: 1px solid var(--line); }
.seg-ind {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 12px; background: var(--surface);
  box-shadow: 0 1px 2px rgba(8, 9, 10, 0.08), 0 0 0 1px var(--line), 0 8px 18px -10px rgba(255, 104, 0, 0.55);
  transition: transform 0.55s var(--ease-spring), width 0.45s var(--ease-out), height 0.45s var(--ease-out);
}
.seg-ind::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); }
.seg button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 5px; padding: 12px 20px 13px; border-radius: 12px;
  font-size: 16.5px; line-height: 1; color: var(--fg-4); transition: color 0.3s; white-space: nowrap;
}
.seg button small { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10.5px; letter-spacing: 0.03em; color: var(--fg-4); transition: color 0.3s; }
.seg button[aria-pressed="true"] { color: var(--fg); --thin-bg: var(--surface); }
.seg button[aria-pressed="true"] small { color: var(--accent-ink); }
.seg button:hover { color: var(--fg-2); }
.bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 28px; align-items: start; margin-top: 22px; }
.inputs { display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 0; }
fieldset.card { margin: 0; padding: 0 clamp(18px, 2vw, 26px) 10px; min-width: 0; }
.legend {
  float: left; width: 100%; padding: 22px 0 6px; display: flex; align-items: center; gap: 10px;
  font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-ink);
}
.legend + * { clear: both; }
.legend-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft-solid); --thin-bg: var(--accent-soft-solid); font-size: 11px; }
.field { padding: 18px 0 16px; border-top: 1px solid var(--line); }
.legend + .field { border-top: 0; padding-top: 10px; }
.field-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field label { font-size: 16.5px; line-height: 1.3; color: var(--fg); display: flex; align-items: center; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 9px; flex: none; }
.key-today { background: var(--today); }
.key-catio { background: var(--accent); }
.help { font-size: 13.5px; line-height: 1.45; color: var(--fg-4); margin-top: 6px; max-width: 62ch; }

.numbox {
  display: flex; align-items: center; flex: none; width: 152px; height: 46px; border-radius: 12px;
  background: var(--bg); --thin-bg: var(--bg); border: 1px solid var(--line-strong);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.numbox:hover { border-color: var(--fg-4); }
.numbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
.numbox input {
  flex: 1; min-width: 0; width: 100%; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 19px; text-align: right; padding: 0 4px; color: var(--fg); -moz-appearance: textfield; appearance: textfield;
}
.numbox input::-webkit-outer-spin-button, .numbox input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.affix { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 11px; color: var(--fg-4); padding: 0 11px; text-transform: uppercase; }
.numbox input:first-child { padding-left: 12px; }

.range {
  --p: 50%; --fill: var(--fg-2);
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 32px; margin: 10px 0 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.kind-today .range { --fill: var(--today); }
.kind-catio .range { --fill: var(--accent); }
.range:focus-visible { outline: none; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--fill) 0 var(--p), var(--track) var(--p) 100%); }
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--fill); box-shadow: 0 2px 8px rgba(8, 9, 10, 0.18);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
}
.range:hover::-webkit-slider-thumb { box-shadow: 0 0 0 7px color-mix(in srgb, var(--fill) 16%, transparent), 0 2px 8px rgba(8, 9, 10, 0.18); }
.range.dragging::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1.18); box-shadow: 0 0 0 10px color-mix(in srgb, var(--fill) 20%, transparent), 0 2px 10px rgba(8, 9, 10, 0.22); }
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--focus); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--track); }
.range::-moz-range-progress { height: 8px; border-radius: 99px; background: var(--fill); }
.range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--fill); box-shadow: 0 2px 8px rgba(8, 9, 10, 0.18); }

.warn { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.4s var(--ease-out), margin 0.4s var(--ease-out); }
.warn > p {
  min-height: 0; overflow: hidden; display: flex; gap: 8px; align-items: flex-start;
  padding: 0 12px; border-radius: 10px; background: var(--warn-wash); --thin-bg: var(--warn-wash); color: var(--warn);
  font-size: 13.5px; line-height: 1.45; transition: padding 0.4s var(--ease-out);
}
.warn svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.warn.on { grid-template-rows: 1fr; margin-top: 10px; }
.warn.on > p { padding: 9px 12px; }

.gap-chip {
  display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 11px 14px; border-radius: 14px;
  background: var(--bg-2); --thin-bg: var(--bg-2); font-size: 14px; color: var(--fg-3);
}
.gap-chip b { color: var(--fg); }
.gap-bar { position: relative; flex: none; width: clamp(80px, 22%, 150px); height: 8px; border-radius: 99px; background: var(--track); }
.gap-bar::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: var(--l, 0%); width: var(--w, 0%); border-radius: 99px;
  background: linear-gradient(90deg, var(--today), var(--accent)); opacity: 0.55;
  transition: left 0.6s var(--ease-out), width 0.6s var(--ease-out);
}
.gap-bar.rev::before { background: linear-gradient(90deg, var(--accent), var(--today)); }
.gap-bar i { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--bg-2); transition: left 0.6s var(--ease-out); }
.gap-bar i:first-child { background: var(--today); }
.gap-bar i:last-child { background: var(--accent); }

/* verdict */
.verdict {
  position: sticky; top: calc(var(--bar) + 18px); min-width: 0; overflow: hidden;
  background: var(--panel); --thin-bg: var(--panel); color: var(--panel-fg);
  border-radius: 26px; padding: 26px 26px 24px; border: 1px solid var(--panel-edge);
  box-shadow: var(--panel-shadow);
}
.verdict::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), #ffb27a 60%, var(--accent)); background-size: 200% 100%; animation: sheen 6s linear infinite; }
.verdict .eyebrow { color: var(--panel-fg-3); }
.v-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.delta {
  font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 12px; white-space: nowrap;
  padding: 5px 10px; border-radius: 99px; background: var(--delta-bg); --thin-bg: var(--delta-bg); color: var(--delta-fg);
  opacity: 0; transform: translateY(6px) scale(0.92); transition: opacity 0.35s, transform 0.45s var(--ease-spring);
}
.delta.on { opacity: 1; transform: none; }
.delta.neg { background: var(--delta-neg-bg); --thin-bg: var(--delta-neg-bg); color: var(--delta-neg-fg); }
.v-total { font-size: clamp(66px, 6.2vw, 100px); color: var(--panel-num); margin: 12px 0 8px; }
.v-sub { color: var(--panel-fg-2); font-size: 15px; }
.comp { display: flex; gap: 3px; height: 14px; margin-top: 22px; border-radius: 99px; overflow: hidden; background: var(--panel-track); }
.comp span { flex: 0 0 50%; min-width: 0; transition: flex-basis 0.8s var(--ease-out); }
.comp-a { background: var(--accent); }
.comp-b { background: repeating-linear-gradient(-45deg, #ffb27a 0 6px, #ff9a52 6px 12px); }
.comp span.neg { background: repeating-linear-gradient(-45deg, #8a7a62 0 6px, #6c604e 6px 12px); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.split > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; align-content: start; column-gap: 8px; row-gap: 2px; min-width: 0; }
.sw { width: 10px; height: 10px; border-radius: 3px; }
.sw-a { background: var(--accent); }
.sw-b { background: #ffb27a; }
.split b { font-size: 27px; letter-spacing: -0.015em; --thin: var(--thin-title); }
.split > div > span:last-child { grid-column: 1 / -1; font-size: 13px; line-height: 1.35; color: var(--panel-fg-2); }
.bars { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.bars .eyebrow { margin-bottom: 2px; }
.bar-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 62px; align-items: center; gap: 10px; font-size: 13.5px; color: var(--panel-fg-2); }
.bar-row .track { height: 12px; border-radius: 99px; background: var(--panel-track); overflow: hidden; }
.bar-row .fill { height: 100%; width: 0; border-radius: 99px; transition: width 0.85s var(--ease-out); }
.fill.today { background: var(--today); }
.fill.catio { background: linear-gradient(90deg, #ff6800, #ff9447); }
.bar-row .val { text-align: right; color: var(--panel-fg); }
.ratios { margin-top: 22px; border-top: 1px solid var(--panel-line); }
.ratio { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--panel-line); font-size: 14px; color: var(--panel-fg-2); }
.ratio b { color: var(--panel-fg); font-size: 16px; white-space: nowrap; }
.ratio:nth-child(2) b { color: var(--panel-a); }
.formula { margin-top: 18px; padding: 14px 16px; border-radius: 16px; background: var(--panel-2); --thin-bg: var(--panel-2); }
.f-live { font-size: 15px; line-height: 1.6; color: var(--panel-fg); }
.f-live .fa { color: var(--panel-a); }
.f-live .fb { color: var(--panel-b); }
.f-text { margin-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--panel-fg-3); }

@media (max-width: 999px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
  .verdict { position: static; }
}
@media (max-width: 560px) {
  .seg { display: grid; grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .seg button { min-width: 0; align-items: center; text-align: center; padding: 11px 4px 12px; font-size: clamp(12.5px, 3.7vw, 15px); }
  .seg button small { font-size: 9px; }
  .seg-ind::after { left: 10px; right: 10px; }
  .bar-actions { width: 100%; }
  .bar-actions .btn { flex: 1 1 auto; }
  .field-top { flex-wrap: wrap; }
  .numbox { width: 100%; }
  .split b { font-size: 23px; }
  .verdict { padding: 22px 18px 20px; }
}

/* ---------- how it adds up ---------- */
.how { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; margin-top: 34px; }
.how-card { position: relative; display: flex; flex-direction: column; gap: 18px; padding: clamp(20px, 2.4vw, 30px); min-width: 0; }
.how-tag { display: flex; align-items: center; gap: 12px; font-size: 20px; line-height: 1.25; --thin: var(--thin-title); }
.tag-letter { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--accent); --thin-bg: var(--accent); color: #fff; font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 16px; }
.how-text { color: var(--fg-3); font-size: 16px; min-height: 3.1em; }
.how-note { color: var(--fg-4); font-size: 14px; line-height: 1.5; }
.dots { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: clamp(5px, 0.8vw, 9px); width: 100%; max-width: 360px; }
.dots i {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--line-strong); background: transparent;
  transform: scale(0.15); opacity: 0;
  transition: background-color 0.45s var(--ease-out) var(--d, 0ms), border-color 0.45s var(--ease-out) var(--d, 0ms),
    transform 0.6s var(--ease-spring) var(--r, 0ms), opacity 0.35s var(--r, 0ms);
}
.dots.in i { transform: scale(1); opacity: 1; }
.dots i[data-k="both"] { background: var(--today); border-color: var(--today); }
.dots i[data-k="gain"] { background: var(--accent); border-color: var(--accent); }
.dots i[data-k="loss"] { border-color: var(--warn); border-style: dashed; }
.dots.in i[data-k="gain"] { animation: pop 0.5s var(--ease-spring) var(--d, 0ms) both; }
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13.5px; color: var(--fg-3); }
.legend-list li { display: flex; align-items: center; gap: 7px; }
.legend-list b { color: var(--fg); }
.lg { width: 12px; height: 12px; border-radius: 50%; border: 2px solid transparent; }
.lg-both { background: var(--today); }
.lg-gain { background: var(--accent); }
.lg-loss { border: 2px dashed var(--warn); }
.lg-none { border-color: var(--line-strong); }
.eq { margin-top: auto; padding: 14px 18px; border-radius: 16px; background: var(--bg-2); --thin-bg: var(--bg-2); font-size: 16.5px; color: var(--fg-2); }
.eq b { color: var(--accent-ink); font-size: 22px; }

.tl { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.tl-row { display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: end; gap: 12px; }
.tl-label { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10.5px; text-transform: uppercase; color: var(--fg-3); padding-bottom: 13px; }
.tl-catio .tl-label { color: var(--accent-ink); }
.tl-track { position: relative; height: 42px; margin-top: 24px; border-radius: 11px; background: var(--bg-2); }
.tl-bar { position: absolute; left: 0; top: 8px; bottom: 8px; width: 0; border-radius: 7px; transform-origin: left; transition: width 0.85s var(--ease-out), transform 1s var(--ease-out) 0.1s; }
.tl-today .tl-bar { background: var(--today); }
.tl-catio .tl-bar { background: var(--accent); z-index: 1; }
.tl-flag {
  position: absolute; bottom: calc(100% + 13px); right: 0; transform: translateX(50%); white-space: nowrap;
  font-size: 12.5px; line-height: 1; color: var(--fg-3); transition: transform 0.4s var(--ease-out);
}
.tl-flag::after { content: ""; position: absolute; left: 50%; top: calc(100% + 3px); width: 2px; height: 9px; margin-left: -1px; border-radius: 1px; background: currentColor; transition: left 0.4s var(--ease-out); }
.tl-flag[data-align="end"] { transform: none; }
.tl-flag[data-align="end"]::after { left: calc(100% - 1px); }
.tl-flag[data-align="start"] { transform: translateX(100%); }
.tl-flag[data-align="start"]::after { left: 1px; }
.tl-catio .tl-flag { color: var(--accent-ink); }
.tl-saved {
  position: absolute; top: 8px; bottom: 8px; left: 0; width: 0; border-radius: 7px; --n: 1;
  background: linear-gradient(90deg, var(--cell) 0 calc(100% - 3px), transparent calc(100% - 3px)) 0 0 / calc(100% / var(--n)) 100% repeat-x;
  transition: left 0.85s var(--ease-out), width 0.85s var(--ease-out), clip-path 1.1s var(--ease-out) 0.55s;
  clip-path: inset(0 0 0 0);
}
.tl-saved.loss { background: repeating-linear-gradient(-45deg, var(--warn-wash) 0 6px, transparent 6px 12px); outline: 1.5px dashed var(--warn); outline-offset: -1.5px; }
.tl-saved-label { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 99px; background: var(--surface); --thin-bg: var(--surface); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(8, 9, 10, 0.15); }
.tl-saved-label:empty { display: none; }
.tl-saved.loss .tl-saved-label { color: var(--warn); }
.tl.pre .tl-bar { transform: scaleX(0); }
.tl.pre .tl-saved { clip-path: inset(0 100% 0 0); }
.tl-axis { position: relative; height: 18px; margin-left: 98px; }
.tl-axis span { position: absolute; top: 0; transform: translateX(-50%); font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 9.5px; color: var(--fg-4); }
.tl-axis span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 4px; background: var(--line-strong); }

.sum {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px clamp(14px, 2.4vw, 34px);
  margin-top: 24px; padding: clamp(20px, 2.6vw, 32px); border-radius: 24px;
  background: var(--panel); --thin-bg: var(--panel); color: var(--panel-fg);
  border: 1px solid var(--panel-edge); box-shadow: var(--panel-shadow);
}
.sum-part { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sum-k { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 11px; color: var(--panel-a); }
.sum-part b { --thin: var(--thin-display); font-size: clamp(30px, 3.4vw, 50px); line-height: 1; letter-spacing: -0.02em; }
.sum-part small { font-size: 13px; color: var(--panel-fg-2); }
.sum-total b { color: var(--panel-num); font-size: clamp(38px, 4.4vw, 64px); }
.sum-op { font-size: clamp(26px, 3vw, 44px); color: var(--panel-fg-3); line-height: 1; }

@media (max-width: 899px) { .how { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .tl-row { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
  .tl-axis { margin-left: 72px; }
  .sum { justify-content: flex-start; }
  .sum-total { flex-basis: 100%; }
}

/* ---------- three cases ---------- */
.case-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 32px; }
.case-card {
  position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px 22px 20px; text-align: left; cursor: pointer;
  background: var(--surface); --thin-bg: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  transition: transform 0.35s var(--ease-out), border-color 0.3s, box-shadow 0.35s, opacity 0.8s var(--ease-out), filter 0.8s var(--ease-out);
}
.case-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.case-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash), var(--shadow); }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-name { font-size: 22px; --thin: var(--thin-title); }
.cc-badge { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10px; padding: 4px 9px; border-radius: 99px; background: var(--accent-soft-solid); --thin-bg: var(--accent-soft-solid); color: var(--accent-ink); opacity: 0; transform: scale(0.8); transition: opacity 0.3s, transform 0.4s var(--ease-spring); }
.case-card[aria-pressed="true"] .cc-badge { opacity: 1; transform: none; }
.cc-size { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 11px; color: var(--fg-4); }
.cc-total { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; color: var(--fg-3); font-size: 14px; }
.cc-total b { font-size: 40px; line-height: 1; color: var(--fg); letter-spacing: -0.02em; --thin: var(--thin-display); }
.case-card[aria-pressed="true"] .cc-total b { color: var(--accent); }
.cc-bar { display: flex; gap: 3px; height: 10px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.cc-bar span { width: 0; transition: width 0.85s var(--ease-out); }
.cc-a { background: var(--accent); }
.cc-b { background: repeating-linear-gradient(-45deg, #ffb27a 0 5px, #ff9a52 5px 10px); }
.cc-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--fg-3); }
.cc-meta b { color: var(--fg); }

.table-wrap { margin-top: 22px; overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); --thin-bg: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 15px; }
th, td { padding: 13px 18px; text-align: left; border-top: 1px solid var(--line); vertical-align: top; transition: background-color 0.4s, box-shadow 0.4s; }
thead th { border-top: 0; background: var(--bg-2); --thin-bg: var(--bg-2); font-family: var(--ff-sign); --thin: var(--thin-sign); font-weight: 400; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-4); }
td.num, th.num { text-align: right; white-space: nowrap; }
.arr { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 0.8em; color: var(--fg-4); padding: 0 2px; }
.cmp td:first-child { color: var(--fg-3); }
th.active { box-shadow: inset 0 3px 0 var(--accent); color: var(--accent-ink); }
td.active { background: var(--accent-soft-2); --thin-bg: var(--accent-soft-2); }
tr.total td { background: var(--accent-soft-solid); --thin-bg: var(--accent-soft-solid); color: var(--fg); }
tr.total td.active { color: var(--accent-ink); }

@media (max-width: 899px) { .case-cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- stages ---------- */
.rail { position: relative; list-style: none; margin: 40px 0 0; padding: 0 0 0 58px; display: flex; flex-direction: column; gap: 20px; }
.rail-line { position: absolute; left: 19px; top: 26px; bottom: 26px; width: 3px; border-radius: 3px; background: var(--line); }
.rail-line span { position: absolute; inset: 0; border-radius: 3px; transform-origin: top; transform: scaleY(0); background: linear-gradient(var(--accent), #ffb27a); }
.stage { position: relative; }
.node {
  position: absolute; left: -58px; top: 22px; width: 41px; height: 41px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); --thin-bg: var(--surface); border: 2px solid var(--line-strong);
  font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 15px; color: var(--fg-4);
  transition: background-color 0.45s, border-color 0.45s, color 0.45s, box-shadow 0.5s var(--ease-out), transform 0.5s var(--ease-spring);
}
.stage.lit .node { background: var(--accent); --thin-bg: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 7px var(--accent-wash); transform: scale(1.05); }
.stage-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); padding: clamp(18px, 2vw, 26px); transition: border-color 0.45s; }
.stage.lit .stage-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.stage-main h3 { font-size: 24px; line-height: 1.15; letter-spacing: -0.01em; --thin: var(--thin-title); }
.stage-what { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--fg-3); }
.vs { display: flex; flex-direction: column; gap: 8px; }
.vs-row { display: flex; flex-direction: column; gap: 4px; padding: 11px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.vs-today { background: var(--bg-2); --thin-bg: var(--bg-2); color: var(--fg-2); }
.vs-catio { background: var(--accent-soft-solid); --thin-bg: var(--accent-soft-solid); color: var(--fg); }
.vs-k { font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-4); }
.vs-catio .vs-k { color: var(--accent-ink); }
.tag { display: inline-block; margin-left: 4px; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-strong); font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-4); vertical-align: 2px; white-space: nowrap; }
.stage-meta { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.stage-meta dt { display: flex; align-items: center; gap: 7px; font-family: var(--ff-sign); --thin: var(--thin-sign); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg-4); }
.stage-meta dt svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stage-meta dd { margin: 5px 0 0; font-size: 14.5px; line-height: 1.45; color: var(--fg-2); }
@media (max-width: 1099px) { .stage-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .stage-meta { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; } .stage-meta > div { flex: 1 1 240px; } }
@media (max-width: 699px) {
  .rail { padding-left: 44px; }
  .rail-line { left: 14px; }
  .node { left: -44px; width: 31px; height: 31px; font-size: 12px; top: 20px; }
  .stage-card { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- basis ---------- */
.basis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 26px; margin-top: 32px; }
@media (max-width: 899px) { .basis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .basis { grid-template-columns: minmax(0, 1fr); } }
.basis-item { position: relative; display: flex; flex-direction: column; gap: 6px; padding-top: 16px; }
.basis-item::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--line); }
.basis-item::after { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 56px; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform 0.9s var(--ease-out) calc(var(--rd, 0ms) + 0.25s); }
.basis-item.in::after { transform: none; }
.basis-item b { font-size: 16px; line-height: 1.35; }
.basis-item span { font-size: 14.5px; line-height: 1.5; color: var(--fg-4); }

/* ---------- footer ---------- */
.foot { margin-top: clamp(88px, 12vh, 140px); border-top: 1px solid var(--line); }
.foot-in { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin: 0 auto; padding: 26px var(--gutter) calc(40px + env(safe-area-inset-bottom, 0px)); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; font-size: 13.5px; color: var(--fg-4); }
.foot-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--fg-3); }
.foot-brand .mark { width: 17px; height: 17px; }

/* ---------- live bar (phones and tablets) ---------- */
.livebar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 45;
  display: none; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; cursor: pointer; text-align: left;
  background: var(--panel); --thin-bg: var(--panel); color: var(--panel-fg); border: 1px solid var(--panel-edge);
  box-shadow: var(--panel-shadow);
  transform: translateY(150%); transition: transform 0.5s var(--ease-spring);
}
.livebar .eyebrow { color: var(--panel-fg-3); }
.lb-total { flex: 1; min-width: 0; font-size: 14px; color: var(--panel-fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-total b { font-size: 22px; color: var(--panel-a); margin-right: 4px; }
.livebar.on { transform: none; }
@media (max-width: 999px) { .livebar { display: flex; } }
@media (max-width: 400px) { .livebar .eyebrow { display: none; } }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 60;
  padding: 11px 18px; border-radius: 14px; background: var(--panel); --thin-bg: var(--panel); color: var(--panel-fg); font-size: 14px;
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 0.3s, transform 0.4s var(--ease-spring);
  border: 1px solid var(--panel-edge); box-shadow: var(--panel-shadow);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(24px); filter: blur(6px); transition: opacity 0.85s var(--ease-out) var(--rd, 0ms), transform 0.95s var(--ease-out) var(--rd, 0ms), filter 0.85s var(--ease-out) var(--rd, 0ms); }
.js .stage[data-reveal] { transform: translateX(-18px); }
.js [data-reveal].in { opacity: 1; transform: none; filter: none; }
.js .case-card[data-reveal].in:hover { transform: translateY(-4px); }

/* ---------- keyframes ---------- */
@keyframes rise { to { transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-5%, 6%) scale(1.08); } }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
@keyframes spin { to { transform: rotate(-360deg); } }
@keyframes sheen { to { background-position: -200% 0; } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, ::before, ::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .w > span { transform: none; }
  .hero-glow { animation: none; }
}

@media print {
  .bar, .livebar, .toast, .hero-glow, .race, .bar-actions { display: none !important; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .verdict { position: static; }
}
