:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #151a22;
  --muted: #5f6b7c;
  --line: #e0e5ec;
  --accent: #e2571a;
  --accent-ink: #ffffff;
  --amazon: #ff9900;
  --amazon-ink: #1a1200;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.05);
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --surface: #151b24;
    --surface-2: #1b2330;
    --text: #eef2f8;
    --muted: #9aa7ba;
    --line: #253041;
    --accent: #ff7a3d;
    --accent-ink: #180a03;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 30px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 0.5rem; }

.sr-only,
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  clip: auto;
  z-index: 50;
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

.muted { color: var(--muted); }

.fineprint {
  margin-top: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand span { color: var(--accent); }
.brand small { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-link {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.35rem 0.15rem;
  border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.is-active { color: var(--text); border-bottom-color: var(--accent); }

.count {
  display: inline-block;
  min-width: 1.15rem;
  padding: 0 0.3rem;
  margin-left: 0.15rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.7rem;
  line-height: 1.3rem;
  text-align: center;
  vertical-align: middle;
}

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 22rem;
  max-width: 34rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.25rem 0.2rem 0.95rem;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  padding: 0.45rem 0;
}

.search input:focus { outline: none; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.mic,
.search-submit {
  border: 0;
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
}

.mic {
  background: transparent;
  font-size: 1rem;
  padding: 0.35rem 0.5rem;
  line-height: 1;
}

.mic:hover { background: var(--surface); }

.mic.is-listening {
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.mic.is-unsupported { opacity: 0.55; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent); }
}

.search-submit {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.95rem;
}

.search-large { max-width: 40rem; margin: 1.5rem 0 0.75rem; padding: 0.35rem 0.35rem 0.35rem 1.15rem; }
.search-large input { font-size: 1.02rem; padding: 0.65rem 0; }
.search-large .search-submit { padding: 0.7rem 1.25rem; }

.disclosure-bar {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 1rem;
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.disclosure-bar a { color: var(--accent); }

/* Hero */
.hero {
  background:
    radial-gradient(70% 90% at 85% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3.25rem 1.25rem 2.75rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 0.9rem;
}

.hero h1 span { color: var(--accent); }

.lede {
  max-width: 44rem;
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
}

.hero-stats { margin: 1rem 0 0; font-size: 0.82rem; color: var(--muted); }

/* Sections */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.section-head h2 { font-size: 1.45rem; margin: 0 0 0.75rem; }
.section-head h3 { font-size: 1.2rem; margin: 0 0 0.75rem; }
.section-head h3 a { text-decoration: none; }
.section-head h3 a:hover { color: var(--accent); }

.more { font-size: 0.86rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.more:hover { text-decoration: underline; }

.sub-section { margin-top: 2rem; }

.notice {
  margin: 0.5rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--amazon) 45%, var(--line));
  border-left: 4px solid var(--amazon);
  border-radius: 10px;
  background: color-mix(in srgb, var(--amazon) 9%, var(--surface));
  font-size: 0.88rem;
  color: var(--text);
}

.empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Grid and cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }

.thumb {
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 0.75rem; background: #fff; }

.thumb-fallback { color: #fff; font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }

.card-body { display: flex; flex-direction: column; gap: 0.45rem; padding: 0.9rem 1rem 1rem; flex: 1; }

.card-flags { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }

.rank { font-size: 0.74rem; color: var(--muted); font-weight: 600; }

.card-title { font-size: 0.98rem; margin: 0; }
.card-title a { text-decoration: none; }
.card-title a:hover { color: var(--accent); }

.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 0.6rem; font-size: 0.85rem; }
.rating { color: var(--muted); font-size: 0.79rem; }

.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: auto; padding-top: 0.6rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.btn-amazon { background: var(--amazon); color: var(--amazon-ink); flex: 1; }
.btn-amazon:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 0.75rem 1.2rem; font-size: 0.92rem; }
.btn svg { width: 0.95rem; height: 0.95rem; flex-shrink: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn svg { width: 1rem; height: 1rem; }

.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Category tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.4rem 1.2rem;
  border-radius: var(--radius);
  color: #fff;
  text-decoration: none;
  min-height: 8.5rem;
  justify-content: flex-end;
  box-shadow: var(--shadow);
}

.tile:hover { filter: brightness(1.06); }
.tile-name { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.tile-meta { font-size: 0.78rem; opacity: 0.85; }

/* Restore the six distinct category tiles. The .tc classes are also used by
   image fallbacks, so each category keeps a recognisable color. */
.tc0 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.2), transparent 45%), linear-gradient(135deg, #c2410c, #7c2d12); }
.tc1 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(135deg, #1d4ed8, #1e3a8a); }
.tc2 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(135deg, #15803d, #14532d); }
.tc3 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(135deg, #7e22ce, #4c1d95); }
.tc4 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(135deg, #be123c, #881337); }
.tc5 { background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%), linear-gradient(135deg, #0f766e, #134e4a); }

.chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 0; }

.chip {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 600;
}

.chip:hover { border-color: var(--accent); color: var(--accent); }

/* Breadcrumbs and titles */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0; margin: 0 0 1rem; font-size: 0.8rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--line); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }

.page-title { font-size: clamp(1.65rem, 3.6vw, 2.35rem); margin-bottom: 0.5rem; }

/* Item page */
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 2rem; align-items: start; margin-top: 1rem; }
.item-layout--text { grid-template-columns: minmax(0, 1fr); }
.item-media .thumb { border-radius: var(--radius); border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.item-media .thumb img { padding: 1.5rem; }
.item-main { display: flex; flex-direction: column; gap: 0.6rem; }
.rating-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.6rem; }

.item-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 0.35rem; }

/* Prose */
.prose { max-width: 52rem; }
.prose h2 { font-size: 1.15rem; margin: 1.75rem 0 0.4rem; }
.prose p, .prose li { color: var(--muted); }
.prose ul { padding-left: 1.2rem; }
.prose code { background: var(--surface-2); padding: 0.1rem 0.35rem; border-radius: 5px; font-size: 0.86em; }
.prose a { color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 1rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 2rem;
  font-size: 0.84rem;
}

.footer-brand { font-weight: 800; margin: 0 0 0.4rem; }
.footer-inner nav { display: flex; flex-direction: column; gap: 0.4rem; }
.footer-inner nav a { text-decoration: none; color: var(--muted); }
.footer-inner nav a:hover { color: var(--accent); }
.copyright { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem 1.75rem; font-size: 0.76rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 60;
}

/* Error */
.error-page { min-height: 45vh; }

@media (max-width: 860px) {
  .header-inner { flex-wrap: wrap; gap: 0.6rem 1rem; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .nav { margin-left: auto; }
  .item-layout { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero-inner { padding-top: 2.25rem; }
}

@media (max-width: 520px) {
  .nav-link { font-size: 0.82rem; }
  .section { padding: 1.5rem 1rem 2.25rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.75rem; }
  .card-body { padding: 0.75rem; }
  .card-why { display: none; }
  .search-submit { padding: 0.5rem 0.7rem; }
}
