/* ==========================================================================
   HomageFinder
   Single stylesheet, no external fonts or frameworks — the whole page paints
   from one request.
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef0f4;
  --border: #dce0e8;
  --text: #1a1f27;
  --muted: #5c6779;
  /* --brand is the fixed logo red, used for solid fills where the text on top
     is always white. --accent is the theme-adjusted red for links and borders,
     which has to stay readable on each background. */
  --brand: #c8102e;
  --brand-ink: #ffffff;
  --accent: #b3162a;
  --accent-soft: #fdecee;
  --star: #b8860b;   /* ratings stay gold — a red star reads as a warning */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 22, 32, .06), 0 4px 16px rgba(16, 22, 32, .05);
  --shadow-lift: 0 2px 6px rgba(16, 22, 32, .1), 0 12px 32px rgba(16, 22, 32, .1);
  --maxw: 1240px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11161d;
    --surface: #171e27;
    --surface-2: #1e2732;
    --border: #2a3441;
    --text: #e6e9ef;
    --muted: #8d99ab;
    --brand: #c8102e;
    --brand-ink: #ffffff;
    --accent: #ff6b76;
    --accent-soft: #33171a;
    --star: #e0b55f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --shadow-lift: 0 2px 6px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
  }
}

:root[data-theme="dark"] {
  --bg: #11161d;
  --surface: #171e27;
  --surface-2: #1e2732;
  --border: #2a3441;
  --text: #e6e9ef;
  --muted: #8d99ab;
  --brand: #c8102e;
  --brand-ink: #ffffff;
  --accent: #ff6b76;
  --accent-soft: #33171a;
  --star: #e0b55f;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

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

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); font-weight: 650; }
h2 { font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem); font-weight: 620; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: var(--brand-ink); padding: .6rem 1rem; z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- masthead */

.masthead {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.masthead__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: .7rem 16px;
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--text); font-size: 1.1rem; letter-spacing: -.02em;
  margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand__mark { display: inline-flex; line-height: 0; }
.brand__text { font-weight: 450; }
.brand__text strong { font-weight: 680; }

.nav { display: flex; gap: .2rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  padding: .4rem .7rem;
  border-radius: var(--radius-sm);
  font-size: .925rem;
  white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.is-current { color: var(--text); background: var(--surface-2); font-weight: 550; }

/* Checkbox-driven mobile nav — no JavaScript. */
.navtoggle, .navtoggle__btn { display: none; }

@media (max-width: 720px) {
  .navtoggle__btn {
    display: flex; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 36px; padding: 0 8px; cursor: pointer;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
  }
  .navtoggle__btn span {
    display: block; height: 2px; background: var(--text); border-radius: 2px;
    transition: transform .18s ease, opacity .18s ease;
  }
  .nav {
    display: none; width: 100%; flex-direction: column; gap: 0;
    padding-top: .5rem;
  }
  .navtoggle:checked ~ .nav { display: flex; }
  .navtoggle:checked ~ .navtoggle__btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .navtoggle:checked ~ .navtoggle__btn span:nth-child(2) { opacity: 0; }
  .navtoggle:checked ~ .navtoggle__btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav a { padding: .6rem .5rem; border-radius: 0; }
}

/* ------------------------------------------------------------------ layout */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem 16px 3rem;
}

.prose { max-width: 68ch; }
.prose p { margin: 0 0 1rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .4rem; }

.lede { color: var(--muted); font-size: 1.05rem; margin: -.2rem 0 1.5rem; max-width: 70ch; }

.pagehead { margin-bottom: 1.5rem; }

/* ------------------------------------------------------------------ notice */

.notice {
  display: flex; gap: .7rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  margin: 0 0 1.5rem;
  font-size: .925rem; color: var(--muted);
}
.notice strong { color: var(--text); }
.notice--warn { border-left-color: #c2410c; }

/* -------------------------------------------------------------------- bar */

.bar {
  display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
  padding: .75rem 0 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.bar__count { color: var(--muted); font-size: .925rem; }
.bar__count strong { color: var(--text); font-variant-numeric: tabular-nums; }
.bar__sort { display: flex; align-items: center; gap: .4rem; margin-left: auto; flex-wrap: wrap; }
.bar__sort-label { color: var(--muted); font-size: .875rem; }

.chip {
  display: inline-block;
  padding: .3rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: .875rem;
}
.chip:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 550;
}

/* ------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 1rem;
}

.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.card__media { background: var(--surface-2); aspect-ratio: 1; }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card__body { padding: .6rem .7rem .7rem; display: flex; flex-direction: column; gap: .35rem; }
.card__name {
  font-size: .9rem; font-weight: 550; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__meta { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.card__price { font-size: .95rem; font-weight: 620; font-variant-numeric: tabular-nums; }
.card__price--unknown { font-size: .825rem; font-weight: 500; color: var(--muted); }
.card__rating { font-size: .825rem; color: var(--star); white-space: nowrap; }

/* ----------------------------------------------------------------- pager */

.pager {
  display: flex; gap: .3rem; flex-wrap: wrap; align-items: center;
  justify-content: center;
  margin: 2.25rem 0 .5rem;
}
.pager a, .pager__current {
  min-width: 2.35rem; padding: .45rem .6rem;
  text-align: center; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface);
  font-size: .925rem; font-variant-numeric: tabular-nums;
}
.pager a { color: var(--muted); }
.pager a:hover { text-decoration: none; border-color: var(--accent); color: var(--text); }
.pager__current { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 620; }
.pager__step { font-weight: 550; }
.pager__gap { color: var(--muted); padding: 0 .2rem; }

/* ----------------------------------------------------------- filter form */

/* align-items:start keeps each fieldset at its natural height — the default
   stretch left the shortest column as a mostly-empty box. */
.filters {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  align-items: start;
}

.fieldset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.2rem;
  margin: 0;
}
.fieldset > legend {
  font-weight: 620; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); padding: 0 .4rem; margin-left: -.4rem;
}

.field { margin-bottom: .85rem; }
.field:last-child { margin-bottom: 0; }
.field > label { display: block; font-size: .875rem; color: var(--muted); margin-bottom: .3rem; }
.field__hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }

input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%;
  padding: .5rem .65rem;
  font: inherit; font-size: .925rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

.range { display: flex; align-items: center; gap: .5rem; }
.range input { flex: 1; min-width: 0; }
.range span { color: var(--muted); font-size: .875rem; }

.checks { display: grid; gap: .35rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.check input { width: 1rem; height: 1rem; accent-color: var(--accent); flex: none; }

.actions {
  display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-block;
  padding: .6rem 1.4rem;
  font: inherit; font-size: .95rem; font-weight: 600;
  color: var(--brand-ink); background: var(--brand);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border); font-weight: 550; }
.btn--ghost:hover { border-color: var(--accent); filter: none; }
.btn--block { display: block; width: 100%; text-align: center; }

/* -------------------------------------------------------------- product */

.product { display: grid; gap: 2rem; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .product { grid-template-columns: 1fr; gap: 1.5rem; } }

.product__media {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky; top: 5rem;
}
@media (max-width: 860px) { .product__media { position: static; } }
.product__media img { width: 100%; display: block; aspect-ratio: 1; object-fit: cover; }

.product__buy { padding: 1rem; border-top: 1px solid var(--border); display: grid; gap: .6rem; }
.product__price { font-size: 1.05rem; }
.product__price strong { font-size: 1.5rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.product__price-note { display: block; color: var(--muted); font-size: .825rem; }

.homage-banner {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  margin-bottom: 1.5rem;
}
.homage-banner__label { font-size: .775rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: .15rem; }
.homage-banner__name { font-size: 1.2rem; font-weight: 640; }

.rating-row { display: flex; align-items: center; gap: .6rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stars { position: relative; display: inline-block; color: var(--border); font-size: 1.05rem; letter-spacing: .1em; }
.stars__fill { position: absolute; inset: 0; overflow: hidden; color: var(--star); white-space: nowrap; }
.rating-row__text { color: var(--muted); font-size: .9rem; }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1.5rem; margin: 0; }
.specs div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .55rem 0; border-bottom: 1px solid var(--border);
  font-size: .925rem;
}
.specs dt { color: var(--muted); }
.specs dd { margin: 0; text-align: right; font-weight: 520; }

.shoplinks { display: grid; gap: .5rem; margin-top: 1.5rem; }
.shoplinks a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .7rem .9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-size: .925rem;
}
.shoplinks a:hover { text-decoration: none; border-color: var(--accent); }
.shoplinks span { color: var(--muted); font-size: .85rem; }

.proscons { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 1.5rem 0; }
.proscons__col {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.proscons__col h3 { font-size: .95rem; margin-bottom: .5rem; display: flex; align-items: center; gap: .4rem; }
.proscons__col--pro h3 { color: #15803d; }
.proscons__col--con h3 { color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .proscons__col--pro h3 { color: #4ade80; }
  :root:not([data-theme="light"]) .proscons__col--con h3 { color: #f87171; }
}
.proscons__col p { margin: 0; font-size: .925rem; line-height: 1.65; }
.proscons__by { color: var(--muted); font-size: .85rem; margin-top: 1rem; }

/* ------------------------------------------------------- homage sections */

.homage-group { margin-bottom: 2.5rem; }
.homage-group__head {
  display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap;
  padding-bottom: .6rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.homage-group__head h2 { margin: 0; }
.homage-group__count { color: var(--muted); font-size: .875rem; }

.toc { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 2rem; padding: 0; list-style: none; }

/* ------------------------------------------------------------- messages */

.empty {
  text-align: center; padding: 3rem 1rem;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty h2 { margin-bottom: .4rem; }
.empty p { color: var(--muted); margin: 0 0 1.25rem; }

/* --------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 2rem; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; padding: 2rem 16px 2.5rem; }
.footer__note { margin: 0 0 .7rem; font-size: .9rem; max-width: 80ch; }
.footer__note--muted { color: var(--muted); }
.footer__links { display: flex; gap: 1.1rem; flex-wrap: wrap; margin-top: 1.1rem; font-size: .9rem; }

/* -------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .card:hover { transform: none; }
}
