/* Global Rating design system.
   Mobile first: base rules are for phones, wider screens add rules through min-width queries.
   Every value resolves to a token below (see .claude/skills/landing-page-design: type scale B1,
   spacing B2, radius B3, flat backgrounds B4, motion B7). */

@font-face {
  font-family: "Geist";
  src: url("/static/fonts/Geist-Variable.woff2") format("woff2-variations"), url("/static/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* type scale: size / line height */
  --text-xs: 0.75rem;   --lh-xs: 1rem;
  --text-sm: 0.875rem;  --lh-sm: 1.25rem;
  --text-base: 1rem;    --lh-base: 1.5rem;
  --text-lg: 1.125rem;  --lh-lg: 1.75rem;
  --text-xl: 1.25rem;   --lh-xl: 1.75rem;
  --text-2xl: 1.5rem;   --lh-2xl: 2rem;
  --text-3xl: 1.875rem; --lh-3xl: 2.25rem;
  --text-4xl: 2.25rem;  --lh-4xl: 2.5rem;
  --text-5xl: 3rem;

  /* spacing */
  --s-25: 2px; --s-50: 4px; --s-75: 8px; --s-100: 12px; --s-200: 16px; --s-300: 24px;
  --s-400: 32px; --s-500: 40px; --s-600: 48px; --s-700: 64px; --s-800: 80px; --s-900: 96px;

  /* radius */
  --r-md: 6px; --r-lg: 8px; --r-xl: 12px; --r-2xl: 16px; --r-3xl: 24px; --r-full: 9999px;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 300ms; --t-slow: 500ms;

  /* light theme */
  --bg: #f5f5f4; --surface: #ffffff; --surface-2: #f0f0ef; --line: #e4e4e2;
  --text: #0b0b0b; --muted: #5f5f5c; --faint: #8c8c88;
  --accent: #1f4fd8; --accent-ink: #ffffff; --accent-soft: #e9eefc;
  --pro: #157a3c; --con: #b42318; --track: #e4e4e2;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --hero-from: #000000; --hero-to: #666666;
  --focus: 0 0 0 3px rgba(31, 79, 216, 0.35);

  --font: "Geist", system-ui, -apple-system, "Segoe UI", "Noto Sans", "PingFang SC", "Hiragino Sans",
          "Hiragino Kaku Gothic ProN", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans JP",
          "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --surface: #181818; --surface-2: #1f1f1f; --line: #272727;
    --text: #f2f2f2; --muted: #a3a3a3; --faint: #7a7a7a;
    --accent: #8fb0ff; --accent-ink: #000000; --accent-soft: #1f1f1f;
    --pro: #5fd38d; --con: #ff8a7a; --track: #313131;
    --nav-bg: rgba(24, 24, 24, 0.72);
    --hero-from: #ffffff; --hero-to: #9b9b9b;
    --focus: 0 0 0 3px rgba(143, 176, 255, 0.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--s-900); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--text-base); line-height: var(--lh-base);
  font-synthesis: none; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 600; text-wrap: balance; margin: 0; }
p, li, dd { text-wrap: pretty; }
em, i { font-style: normal; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-md); }
svg.i { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--s-200); }
.muted { color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.lead { color: var(--muted); font-size: var(--text-lg); line-height: var(--lh-lg); max-width: 680px; margin: var(--s-200) 0 0; }

.skip { position: absolute; inset-inline-start: var(--s-200); top: -100px; z-index: 100; padding: var(--s-75) var(--s-100);
        background: var(--accent); color: var(--accent-ink); border-radius: var(--r-lg); font-weight: 600; }
.skip:focus { top: var(--s-200); }

/* ---------- navigation: floating translucent bar ---------- */
.nav-shell { position: sticky; top: var(--s-100); z-index: 50; display: flex; justify-content: center; padding: 0 var(--s-200); }
.nav {
  display: flex; align-items: center; gap: var(--s-200); width: 100%; max-width: 1040px;
  padding: var(--s-75) var(--s-75) var(--s-75) var(--s-200);
  background: var(--nav-bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--r-2xl);
}
[dir="rtl"] .nav { padding: var(--s-75) var(--s-200) var(--s-75) var(--s-75); }
.logo { display: inline-flex; align-items: center; gap: var(--s-75); font-weight: 600; color: var(--text); white-space: nowrap; margin-inline-end: auto; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 24px; height: 24px; border-radius: var(--r-md); background: var(--accent); color: var(--accent-ink);
             display: grid; place-items: center; font-size: var(--text-xs); }
.nav-links { display: none; }
.nav-links a { color: var(--text); font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 500; padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); }
.nav-links a:hover { background: var(--surface-2); text-decoration: none; }
.nav-links a[aria-current="page"] { background: var(--surface-2); }

/* language picker (desktop) */
.lang { position: relative; display: none; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s-50);
                font-size: var(--text-sm); line-height: var(--lh-sm); font-weight: 500; padding: var(--s-75) var(--s-100); border-radius: var(--r-lg); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover { background: var(--surface-2); }
.lang ul { position: absolute; inset-inline-end: 0; top: calc(100% + var(--s-75)); margin: 0; padding: var(--s-75); list-style: none;
           min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
           display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-25); }
.lang li a { display: block; padding: var(--s-75) var(--s-100); border-radius: var(--r-md); color: var(--text); font-size: var(--text-sm); line-height: var(--lh-sm); }
.lang li a:hover { background: var(--surface-2); text-decoration: none; }
.lang li a[aria-current="true"] { color: var(--accent); }

/* mobile menu: full height panel */
.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--r-lg); }
.menu summary::-webkit-details-marker { display: none; }
.burger { position: relative; width: 18px; height: 12px; }
.burger span { position: absolute; inset-inline-start: 0; width: 18px; height: 2px; border-radius: 2px; background: var(--text);
               transition: transform var(--t-slow) var(--ease), opacity var(--t-fast) var(--ease); }
.burger span:nth-child(1) { top: 0; } .burger span:nth-child(2) { top: 5px; } .burger span:nth-child(3) { top: 10px; }
.menu[open] .burger span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.menu[open] .burger span:nth-child(2) { opacity: 0; }
.menu[open] .burger span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.menu-panel { position: fixed; inset: 72px 0 0 0; z-index: 40; overflow-y: auto; padding: var(--s-300) var(--s-200) var(--s-600);
              background: var(--nav-bg); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
@media (prefers-color-scheme: dark) { .menu-panel { background: rgba(0, 0, 0, 0.92); } }
@media (prefers-color-scheme: light) { .menu-panel { background: rgba(245, 245, 244, 0.94); } }
.menu-panel a { display: block; color: var(--text); font-size: var(--text-2xl); line-height: var(--lh-2xl); font-weight: 600; padding: var(--s-100) 0; }
.menu-panel .menu-langs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-50) var(--s-200); margin-top: var(--s-400); padding-top: var(--s-300); border-top: 1px solid var(--line); }
.menu-panel .menu-langs a { font-size: var(--text-base); line-height: var(--lh-base); font-weight: 500; padding: var(--s-75) 0; }
.menu[open] .menu-panel > * { animation: rise var(--t-slow) var(--ease) both; }
.menu[open] .menu-panel > :nth-child(2) { animation-delay: 60ms; }
.menu[open] .menu-panel > :nth-child(3) { animation-delay: 120ms; }
.menu[open] .menu-panel > :nth-child(4) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--s-300)); } to { opacity: 1; transform: none; } }

/* ---------- layout ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-50); align-items: center; padding-top: var(--s-300);
          font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--faint); }
.crumbs a { color: var(--muted); }
main { padding-bottom: var(--s-800); }
section { margin-top: var(--s-600); }
.section-title { font-size: var(--text-2xl); line-height: var(--lh-2xl); margin-bottom: var(--s-300); }

/* hero */
.hero { padding: var(--s-600) 0 var(--s-200); }
.hero h1, .page-head h1 {
  font-size: var(--text-4xl); line-height: var(--lh-4xl); letter-spacing: -0.02em; max-width: 680px;
  background: linear-gradient(to right, var(--hero-from), var(--hero-to)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
[dir="rtl"] .hero h1, [dir="rtl"] .page-head h1 { background: linear-gradient(to left, var(--hero-from), var(--hero-to)); -webkit-background-clip: text; background-clip: text; }
.hero .actions { display: flex; flex-wrap: wrap; gap: var(--s-100); margin-top: var(--s-400); }
.proof { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-300); margin-top: var(--s-300); color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.proof span { display: inline-flex; align-items: center; gap: var(--s-75); }
.proof .i { color: var(--pro); }
.page-head { padding: var(--s-400) 0 0; }
.page-head h1 { font-size: var(--text-3xl); line-height: var(--lh-3xl); }
.meta-line { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); margin-top: var(--s-200); color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-75); padding: var(--s-75) var(--s-100);
       min-height: 40px; border-radius: var(--r-lg); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
       font-size: var(--text-base); line-height: var(--lh-base); font-weight: 600;
       transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease); }
.btn:hover { text-decoration: none; opacity: 0.9; }
.btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); opacity: 1; }
.btn.sm { font-size: var(--text-sm); line-height: var(--lh-sm); min-height: 36px; }

/* cards (home) */
.cards { display: grid; gap: var(--s-200); }
.card { display: flex; flex-direction: column; gap: var(--s-75); padding: var(--s-300); background: var(--surface);
        border: 1px solid var(--line); border-radius: var(--r-2xl); color: var(--text);
        transition: transform var(--t-slow) var(--ease), border-color var(--t-fast) var(--ease); }
.card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.card-cat { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--accent); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.card strong { font-size: var(--text-xl); line-height: var(--lh-xl); font-weight: 600; }
.mini { list-style: none; margin: var(--s-100) 0 0; padding: 0; display: grid; gap: var(--s-50); }
.mini li { display: flex; justify-content: space-between; gap: var(--s-200); font-size: var(--text-sm); line-height: var(--lh-sm); }
.mini b { color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }

.steps { display: grid; gap: var(--s-200); }
.step { padding: var(--s-300); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); }
.step-n { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--accent); font-weight: 600; }
.step h3 { font-size: var(--text-lg); line-height: var(--lh-lg); margin: var(--s-75) 0 var(--s-50); }
.step p { margin: 0; color: var(--muted); }

/* tagline reveal */
.reveal-tagline { margin: var(--s-800) 0; }
.reveal-tagline p { margin: 0; max-width: 680px; font-size: var(--text-3xl); line-height: var(--lh-3xl); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
.js .reveal-tagline .w { color: var(--text); opacity: 0.3; transition: opacity var(--t-slow) var(--ease); }
.js .reveal-tagline .w.on { opacity: 1; }

/* scroll reveal, only when JS runs (content stays visible without it) */
.js .rv { opacity: 0; transform: translateY(var(--s-400)); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

/* ---------- ranking board ---------- */
.board { list-style: none; margin: var(--s-400) 0 0; padding: 0; display: grid; gap: var(--s-200); }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); padding: var(--s-200); }
.entry-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-100); }
.rank { min-width: 40px; height: 40px; padding: 0 var(--s-75); display: grid; place-items: center; border-radius: var(--r-lg);
        background: var(--surface-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.board > li:first-child .rank { background: var(--accent); color: var(--accent-ink); }
.entry-name { font-size: var(--text-xl); line-height: var(--lh-xl); }
.entry-name a { color: var(--text); }
.score { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score b { font-size: var(--text-3xl); line-height: var(--lh-3xl); font-weight: 600; color: var(--accent); }
.score small { font-size: var(--text-sm); color: var(--faint); }

.bars { display: grid; gap: var(--s-100); margin: var(--s-300) 0; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: var(--s-50) var(--s-100); align-items: center; font-size: var(--text-sm); line-height: var(--lh-sm); }
.bar-label { color: var(--muted); }
.bar-val { font-variant-numeric: tabular-nums; font-weight: 600; }
.bar-track { grid-column: 1 / -1; height: 6px; background: var(--track); border-radius: var(--r-full); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: var(--r-full); transform-origin: left; }
[dir="rtl"] .bar-fill { transform-origin: right; }
.js .rv .bar-fill { transform: scaleX(0); transition: transform 900ms var(--ease) 150ms; }
.js .rv.in .bar-fill { transform: scaleX(1); }

.kf { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-75); margin: 0; }
.kf div { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s-100); min-width: 0; }
.kf dt { font-size: var(--text-xs); line-height: var(--lh-xs); color: var(--muted); }
.kf dd { margin: var(--s-25) 0 0; font-weight: 600; overflow-wrap: anywhere; }

.pc { display: grid; gap: var(--s-200); margin-top: var(--s-300); }
.pc h3 { font-size: var(--text-sm); line-height: var(--lh-sm); margin-bottom: var(--s-75); }
.pros, .cons { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-75); }
.pros li, .cons li { display: flex; gap: var(--s-75); align-items: flex-start; font-size: var(--text-sm); line-height: var(--lh-sm); }
.pros .i { color: var(--pro); margin-top: var(--s-25); } .cons .i { color: var(--con); margin-top: var(--s-25); }
.pro-h { color: var(--pro); } .con-h { color: var(--con); }
.entry-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-75); margin-top: var(--s-300); }
.entry-foot .muted { width: 100%; }

/* ---------- tables, faq, misc ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--lh-sm); }
th, td { text-align: start; padding: var(--s-100) var(--s-200); border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.factor { margin-top: var(--s-500); }
.factor h2 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-75); font-size: var(--text-xl); line-height: var(--lh-xl); }
.factor > p { color: var(--muted); max-width: 680px; }
.weight { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--accent); background: var(--accent-soft); padding: var(--s-25) var(--s-75); border-radius: var(--r-full); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--s-200); margin-top: var(--s-75); }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: var(--s-200); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { transition: transform var(--t-slow) var(--ease); }
.faq details[open] summary .i { transform: rotate(180deg); }
.faq details p { margin: var(--s-100) 0 0; color: var(--muted); }
.insufficient { padding: var(--s-300); border: 1px solid var(--line); border-radius: var(--r-2xl); background: var(--surface); }
.insufficient h2 { font-size: var(--text-lg); line-height: var(--lh-lg); }
.insufficient ul { margin: var(--s-200) 0 0; padding-inline-start: var(--s-300); }
.prose { max-width: 680px; padding-top: var(--s-400); }
.prose h1 { font-size: var(--text-3xl); line-height: var(--lh-3xl); margin-bottom: var(--s-300); }
.lang-grid { list-style: none; padding: 0; margin: var(--s-400) 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-75); }
.lang-grid a { display: block; padding: var(--s-100) var(--s-200); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); color: var(--text); }
.lang-grid a:hover { border-color: var(--accent); text-decoration: none; }

.foot { border-top: 1px solid var(--line); padding: var(--s-500) 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }
.foot p { margin: 0 0 var(--s-200); max-width: 680px; }
.foot .langs { display: flex; flex-wrap: wrap; gap: var(--s-75) var(--s-200); }
.foot .langs a, .foot a { color: var(--muted); }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .wrap { padding: 0 var(--s-300); }
  .hero { padding: var(--s-800) 0 var(--s-300); }
  .hero h1 { font-size: var(--text-5xl); line-height: 1; }
  .page-head h1 { font-size: var(--text-4xl); line-height: var(--lh-4xl); }
  .reveal-tagline p { font-size: var(--text-4xl); line-height: var(--lh-4xl); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .entry { padding: var(--s-300); }
  .kf { grid-template-columns: repeat(3, 1fr); }
  .pc { grid-template-columns: 1fr 1fr; }
  .entry-foot .muted { width: auto; margin-inline-start: auto; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .nav-links, .lang { display: flex; align-items: center; gap: var(--s-25); }
  .menu { display: none; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .kf { grid-template-columns: repeat(5, 1fr); }
  .bars { grid-template-columns: 1fr 1fr; gap: var(--s-100) var(--s-400); }
  .lang-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .js .rv { transform: none; }
  .js .rv .bar-fill { transform: none; }
}

/* ---------- data viz: categorical series (validated, see dataviz skill palette) ---------- */
:root { --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100; --c5: #e87ba4; }
@media (prefers-color-scheme: dark) { :root { --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500; --c5: #d55181; } }
.c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); }
.bar-fill[class*=" c"] { background: var(--c); }

/* KPI tiles */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-75); margin-top: var(--s-400); }
.stat { display: flex; flex-direction: column; gap: var(--s-50); padding: var(--s-200); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2xl); }
.stat:last-child { grid-column: 1 / -1; }
.stat-v { font-size: var(--text-3xl); line-height: var(--lh-3xl); font-weight: 600; letter-spacing: -0.02em; }
.stat-l { font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }

/* live top 5 */
.top { list-style: none; margin: var(--s-300) 0 var(--s-300); padding: 0; display: grid; gap: var(--s-75); }
.top-row { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "rank name score" "spark spark spark";
           align-items: center; gap: var(--s-75) var(--s-100); padding: var(--s-100) var(--s-200); color: var(--text);
           background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
           transition: border-color var(--t-fast) var(--ease), transform var(--t-slow) var(--ease); }
.top-row:hover { text-decoration: none; border-color: var(--accent); }
.top-row:active { transform: scale(0.99); }
.top-row .rank { grid-area: rank; min-width: 32px; height: 32px; font-size: var(--text-sm); }
.top li:first-child .rank { background: var(--accent); color: var(--accent-ink); }
.top-name { grid-area: name; font-weight: 600; }
.top-score { grid-area: score; font-variant-numeric: tabular-nums; }
.top-score b { font-size: var(--text-xl); line-height: var(--lh-xl); font-weight: 600; }
.top-score small { color: var(--faint); font-size: var(--text-xs); }
.spark { grid-area: spark; display: flex; gap: 2px; height: 6px; }
.spark-seg { flex: 1; border-radius: var(--r-full); background: var(--track); position: relative; overflow: hidden; }
.spark-seg::after { content: ""; position: absolute; inset: 0; background: var(--c); transform: scaleX(calc(var(--v) / 100)); transform-origin: left; border-radius: var(--r-full); }
[dir="rtl"] .spark-seg::after { transform-origin: right; }

/* anatomy: 100% stacked bar of factor weights */
.stack { display: flex; gap: 2px; height: 24px; margin-top: var(--s-300); }
.stack-seg { background: var(--c); min-width: 4px; }
.stack-seg:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.stack-seg:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.js .anatomy.rv .stack-seg { transform: scaleY(0.2); opacity: 0.4; transition: transform 700ms var(--ease), opacity 700ms var(--ease); }
.js .anatomy.rv.in .stack-seg { transform: none; opacity: 1; }
.legend { list-style: none; margin: var(--s-200) 0 0; padding: 0; display: grid; gap: var(--s-75); }
.legend li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--s-75); font-size: var(--text-sm); line-height: var(--lh-sm); }
.legend b { font-variant-numeric: tabular-nums; font-weight: 600; }
.key { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }

/* pipeline */
.pipe { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-75); counter-reset: none; }
.pipe li { position: relative; padding: var(--s-200) var(--s-200) var(--s-200) var(--s-700); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); }
[dir="rtl"] .pipe li { padding: var(--s-200) var(--s-700) var(--s-200) var(--s-200); }
.pipe-n { position: absolute; inset-inline-start: var(--s-200); top: var(--s-200); width: 32px; height: 32px; display: grid; place-items: center;
          border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: var(--text-sm); }
.pipe li:last-child .pipe-n { background: var(--accent); color: var(--accent-ink); }
.pipe h3 { font-size: var(--text-base); line-height: var(--lh-base); }
.pipe p { margin: var(--s-25) 0 0; color: var(--muted); font-size: var(--text-sm); line-height: var(--lh-sm); }

/* comparison */
.compare td.us, .compare th.us { text-align: center; color: var(--text); }
.compare th.us { color: var(--accent); }
.compare td.them { color: var(--faint); text-align: center; }
.compare .yes { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: var(--r-full); background: var(--accent-soft); color: var(--pro); }

/* chips */
.chips { list-style: none; margin: var(--s-300) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-75); }
.chips li { padding: var(--s-50) var(--s-100); border: 1px solid var(--line); border-radius: var(--r-full); background: var(--surface);
            font-size: var(--text-sm); line-height: var(--lh-sm); color: var(--muted); }

/* final CTA */
.final { margin-top: var(--s-800); padding: var(--s-500) var(--s-300); text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3xl); }
.final h2 { font-size: var(--text-3xl); line-height: var(--lh-3xl); }
.final .lead { margin-inline: auto; }
.final .btn { margin-top: var(--s-300); }

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
  .stat:last-child { grid-column: auto; }
  .top-row { grid-template-columns: auto minmax(0, 1fr) 160px auto; grid-template-areas: "rank name spark score"; }
  .legend { grid-template-columns: repeat(2, 1fr); gap: var(--s-75) var(--s-400); }
  .pipe { grid-template-columns: repeat(5, 1fr); }
  .pipe li, [dir="rtl"] .pipe li { padding: var(--s-700) var(--s-200) var(--s-200); }
  .final { padding: var(--s-800) var(--s-500); }
}
@media (min-width: 900px) {
  .legend { grid-template-columns: repeat(5, auto); justify-content: start; }
}
.compare th.us, .compare td.us, .compare th:last-child, .compare td.them { width: 1%; white-space: nowrap; }
.compare td:first-child { min-width: 180px; }
