:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #efeae2;
  --text: #1c1a17;
  --text-2: #57514a;
  --muted: #8a8278;
  --border: #e2dbd0;
  --accent: #d2491f;
  --accent-ink: #ffffff;
  --chip: #f1e6dc;
  --shadow: 0 1px 2px rgba(28, 26, 23, 0.06), 0 8px 24px rgba(28, 26, 23, 0.06);
  --radius: 14px;
  --max: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --surface: #1d1b17;
    --surface-2: #26231e;
    --text: #f2ede6;
    --text-2: #c2b9ad;
    --muted: #8e8679;
    --border: #332f28;
    --accent: #ff6b3d;
    --accent-ink: #1a0f0a;
    --chip: #2e2720;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  --bg: #14130f;
  --surface: #1d1b17;
  --surface-2: #26231e;
  --text: #f2ede6;
  --text-2: #c2b9ad;
  --muted: #8e8679;
  --border: #332f28;
  --accent: #ff6b3d;
  --accent-ink: #1a0f0a;
  --chip: #2e2720;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
a { color: inherit; }
img, svg { display: block; }

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

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; }
.brand-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); }
.nav { display: flex; gap: 18px; font-size: 14px; color: var(--text-2); }
.nav a { text-decoration: none; }
.nav a:hover { color: var(--text); }
@media (max-width: 560px) { .nav { display: none; } }

/* Hero */
.hero { padding: 72px 0 40px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.hero h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 14ch;
}
.hero p.lede { font-size: clamp(17px, 2.2vw, 20px); color: var(--text-2); max-width: 60ch; margin: 0 0 28px; }
.stats { display: flex; flex-wrap: wrap; gap: 28px; margin: 0; padding: 0; list-style: none; }
.stats li { display: flex; flex-direction: column; }
.stats strong { font-family: "Fraunces", Georgia, serif; font-size: 32px; font-weight: 600; line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }

/* Controls */
.controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 16px 0 8px; border-top: 1px solid var(--border);
}
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button {
  border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.select, .search {
  font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; min-height: 38px;
}
.search { flex: 1 1 200px; min-width: 0; }
.select:focus, .search:focus, .seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.result-count { font-size: 13px; color: var(--muted); padding: 4px 0 20px; }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; padding-bottom: 64px; }
@media (max-width: 380px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-2px); }
.card-art { position: relative; height: 148px; overflow: hidden; }
.card-art svg { width: 100%; height: 100%; }
.rank {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.dist-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255, 255, 255, 0.92); color: #1c1a17;
  font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 999px;
}
.card-body { padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card h3 { font-family: "Fraunces", Georgia, serif; font-size: 22px; font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.where { font-size: 14px; color: var(--text-2); margin: 0; }
.hook { margin: 0; font-size: 15px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.facts li { background: var(--chip); color: var(--text-2); font-size: 12.5px; padding: 4px 10px; border-radius: 999px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--border); }
.when { font-size: 13px; color: var(--muted); }
.when strong { color: var(--text); font-weight: 600; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--accent); white-space: nowrap;
}
.btn:hover { text-decoration: underline; }
.note { font-size: 12.5px; color: var(--muted); margin: 0; font-style: italic; }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 0; color: var(--muted); }

/* Calendar strip */
.section-title { font-family: "Fraunces", Georgia, serif; font-size: clamp(26px, 4vw, 36px); font-weight: 600; letter-spacing: -0.01em; margin: 0 0 8px; }
.section-sub { color: var(--text-2); margin: 0 0 24px; max-width: 60ch; }
.calendar { padding: 56px 0 64px; border-top: 1px solid var(--border); }
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.month { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; min-height: 88px; }
.month h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.month ul { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.month li { padding: 2px 0; }
.month li a { text-decoration: none; }
.month li a:hover { color: var(--accent); }
.month .none { color: var(--muted); font-size: 13px; }

/* About / footer */
.about { padding: 48px 0 64px; border-top: 1px solid var(--border); }
.about p { color: var(--text-2); max-width: 70ch; }
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 40px; font-size: 13px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.theme-toggle { font: inherit; font-size: 13px; color: var(--text-2); background: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
