/* 레이아웃: 벤치마크 스펙시트 — 차가운 종이색 바탕, 코발트 막대 게이지, 주황 세로선은 '권장 사양' 표시 */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --ink: #111729;
  --muted: #586180;
  --line: #dde2ee;
  --accent: #1d3fd8;
  --accent-ink: #ffffff;
  --accent-soft: #e5eaff;
  --need: #e0590d;
  --ok: #137347;
  --ok-soft: #e1f3e9;
  --mid: #8a5a00;
  --mid-soft: #fbf0d9;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --track: #e6e9f2;
  --font-body: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c111d; --surface: #141b2c; --ink: #e7ebf5; --muted: #9aa3bf; --line: #252f47;
    --accent: #7f97ff; --accent-ink: #0c111d; --accent-soft: #1b2552; --need: #ff8d42;
    --ok: #5fcf95; --ok-soft: #12301f; --mid: #f0c060; --mid-soft: #33280f; --bad: #ff7b72; --bad-soft: #3a1714;
    --track: #222a3f; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c111d; --surface: #141b2c; --ink: #e7ebf5; --muted: #9aa3bf; --line: #252f47;
  --accent: #7f97ff; --accent-ink: #0c111d; --accent-soft: #1b2552; --need: #ff8d42;
  --ok: #5fcf95; --ok-soft: #12301f; --mid: #f0c060; --mid-soft: #33280f; --bad: #ff7b72; --bad-soft: #3a1714;
  --track: #222a3f; color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* 헤더 */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; text-decoration: none; }
.logo-mark { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; padding: 3px 6px; border-radius: 5px; background: var(--ink); color: var(--bg); }
.nav { display: flex; gap: 18px; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }

.sample-banner { background: var(--mid-soft); color: var(--mid); font-size: 0.9rem; text-align: center; padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); }

main { padding-block: 8px 48px; }

/* 히어로 */
.hero { padding-block: 40px 28px; display: grid; gap: 12px; max-width: 720px; }
.hero h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 700; }
.h1-sub { display: block; font-size: 0.5em; font-weight: 500; color: var(--muted); margin-top: 6px; }
.eyebrow { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.08em; color: var(--accent); font-weight: 600; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 62ch; }
.hero-game { padding-block: 20px 24px; }

.section { margin-top: 44px; display: grid; gap: 16px; }
.sub { color: var(--muted); font-size: 0.95rem; margin-top: -8px; }

/* 게임 카드 */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.game-card { display: grid; gap: 4px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; transition: border-color .15s, transform .15s; }
.game-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.game-genre { font-size: 0.8rem; color: var(--muted); }
.game-name { font-size: 1.2rem; font-weight: 700; }
.game-rec { font-size: 0.88rem; color: var(--muted); }
.game-pick { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 700; color: var(--accent); display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.label { font-size: 0.78rem; color: var(--muted); font-weight: 500; }

/* 성능 막대 */
.meter { position: relative; height: 8px; background: var(--track); border-radius: 99px; overflow: visible; }
.meter-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 99px; }
.meter-need { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; background: var(--need); border-radius: 2px; }
.ladder { display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.ladder-row { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 64px; gap: 14px; align-items: center; padding: 10px 8px; border-radius: 6px; text-decoration: none; }
.ladder-row:hover { background: var(--accent-soft); }
.ladder-name { font-weight: 500; font-size: 0.95rem; }
.ladder-score { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; font-size: 0.9rem; color: var(--muted); }

/* 단계 */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { counter-increment: s; display: grid; gap: 4px; padding: 16px; border-top: 2px solid var(--ink); }
.steps li::before { content: "STEP " counter(s); font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted); letter-spacing: 0.06em; }
.steps span { color: var(--muted); font-size: 0.95rem; }

/* 권장 사양 */
.spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 14px; }
.spec-title { font-size: 1rem; }
.spec-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.spec-list div { display: grid; gap: 2px; min-width: 0; }
.spec-list dt { font-size: 0.8rem; color: var(--muted); }
.spec-list dd { margin: 0; font-weight: 500; }
.tip { padding: 12px 14px; background: var(--accent-soft); border-radius: 8px; font-size: 0.95rem; }
.tip strong { color: var(--accent); margin-right: 6px; }
.note { font-size: 0.85rem; color: var(--muted); }

/* 등급 카드 */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; align-items: start; }
.tier { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 12px; min-width: 0; }
.tier-featured { border: 2px solid var(--accent); padding: 17px; }
.tier-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.tier-desc { font-size: 0.85rem; color: var(--muted); }
.tier-gpu { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tier-gpu a { font-weight: 700; text-decoration: none; color: var(--accent); }
.tier-gpu .mono { font-size: 0.82rem; color: var(--muted); }

.chip { font-size: 0.75rem; padding: 2px 8px; border-radius: 99px; white-space: nowrap; font-weight: 500; }
.chip-accent { background: var(--accent); color: var(--accent-ink); }
.chip-rocket { background: var(--accent-soft); color: var(--accent); }

/* 상품 */
.prods { list-style: none; margin: 0; padding: 0; display: grid; }
.prod { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.prod-img { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--bg); display: grid; place-items: center; }
.prod-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph { color: var(--muted); width: 36px; display: block; }
.prod-body { min-width: 0; display: grid; gap: 4px; }
.prod-name { font-size: 0.9rem; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
.prod-name:hover { text-decoration: underline; }
.prod-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 0.95rem; }
.prod-empty { padding: 12px 0; color: var(--muted); font-size: 0.9rem; border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border-radius: 8px; font-weight: 700; font-size: 0.85rem; padding: 8px 12px; white-space: nowrap; }
.btn-buy { background: var(--accent); color: var(--accent-ink); }
.btn-buy:hover { filter: brightness(1.08); }
.more { font-size: 0.9rem; font-weight: 500; color: var(--accent); text-decoration: none; padding-top: 10px; border-top: 1px solid var(--line); }
.more:hover { text-decoration: underline; }

/* GPU 페이지 */
.split { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; align-items: start; }
.split > div { display: grid; gap: 14px; min-width: 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.games-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.games-table th, .games-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.games-table tr:last-child td { border-bottom: 0; }
.games-table th { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.games-table a { text-decoration: none; font-weight: 500; }
.state { font-size: 0.8rem; padding: 2px 8px; border-radius: 99px; font-weight: 700; }
.state-ok { background: var(--ok-soft); color: var(--ok); }
.state-mid { background: var(--mid-soft); color: var(--mid); }
.state-bad { background: var(--bad-soft); color: var(--bad); }
.neighbors { display: flex; justify-content: space-between; gap: 12px; margin-top: 36px; flex-wrap: wrap; }
.neighbors a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* 기타 */
.crumbs { display: flex; gap: 8px; font-size: 0.85rem; color: var(--muted); padding-top: 18px; }
.crumbs a { text-decoration: none; }
.faqs { display: grid; gap: 8px; }
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 500; }
.faq p { margin-top: 8px; color: var(--muted); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 99px; text-decoration: none; background: var(--surface); font-size: 0.92rem; }
.pills a:hover { border-color: var(--accent); color: var(--accent); }

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { padding-block: 24px; display: grid; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.disclosure { color: var(--ink); font-weight: 500; }

@media (max-width: 520px) {
  .ladder-row { grid-template-columns: minmax(0, 1fr) 56px; gap: 6px 10px; }
  .ladder-bar { grid-column: 1 / -1; grid-row: 2; }
  .prod { grid-template-columns: 56px minmax(0, 1fr); }
  .prod-img { width: 56px; height: 56px; }
  .btn-buy { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .game-card { transition: none; } .game-card:hover { transform: none; } }

/* 용도별 */
.use-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.use-card { display: grid; gap: 4px; padding: 20px; background: var(--accent-soft); border: 1px solid transparent; border-radius: var(--r); text-decoration: none; transition: border-color .15s, transform .15s; }
.use-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.use-card .game-pick { border-top-color: var(--accent); }
.spec-list-ranked { counter-reset: f; }
.spec-list-ranked div { counter-increment: f; }
.spec-list-ranked dt::before { content: counter(f) ". "; font-family: var(--font-mono); color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .use-card { transition: none; } .use-card:hover { transform: none; } }
