/* SelfHostIndex — design system. System fonts, no external requests, no FOUC.
   Theme: "forged copper" — warm stone neutrals, burnt-copper primary, gold
   accents. Light + dark are tuned separately, not inverted. */

/* ---- design tokens ---------------------------------------------------- */
:root,
[data-theme="light"] {
  --bg: #faf8f5;
  --bg-tint: #f4efe7;
  --surface: #ffffff;
  --surface-2: #f6f2eb;
  --surface-3: #ede6db;
  --border: #eae3d7;
  --border-strong: #d9cfc0;
  --text: #211b15;
  --text-soft: #4b4238;
  --muted: #6d6459;
  --primary: #c2410c;
  --primary-dark: #9a3412;
  --primary-soft: #faeadd;
  --primary-line: #ecc5a3;
  --primary-glow: rgba(194, 65, 12, .16);
  --accent: #b45309;
  --accent-soft: #f8eed7;
  --star: #b45309;
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, .08);
  --danger: #b91c1c;
  --btn-text: #fff8f2;
  --chart-bar: #c2410c;
  --grid-line: rgba(120, 85, 50, .10);
  --tile-bg-s: 58%; --tile-bg-l: 93%; --tile-bg-l2: 87%;
  --tile-fg-s: 52%; --tile-fg-l: 30%;
  --tile-line-s: 42%; --tile-line-l: 82%;
  --shadow-sm: 0 1px 2px rgba(64, 41, 20, .05);
  --shadow: 0 1px 2px rgba(64, 41, 20, .05), 0 10px 28px rgba(64, 41, 20, .08);
  --shadow-lg: 0 2px 6px rgba(64, 41, 20, .07), 0 22px 56px rgba(64, 41, 20, .16);
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #110d0a;
    --bg-tint: #171210;
    --surface: #1a1511;
    --surface-2: #221b15;
    --surface-3: #2d241c;
    --border: #2a211a;
    --border-strong: #443528;
    --text: #f3ede4;
    --text-soft: #d4c9bc;
    --muted: #a2968a;
    --primary: #f59b57;
    --primary-dark: #f8b078;
    --primary-soft: #2e1f12;
    --primary-line: #5f4124;
    --primary-glow: rgba(245, 155, 87, .13);
    --accent: #eab308;
    --accent-soft: #2c2410;
    --star: #f6b21f;
    --success: #55cc80;
    --success-soft: rgba(85, 204, 128, .09);
    --danger: #f27a72;
    --btn-text: #2b1304;
    --chart-bar: #e2701d;
    --grid-line: rgba(245, 190, 130, .06);
    --tile-bg-s: 30%; --tile-bg-l: 23%; --tile-bg-l2: 17%;
    --tile-fg-s: 62%; --tile-fg-l: 76%;
    --tile-line-s: 26%; --tile-line-l: 30%;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .42);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 26px 64px rgba(0, 0, 0, .6);
  }
}
[data-theme="dark"] {
  --bg: #110d0a;
  --bg-tint: #171210;
  --surface: #1a1511;
  --surface-2: #221b15;
  --surface-3: #2d241c;
  --border: #2a211a;
  --border-strong: #443528;
  --text: #f3ede4;
  --text-soft: #d4c9bc;
  --muted: #a2968a;
  --primary: #f59b57;
  --primary-dark: #f8b078;
  --primary-soft: #2e1f12;
  --primary-line: #5f4124;
  --primary-glow: rgba(245, 155, 87, .13);
  --accent: #eab308;
  --accent-soft: #2c2410;
  --star: #f6b21f;
  --success: #55cc80;
  --success-soft: rgba(85, 204, 128, .09);
  --danger: #f27a72;
  --btn-text: #2b1304;
  --chart-bar: #e2701d;
  --grid-line: rgba(245, 190, 130, .06);
  --tile-bg-s: 30%; --tile-bg-l: 23%; --tile-bg-l2: 17%;
  --tile-fg-s: 62%; --tile-fg-l: 76%;
  --tile-line-s: 26%; --tile-line-l: 30%;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow: 0 1px 3px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .42);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, .5), 0 26px 64px rgba(0, 0, 0, .6);
}

/* ---- base ------------------------------------------------------------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.theme-anim, html.theme-anim *,
html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .35s ease, border-color .35s ease,
              color .35s ease, box-shadow .35s ease !important;
}
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.62;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--primary-glow); color: inherit; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-track { background: transparent; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.12; font-weight: 800; letter-spacing: -.028em; }
h1 {
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.15rem);
  margin: 0 0 .5rem; line-height: 1.05; letter-spacing: -.035em;
  text-wrap: balance;
}
h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem); margin: 0 0 1rem; }
h3 { font-size: 1.05rem; margin: 0 0 .4rem; letter-spacing: -.015em; }
p { margin: 0 0 1rem; }
img, svg { max-width: 100%; }
code {
  background: var(--surface-2); padding: .14em .42em; border-radius: 5px;
  font-size: .88em; font-family: var(--mono);
  border: 1px solid var(--border);
}
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1.15rem; }
.muted { color: var(--muted); font-size: .92rem; }
.grad {
  background: linear-gradient(100deg, var(--primary) 10%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.num, .hero-stats strong, .statbox strong, .chart-value, .cat-count,
.filter-count, .chip span, .watchlist-count {
  font-variant-numeric: tabular-nums;
}
.skip {
  position: absolute; left: -999px; top: 0; background: var(--primary);
  color: var(--btn-text); padding: .6rem 1rem; z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip:focus { left: 0; }

/* ---- header ----------------------------------------------------------- */
.site-header {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 60;
}
.site-header::before {
  /* the forge line — brand signature across the very top */
  content: ""; display: block; height: 2px;
  background: linear-gradient(90deg,
    transparent, var(--primary) 18%, var(--accent) 55%, transparent 92%);
}
.header-inner { display: flex; align-items: center; gap: .9rem; height: 60px; }
.brand {
  display: flex; align-items: center; gap: .6rem;
  font-weight: 800; font-size: 1.14rem; color: var(--text);
  white-space: nowrap; letter-spacing: -.025em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; color: #fff8f0; font-size: .72rem; font-weight: 800;
  background: linear-gradient(140deg, #d35415, #9a3412);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25),
              0 2px 10px var(--primary-glow);
  letter-spacing: 0;
}
.main-nav { display: flex; gap: .1rem; margin-left: .5rem; flex: 1; }
.main-nav a {
  color: var(--text-soft); padding: .44rem .68rem; border-radius: 8px;
  font-size: .9rem; font-weight: 560;
  transition: background-color .15s ease, color .15s ease;
}
.main-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.search { position: relative; }
.search input[type=search] {
  width: 215px; max-width: 44vw; padding: .5rem .95rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--text); font-size: .89rem;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--primary);
  background: var(--surface); box-shadow: 0 0 0 3px var(--primary-glow); }
.search-results {
  position: absolute; top: 120%; right: 0; width: 360px; max-width: 86vw;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; max-height: 72vh; overflow-y: auto;
}
.search-results a {
  display: block; padding: .58rem .9rem; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.active {
  background: var(--primary-soft); text-decoration: none;
}
.search-results .sr-type {
  font-size: .66rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--primary); font-weight: 800;
}
.search-results .sr-empty { padding: .9rem; color: var(--muted); }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--border-strong); border-radius: 9px;
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  padding: 0;
  transition: color .15s ease, border-color .15s ease, transform .15s ease;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 17px; height: 17px; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
.icon-sun { display: none; }
.icon-moon { display: block; }
.nav-toggle { display: none; }
.mobile-nav {
  display: none; flex-direction: column; gap: .15rem;
  border-top: 1px solid var(--border); background: var(--surface);
  padding: .6rem 1.15rem 1rem;
}
.mobile-nav a {
  padding: .6rem .5rem; color: var(--text); border-radius: 8px;
  font-weight: 560;
}
.mobile-nav a:hover { background: var(--surface-2); text-decoration: none; }

/* ---- breadcrumbs ------------------------------------------------------ */
.crumbs { margin: 1.05rem 0 .3rem; font-size: .82rem; }
.crumbs ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem;
  padding: 0; margin: 0;
}
.crumbs li + li::before {
  content: "\203A"; color: var(--border-strong); margin-right: .4rem;
  font-weight: 600;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs li[aria-current] { color: var(--text-soft); font-weight: 600; }

/* ---- hero ------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border); border-radius: 18px;
  padding: 3.6rem 1.6rem 3rem; margin: 1.3rem 0 2rem; text-align: center;
  background:
    radial-gradient(52% 90% at 22% -12%, var(--primary-glow), transparent 68%),
    radial-gradient(46% 80% at 82% -8%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 70%),
    linear-gradient(180deg, var(--bg-tint), var(--surface) 78%);
}
.hero::before {
  /* blueprint grid, faded at the edges */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(70% 90% at 50% 0%, #000 30%, transparent 80%);
          mask-image: radial-gradient(70% 90% at 50% 0%, #000 30%, transparent 80%);
}
.hero::after {
  /* film grain */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--noise); opacity: .05; mix-blend-mode: overlay;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  max-width: 21ch; margin: 0 auto .6rem;
  font-size: clamp(2.3rem, 1.35rem + 3.7vw, 3.9rem);
}
.hero .pill-tag {
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: 1.15rem;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border: 1px solid var(--border-strong);
  padding: .3rem .85rem; border-radius: 999px; font-size: .78rem;
  font-weight: 600; color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}
.pill-tag .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--success-soft); }
  50% { box-shadow: 0 0 0 5px var(--success-soft); }
}
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; margin: 0 auto 1.3rem; }
.lede strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.hero-search {
  display: flex; gap: .5rem; max-width: 560px; margin: 1.4rem auto .5rem;
}
.hero-search input {
  flex: 1; min-width: 0; padding: .88rem 1.15rem; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 1rem; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search input:focus { outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow); }
.hero-cta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap;
  margin-top: 1.15rem; }
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1rem 0; margin-top: 2.1rem;
}
.hero-stats div {
  display: flex; flex-direction: column; padding: 0 2.1rem;
  border-left: 1px solid var(--border);
}
.hero-stats div:first-child { border-left: 0; }
.hero-stats strong {
  font-size: 1.65rem; font-weight: 700; font-family: var(--mono);
  letter-spacing: -.04em; color: var(--text);
}
.hero-stats span {
  font-size: .72rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .09em; font-weight: 650;
}

/* ---- buttons ---------------------------------------------------------- */
.btn, button.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.3rem; border-radius: 10px; border: 1px solid transparent;
  background: linear-gradient(180deg, #d0500f, #b13c0a);
  color: var(--btn-text); font-weight: 650;
  font-size: .94rem; cursor: pointer; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22),
              0 1px 2px rgba(80, 30, 5, .25), 0 4px 14px var(--primary-glow);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
[data-theme="dark"] .btn:not(.btn-ghost),
[data-theme="dark"] button.btn:not(.btn-ghost) {
  background: linear-gradient(180deg, #f8a869, #ec7c26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35),
              0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px var(--primary-glow);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:not(.btn-ghost),
  :root:not([data-theme="light"]) button.btn:not(.btn-ghost) {
    background: linear-gradient(180deg, #f8a869, #ec7c26);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35),
                0 1px 2px rgba(0, 0, 0, .5), 0 4px 16px var(--primary-glow);
  }
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px);
  text-decoration: none; }
.btn:active { transform: translateY(0); filter: brightness(.97); }
.btn-ghost, button.btn-ghost {
  background: var(--surface); color: var(--text-soft);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary);
  filter: none; }
.btn-lg { padding: .85rem 1.55rem; font-size: 1rem; border-radius: 11px; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.hero-search button { border: 0; }

/* ---- sections --------------------------------------------------------- */
.block { margin: 2.7rem 0; }
.block-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.05rem;
}
.block-head h2 { margin: 0; }
.section-sub { color: var(--muted); margin: -.55rem 0 1.1rem; font-size: .95rem; }
.page-head { margin: 1.3rem 0 1.6rem; }
.page-head .lede { margin-left: 0; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 1.8rem; }
.prose ul { padding-left: 1.15rem; }
.see-all { font-weight: 650; font-size: .9rem; white-space: nowrap; }

/* ---- category tiles --------------------------------------------------- */
.cat-grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
}
.cat-tile {
  position: relative; display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1.2),
              border-color .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.cat-tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: linear-gradient(var(--primary), var(--accent));
  transform: scaleY(0); transform-origin: top; transition: transform .18s ease;
}
.cat-tile:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: var(--primary-line); box-shadow: var(--shadow);
}
.cat-tile:hover::before { transform: scaleY(1); }
.cat-tile h3 { margin-bottom: .25rem; }
.cat-tile p { color: var(--muted); font-size: .88rem; margin: 0 0 .75rem; }
.cat-count {
  font-size: .74rem; font-weight: 700; color: var(--primary);
  background: var(--primary-soft); padding: .18rem .6rem; border-radius: 999px;
  font-family: var(--mono); letter-spacing: -.02em;
}

/* ---- app cards -------------------------------------------------------- */
.grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(284px, 1fr));
}
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1.2),
              border-color .18s ease, box-shadow .18s ease;
}
.card:hover {
  transform: translateY(-3px); border-color: var(--primary-line);
  box-shadow: var(--shadow), 0 0 0 1px var(--primary-glow);
}
.card.is-hidden { display: none; }
.card-link { display: block; padding: 1.05rem 1.1rem; color: var(--text); height: 100%; }
.card-link:hover { text-decoration: none; }
.card-top { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; }
.card-icon, .app-icon {
  display: grid; place-items: center; flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 11px;
  background: linear-gradient(150deg,
    hsl(var(--h, 25) var(--tile-bg-s) var(--tile-bg-l)),
    hsl(var(--h, 25) var(--tile-bg-s) var(--tile-bg-l2)));
  color: hsl(var(--h, 25) var(--tile-fg-s) var(--tile-fg-l));
  font-weight: 800; font-size: .92rem; letter-spacing: .01em;
  border: 1px solid hsl(var(--h, 25) var(--tile-line-s) var(--tile-line-l));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .18s ease;
}
[data-theme="dark"] .card-icon, [data-theme="dark"] .app-icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.card:hover .card-icon { transform: scale(1.06) rotate(-2deg); }
.card-top h3 { margin: 0; font-size: 1.05rem; }
.card-cat { font-size: .76rem; color: var(--muted); }
.card-tagline { font-size: .89rem; color: var(--text-soft); margin: 0 0 .55rem; }
.card-alt { font-size: .8rem; color: var(--muted); margin: 0 0 .6rem; }
.card-alt b { color: var(--text-soft); font-weight: 650; }
.card-note {
  font-size: .8rem; color: var(--primary); font-weight: 650; margin: .55rem 0 0;
}
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem; }

/* subtle entrance for static grids (not the giant filterable ones) */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.grid:not([data-filter-grid]) .card:nth-child(-n+12) {
  animation: rise .4s cubic-bezier(.2, .7, .3, 1) both;
}
.grid:not([data-filter-grid]) .card:nth-child(2) { animation-delay: .04s; }
.grid:not([data-filter-grid]) .card:nth-child(3) { animation-delay: .08s; }
.grid:not([data-filter-grid]) .card:nth-child(4) { animation-delay: .12s; }
.grid:not([data-filter-grid]) .card:nth-child(5) { animation-delay: .16s; }
.grid:not([data-filter-grid]) .card:nth-child(6) { animation-delay: .2s; }

/* ---- badges + chips --------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .72rem; font-weight: 650; padding: .2rem .5rem;
  border-radius: 6px; background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.badge-star {
  color: var(--star);
  background: color-mix(in srgb, var(--star) 9%, var(--surface-2));
  border-color: color-mix(in srgb, var(--star) 28%, var(--border));
}
.badge-easy {
  color: var(--success);
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
}
.badge-hard {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 7%, var(--surface-2));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
}
a.badge:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border-strong);
  padding: .42rem .9rem; border-radius: 999px; font-size: .87rem;
  color: var(--text); font-weight: 560; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary);
  text-decoration: none; transform: translateY(-1px); }
.chip span {
  background: var(--primary-soft); color: var(--primary);
  font-size: .7rem; font-weight: 700; padding: .05rem .45rem;
  border-radius: 999px; font-family: var(--mono); letter-spacing: -.02em;
}
.chip-sm { font-size: .79rem; padding: .26rem .66rem; }
.chip-static { color: var(--muted); box-shadow: none; }
.chip-static:hover { border-color: var(--border-strong); color: var(--muted);
  transform: none; }

/* ---- link lists ------------------------------------------------------- */
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: .32rem 0; }
.link-list.cols { columns: 2; column-gap: 2.2rem; }
.link-list.cols li { break-inside: avoid; }
.link-list.big li {
  display: flex; justify-content: space-between; gap: 1rem;
  border-bottom: 1px solid var(--border); padding: .6rem 0;
}
.more { display: inline-block; margin-top: .7rem; font-weight: 650; font-size: .9rem; }

/* ---- filter bar ------------------------------------------------------- */
.browse { margin-top: 1rem; }
.filterbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .7rem;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius); padding: .8rem .9rem; margin-bottom: 1.1rem;
  box-shadow: var(--shadow-sm); position: sticky; top: 70px; z-index: 20;
}
.filter-text, .filter-cat, .filter-sort {
  padding: .5rem .75rem; border: 1px solid var(--border-strong);
  border-radius: 9px; background: var(--surface-2); color: var(--text);
  font-size: .88rem; font-family: var(--font);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.filter-text { flex: 1; min-width: 150px; }
.filter-text::placeholder { color: var(--muted); }
.filter-text:focus, .filter-cat:focus, .filter-sort:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow); background: var(--surface);
}
.pillset { display: flex; flex-wrap: wrap; gap: .35rem; }
.pill {
  display: inline-flex; align-items: center; cursor: pointer;
  font-size: .8rem; font-weight: 600; color: var(--text-soft);
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: .32rem .72rem; user-select: none; white-space: nowrap;
  text-transform: capitalize; background: var(--surface);
  transition: border-color .15s ease, background-color .15s ease,
              color .15s ease;
}
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill:hover { border-color: var(--primary); color: var(--primary); }
.pill:has(input:checked) {
  background: var(--primary); color: var(--btn-text);
  border-color: var(--primary);
}
[data-theme="dark"] .pill:has(input:checked) { color: #2b1304; }
.filter-meta { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.filter-count { font-size: .82rem; color: var(--muted); font-weight: 600;
  white-space: nowrap; }
.filter-reset {
  background: none; border: 0; color: var(--primary); cursor: pointer;
  font-size: .82rem; font-weight: 650; padding: .3rem .2rem; font-family: var(--font);
}
.filter-reset:hover { text-decoration: underline; }
.filter-empty {
  text-align: center; padding: 2.5rem 1rem; color: var(--muted);
  background: var(--surface-2); border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
}
.load-more { display: block; margin: 1.4rem auto 0; }

/* ---- watchlist (star button on cards + header counter) --------------- */
.watch-btn {
  position: absolute; top: .55rem; right: .55rem;
  display: grid; place-items: center; width: 30px; height: 30px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; color: var(--muted); padding: 0;
  z-index: 2; opacity: .5;
  transition: opacity .15s ease, color .15s ease, transform .15s ease;
}
.watch-btn svg { width: 16px; height: 16px; }
.card:hover .watch-btn { opacity: 1; }
.watch-btn:hover { color: var(--star); border-color: var(--star);
  transform: scale(1.08); }
.watch-btn.is-watched {
  color: var(--star); border-color: var(--star);
  background: color-mix(in srgb, var(--star) 12%, var(--surface)); opacity: 1;
}
.watch-btn.is-watched svg { fill: var(--star); }
.app-hero { position: relative; }
.watch-btn-hero { top: .85rem; right: .85rem; width: 36px; height: 36px; }
.watch-btn-hero svg { width: 18px; height: 18px; }
.icon-btn.watchlist-btn { position: relative; text-decoration: none; }
.icon-btn.watchlist-btn.has-items { color: var(--star); border-color: var(--star); }
.icon-btn.watchlist-btn.has-items svg { fill: var(--star); }
.watchlist-count[hidden] { display: none; }
.watchlist-count {
  position: absolute; top: -5px; right: -5px;
  background: var(--primary); color: var(--btn-text);
  font-size: .63rem; font-weight: 800; min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 4px; display: grid; place-items: center;
  border: 2px solid var(--bg); font-family: var(--mono);
}

/* ---- command palette (Ctrl+K) --------------------------------------- */
.palette[hidden] { display: none; }
.palette {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: start center; padding-top: 12vh;
}
.palette-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--bg) 55%, rgba(12, 8, 4, .55));
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.palette-modal {
  position: relative; width: min(640px, 92vw);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: rise .18s ease both;
}
.palette-input {
  width: 100%; padding: 1rem 1.2rem; border: 0;
  background: var(--surface); color: var(--text); font-size: 1rem;
  border-bottom: 1px solid var(--border); font-family: var(--font);
}
.palette-input:focus { outline: none; }
.palette-results { max-height: 60vh; overflow-y: auto; }
.palette-item {
  display: grid; grid-template-columns: 90px 1fr auto; align-items: center;
  gap: .8rem; padding: .65rem 1.1rem; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.palette-item:last-child { border-bottom: 0; }
.palette-item.active { background: var(--primary-soft); }
.palette-kind {
  font-size: .66rem; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: .06em;
}
.palette-label { color: var(--text); font-weight: 600; }
.palette-sub { color: var(--muted); font-size: .82rem; }
.palette-empty { padding: 1rem 1.2rem; color: var(--muted); }
.palette-hint {
  padding: .55rem 1.1rem; color: var(--muted); font-size: .76rem;
  background: var(--surface-2); border-top: 1px solid var(--border);
}
.palette-hint kbd {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-bottom-width: 2px; border-radius: 5px; padding: .1rem .35rem;
  font-family: var(--mono); font-size: .72rem; margin: 0 .15rem;
}

/* ---- multi-compare builder + stack builder shared bits --------------- */
.cmp-builder { margin: 1.2rem 0; }
.cmp-builder-tools {
  display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1rem;
  position: relative;
}
.cmp-builder-tools .filter-text { flex: 1; min-width: 220px; }
.cmp-builder-tools .search-results {
  top: 100%; left: 0; right: auto; width: 100%; max-width: 100%;
}
.mc-table { table-layout: fixed; }
.mc-table th, .mc-table td { vertical-align: top; word-wrap: break-word; }
.mc-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
}
.mc-head strong { font-size: 1.05rem; }
.mc-cat { font-size: .78rem; color: var(--muted); }
.mc-remove {
  background: none; border: 0; color: var(--danger);
  font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0;
  margin-top: .2rem;
}

/* ---- stack builder layout ------------------------------------------- */
.stack-layout {
  display: grid; gap: 1.4rem;
  grid-template-columns: 1fr 320px;
}
.stack-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow-sm);
  align-self: start; position: sticky; top: 80px;
}
.stack-sidebar h2 { font-size: 1.1rem; }
.stack-sidebar h3 {
  margin-top: 1.2rem; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
}
.stack-remove {
  position: absolute; top: .55rem; right: 2.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--danger); width: 30px; height: 30px;
  cursor: pointer; padding: 0; z-index: 2; opacity: .55;
  display: grid; place-items: center;
}
.stack-remove:hover { opacity: 1; border-color: var(--danger); }
@media (max-width: 860px) {
  .stack-layout { grid-template-columns: 1fr; }
  .stack-sidebar { position: static; }
}

/* ---- app page --------------------------------------------------------- */
.app-hero {
  position: relative; overflow: hidden;
  display: flex; gap: 1.2rem; align-items: flex-start;
  background:
    radial-gradient(70% 120% at 100% 0%, var(--primary-glow), transparent 58%),
    linear-gradient(180deg, var(--bg-tint), var(--surface) 85%);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 1.7rem 1.6rem; box-shadow: var(--shadow-sm); margin-bottom: 1.5rem;
}
.app-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(75% 110% at 100% 0%, #000 20%, transparent 75%);
          mask-image: radial-gradient(75% 110% at 100% 0%, #000 20%, transparent 75%);
}
.app-hero > * { position: relative; }
.app-hero .app-icon {
  width: 64px; height: 64px; font-size: 1.4rem; border-radius: 15px;
}
.app-hero h1 { margin: 0 0 .3rem; }
.app-hero .lede { margin: 0 0 .8rem; }
.app-cols { display: grid; gap: 1.7rem; grid-template-columns: 1fr 322px; }
.app-side {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.25rem;
  box-shadow: var(--shadow-sm);
  align-self: start; position: sticky; top: 80px;
}
.app-side h2 { font-size: 1.1rem; }
.app-side h3 { margin-top: 1.15rem; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); }
table.spec { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.spec th, table.spec td {
  text-align: left; padding: .55rem .15rem; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.spec tr:last-child th, table.spec tr:last-child td { border-bottom: 0; }
table.spec th { color: var(--muted); font-weight: 600; width: 42%; }
table.spec td { font-variant-numeric: tabular-nums; }

/* difficulty meter */
.meter { display: flex; gap: 4px; margin-top: .35rem; }
.meter span {
  height: 6px; flex: 1; border-radius: 3px; background: var(--surface-3);
}
.meter span.on {
  background: var(--accent);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent);
}
.meter.lvl1 span.on {
  background: var(--success);
  box-shadow: 0 0 6px color-mix(in srgb, var(--success) 40%, transparent);
}
.meter.lvl3 span.on {
  background: var(--danger);
  box-shadow: 0 0 6px color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ---- lists ------------------------------------------------------------ */
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding: .3rem 0 .3rem 1.75rem; position: relative; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .66rem;
  width: 13px; height: 7px; border-left: 2.5px solid var(--success);
  border-bottom: 2.5px solid var(--success); transform: rotate(-45deg);
}
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.proscons .col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.proscons .col.pros { border-top: 3px solid var(--success); }
.proscons .col.cons { border-top: 3px solid var(--danger); }
.proscons ul { padding-left: 1.15rem; margin: .2rem 0 0; }
.proscons li { padding: .15rem 0; }
.proscons h3 { display: flex; align-items: center; gap: .4rem; }
.pros h3 { color: var(--success); }
.cons h3 { color: var(--danger); }

/* ---- comparison ------------------------------------------------------- */
.vs-head {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: stretch; gap: 1rem; margin-bottom: 1.3rem;
}
.vs-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .45rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.35rem 1rem; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.vs-card:hover { border-color: var(--primary-line); text-decoration: none;
  transform: translateY(-2px); box-shadow: var(--shadow); }
.vs-card .card-icon { width: 52px; height: 52px; font-size: 1.05rem; }
.vs-card .muted { font-size: .82rem; }
.vs-badge {
  display: grid; place-items: center; align-self: center;
  font-weight: 800; font-size: .92rem; letter-spacing: .02em;
  color: var(--btn-text);
  background: linear-gradient(145deg, #d0500f, #9a3412);
  border-radius: 50%; width: 52px; height: 52px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3),
              0 4px 14px var(--primary-glow),
              0 0 0 5px var(--primary-soft);
}
[data-theme="dark"] .vs-badge {
  background: linear-gradient(145deg, #f8a869, #ec7c26); color: #2b1304;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .vs-badge {
    background: linear-gradient(145deg, #f8a869, #ec7c26); color: #2b1304;
  }
}
.verdict {
  display: flex; gap: .95rem; align-items: flex-start;
  background:
    linear-gradient(120deg, var(--primary-soft), transparent 70%), var(--surface);
  border: 1px solid var(--primary-line); border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 1.15rem 1.25rem; margin: 1.3rem 0;
  box-shadow: var(--shadow-sm);
}
.verdict-icon {
  flex-shrink: 0; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(145deg, #d0500f, #9a3412);
  color: #fff8f2; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.verdict-label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--primary); font-weight: 800;
}
.verdict p { margin: .15rem 0 0; }
.compare-table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-table th, .compare-table td {
  padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border);
}
.compare-table thead th {
  background: var(--surface-2); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted);
}
.compare-table tbody th { color: var(--muted); font-weight: 600; width: 28%; }
.compare-table td { font-variant-numeric: tabular-nums; }
.compare-table tbody tr:hover td, .compare-table tbody tr:hover th {
  background: var(--surface-2);
}
.compare-table tr:last-child td, .compare-table tr:last-child th { border-bottom: 0; }
.cell-win {
  color: var(--success); font-weight: 700;
  background: var(--success-soft);
}
.cell-win::after { content: " \25B2"; font-size: .68em; vertical-align: .15em; }
.compare-table tbody tr:hover td.cell-win {
  background: color-mix(in srgb, var(--success) 12%, var(--surface-2));
}
.cmp-picker {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .7rem 1rem; margin: 1.1rem 0;
  font-size: .87rem; box-shadow: var(--shadow-sm);
}
.cmp-picker-label { font-weight: 700; color: var(--text-soft); }
.cmp-picker label {
  display: flex; align-items: center; gap: .4rem; color: var(--muted);
}
.cmp-jump {
  padding: .4rem .55rem; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface-2); color: var(--text);
  font-size: .85rem; font-family: var(--font); max-width: 210px;
}
.cmp-jump:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ---- faq -------------------------------------------------------------- */
.faq {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: .1rem 1.05rem; margin-bottom: .55rem;
  transition: border-color .15s ease;
}
.faq:hover { border-color: var(--border-strong); }
.faq summary {
  cursor: pointer; font-weight: 650; padding: .8rem 0; list-style: none;
  display: flex; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; color: var(--primary); font-weight: 800;
  transition: transform .18s ease;
}
.faq[open] summary::after { content: "+"; transform: rotate(45deg); }
.faq p { margin: 0 0 .9rem; color: var(--text-soft); }

/* ---- charts (stats) --------------------------------------------------- */
.statgrid {
  display: grid; gap: .9rem; margin: 1.3rem 0 2rem;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.statbox {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem 1.2rem 1.05rem;
  box-shadow: var(--shadow-sm);
}
.statbox::before {
  content: ""; position: absolute; top: 0; left: 1.2rem; width: 30px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.statbox strong {
  display: block; font-size: 1.8rem; font-weight: 700;
  font-family: var(--mono); letter-spacing: -.045em; color: var(--text);
  margin-top: .25rem;
}
.statbox span {
  font-size: .74rem; color: var(--muted); font-weight: 650;
  text-transform: uppercase; letter-spacing: .07em;
}
.chart { display: flex; flex-direction: column; gap: .45rem; }
.chart-row {
  display: grid; grid-template-columns: 165px 1fr 56px; align-items: center;
  gap: .7rem; font-size: .87rem;
}
.chart-label { color: var(--text-soft); text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-label a { color: var(--text-soft); }
.chart-label a:hover { color: var(--primary); }
.chart-track {
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
  border-radius: 6px; height: 12px; overflow: hidden;
}
.chart-bar {
  display: block; height: 100%; border-radius: 2px 4px 4px 2px;
  background: var(--chart-bar);
  min-width: 3px;
}
.chart-value {
  color: var(--muted); font-weight: 600; font-family: var(--mono);
  font-size: .8rem; letter-spacing: -.02em;
}

/* ---- comparison cards (home) ----------------------------------------- */
.cmp-grid {
  display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.cmp-card {
  display: flex; flex-direction: column; gap: .25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .9rem 1.05rem; color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.cmp-card:hover { border-color: var(--primary-line); text-decoration: none;
  transform: translateY(-2px); box-shadow: var(--shadow); }
.cmp-card .cmp-vs { font-weight: 700; letter-spacing: -.01em; }
.cmp-card .cmp-vs em {
  color: var(--primary); font-style: normal; font-weight: 800;
  font-size: .78em; padding: 0 .1em; text-transform: uppercase;
}
.cmp-card .cmp-cat { font-size: .78rem; color: var(--muted); }

/* ---- value props ----------------------------------------------------- */
.props { display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.prop {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease;
}
.prop:hover { transform: translateY(-2px); border-color: var(--primary-line); }
.prop-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 11px; background: var(--primary-soft); color: var(--primary);
  font-weight: 800; margin-bottom: .75rem; font-size: 1.1rem;
  border: 1px solid var(--primary-line);
}
.prop h3 { margin-bottom: .3rem; }
.prop p { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---- callout / cta --------------------------------------------------- */
.cta-band {
  position: relative; overflow: hidden;
  text-align: center; background:
    radial-gradient(70% 130% at 50% 0%, var(--primary-glow), transparent 70%),
    linear-gradient(180deg, var(--bg-tint), var(--surface));
  border: 1px solid var(--border); border-radius: 18px;
  padding: 2.6rem 1.4rem;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: radial-gradient(60% 90% at 50% 0%, #000 25%, transparent 78%);
          mask-image: radial-gradient(60% 90% at 50% 0%, #000 25%, transparent 78%);
}
.cta-band > * { position: relative; }
.cta-band h2 { margin-bottom: .4rem; }
.cta-band p { color: var(--muted); max-width: 52ch; margin: 0 auto 1.2rem; }

/* ---- search page ------------------------------------------------------ */
.search-page-results { margin-top: 1.4rem; }
.search-page-results .grid { margin-top: .8rem; }

/* ---- footer ----------------------------------------------------------- */
.site-footer {
  background: var(--bg-tint);
  border-top: 1px solid var(--border);
  margin-top: 4rem; padding: 2.6rem 0 1.6rem;
}
.footer-grid {
  display: grid; gap: 1.5rem;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
}
.footer-grid h3 {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--muted); margin-bottom: .6rem;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { padding: .18rem 0; font-size: .88rem; }
.footer-grid a { color: var(--text-soft); }
.footer-grid a:hover { color: var(--primary); }
.brand-footer { font-size: 1.08rem; margin-bottom: .45rem; }
.footer-base {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  margin-top: 1.9rem; padding-top: 1.1rem; border-top: 1px solid var(--border);
  font-size: .82rem;
}

/* ---- sponsor (affiliate CTA) ------------------------------------------ */
.sponsor {
  margin: 1.6rem 0;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  background:
    linear-gradient(120deg, var(--accent-soft), transparent 60%),
    var(--surface);
}
.sponsor-head h3 {
  margin: .35rem 0 .25rem; font-size: 1.05rem;
}
.sponsor-tag {
  display: inline-block;
  font-size: .64rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
  background: var(--surface-2); padding: .18rem .55rem;
  border-radius: 999px; border: 1px solid var(--border);
}
.sponsor-grid {
  display: grid; gap: .7rem; margin-top: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.sponsor-card {
  display: flex; flex-direction: column; gap: .25rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem .95rem;
  color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease;
}
.sponsor-card:hover {
  border-color: var(--primary); text-decoration: none;
  transform: translateY(-2px);
}
.sponsor-card strong { font-size: 1rem; }
.sponsor-tagline { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.sponsor-cta {
  color: var(--primary); font-weight: 650; font-size: .85rem;
  margin-top: .35rem;
}

/* ---- share ------------------------------------------------------------ */
.share {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  margin: 1.5rem 0 .5rem;
}
.share-label {
  font-size: .72rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-right: .1rem;
}
.share-btn {
  font-size: .84rem; font-weight: 600; padding: .42rem .9rem;
  border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-soft); cursor: pointer;
  font-family: var(--font); line-height: 1.3;
  transition: border-color .15s ease, color .15s ease;
}
.share-btn:hover {
  border-color: var(--primary); color: var(--primary); text-decoration: none;
}
.share-btn.copied { border-color: var(--success); color: var(--success); }

/* ---- misc ------------------------------------------------------------- */
.notfound { text-align: center; padding: 4rem 1rem; }
.notfound .big404 {
  font-size: clamp(4rem, 14vw, 8rem); font-weight: 800; line-height: 1;
  font-family: var(--mono); letter-spacing: -.06em;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- blog -------------------------------------------------------------- */
.blog-grid {
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.post-card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.3rem;
  color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1.2),
              border-color .18s ease, box-shadow .18s ease;
}
.post-card:hover {
  text-decoration: none; transform: translateY(-3px);
  border-color: var(--primary-line); box-shadow: var(--shadow);
}
.post-card h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.post-card p { margin: 0; color: var(--muted); font-size: .89rem; }
.post-kicker {
  font-size: .68rem; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--primary);
}
a.post-kicker:hover { text-decoration: none; color: var(--primary-dark); }
.post-byline {
  font-size: .8rem; color: var(--muted);
  font-variant-numeric: tabular-nums; margin-top: auto;
}
.post-card-featured {
  position: relative; overflow: hidden; padding: 2rem 2.1rem;
  background:
    radial-gradient(70% 130% at 100% 0%, var(--primary-glow), transparent 60%),
    linear-gradient(180deg, var(--bg-tint), var(--surface) 85%);
}
.post-card-featured h3 {
  font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); letter-spacing: -.025em;
  max-width: 30ch;
}
.post-card-featured p { font-size: .98rem; max-width: 64ch; }

/* article */
.article { max-width: 760px; }
.article-head { margin: 1.2rem 0 1.8rem; }
.article-head h1 { margin: .5rem 0 .6rem; }
.article-head .lede { margin: 0 0 .8rem; }
.article-body { font-size: 1.02rem; line-height: 1.72; }
.article-body h2 {
  margin: 2.4rem 0 .9rem; padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.article-body h3 { margin: 1.8rem 0 .6rem; }
.article-body p { margin: 0 0 1.05rem; }
.article-body ul, .article-body ol { padding-left: 1.35rem; margin: 0 0 1.05rem; }
.article-body li { margin: .3rem 0; }
.article-body a { font-weight: 600; }
.article-body pre {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: .95rem 1.1rem; overflow-x: auto;
  font-size: .84rem; line-height: 1.6; margin: 0 0 1.15rem;
}
.article-body pre code {
  background: none; border: 0; padding: 0; font-size: inherit;
}
.article-body blockquote {
  margin: 0 0 1.05rem; padding: .2rem 0 .2rem 1.1rem;
  border-left: 3px solid var(--primary-line); color: var(--text-soft);
}
.article-body blockquote p { margin: 0; }
.article-body hr { margin: 2rem 0; }
.table-wrap { overflow-x: auto; margin: 0 0 1.15rem; }
.table-wrap table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: .9rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.table-wrap th, .table-wrap td {
  text-align: left; padding: .55rem .8rem;
  border-bottom: 1px solid var(--border);
}
.table-wrap thead th {
  background: var(--surface-2); font-size: .74rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td { font-variant-numeric: tabular-nums; }
.post-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: 1.6rem 0 .4rem; }
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; margin: 2rem 0;
}
.post-nav-link {
  display: flex; flex-direction: column; gap: .2rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem;
  color: var(--text); font-weight: 600; font-size: .92rem;
  transition: border-color .15s ease;
}
.post-nav-link:hover { border-color: var(--primary); text-decoration: none; }
.post-nav-link span {
  font-size: .7rem; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.post-nav-next { text-align: right; margin-left: auto; width: 100%; }
@media (max-width: 540px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-card-featured { padding: 1.4rem 1.2rem; }
}

/* ---- print ------------------------------------------------------------ */
@media print {
  .site-header, .site-footer, .share, .cmp-picker, .watch-btn, .palette,
  .hero-cta, .hero-search, .btn-row, .sponsor, .filterbar { display: none !important; }
  body { background: #fff; color: #000; }
  .app-side, .card, .compare-table, .vs-card, .verdict {
    box-shadow: none; border-color: #bbb;
  }
  a { color: #000; text-decoration: underline; }
  .compare-table th, .compare-table td { border-bottom: 1px solid #ccc; }
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 920px) {
  .app-cols { grid-template-columns: 1fr; }
  .app-side { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .chart-row { grid-template-columns: 120px 1fr 50px; }
}
@media (max-width: 760px) {
  .main-nav { display: none; }
  .nav-toggle { display: grid; }
  .header-inner.nav-open + .mobile-nav, .mobile-nav.open { display: flex; }
  .search input[type=search] { width: 150px; }
  .link-list.cols { columns: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .filterbar { position: static; }
  .hero-stats div { padding: 0 1.15rem; }
}
@media (max-width: 540px) {
  .proscons { grid-template-columns: 1fr; }
  .vs-head { grid-template-columns: 1fr; }
  .vs-badge { justify-self: center; }
  .hero { padding: 2.5rem 1rem 2.2rem; }
  .hero-stats { gap: 1rem 0; }
  .hero-stats div { padding: 0 .9rem; }
  .hero-stats strong { font-size: 1.3rem; }
  .app-hero { padding: 1.25rem 1.1rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .compare-table { font-size: .83rem; }
  .compare-table th, .compare-table td { padding: .5rem .5rem; }
  .chart-row { grid-template-columns: 92px 1fr 44px; font-size: .8rem; }
  .search-results { width: 84vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important; animation: none !important;
    scroll-behavior: auto !important;
  }
}
