:root {
  color-scheme: light dark;

  --fg: #16211d;
  --muted: #5c6b66;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --border: #e2e1da;
  --border-strong: #cbcabf;

  --brand: #0f5c4f;
  --brand-strong: #0a4238;
  --brand-soft: #e6f1ee;

  --accent: #c15a1f;
  --accent-soft: #fbe9dd;

  --good: #1a7f37;
  --good-soft: #e6f4ea;

  --radius-sm: 0.4rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  --shadow-sm: 0 1px 2px rgba(22, 33, 29, 0.06);
  --shadow-md: 0 4px 16px rgba(22, 33, 29, 0.08);

  --content-width: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eef2f0;
    --muted: #a3b0ab;
    --bg: #10201b;
    --surface: #16302a;
    --border: #24443b;
    --border-strong: #315b4f;

    --brand: #4fd8b8;
    --brand-strong: #7fe6cc;
    --brand-soft: #1b3a33;

    --accent: #f0975a;
    --accent-soft: #3a2718;

    --good: #6fcf8e;
    --good-soft: #17342370;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
  }
}

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

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

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.25rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

a {
  color: var(--brand);
  text-decoration-thickness: from-font;
}

a:hover {
  color: var(--brand-strong);
}

/* ---------- header ---------- */

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

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

.site-header .brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.site-header nav a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.site-header nav a:hover {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

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

.site-footer {
  max-width: var(--content-width);
  margin: 2rem auto 0;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- hero (home) ---------- */

.hero {
  padding: 1rem 0 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.hero h1 {
  max-width: 30ch;
}

.hero p {
  max-width: 55ch;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ---------- breadcrumbs ---------- */

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.breadcrumbs a:hover {
  color: var(--brand);
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--border-strong);
}

/* ---------- generic surfaces ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin: 1.25rem 0;
}

.collection-rule {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

/* ---------- racket cards / grids ---------- */

.racket-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}

.racket-card {
  display: flex;
}

.racket-card a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--fg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.racket-card a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.racket-card .brand {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.racket-card .year {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- collections index (home) ---------- */

.collection-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.collection-links a {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  text-decoration: none;
  color: var(--fg);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.collection-links a:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.deals-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.deals-link:hover {
  color: var(--accent);
  filter: brightness(0.95);
}

.brand-group {
  margin-bottom: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.15rem 1rem 0.9rem;
}

.brand-group > summary {
  cursor: pointer;
  padding: 0.75rem 0;
  font-weight: 700;
  list-style: none;
}

.brand-group > summary::-webkit-details-marker {
  display: none;
}

.brand-group > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}

.brand-group[open] > summary::before {
  transform: rotate(90deg);
}

/* ---------- offers / price tables ---------- */

.offers-notice {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.offers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.offers-table th,
.offers-table td {
  text-align: left;
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.offers-table thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 2px solid var(--border-strong);
}

.offers-table tbody tr:hover {
  background: var(--brand-soft);
}

.offers-table .cell-total {
  font-weight: 700;
}

.price-was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--border);
  border-radius: 999px;
}

.badge-drop {
  color: var(--good);
  background: var(--good-soft);
  font-weight: 700;
}

.btn {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--brand-strong);
  color: #fff;
}

/* Responsive table -> stacked cards below 640px, data-label supplies the row's caption. */
@media (max-width: 640px) {
  .offers-table,
  .offers-table thead,
  .offers-table tbody,
  .offers-table th,
  .offers-table td,
  .offers-table tr {
    display: block;
  }

  .offers-table thead {
    display: none;
  }

  .offers-table tr {
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
  }

  .offers-table tbody tr:hover {
    background: var(--surface);
  }

  .offers-table th[scope="row"] {
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.4rem;
    padding: 0 0 0.5rem;
    font-weight: 700;
  }

  .offers-table td {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: none;
    padding: 0.2rem 0;
  }

  .offers-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8rem;
  }

  .offers-table td:last-child {
    justify-content: flex-end;
    padding-top: 0.6rem;
  }
}

/* ---------- specs ---------- */

.specs {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  margin: 0;
}

.specs .spec-row:not(:last-child) dt,
.specs .spec-row:not(:last-child) dd {
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.spec-row {
  display: contents;
}

.specs dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.9rem;
}

.specs dd {
  margin: 0;
}

.spec-raw {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- price chart ---------- */

.price-chart h2 {
  margin-top: 0;
}

.price-chart svg {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0.5rem 0;
}

.chart-summary {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* ---------- deals hub ---------- */

.deals-table td:nth-child(2),
.deals-table td:nth-child(3) {
  color: var(--muted);
}

.deals-table td:nth-child(3) {
  color: var(--fg);
  font-weight: 700;
}
