:root {
  --bg: #f8f6f1;
  --bg-card: #ffffff;
  --header-bg: #d8e2d3;
  --ink: #2f4f3a;
  --ink-soft: #667a68;
  --accent: #667a68;
  --accent-deep: #2f4f3a;
  --gold: #667a68;
  --line: #e4e0d7;
  --match-bg: #e7efe2;
  --shadow: 0 10px 30px -18px rgba(47, 79, 58, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% -10%, #fdfcf8 0%, var(--bg) 55%);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.header {
  text-align: center;
  padding: 3.5rem 1.25rem 2.75rem;
  background: var(--header-bg);
}

.header__eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
}

.header__couple {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(2.6rem, 9vw, 4.25rem);
  line-height: 1.05;
  color: var(--ink);
}

.header__date {
  margin: 0.5rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 4vw, 1.35rem);
  color: var(--ink-soft);
}

.header__note {
  margin: 1.25rem auto 0;
  max-width: 30rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

/* ---------- Search bar ---------- */
.searchbar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.9rem 1.25rem 1rem;
  background: linear-gradient(var(--bg) 72%, rgba(248, 246, 241, 0));
  backdrop-filter: blur(2px);
}

.searchbar__inner {
  max-width: 540px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.searchbar__field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.searchbar__icon {
  position: absolute;
  left: 1rem;
  display: flex;
  color: var(--accent-deep);
  pointer-events: none;
}

.searchbar__input {
  width: 100%;
  padding: 0.95rem 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--ink);
  font-size: 1.05rem;
  font-family: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.searchbar__input::placeholder {
  color: rgba(102, 122, 104, 0.6);
}

.searchbar__input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(102, 122, 104, 0.18), var(--shadow);
}

/* hide native search clear, use our own */
.searchbar__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.searchbar__clear {
  position: absolute;
  right: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.searchbar__clear:hover {
  background: var(--line);
}

.searchbar__go {
  flex-shrink: 0;
  padding: 0.95rem 1.4rem;
  border: 1px solid var(--accent-deep);
  border-radius: 999px;
  background: var(--accent-deep);
  color: #ffffff;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background 0.2s, transform 0.1s;
}

.searchbar__go:hover {
  background: var(--accent);
  border-color: var(--accent);
}

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

.result {
  max-width: 480px;
  margin: 0.7rem auto 0;
  text-align: center;
  font-size: 0.95rem;
  min-height: 1.2rem;
}

.result--found {
  color: var(--accent-deep);
}

.result--found strong {
  color: var(--ink);
}

.result--empty {
  color: var(--ink-soft);
}

/* ---------- Tables grid ---------- */
.tables {
  max-width: 960px;
  margin: 0.5rem auto 0;
  padding: 0.5rem 1.25rem 1rem;
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.card.is-hidden {
  display: none;
}

.card.is-match {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(102, 122, 104, 0.25), var(--shadow);
  transform: translateY(-2px);
}

.card__title {
  margin: 0 0 0.9rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--accent-deep);
}

.card__guests {
  list-style: none;
  margin: 0;
  padding: 0;
}

.guest {
  padding: 0.35rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 8px;
  font-size: 1.02rem;
  transition: background 0.2s, color 0.2s;
}

.guest.is-match {
  background: var(--match-bg);
  color: var(--accent-deep);
  font-weight: 600;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2.5rem 1.25rem 3.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer__divider {
  display: block;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

@media (max-width: 480px) {
  .header {
    padding-top: 2.5rem;
  }
  .tables {
    grid-template-columns: 1fr;
  }
}
