/* pokedrill — site-wide styles
   Light theme, mobile-first, system fonts. */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --fg: #1a1a2e;
  --fg-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-fg: #ffffff;
  --highlight: #fef3c7;
  --radius: 12px;
  --container: 1100px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.site-header-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.brand {
  font-weight: 700; font-size: 1.2rem; color: var(--fg); text-decoration: none;
}
.brand-mark { color: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; }
.site-nav a {
  color: var(--fg-muted); font-size: .95rem; font-weight: 500;
  text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { color: var(--fg); }
.site-nav a[aria-current="page"] { color: var(--fg); border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

@media (max-width: 640px) {
  .site-nav { gap: .75rem; font-size: .85rem; }
  .site-nav a { font-size: .85rem; }
  .site-header-row { flex-wrap: wrap; height: auto; padding: .5rem 0; }
}

/* ── Hero ── */
.hero {
  padding: 2.5rem 1.25rem 1.5rem;
  text-align: center;
}
.hero h1 {
  font-size: 2rem; line-height: 1.2; margin: 0 0 .75rem;
}
.hero-tagline {
  font-size: 1.1rem; color: var(--fg); font-weight: 500;
  margin: 0 0 .75rem; max-width: 640px; margin-left: auto; margin-right: auto;
}
.hero-lede {
  font-size: 1rem; color: var(--fg-muted); max-width: 680px;
  margin: 0 auto 1.5rem;
}
.hero-ctas { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.cta {
  display: inline-block; padding: .65rem 1.25rem; border-radius: 8px;
  font-weight: 500; text-decoration: none;
}
.cta-primary { background: var(--accent); color: var(--accent-fg); }
.cta-primary:hover { background: #1e54d5; text-decoration: none; }
.cta-secondary { background: var(--surface); color: var(--fg); border: 1px solid var(--border); }
.cta-secondary:hover { background: #f3f4f6; text-decoration: none; }

@media (min-width: 640px) {
  .hero h1 { font-size: 2.5rem; }
}

/* ── Body sections ── */
.body-section {
  margin: 2rem auto;
  max-width: 720px;
}
.body-section h2 {
  font-size: 1.4rem; line-height: 1.3; margin: 0 0 .75rem;
  color: var(--fg);
}
.body-section p { margin: 0 0 1rem; }

.feature-bullets {
  list-style: none; padding: 0; margin: 1rem 0;
}
.feature-bullets li {
  padding: .5rem .85rem; border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 4px;
  margin-bottom: .5rem;
}

/* ── Quiz section ── */
.quiz-section { padding: 1rem 0 2rem; }

/* ── FAQ ── */
.faq-section { max-width: 720px; margin: 3rem auto; }
.faq-section h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 0 1rem; margin-bottom: .5rem;
}
.faq-item summary {
  padding: .85rem 0; cursor: pointer; font-weight: 500;
  list-style: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: .85rem;
  font-size: 1.2rem; color: var(--fg-muted);
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 0 1rem; color: var(--fg-muted); }

/* ── Related links ── */
.related-section { max-width: 720px; margin: 2rem auto 3rem; }
.related-section h2 { font-size: 1.4rem; margin: 0 0 1rem; }
.related-links { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.related-links li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 1rem;
}
.related-links a { color: var(--accent); text-decoration: none; }
.related-links a:hover { text-decoration: underline; }
.related-context {
  display: block; color: var(--fg-muted); font-size: .9rem;
  margin-top: .35rem;
}

/* ── Sprite grid (info-hub) ── */
.sprite-grid-controls {
  background: var(--surface); padding: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 1rem;
}
.sprite-grid-controls input[type=search] {
  width: 100%; padding: .6rem .85rem;
  border: 1px solid var(--border); border-radius: 8px; font-size: 1rem;
  margin-bottom: .5rem;
}
.grid-filter-row {
  display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;
}
.grid-filter-row label { font-size: .9rem; color: var(--fg-muted); }
.grid-filter-row select {
  padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; font-size: .9rem;
}
.grid-count { font-size: .85rem; color: var(--fg-muted); margin: .75rem 0 0; }

.sprite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: .5rem;
}
.sprite-cell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .35rem; text-align: center;
  font-size: .7rem; color: var(--fg-muted);
  cursor: pointer; transition: transform .1s;
}
.sprite-cell:hover { transform: translateY(-2px); }
.sprite-cell img {
  width: 64px; height: 64px; object-fit: contain;
  image-rendering: pixelated;
}
.sprite-cell-name { display: block; font-weight: 500; color: var(--fg); }
.sprite-cell-id { display: block; opacity: .7; }

/* ── Count table (info-hub) ── */
.count-summary {
  text-align: center; padding: 1.5rem 0;
}
.count-big {
  display: block; font-size: 4rem; font-weight: 700;
  color: var(--accent); line-height: 1;
}
.count-label { display: block; color: var(--fg-muted); font-size: 1rem; margin-top: .35rem; }
.count-table {
  width: 100%; border-collapse: collapse; margin: 1rem 0 2rem;
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
}
.count-table th, .count-table td {
  padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--border);
}
.count-table thead th { background: #f9fafb; font-weight: 600; font-size: .9rem; }
.count-table tfoot th { background: #f9fafb; font-weight: 700; }

/* ── Hardest list (data-bound at runtime) ── */
.hardest-board-intro { color: var(--fg-muted); margin: 0 0 1rem; }
.hardest-list { list-style: none; padding: 0; counter-reset: rank; }
.hardest-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: .65rem 1rem; margin-bottom: .35rem;
  display: flex; align-items: center; gap: .85rem;
  counter-increment: rank;
}
.hardest-list li::before {
  content: counter(rank);
  font-weight: 700; color: var(--fg-muted); min-width: 2rem;
}
.hardest-loading { color: var(--fg-muted); font-style: italic; }
.hardest-list img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.hardest-list-name { font-weight: 600; flex: 1; }
.hardest-list-rate { color: var(--accent); font-weight: 600; }

/* ── Footer ── */
.site-footer {
  margin-top: 4rem; background: var(--surface); border-top: 1px solid var(--border);
  padding: 2.5rem 0 1.5rem;
}
.footer-nav {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem; margin-bottom: 2rem;
}
.footer-col h3 {
  font-size: .85rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--fg-muted); margin: 0 0 .65rem;
}
.footer-col a { display: block; padding: .15rem 0; color: var(--fg); font-size: .92rem; }
.footer-col a:hover { color: var(--accent); }
.footer-disclaimer {
  font-size: .8rem; color: var(--fg-muted); line-height: 1.5;
  border-top: 1px solid var(--border); padding-top: 1.25rem;
}
