/* Self-hosted Geist (SIL Open Font License), latin subset, preloaded in each page head. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/geist-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback so text doesn't jump when Geist finishes loading (CLS). */
@font-face {
  font-family: "Geist Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 104.2%;
  ascent-override: 96.9%;
  descent-override: 27.8%;
  line-gap-override: 0%;
}

/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #232328;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.13);
  --text: #fafafa;
  --text-2: #a1a1aa;
  --text-3: #8b8b94;
  --accent: #34d399;
  --accent-ink: #022c1e;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --excellent: #34d399;
  --good: #a3e635;
  --moderate: #fbbf24;
  --severe: #f87171;
  --gpu: #60a5fa;
  --thumb: #27272a;
  --thumb-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --pop-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.7);

  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-fast: 160ms;
  --t-med: 280ms;

  --font: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* Light theme: follows the system unless the visitor picked one with the header switch
   (data-theme on <html>, saved in localStorage and applied before first paint). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #e4e4e7;
    --border: rgba(9, 9, 11, 0.08);
    --border-strong: rgba(9, 9, 11, 0.14);
    --text: #09090b;
    --text-2: #52525b;
    --text-3: #6b6b74;
    --accent: #059669;
    --accent-ink: #ffffff;
    --accent-soft: rgba(5, 150, 105, 0.1);
    --excellent: #059669;
    --good: #65a30d;
    --moderate: #d97706;
    --severe: #dc2626;
    --gpu: #2563eb;
    --thumb: #ffffff;
    --thumb-shadow: 0 1px 3px rgba(9, 9, 11, 0.12), 0 0 0 1px rgba(9, 9, 11, 0.04);
    --pop-shadow: 0 16px 40px -12px rgba(9, 9, 11, 0.18);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --surface-3: #e4e4e7;
    --border: rgba(9, 9, 11, 0.08);
    --border-strong: rgba(9, 9, 11, 0.14);
    --text: #09090b;
    --text-2: #52525b;
    --text-3: #6b6b74;
    --accent: #059669;
    --accent-ink: #ffffff;
    --accent-soft: rgba(5, 150, 105, 0.1);
    --excellent: #059669;
    --good: #65a30d;
    --moderate: #d97706;
    --severe: #dc2626;
    --gpu: #2563eb;
    --thumb: #ffffff;
    --thumb-shadow: 0 1px 3px rgba(9, 9, 11, 0.12), 0 0 0 1px rgba(9, 9, 11, 0.04);
    --pop-shadow: 0 16px 40px -12px rgba(9, 9, 11, 0.18);
    color-scheme: light;
}
:root[data-theme="dark"] { color-scheme: dark; }

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
svg { display: block; }
a { color: var(--text); text-decoration-color: var(--border-strong); text-underline-offset: 3px; transition: text-decoration-color var(--t-fast); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 0.5em; font-weight: 650; }
p { margin: 0 0 1em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; touch-action: manipulation; }

.skip {
  position: absolute; left: 16px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--text); color: var(--bg); font-weight: 600; text-decoration: none; transition: top var(--t-fast);
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med);
}
.site-header.scrolled { border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; }
.logo svg { width: 24px; height: 24px; }
.logo b { color: var(--accent); font-weight: 600; }
.logo-needle { transform-origin: 12px 17px; transition: transform 600ms var(--ease-spring); }
.logo:hover .logo-needle { transform: rotate(-60deg); }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a { color: var(--text-2); text-decoration: none; font-size: 14px; padding: 8px 12px; border-radius: var(--r-sm); transition: color var(--t-fast), background var(--t-fast); }
.nav a:hover { color: var(--text); background: var(--surface-2); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding: 72px 0 36px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 12px 6px 10px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-2); background: var(--surface);
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); position: relative; }
.live-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.7; } 80%, 100% { transform: scale(3); opacity: 0; } }
.hero h1 { font-size: clamp(40px, 6.4vw, 68px); font-weight: 650; letter-spacing: -0.045em; margin-bottom: 16px; }
.hero .lead { color: var(--text-2); font-size: clamp(16px, 2vw, 19px); max-width: 560px; margin: 0 auto; }

/* ==========================================================================
   Cards & calculator
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.calc { display: grid; gap: 12px; margin-bottom: 12px; }

.builder { padding: 8px; position: relative; z-index: 2; }
.builder-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; }
.builder-main .field { padding: 14px 14px 10px; min-width: 0; }
.builder-plus { display: grid; place-items: center; width: 32px; height: 32px; margin-top: 50px; border-radius: 50%; background: var(--surface-2); color: var(--text-3); }
.builder-plus svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.builder-sub { display: flex; align-items: flex-end; gap: 12px; padding: 4px 14px 14px; }
.field-res { flex: 1 1 340px; max-width: 420px; }

.field > label, .field-label { display: block; font-size: 13.5px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.field-meta { font-size: 12.5px; color: var(--text-3); margin-top: 8px; min-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Combobox */
.combo { position: relative; }
.combo-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--text-3); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke var(--t-fast); }
.combo:focus-within .combo-icon { stroke: var(--accent); }
.combo input {
  width: 100%; height: 54px; padding: 0 46px 0 44px;
  background: var(--surface-2); color: var(--text); border: 1px solid transparent; border-radius: var(--r-md);
  font: 500 16.5px var(--font); letter-spacing: -0.01em;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.combo input::placeholder { color: var(--text-3); font-weight: 400; }
.combo input:hover { border-color: var(--border-strong); }
.combo input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.combo-toggle {
  position: absolute; right: 8px; top: 9px; width: 36px; height: 36px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--text-3); cursor: pointer; display: grid; place-items: center;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-med) var(--ease-out);
}
.combo-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.combo-toggle:hover { background: var(--surface-3); color: var(--text); }
.combo input[aria-expanded="true"] ~ .combo-toggle { transform: rotate(180deg); }
.combo-list {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px);
  max-height: 340px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--pop-shadow); transform-origin: top center;
  animation: pop-in 180ms var(--ease-out);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.combo-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 15px;
}
.combo-list li .opt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-list li .opt-meta { font-size: 12px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; font-family: var(--mono); }
.combo-list li mark { background: none; color: var(--accent); font-weight: 600; }
.combo-list li[aria-selected="true"] .opt-name::after { content: " ✓"; color: var(--accent); }
.combo-list li.active { background: var(--surface-2); }
.combo-list .empty { color: var(--text-3); cursor: default; justify-content: center; text-align: center; }
.badge {
  display: inline-block; font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); margin-left: 6px; vertical-align: 1px;
}

/* Segmented control with sliding thumb */
.seg {
  position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding: 4px;
  background: var(--surface-2); border-radius: var(--r-md); isolation: isolate;
}
.seg-thumb {
  position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4);
  background: var(--thumb); border-radius: var(--r-sm); box-shadow: var(--thumb-shadow);
  transition: transform var(--t-med) var(--ease-out);
}
.seg:has(label:nth-of-type(2) input:checked) .seg-thumb { transform: translateX(100%); }
.seg:has(label:nth-of-type(3) input:checked) .seg-thumb { transform: translateX(200%); }
.seg:has(label:nth-of-type(4) input:checked) .seg-thumb { transform: translateX(300%); }
.seg label { position: relative; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block; text-align: center; padding: 9px 4px; font-size: 14px; font-weight: 500;
  color: var(--text-3); white-space: nowrap; cursor: pointer; transition: color var(--t-fast);
}
.seg label:hover span { color: var(--text-2); }
.seg input:checked + span { color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-sm); }

/* Settings disclosure */
.more-toggle {
  display: flex; align-items: center; gap: 12px; margin-left: auto; height: 46px; padding: 0 14px; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--r-md); background: transparent; cursor: pointer; text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.more-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
.more-toggle > svg { width: 18px; height: 18px; fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; flex-shrink: 0; }
.more-toggle .chev { transition: transform var(--t-med) var(--ease-out); margin-left: auto; }
.more-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.more-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.more-text b { font-size: 14px; font-weight: 500; }
.more-text span { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-med) var(--ease-out); }
.more.open { grid-template-rows: 1fr; }
.more-inner { overflow: hidden; }
.more:not(.open) .more-inner { visibility: hidden; transition: visibility 0s var(--t-med); }
.more-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; margin: 0 14px 14px; padding-top: 18px;
  border-top: 1px solid var(--border); opacity: 0; transform: translateY(-6px);
  transition: opacity var(--t-med), transform var(--t-med) var(--ease-out);
}
.more.open .more-grid { opacity: 1; transform: none; }

select {
  width: 100%; height: 44px; padding: 0 40px 0 14px; appearance: none;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%238b8b94' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text); border: 1px solid transparent; border-radius: var(--r-md);
  font: 500 15px var(--font); cursor: pointer; transition: border-color var(--t-fast);
}
select:hover { border-color: var(--border-strong); }
select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.switch { position: relative; display: flex; align-items: center; gap: 12px; font-size: 14.5px; color: var(--text-2); cursor: pointer; align-self: end; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex-shrink: 0; width: 40px; height: 24px; border-radius: 999px; background: var(--surface-3); transition: background var(--t-med); }
.switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform var(--t-med) var(--ease-spring);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==========================================================================
   Results
   ========================================================================== */
.results { padding: 28px; display: flex; flex-direction: column; gap: 24px; min-width: 0; position: relative; overflow: hidden; }
.results::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: -180px; height: 340px; pointer-events: none;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tone, var(--accent)) 13%, transparent), transparent);
}
.results > * { position: relative; }
.results-head { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center; }
.gauge { position: relative; width: 200px; }
.gauge svg { width: 200px; height: auto; overflow: visible; }
.gauge .track { stroke: var(--surface-3); }
.gauge .fill { stroke: var(--tone, var(--accent)); transition: stroke-dashoffset 900ms var(--ease-out), stroke 400ms; }
.gauge-value { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge-value strong { display: block; font-size: 44px; font-weight: 600; line-height: 1; }
.gauge-value small { font-size: 12.5px; color: var(--text-3); }

.tone-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500;
  padding: 4px 10px 4px 8px; border-radius: 999px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--tone, var(--accent)) 14%, transparent); color: var(--tone, var(--accent));
}
.tone-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.verdict h2 { font-size: clamp(22px, 2.6vw, 28px); margin-bottom: 8px; }
.verdict p { color: var(--text-2); margin: 0; max-width: 620px; }
.verdict.swap { animation: swap var(--t-med) var(--ease-out); }
@keyframes swap { from { opacity: 0.2; transform: translateY(4px); } }

[data-tone="excellent"] { --tone: var(--excellent); }
[data-tone="good"] { --tone: var(--good); }
[data-tone="moderate"] { --tone: var(--moderate); }
[data-tone="severe"] { --tone: var(--severe); }
[data-tone="gpu"] { --tone: var(--gpu); }

/* Frame pipeline (motion graphic) */
.pipeline { position: relative; height: 96px; border-radius: var(--r-md); background: var(--surface-2); }
.pipeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pipe-node {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 92px; padding: 9px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border-strong);
  transition: border-color 400ms, box-shadow 400ms;
}
.node-cpu { left: 13%; }
.node-gpu { left: 50%; }
.node-display { left: 87%; }
.pipe-name { font-size: 12px; color: var(--text-3); line-height: 1.2; }
.pipe-val { font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.pipe-tag {
  position: absolute; bottom: calc(100% + 5px); left: 50%; transform: translate(-50%, 4px) scale(0.9); opacity: 0;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--tone); color: #0b0b0d; transition: opacity var(--t-med), transform var(--t-med) var(--ease-spring);
}
.pipe-node.limit { border-color: var(--tone); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tone) 16%, transparent); }
.pipe-node.limit .pipe-tag { opacity: 1; transform: translate(-50%, 0) scale(1); }
.pipe-note { font-size: 13px; color: var(--text-3); margin: -14px 0 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 14px 16px; min-width: 0; }
.stat small { display: block; font-size: 12.5px; color: var(--text-3); margin-bottom: 4px; }
.stat strong { font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat .unit { font-size: 14px; color: var(--text-3); margin-left: 2px; }
.meter { height: 4px; background: var(--surface-3); border-radius: 99px; margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--text-3); border-radius: 99px; transform-origin: left; transform: scaleX(0); transition: transform 900ms var(--ease-out), background 400ms; }
.meter i.hot { background: var(--tone, var(--accent)); }

.result-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.result-actions .context { font-size: 13px; color: var(--text-3); margin-right: auto; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; font-size: 14px; font-weight: 500;
  transition: background var(--t-fast), transform var(--t-fast);
}
.btn-ghost svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-ghost:active { transform: scale(0.97); }

/* ==========================================================================
   Detail panels
   ========================================================================== */
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 96px; }
.panel { padding: 24px; min-width: 0; }
.panel.wide { grid-column: 1 / -1; }
.panel h2 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.015em; }
.panel h3 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.015em; }
.panel .sub { font-size: 13.5px; color: var(--text-3); margin-bottom: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
td.r, th.r { text-align: right; }
td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.current td { background: var(--surface-2); }
tr.current td:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
tr.current td:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
td small { color: var(--text-3); font-size: 12.5px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--tone); margin-right: 7px; vertical-align: 1px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tips li { display: grid; grid-template-columns: 20px 1fr; gap: 12px; font-size: 14.5px; color: var(--text-2); padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
.tips li svg { width: 20px; height: 20px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; stroke: var(--gpu); }
.tips li.good svg { stroke: var(--excellent); }
.tips li.warn svg { stroke: var(--moderate); }

.upgrades { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.up {
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-md); padding: 14px;
  display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out);
}
.up:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.up:active { transform: scale(0.98); }
.up .up-tag { font-size: 12px; color: var(--text-3); }
.up .up-name { font-weight: 600; font-size: 15.5px; }
.up .up-gain { font-size: 13.5px; color: var(--text-2); }
.up .up-gain b { color: var(--excellent); font-weight: 600; }
.empty-note { color: var(--text-3); font-size: 14.5px; margin: 0; }

/* ==========================================================================
   Article
   ========================================================================== */
.content { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 64px; padding-bottom: 80px; }
.toc { position: sticky; top: 92px; align-self: start; font-size: 14px; }
.toc p { font-weight: 500; color: var(--text-3); font-size: 13px; margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; border-left: 1px solid var(--border); }
.toc a { position: relative; display: block; padding: 5px 0 5px 14px; color: var(--text-3); text-decoration: none; transition: color var(--t-fast); }
.toc a::before { content: ""; position: absolute; left: -1px; top: 6px; bottom: 6px; width: 1px; background: var(--text); transform: scaleY(0); transition: transform var(--t-med) var(--ease-out); }
.toc a:hover, .toc a.active { color: var(--text); }
.toc a.active::before { transform: scaleY(1); }
.article { max-width: 700px; }
.article section { margin-bottom: 72px; }
.article h2 { font-size: clamp(26px, 3vw, 32px); margin-bottom: 18px; letter-spacing: -0.03em; }
.article h3 { font-size: 18px; margin: 30px 0 10px; }
.article p, .article li { color: var(--text-2); }
.article strong { color: var(--text); font-weight: 600; }
.article ul, .article ol { padding-left: 20px; margin: 0 0 1em; }
.article li { margin-bottom: 6px; }
.article li::marker { color: var(--text-3); }
.article table { margin: 8px 0 18px; }
.callout { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 18px 20px; margin: 20px 0; }
.callout p:last-child { margin: 0; }
.formula {
  font-family: var(--mono); font-size: 13.5px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px; overflow-x: auto; color: var(--text); white-space: pre; line-height: 1.75;
}
.steps { counter-reset: step; list-style: none; padding: 0 !important; display: grid; }
.steps li { counter-increment: step; position: relative; padding: 2px 0 22px 44px; margin: 0 !important; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text); font: 500 13px var(--mono); display: grid; place-items: center; background: var(--bg);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 32px; bottom: 4px; width: 1px; background: var(--border); }

.combos { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 18px 0; }
.combo-card {
  display: block; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  text-decoration: none; transition: border-color var(--t-fast), transform var(--t-med) var(--ease-out);
}
.combo-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.combo-card b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.combo-card span { display: block; font-size: 13px; color: var(--text-3); margin-top: 6px; }
.combo-card em { font-style: normal; font-weight: 500; color: var(--tone); }

.faq details { border-bottom: 1px solid var(--border); }
.faq details:first-of-type { border-top: 1px solid var(--border); }
.faq summary {
  cursor: pointer; padding: 18px 0; font-weight: 500; color: var(--text); list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex-shrink: 0; width: 9px; height: 9px; border-right: 1.6px solid var(--text-3); border-bottom: 1.6px solid var(--text-3);
  transform: translateY(-3px) rotate(45deg); transition: transform var(--t-med) var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(2px) rotate(225deg); }
.faq details > div { padding: 0 0 18px; animation: swap var(--t-med) var(--ease-out); }
.faq details > div p:last-child { margin: 0; }

/* Footer: brand + columns, bottom bar, giant striped wordmark */
.site-footer { position: relative; border-top: 1px solid var(--border); padding-top: 64px; font-size: 14.5px; color: var(--text-3); overflow: hidden; }
.site-footer p { margin: 0; }
.footer-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 48px; }
.footer-logo { font-size: 20px; gap: 12px; }
.footer-logo svg { width: 32px; height: 32px; }
.footer-tagline { color: var(--text-2); font-size: 15.5px; line-height: 1.6; max-width: 400px; margin: 18px 0 24px !important; }
.footer-cta {
  display: inline-flex; align-items: center; gap: 14px; height: 52px; padding: 0 8px 0 22px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-weight: 500; font-size: 15.5px; text-decoration: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 8px 24px -10px rgba(0, 0, 0, 0.6);
  transition: transform var(--t-fast), box-shadow var(--t-med);
}
.footer-cta-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 14%, transparent); }
.footer-cta-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-med) var(--ease-out); }
.footer-cta:hover .footer-cta-icon svg { transform: translateX(3px); }
.footer-cta:active { transform: scale(0.98); }
.footer-badges { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 18px 0 0; padding: 0; font-size: 14px; color: var(--text-2); }
.footer-badges li { display: flex; align-items: center; gap: 8px; }
.footer-badges svg { width: 17px; height: 17px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.footer-cols { display: grid; grid-template-columns: repeat(3, minmax(150px, auto)); gap: 40px; }
.fcol h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--text); margin: 0 0 18px; }
.fcol ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fcol a { display: inline-block; padding: 7px 0; color: var(--text-2); text-decoration: none; transition: color var(--t-fast); }
.fcol a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.footer-copy a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.footer-copy a:hover { color: var(--text); }
.footer-status { display: flex; align-items: center; gap: 10px; margin-left: auto !important; color: var(--text-2); }
.footer-disclaimer { margin-top: 14px !important; font-size: 12.5px; max-width: 760px; line-height: 1.6; }

.wordmark {
  position: relative; margin-top: 28px; text-align: center; white-space: nowrap; user-select: none;
  font-weight: 600; font-size: clamp(24px, 8.6vw, 150px); line-height: 0.82; letter-spacing: -0.045em;
  height: 0.86em; overflow: hidden; --mx: 50%; --my: 40%;
}
.wordmark span {
  display: block; color: transparent; -webkit-background-clip: text; background-clip: text;
}
.wm-base { background: repeating-linear-gradient(90deg, var(--wm-stripe) 0 2px, transparent 2px 6px); }
/* Glow layer: an accent gradient clipped to the text, cut into the same stripes and
   revealed only inside a soft spotlight that follows the cursor (--mx/--my). */
.wm-glow {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, var(--wm-glow) 0%, var(--wm-glow) 40%, color-mix(in srgb, var(--wm-glow) 45%, transparent) 100%);
  -webkit-mask-image: radial-gradient(circle 230px at var(--mx) var(--my), #000 0, #000 28%, rgba(0,0,0,.55) 58%, transparent 82%),
                      repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 6px);
  -webkit-mask-composite: source-in;
  mask-image: radial-gradient(circle 230px at var(--mx) var(--my), #000 0, #000 28%, rgba(0,0,0,.55) 58%, transparent 82%),
              repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 6px);
  mask-composite: intersect;
  opacity: 0; transition: opacity 450ms var(--ease-out);
}
.wordmark.lit .wm-glow { opacity: 1; }
:root { --wm-stripe: rgba(250, 250, 250, 0.09); --wm-glow: #34d399; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --wm-stripe: rgba(9, 9, 11, 0.09); --wm-glow: #059669; } }
:root[data-theme="light"] { --wm-stripe: rgba(9, 9, 11, 0.09); --wm-glow: #059669; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 50;
  transform: translate(-50%, 16px) scale(0.96); opacity: 0;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 500; font-size: 14px;
  transition: opacity var(--t-med), transform var(--t-med) var(--ease-spring); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ==========================================================================
   Build pages (bottleneck/)
   ========================================================================== */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13.5px; color: var(--text-3); padding-top: 28px; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.combo-hero { text-align: left; padding: 20px 0 28px; }
.combo-hero h1 { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -0.035em; }
.combo-hero h1 span { color: var(--text-3); }
.combo-hero .lead { margin: 0; max-width: 860px; font-size: clamp(15.5px, 1.8vw, 17px); }
.part {
  display: flex; align-items: center; min-height: 54px; padding: 0 16px; border-radius: var(--r-md);
  background: var(--surface-2); font-weight: 500; font-size: 16.5px; letter-spacing: -0.01em;
}
.build-summary .builder-sub { align-items: center; justify-content: space-between; flex-wrap: wrap; }
.assumed { margin: 0; font-size: 13.5px; color: var(--text-3); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: var(--r-md); background: var(--text); color: var(--bg); font-weight: 500; font-size: 14.5px; text-decoration: none;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--t-med) var(--ease-out); }
.btn:hover { opacity: 0.88; }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: scale(0.98); }
a.up { text-decoration: none; }
.combo-article { max-width: none; padding-bottom: 40px; }
.combo-article .faq { max-width: 760px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 40px; padding: 0; list-style: none; }
.chips a {
  display: block; padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text-2); font-size: 13.5px; text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast);
}
.chips a:hover { color: var(--text); border-color: var(--border-strong); }
.build-group { margin-bottom: 48px; }
.build-group h2 { font-size: 22px; margin-bottom: 2px; }
.build-group .sub { font-size: 13.5px; color: var(--text-3); margin: 0; }
.builds { padding-bottom: 40px; }

/* Trust pages (about/, contact/, privacy/, editorial-policy/) */
.combo-hero .updated { margin: 14px 0 0; font-size: 13.5px; color: var(--text-3); }
.trust { padding-bottom: 40px; }
.trust section { margin-bottom: 48px; }
.trust h2 { font-size: clamp(22px, 2.6vw, 26px); margin-bottom: 14px; }
.trust code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-2); border-radius: 6px; padding: 1px 5px; overflow-wrap: anywhere; }
.contact-email { font-family: var(--mono); font-size: clamp(16px, 2.4vw, 19px); font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }

/* FPS calculator (fps-calculator/) */
.field-game { flex: 0 1 280px; min-width: 0; }
.panel-wide { grid-column: 1 / -1; }
.tips b { color: var(--text); font-weight: 600; }
.fps-grid th[scope="row"] { font-size: 14.5px; font-weight: 500; color: var(--text); }
.fps-grid tbody tr:last-child th { border-bottom: 0; }
.fps-grid td { padding: 4px; }
.fps-cell {
  display: inline-flex; align-items: center; justify-content: flex-end; width: 100%; min-height: 44px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 600; transition: background var(--t-fast), border-color var(--t-fast);
}
.fps-cell:hover { background: var(--surface-2); }
.fps-cell[aria-pressed="true"] { background: var(--surface-2); border-color: var(--tone); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 14px 0 0; font-size: 12.5px; color: var(--text-3); }
.game-link { font-weight: 500; text-decoration: none; }
.game-link:hover { text-decoration: underline; }
.builds-table th small { font-weight: 400; }
.load-build { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Draw-in for server-rendered gauges and meters */
.js .gauge .fill.draw { animation: draw 1.1s var(--ease-out) both 200ms; }
@keyframes draw { from { stroke-dashoffset: 100; } }
.js .meter i.grow { animation: grow 1s var(--ease-out) both 300ms; }
@keyframes grow { from { transform: scaleX(0); } }

/* ==========================================================================
   Scroll reveal (only when JS runs, so content is never hidden without it)
   ========================================================================== */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.js .reveal.in { opacity: 1; transform: none; }
/* Above the fold: paint immediately (good for LCP), animate position only. */
.js .hero .reveal, .js .calc.reveal { opacity: 1; transform: none; transition: none; animation: rise 700ms var(--ease-out) both; }
.js .hero .reveal:nth-child(2) { animation-delay: 60ms; }
.js .hero .reveal:nth-child(3) { animation-delay: 120ms; }
.js .calc.reveal { animation-delay: 180ms; }
@keyframes rise { from { transform: translateY(12px); } }
.js .reveal-group > * { opacity: 0; transform: translateY(14px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.js .reveal-group.in > * { opacity: 1; transform: none; }
.js .reveal-group.in > *:nth-child(2) { transition-delay: 60ms; }
.js .reveal-group.in > *:nth-child(3) { transition-delay: 120ms; }
.js .reveal-group.in > *:nth-child(4) { transition-delay: 180ms; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .footer-top { grid-template-columns: 1fr; gap: 40px; }
  .details { grid-template-columns: 1fr; }
  .content { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .hero { padding: 44px 0 24px; }
  .builder-main { grid-template-columns: 1fr; }
  .builder-main .field { padding: 12px 10px 4px; }
  .builder-plus { display: none; }
  .builder-sub { flex-direction: column; align-items: stretch; padding: 8px 10px 10px; }
  .field-res { max-width: none; flex: none; }
  .field-game { flex: none; }
  .fps-grid th, .fps-grid td { padding-left: 2px; padding-right: 2px; }
  .fps-cell { padding: 0 4px; font-size: 13.5px; }
  .fps-cell .dot { margin-right: 5px; }
  .more-toggle { margin-left: 0; }
  .more-grid { grid-template-columns: 1fr; margin: 0 10px 10px; }
  .results { padding: 20px 16px; gap: 20px; }
  .results-head { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .pipe-node { min-width: 0; padding: 6px 10px; }
  .pipe-val { font-size: 14px; }
  .pu { display: none; }
  .node-cpu { left: 13%; }
  .node-display { left: 87%; }
  .panel { padding: 18px 16px; }
  th, td { padding: 10px 6px; font-size: 13.5px; }
  .hide-sm { display: none; }
  .site-footer { padding-top: 48px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-status { margin-left: 0 !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal, .js .reveal-group > * { opacity: 1; transform: none; }
}

/* ==========================================================================
   Header menu (compact menu below 900px so the nav never wraps)
   ========================================================================== */
.nav a { white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--text); }
.menu { display: none; position: relative; margin-left: auto; }
.menu summary {
  list-style: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md);
  cursor: pointer; color: var(--text-2); transition: background var(--t-fast), color var(--t-fast);
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--surface-2); color: var(--text); }
.menu summary svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; min-width: 220px; padding: 6px;
  display: grid; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--pop-shadow); transform-origin: top right; animation: pop-in 180ms var(--ease-out);
}
.menu-panel a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--r-sm); color: var(--text-2); text-decoration: none; }
.menu-panel a:hover, .menu-panel a[aria-current="page"] { background: var(--surface-2); color: var(--text); }
@media (max-width: 900px) {
  .site-header .nav { display: none; }
  .menu { display: block; }
}

/* ===== Compare pages ===== */
.cmp-overview { padding: 24px; margin-bottom: 12px; }
.cmp-overview h2 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.015em; }
.cmp-overview .sub { font-size: 13.5px; color: var(--text-3); margin-bottom: 18px; }
.cmp-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cmp-metric { background: var(--surface-2); border-radius: var(--r-md); padding: 16px; min-width: 0; }
.cmp-metric h3 { font-size: 13.5px; font-weight: 500; color: var(--text-2); letter-spacing: 0; margin: 0 0 12px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: baseline; margin-bottom: 12px; }
.cmp-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-val { font-size: 14px; color: var(--text-3); }
.cmp-row.win .cmp-val { color: var(--text); font-weight: 600; }
.cmp-bar { grid-column: 1 / -1; height: 8px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.cmp-bar i { display: block; height: 100%; background: var(--text-3); border-radius: 99px; transform-origin: left; }
.cmp-row.win .cmp-bar i { background: var(--accent); }
.js .cmp-bar i { animation: grow 1s var(--ease-out) both 300ms; }
.cmp-note { margin: 0; font-size: 12.5px; color: var(--text-3); }
.cmp-lead { font-family: var(--mono); white-space: nowrap; color: var(--accent); }
.cmp-table td small { white-space: nowrap; }
.cmp-specs td.r { font-family: var(--font); letter-spacing: 0; }
.cmp-who { font-family: var(--font); white-space: nowrap; }
.cmp-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.cmp-pick { padding: 20px 22px; min-width: 0; }
.cmp-pick.win { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.article .cmp-pick h3 { font-size: 17px; margin: 0 0 10px; }
.cmp-pick ul { margin: 0; }
.cmp-pick li:last-child { margin-bottom: 0; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.cmp-actions a { max-width: 100%; height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; text-align: center; text-decoration: none; }
.combo-article .cmp-actions + h3 { margin-top: 36px; }
.cmp-hub-group { margin-bottom: 24px; }
.cmp-hub-group > h2 { font-size: clamp(24px, 3vw, 28px); margin-bottom: 20px; }
.cmp-hub-group .build-group h3 { font-size: 19px; margin-bottom: 2px; }
@media (max-width: 900px) {
  .cmp-metrics { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cmp-overview { padding: 18px 16px; }
  .cmp-picks { grid-template-columns: 1fr; }
  .cmp-pick { padding: 18px 16px; }
  .cmp-who { display: block; }
}

/* ===== i18n ===== */
/* Language switcher in the footer (English · Español · 日本語). */
.lang-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 0; }
.lang-switch a { color: var(--text-2); text-decoration: none; padding: 6px 0; transition: color var(--t-fast); }
.lang-switch a:hover, .lang-switch a[aria-current="page"] { color: var(--text); }
.lang-switch span { color: var(--text-3); }

/* Japanese: Geist (latin subset) for latin glyphs, system Japanese fonts for the rest. No CJK webfont download. */
:root:lang(ja) { --font: "Geist", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; }
.lang-switch a:lang(ja) { font-family: "Geist", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; }
/* Tight latin tracking makes kana and kanji collide; break headings at phrase boundaries. */
:lang(ja) :is(h1, h2, h3) { letter-spacing: 0; }
:lang(ja) :is(h1, h2, h3, .lead) { word-break: auto-phrase; line-break: strict; }
:lang(ja) .article :is(p, li) { line-height: 1.8; }

/* ==========================================================================
   Build score ring (result actions)
   ========================================================================== */
.score { position: relative; display: flex; align-items: center; gap: 10px; min-width: 150px; }
.score svg { width: 44px; height: 44px; transform: rotate(-90deg); flex-shrink: 0; }
.score circle { fill: none; stroke-width: 3.5; }
.score-track { stroke: var(--surface-3); }
.score-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 900ms var(--ease-out), stroke 400ms; }
.score[data-grade="fair"] .score-fill { stroke: var(--moderate); }
.score[data-grade="poor"] .score-fill { stroke: var(--severe); }
.score-num { position: absolute; left: 0; width: 44px; text-align: center; font-size: 14px; font-weight: 600; }
.score-text { display: flex; flex-direction: column; line-height: 1.25; }
.score-text small { font-size: 12px; color: var(--text-3); }
.score-text b { font-size: 14px; font-weight: 600; }
.result-actions .context { margin-left: 6px; }
@media (max-width: 720px) {
  .result-actions .context { flex-basis: 100%; order: 3; margin: 0; }
  .result-actions .score { flex-basis: 100%; }
  .result-actions .btn-ghost { flex: 1 1 0; justify-content: center; white-space: nowrap; }
}

/* ==========================================================================
   Mac gaming calculator
   ========================================================================== */
.big-select { height: 54px; font-size: 16px; padding-left: 16px; }
.run { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.run-native { color: var(--excellent); background: color-mix(in srgb, var(--excellent) 13%, transparent); }
.run-translated { color: var(--moderate); background: color-mix(in srgb, var(--moderate) 14%, transparent); }
.run-blocked { color: var(--severe); background: color-mix(in srgb, var(--severe) 12%, transparent); }
.stat-pc strong { font-size: 17px; line-height: 1.3; display: block; }
.stat-pc .pc-cpu { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.seg label.off span { opacity: 0.35; cursor: not-allowed; }
a.up { color: inherit; }

/* ==========================================================================
   Header tools: search + theme switch
   ========================================================================== */
.header-tools { display: flex; gap: 2px; margin-left: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--text-2); cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: block; }
}
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
.theme-btn svg { transition: transform 500ms var(--ease-spring); }
.theme-btn.spin svg { transform: rotate(180deg); }
@media (max-width: 900px) {
  .header-tools { margin-left: auto; }
  .menu { margin-left: 2px; }
}

/* Search dialog */
.search-dialog {
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100dvh - 120px)); margin: 12vh auto auto; padding: 0;
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--pop-shadow); overflow: hidden;
}
.search-dialog[open] { display: flex; flex-direction: column; animation: pop-in 180ms var(--ease-out); }
.search-dialog::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); }
.search-head { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.search-head svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: var(--text-3); stroke-width: 1.9; stroke-linecap: round; }
.search-head input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; color: var(--text); font: 500 17px var(--font); outline: none; }
.search-head input::placeholder { color: var(--text-3); font-weight: 400; }
.search-head kbd { font: 500 11.5px var(--mono); color: var(--text-3); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 6px; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.search-results a .s-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results a .s-type { flex-shrink: 0; font-size: 12px; color: var(--text-3); }
.search-results li.active a, .search-results a:hover { background: var(--surface-2); }
.search-results mark { background: none; color: var(--accent); font-weight: 600; }
.search-empty { padding: 22px 16px; color: var(--text-3); font-size: 14.5px; text-align: center; }

/* Back to top */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: var(--pop-shadow); cursor: pointer; opacity: 0; transform: translateY(12px) scale(0.9); pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med) var(--ease-spring), background var(--t-fast);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--surface-2); }
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Reading progress (guides) */
.read-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 40; height: 3px; background: var(--accent); transform-origin: left; transform: scaleX(0); pointer-events: none; }

/* ==========================================================================
   Print: clean, ink-friendly pages for results, guides and comparisons
   ========================================================================== */
@media print {
  :root, :root[data-theme] {
    --bg: #fff; --surface: #fff; --surface-2: #f4f4f5; --surface-3: #e4e4e7; --text: #000; --text-2: #222; --text-3: #555;
    --border: #ccc; --border-strong: #999; color-scheme: light;
  }
  body { font-size: 11pt; background: #fff; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .site-header, .site-footer, .toc, .skip, .builder, .result-actions, .pipeline, .pipe-note, .more-toggle, .to-top,
  .read-progress, .search-dialog, .combos, .cmp-actions, .btn, .footer-cta, .chips, .upgrades, .toast, .wordmark { display: none !important; }
  .js .reveal, .js .reveal-group > * { opacity: 1 !important; transform: none !important; }
  .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .results::before { display: none; }
  .content { display: block; padding: 0; }
  .details { grid-template-columns: 1fr; margin-bottom: 16px; }
  .hero { padding: 0 0 12px; }
  table, tr, .callout, .formula { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  .article a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #555; }
  .faq details > div { display: block !important; }
  @page { margin: 16mm; }
}

/* ==========================================================================
   Ad slots (filled only when site.config.json turns ads on)
   ========================================================================== */
.ad-slot { display: block; margin: 40px auto; max-width: 970px; min-height: 290px; text-align: center; }
.ad-slot.ad-in-article { margin: 36px 0; min-height: 250px; max-width: none; }
.ad-label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.ad-slot ins { display: block; }
.consent-link { margin-left: 4px; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; }
.consent-link:hover { color: var(--text); }
@media print { .ad-slot, .consent-link { display: none !important; } }

/* Globe language menu */
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; width: auto; gap: 5px; padding: 0 9px; display: flex; align-items: center; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu[open] summary { background: var(--surface-2); color: var(--text); }
.lang-code { font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.lang-panel { min-width: 170px; }
.lang-panel a[aria-current] { color: var(--text); background: var(--surface-2); }
.lang-panel a[aria-current]::after { content: "✓"; margin-left: auto; color: var(--accent); }
.lang-panel a:lang(ja) { font-family: "Geist", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif; }
@media (max-width: 420px) { .lang-code { display: none; } .lang-menu summary { padding: 0; width: 40px; justify-content: center; } }

/* Full brand name in the header: on small phones the theme switch moves into the menu */
.menu-theme { display: none; }
.menu-panel .menu-theme { min-height: 44px; padding: 0 12px; border: 0; border-top: 1px solid var(--border); border-radius: 0; margin-top: 4px; background: none; color: var(--text-2); font: inherit; text-align: left; cursor: pointer; }
.menu-panel .menu-theme:hover { color: var(--text); background: var(--surface-2); }
.logo span { white-space: nowrap; }
@media (max-width: 480px) {
  .header-tools .theme-btn { display: none; }
  .menu-panel .menu-theme { display: flex; align-items: center; }
  .header-tools { gap: 0; }
  .icon-btn { width: 38px; }
  .logo { font-size: 15.5px; gap: 7px; }
}
