:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --ink: #111617;
  --ink-soft: #666f73;
  --dark: #21292c;
  --brand: #fdd231;
  --line: #e4e4e0;
  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171b1c; --surface: #21292c; --ink: #f4f1e8; --ink-soft: #a1aeb2;
    --dark: #0f1213; --brand: #fdd231; --line: rgba(244, 241, 232, 0.16);
  }
}
:root[data-theme="dark"] {
  --bg: #171b1c; --surface: #21292c; --ink: #f4f1e8; --ink-soft: #a1aeb2;
  --dark: #0f1213; --brand: #fdd231; --line: rgba(244, 241, 232, 0.16);
}
:root[data-theme="light"] {
  --bg: #ffffff; --surface: #f7f7f5; --ink: #111617; --ink-soft: #666f73;
  --dark: #21292c; --brand: #fdd231; --line: #e4e4e0;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
.page { max-width: 720px; margin: 0 auto; }
a { color: inherit; }

.utility { background: var(--dark); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.utility::-webkit-scrollbar { display: none; }
.utility ul { list-style: none; display: flex; gap: 1.4rem; margin: 0; padding: 0.55rem 1.1rem; }
.utility a { color: #a1aeb2; text-decoration: none; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.utility a:hover, .utility a.on { color: var(--brand); }

header.masthead { padding: 1.5rem 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-soft); margin: 0 0 0.3rem; }
.wordmark { font-size: clamp(1.9rem, 8vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; margin: 0; line-height: 1; text-wrap: balance; }
.wordmark a { text-decoration: none; }
.wordmark span { background: var(--brand); padding: 0 0.14em; }

.hero { background: var(--brand); color: var(--dark); margin: 0 1.1rem; padding: 1.8rem 1.5rem 1.6rem; }
.hero-tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--dark); color: var(--brand); padding: 0.3em 0.6em; margin-bottom: 0.9rem; }
.hero-phrase { font-size: clamp(1.4rem, 6vw, 1.9rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 1.3rem; text-wrap: balance; }
.hero-actions { display: flex; align-items: center; gap: 0.6rem; }
.circle-btn { width: 42px; height: 42px; border-radius: 50%; background: rgba(17, 22, 23, 0.78); color: #fff; display: grid; place-items: center; border: none; cursor: pointer; transition: transform 0.12s ease; }
@media (prefers-reduced-motion: reduce) { .circle-btn { transition: none; } }
.circle-btn:hover { transform: scale(1.06); }
.circle-btn:focus-visible { outline: 2px solid var(--dark); outline-offset: 3px; }
.circle-btn svg { width: 18px; height: 18px; }
.hero-btn-label { font-size: 13px; font-weight: 700; color: var(--dark); }

section { padding: 2.2rem 1.1rem 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 3px solid var(--ink); padding-bottom: 0.5rem; margin-bottom: 1rem; gap: 1rem; }
.sec-head h1, .sec-head h2 { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.sec-head .note { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-align: right; text-transform: uppercase; letter-spacing: 0.02em; }

.header-img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; margin: 1.1rem 0 0; background: var(--surface); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cat-card { background: var(--bg); text-decoration: none; color: var(--ink); position: relative; display: flex; flex-direction: column; }
.cat-thumb { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface); }
.cat-card-body { padding: 1rem; flex: 1; }
.cat-rank { font-size: 26px; font-weight: 800; color: var(--line); line-height: 1; display: block; margin-bottom: 0.5rem; font-variant-numeric: tabular-nums; }
.cat-card.top .cat-rank { color: var(--brand); -webkit-text-stroke: 1.5px var(--ink); }
.cat-name { font-size: 1rem; font-weight: 800; margin: 0 0 0.2rem; letter-spacing: -0.01em; }
.cat-meta { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }

.lede { font-size: 13.5px; color: var(--ink-soft); margin: -0.4rem 0 1.1rem; max-width: 52ch; line-height: 1.6; }
.lede-block { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.lede-block p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; margin: 0 0 0.9rem; max-width: 62ch; }
.lede-block h2, .lede-block h3 { font-size: 1rem; font-weight: 800; color: var(--ink); margin: 1.2rem 0 0.5rem; }
.lede-block ul, .lede-block ol { color: var(--ink-soft); font-size: 13.5px; line-height: 1.65; max-width: 62ch; padding-left: 1.2rem; margin: 0 0 0.9rem; }
.lede-block > *:last-child { margin-bottom: 0; }
.lede-block a { color: var(--ink); }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.row:first-of-type { border-top: 1px solid var(--line); }
.row-body { min-width: 0; }
.row-text { font-size: 1.02rem; font-weight: 700; line-height: 1.35; margin: 0; letter-spacing: -0.005em; }
.row-explanation { font-size: 0.83rem; font-weight: 400; line-height: 1.5; color: var(--ink-soft); margin: 0.35rem 0 0; max-width: 56ch; }
.row-actions { display: flex; gap: 0.45rem; flex: none; margin-top: 0.15rem; }
.icon-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background 0.12s ease, color 0.12s ease; }
@media (prefers-reduced-motion: reduce) { .icon-btn { transition: none; } }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn:hover { background: var(--brand); border-color: var(--brand); color: var(--dark); }
.icon-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.icon-btn.done { background: var(--brand); border-color: var(--brand); color: var(--dark); }

.heart-btn { width: auto; min-width: 34px; padding: 0 0.55em; gap: 0.3em; }
.heart-btn .heart-count { font-size: 11.5px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 0; }
.heart-btn.voted { background: #e2604b; border-color: #e2604b; color: #fff; }
.heart-btn.voted svg { fill: currentColor; }
.heart-btn.locked { opacity: 0.35; cursor: not-allowed; }
.heart-btn.locked:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.heart-btn:disabled { cursor: default; }

footer.bar { margin-top: 2.6rem; background: var(--dark); color: #a1aeb2; padding: 1.5rem 1.1rem; text-align: center; }
footer.bar p { margin: 0; font-size: 12.5px; line-height: 1.6; max-width: 40ch; margin: 0 auto; }
footer.bar strong { color: var(--brand); }
footer.bar a { color: #a1aeb2; }
footer.bar .legal-links { margin-top: 0.9rem; font-size: 11px; opacity: 0.75; }
footer.bar .legal-links a { text-decoration: underline; text-underline-offset: 2px; }
footer.bar .legal-links span { margin: 0 0.4em; }

.legal-text h2 { font-size: 1rem; font-weight: 800; margin: 1.6rem 0 0.5rem; }
.legal-text h2:first-child { margin-top: 0; }
.legal-text p { font-size: 0.88rem; line-height: 1.65; color: var(--ink-soft); margin: 0 0 0.9rem; max-width: 66ch; }
.legal-text ul { margin: 0 0 0.9rem; padding-left: 1.2rem; }
.legal-text li { font-size: 0.88rem; line-height: 1.65; color: var(--ink-soft); }
.legal-text strong { color: var(--ink); }
.legal-text a { color: var(--ink); }
.legal-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); font-style: italic; font-size: 0.8rem !important; }

.toast { position: fixed; left: 50%; bottom: 1.4rem; transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; padding: 0.6rem 1.1rem; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 10; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }
