/* ==========================================================================
   Eat Bainbridge — local restaurant discovery
   Palette: charcoal / cream / ember
   ========================================================================== */

:root {
  --ink: #1c1a17;
  --ink-soft: #4b453d;
  --ink-faint: #6f6659;
  --cream: #fbf7f0;
  --cream-deep: #f2eadc;
  --line: #e2d7c5;
  --ember: #c14b1f;
  --ember-dark: #9c3a15;
  --ember-wash: #fbe9e1;
  --sage: #3f6249;
  --sage-wash: #e7efe6;
  --gold: #8f7218;
  --gold-wash: #f7f0d8;
  --teal: #325466;
  --teal-deep: #22454f;
  --teal-pale: #bdcfd9;
  --white: #fffdf9;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(28, 26, 23, .06), 0 2px 8px rgba(28, 26, 23, .05);
  --shadow-md: 0 4px 14px rgba(28, 26, 23, .09), 0 12px 32px rgba(28, 26, 23, .07);
  --shadow-lg: 0 24px 70px rgba(28, 26, 23, .28);

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --wrap: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--ember-dark); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 247, 240, .92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--ember);
  color: var(--white);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 2px;
}

.site-nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--ember-dark); }

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 66px 0 40px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 620px;
  height: 620px;
  background:
    radial-gradient(circle at 74% 18%, rgba(143, 114, 24, .16), transparent 60%),
    radial-gradient(circle, rgba(193, 75, 31, .12), transparent 68%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: 750px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7a5f11;
  background: var(--gold-wash);
  border: 1px solid #e8dcb4;
  padding: 6px 13px;
  border-radius: 100px;
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.2vw, 3.75rem);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 700;
  margin: 0 0 18px;
}

.hero h1 em {
  font-style: italic;
  color: var(--ember);
}

.hero p {
  font-size: 1.08rem;
  color: var(--ink-soft);
  margin: 0 0 30px;
  max-width: 58ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 100px;
  padding: 13px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--ember);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(193, 75, 31, .28);
}
.btn-primary:hover { background: var(--ember-dark); }

.btn-dice {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 0 6px 18px rgba(28, 26, 23, .2);
}
.btn-dice:hover { background: #000; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-faint); background: var(--cream-deep); }

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------------------------------------------------------------- controls */

.controls {
  position: sticky;
  top: 70px;
  z-index: 40;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 210px;
}

.search svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 12px 16px 12px 43px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--white);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(193, 75, 31, .13); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px;
  scrollbar-width: none;
  flex: 1 1 auto;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink-soft);
  border-radius: 100px;
  padding: 8px 15px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .14s ease;
}
.chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

/* chain toggle */

.chain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 14px 7px 13px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--white);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
  user-select: none;
  flex: 0 0 auto;
  transition: border-color .14s ease, color .14s ease;
}
.chain-toggle:hover { border-color: var(--ink-faint); }
.chain-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 100px;
  background: #d9cfbe;
  transition: background-color .18s ease;
  flex-shrink: 0;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s ease;
}

.chain-toggle input:checked ~ .switch { background: var(--sage); }
.chain-toggle input:checked ~ .switch::after { transform: translateX(16px); }
.chain-toggle input:focus-visible ~ .switch { outline: 3px solid var(--ember); outline-offset: 3px; }
.chain-toggle:has(input:checked) { color: var(--sage); border-color: #c3d6c6; background: var(--sage-wash); }

/* ---------------------------------------------------------------- results */

.results { padding: 34px 0 90px; }

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 22px;
}

.results-count {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.results-note {
  font-size: 13.5px;
  color: var(--ink-faint);
}

.results-note strong { color: var(--sage); font-weight: 600; }

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

/* card */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: cardIn .34s ease both;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d5c6ae;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 1.28rem;
  line-height: 1.2;
  letter-spacing: -.015em;
  font-weight: 700;
  margin: 0;
}

.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--ember-dark); }

.price {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-faint);
  flex-shrink: 0;
  padding-top: 4px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 13px;
}

.meta .dot { color: #c9bda8; }

.card-blurb {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 18px;
  flex: 1 1 auto;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--ink-soft);
  background: var(--cream-deep);
  border-radius: 5px;
  padding: 4px 9px;
}

.tag-link {
  text-decoration: none;
  color: var(--ember-dark);
  background: var(--ember-wash);
  border: 1px solid #f2d3c4;
}
.tag-link:hover { background: #f7ddd1; }

.badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--gold);
  padding: 4px 10px;
  border-radius: 100px;
  box-shadow: 0 3px 8px rgba(120, 96, 30, .3);
}

.badge-chain {
  background: var(--ink-soft);
  box-shadow: none;
}

.card.is-chain { background: #f7f3ec; }

/* card media: photo if we have one, monogram tile if we do not */

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  margin: -22px -22px 16px;
  border-radius: 13px 13px 0 0;
  overflow: hidden;
  background: var(--cream-deep);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -.03em;
  color: rgba(255, 253, 249, .94);
  text-shadow: 0 1px 8px rgba(0, 0, 0, .18);
}

.tile[data-tone="0"] { background: linear-gradient(150deg, #3c5b46, #24382c); }
.tile[data-tone="1"] { background: linear-gradient(150deg, #a8871f, #6d5713); }
.tile[data-tone="2"] { background: linear-gradient(150deg, #b9532a, #7d3417); }
.tile[data-tone="3"] { background: linear-gradient(150deg, #325466, #1d333c); }
.tile[data-tone="4"] { background: linear-gradient(150deg, #6b5140, #3f2f24); }

/* weekly special */

.special {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--gold-wash);
  border: 1px solid #e8dcb4;
  border-radius: 9px;
  padding: 8px 11px;
  margin: 0 0 13px;
  font-size: 13px;
  line-height: 1.35;
  color: #5f4a0e;
}

.special svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--gold); }

.special b { font-weight: 600; }

.special .through {
  margin-left: auto;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #8a7433;
  white-space: nowrap;
}

/* partner stripe */

.partner-stripe {
  background: var(--teal);
  color: #dde8ed;
  padding: 17px 0;
  font-size: 13.5px;
}

.partner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.partner-mark {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #eade98;
  padding-right: 18px;
  border-right: 1px solid rgba(234, 222, 152, .35);
}

.partner-inner p { margin: 0; }
.partner-inner a { color: #eade98; text-decoration: none; }
.partner-inner a:hover { text-decoration: underline; }

/* empty state */

.empty {
  text-align: center;
  padding: 70px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.empty h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 0 0 8px;
}

.empty p { color: var(--ink-soft); margin: 0 0 20px; }

/* ---------------------------------------------------------------- picker modal */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 26, 23, .55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.modal[data-open="true"] { opacity: 1; visibility: visible; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 470px;
  background: var(--cream);
  border-radius: 20px;
  padding: 40px 34px 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  transform: translateY(14px) scale(.98);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}

.modal[data-open="true"] .modal-card { transform: none; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.modal-close:hover { background: var(--cream-deep); color: var(--ink); }

.picker-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 14px;
}

.picker-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -.025em;
  font-weight: 700;
  margin: 0 0 10px;
  min-height: 2.2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-title.is-rolling { color: var(--ink-faint); opacity: .6; }

.picker-meta {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0 0 16px;
}

.picker-blurb {
  font-size: 15px;
  color: var(--ink-soft);
  margin: 0 0 26px;
  min-height: 3em;
}

.picker-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.picker-pool {
  margin-top: 18px;
  font-size: 12px;
  color: var(--ink-faint);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--cream-deep);
  padding: 40px 0;
  font-size: 13.5px;
  color: var(--ink-faint);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 30px;
  align-items: center;
  justify-content: space-between;
}

.footer-inner a { color: var(--ink-soft); text-decoration: none; }
.footer-inner a:hover { color: var(--ember-dark); text-decoration: underline; }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .site-nav { display: none; }
  .hero { padding: 44px 0 30px; }
  .controls { top: 70px; padding: 12px 0; }
  .controls-row { gap: 10px; }
  .chip { padding: 7px 13px; font-size: 13px; }
  .grid { grid-template-columns: 1fr; }
  .modal-card { padding: 34px 22px 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
