:root {
  --ink: #1c1410;
  --muted: #6a5c50;
  --paper: #f7f1e8;
  --paper-2: #efe6d8;
  --line: #d9cbb8;
  --accent: #8b1e2d;
  --accent-ink: #fff8f0;
  --ok: #2f5d3a;
  --shadow: 0 18px 40px rgba(28, 20, 16, 0.08);
  --radius: 14px;
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 17px/1.5 var(--font-body);
  background:
    radial-gradient(1200px 600px at 10% -10%, #fffaf3 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e0c8 0%, transparent 50%),
    linear-gradient(180deg, var(--paper), var(--paper-2));
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.shell {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}

.brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0 1.25rem;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: 0.02em;
  margin: 0;
}
.brand-mark span { color: var(--accent); }
.brand a.official {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}
.brand a.official:hover { color: var(--accent); }

.hero {
  padding: 2.4rem 0 1.4rem;
  max-width: 38rem;
}
.hero h2 {
  font-family: var(--font-display);
  font-weight: 560;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 0.7rem;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: stretch;
  padding: 1rem;
  background: rgba(255, 252, 247, 0.85);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

button, select, input {
  font: inherit;
  color: var(--ink);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.7rem 1rem;
}
button {
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  white-space: nowrap;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
input, select { width: 100%; }
input:focus, select:focus, button:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, white);
  outline-offset: 2px;
}

.status {
  min-height: 1.5rem;
  margin: 0.9rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.98rem;
}
.status strong { color: var(--ink); font-weight: 600; }

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

.card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.05rem 1.05rem;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 2px);
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.card:hover, .card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow);
}
.card.is-hidden { display: none; }
.card .name {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 600;
  margin: 0;
}
.card .meta, .card .addr { color: var(--muted); font-size: 0.95rem; }
.card .distance {
  color: var(--ok);
  font-weight: 600;
  font-size: 0.9rem;
}
.card .cta {
  margin-top: 0.55rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
.card.no-page {
  opacity: 0.92;
  border-style: dashed;
}
.card.no-page .cta { color: var(--muted); font-weight: 500; }

.empty {
  display: none;
  padding: 1.4rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,0.45);
}
.empty.show { display: block; }

.foot {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
}

@media (max-width: 720px) {
  .controls { grid-template-columns: 1fr; }
  .brand { flex-direction: column; align-items: flex-start; }
}
