:root {
  --paper: #faf6f0;
  --card: #fffdf9;
  --ink: #2b2622;
  --muted: #7a6f66;
  --line: #e6ddd2;
  --accent: #8c1c13;
  --accent-ink: #fff;
  --ok: #3c6e47;
  --no: #8a5a44;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
  margin: 0 0 .5em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
}
.topbar nav { display: flex; align-items: center; gap: 1.25rem; font-size: .95rem; }
.topbar nav a { color: var(--ink); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }

.hero {
  text-align: center;
  padding: 4.5rem 0 3rem;
}
.hero h1 {
  font-size: clamp(2.8rem, 9vw, 4.75rem);
  margin: .25em 0;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .8rem;
  color: var(--muted);
  margin: 0;
}
.hero-date { font-family: var(--serif); font-size: 1.5rem; margin: 0; }
.hero-place { color: var(--muted); margin: .25rem 0 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.75rem;
  margin: 1.5rem 0;
}
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.about { text-align: center; }
.section-title { margin-top: 2.5rem; text-align: center; }

.muted { color: var(--muted); font-size: .95rem; }
.lede { font-size: 1.05rem; }

.notice, .alert {
  padding: .9rem 1.1rem;
  border-radius: 6px;
  margin: 1rem 0;
}
.notice { background: #eef4ec; border: 1px solid #c9dcc4; }
.alert { background: #fbeeec; border: 1px solid #ecc7c1; white-space: pre-wrap; font: inherit; }

/* Forms */
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.optional { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input[type="radio"], input[type="checkbox"] { width: auto; margin: 0 .5rem 0 0; accent-color: var(--accent); }

button, .button {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: .65rem 1.4rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { filter: brightness(1.1); }
.button.secondary { background: transparent; color: var(--accent); }
button.link {
  background: none;
  border: none;
  padding: 0;
  font-weight: 400;
  color: var(--muted);
  text-decoration: underline;
}
form.inline { display: inline; }

.find-row { display: flex; gap: .5rem; }
.find-row input { flex: 1; }

fieldset {
  border: none;
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 .5rem;
  margin: 0;
}
legend {
  font-family: var(--serif);
  font-size: 1.5rem;
  padding: 0 .5rem 0 0;
}
.you { font-size: 1rem; color: var(--muted); }

.field { margin: 1rem 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.attend { display: flex; gap: .75rem; flex-wrap: wrap; }
.choice {
  display: flex;
  align-items: center;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .55rem 1rem;
  margin: 0;
  cursor: pointer;
  background: #fff;
}
.choice:has(input:checked) { border-color: var(--accent); background: #fbf1ef; }
.check { display: flex; align-items: center; font-weight: 400; }
.help { color: var(--muted); font-size: .9rem; margin: .3rem 0 0; }
.field-error { color: var(--accent); font-size: .9rem; margin: .3rem 0 0; }
.has-error input, .has-error select, .has-error textarea, .has-error .choice { border-color: var(--accent); }
form.rsvp > button { margin-top: 1.5rem; }

/* Info page */
.party { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.party li {
  display: flex;
  justify-content: space-between;
  padding: .5rem 0;
  border-bottom: 1px solid var(--line);
}
.status { font-size: .85rem; font-weight: 600; text-transform: capitalize; }
.status-attending { color: var(--ok); }
.status-declined { color: var(--no); }
.status-pending { color: var(--muted); }

.event .when { font-weight: 600; margin: 0; }
.event .venue { margin: .25rem 0 0; }
.event .address { margin: 0 0 .75rem; }
.description { white-space: pre-line; }

.faq dt { font-weight: 600; margin-top: 1rem; }
.faq dd { margin: .25rem 0 0; }

.choices-list { list-style: none; padding: 0; }
.choices-list li { margin: .75rem 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 2rem 1rem 3rem;
}

/* Admin */
main:has(.admin) { max-width: 1200px; }
.tallies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.tally { margin: 0; padding: 1.1rem; }
.tally p { margin: .25rem 0 0; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; }
.admin-actions form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem; }
.admin-actions form label { width: 100%; }
.admin-actions input[type="file"] { width: auto; }
.admin-actions .notice, .admin-actions .alert { width: 100%; margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--card); }
th, td { text-align: left; vertical-align: top; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--paper); position: sticky; top: 0; }
tbody th { font-weight: 600; }
tbody { border-top: 2px solid var(--line); }
.answer { font-weight: 400; }
.answer span { color: var(--muted); }

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; }
  .find-row { flex-direction: column; }
  .card { padding: 1.25rem; }
  .topbar nav { gap: .9rem; }
}
