/* Colors, fonts, and widths live here as variables. Change them to restyle the whole site. */
:root {
  --paper: #fff8fa;
  --paper-strong: #faf0e8;
  --surface: #ffffff;
  --surface-alt: #fdf6ee;
  --ink: #2d1a1e;
  --ink-soft: #5c3840;
  --muted: #8a6068;
  --line: #ead5c0;
  --field-border: #c8a882;
  --accent: #c07a2a;
  --accent-strong: #9a5f10;
  --accent-dark: #7a4a0a;
  --accent-soft: #fdf0d5;
  --shadow: rgba(90, 40, 20, 0.10);

  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --column: 44rem;
}

html[data-theme="dark"] {
  --paper: #33212a;
  --paper-strong: #281820;
  --surface: #3e2932;
  --surface-alt: #452f3b;
  --ink: #fff5ec;
  --ink-soft: #f0d9c0;
  --muted: #c4a07a;
  --line: #5c3845;
  --field-border: #8a6070;
  --accent: #e8a835;
  --accent-strong: #f5c855;
  --accent-dark: #d4921e;
  --accent-soft: rgba(232, 168, 53, 0.13);
  --shadow: rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-strong) 100%);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Headings ---- */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
}
h1 { font-size: 2.5rem; margin: 1rem 0 0.75rem; }
h2 { font-size: 1.6rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 0; }

/* ---- Layout ---- */
.site-header,
main,
.site-footer {
  max-width: var(--column);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
  text-decoration: none;
}

nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
nav a:hover { border-bottom-color: var(--line); }
nav a[aria-current="page"] { border-bottom-color: var(--accent); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--shadow);
}
.theme-toggle:hover {
  background: var(--surface-alt);
  border-color: var(--accent);
}
.theme-toggle__icon { font-size: 1rem; }

main { padding-top: 1.5rem; padding-bottom: 3rem; }

.site-footer {
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---- Home hero: the one big typographic moment ---- */
.hero { padding: 3rem 0 2rem; }
.hero h1 {
  font-size: clamp(3rem, 12vw, 5.5rem);
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.hero-date { font-size: 1.35rem; margin: 0; }
.hero-place { color: var(--muted); margin: 0.15rem 0 0; }
.countdown { margin-top: 1.5rem; }
.countdown-label { color: var(--muted); font-size: 0.95rem; margin: 0; }
.countdown-value { font-family: var(--serif); font-size: 1.35rem; margin: 0.15rem 0 0; }

/* ---- Buttons ---- */
.button,
button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 0.7rem 1.25rem;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover,
button:hover { background: var(--accent-dark); color: #fff; }

/* ---- Forms ---- */
.field { display: flex; flex-direction: column; gap: 0.3rem; }
label { font-weight: 600; }

input[type="text"],
input[type="password"],
input[type="tel"],
input[type="email"],
select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field-border);
  border-radius: 4px;
}

.lookup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: end;
  margin: 1.5rem 0;
}
.lookup button { grid-column: 1 / -1; justify-self: start; }
.lookup .field-code { grid-column: 1 / -1; }
.lookup .field-code input { max-width: 14rem; letter-spacing: 0.15em; }
.delivery-methods {
  display: flex;
  grid-column: 1 / -1;
  gap: 1.5rem;
  border: 0;
  padding: 0;
  margin: 0;
}
.delivery-methods legend { font-weight: 600; padding: 0; margin-bottom: 0.3rem; }
.delivery-methods label { font-weight: 400; }
.delivery-methods input { margin-right: 0.4rem; }
.hint { margin: 0; color: var(--muted); font-size: 0.95rem; }

.gate-form { display: grid; gap: 1rem; max-width: 20rem; margin: 1.5rem 0; }

/* Buttons that look like text links (sign out, resend code) */
.link-button {
  background: none;
  color: var(--accent);
  padding: 0.25rem 0;
  font-weight: 400;
  text-decoration: underline;
}
.link-button:hover { background: none; color: var(--accent-dark); }
.secondary-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-bottom: 0.75rem; }
.site-footer form { margin: 0; }
.sign-out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.sign-out button { flex: none; }
.sign-out-note { flex: 1 1 18rem; font-size: 0.85rem; }

.sign-in-help {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.rsvp-form fieldset {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.25rem 1.25rem;
  margin: 0 0 1rem;
  box-shadow: 0 8px 24px var(--shadow);
}
.rsvp-form legend {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0 0.4rem;
}
.event-choice + .event-choice { border-top: 1px solid var(--line); }
.event-choice p { margin: 0; padding-top: 0.75rem; }
.event-choice:first-of-type p { padding-top: 0; }
.choices { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-bottom: 1rem; }
.choices label { font-weight: 400; }
.choices input { margin-right: 0.4rem; }
.meal-choice { display: grid; gap: 0.5rem; }
.meal-choice label { font-weight: 400; }
.meal-choice input[type="radio"] { margin-right: 0.4rem; }
.allergy-details { max-width: 32rem; margin-top: 0.25rem; }

/* ---- Messages ---- */
.notice {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  color: var(--ink);
  border-radius: 0 8px 8px 0;
}
.notice p { margin: 0 0 0.25rem; }
.notice ul { margin: 0; padding-left: 1.25rem; }

.result {
  background: var(--surface);
  border-left: 4px solid var(--accent);
  padding: 0.25rem 1.25rem 1.25rem;
  margin: 1.5rem 0 2rem;
  box-shadow: 0 10px 24px var(--shadow);
}
.party-status { padding-left: 1.25rem; }

/* ---- Timeline: banner photo ---- */
.timeline-banner {
  margin: 0.5rem 0 2rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 28px var(--shadow);
}
.timeline-banner__img {
  display: block;
  width: 100%;
  height: 22rem;
  object-fit: cover;
  object-position: center 30%;
}

/* ---- Timeline: a real sequence, so it gets a rail ---- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.5rem;
  border-left: 2px solid var(--line);
}
.event { position: relative; padding-bottom: 1.75rem; }
.event::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 7px);
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.event p { margin: 0.15rem 0; }
.event-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.event-place { font-style: italic; }

/* Suggested / Avoid Color lines: optional text, then optional swatches (set in timeline.html) */
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.swatches { display: inline-flex; gap: 0.3rem; margin-left: 0.25rem; }
.swatch {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-block;
}

/* ---- Our Story: photo timeline, rail down the center ---- */
.story-timeline {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  position: relative;
}
.story-timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 2px solid var(--line);
  transform: translateX(-1px);
}
.story-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 3rem;
  align-items: center;
  padding-bottom: 2.5rem;
}
.story-item::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--accent);
}
.story-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: var(--pos, center);
  border-radius: 8px;
  box-shadow: 0 8px 28px var(--shadow);
}
.story-text h3 { margin: 0 0 0.25rem; }
.story-text p { margin: 0.15rem 0; }
/* Odd: photo left, text right. Even: swap. */
.story-item .story-photo { grid-column: 1; grid-row: 1; }
.story-item .story-text { grid-column: 2; grid-row: 1; }
.story-item:nth-child(even) .story-photo { grid-column: 2; }
.story-item:nth-child(even) .story-text { grid-column: 1; text-align: right; }

/* ---- Static content pages ---- */
.stay p { margin: 0.25rem 0; }
.party { list-style: none; margin: 0; padding: 0; }
.party li { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.party p { margin: 0.15rem 0; }
.role { color: var(--muted); }

/* ---- Small screens ---- */
@media (max-width: 34rem) {
  .lookup { grid-template-columns: 1fr; }
  h1 { font-size: 2.1rem; }
  .story-timeline::before { left: 6px; }
  .story-item { grid-template-columns: 1fr; padding-left: 2rem; row-gap: 0.75rem; }
  .story-item::before { left: 6px; top: 0.4rem; }
  .story-item .story-photo,
  .story-item:nth-child(even) .story-photo { grid-column: 1; grid-row: 1; }
  .story-item .story-text,
  .story-item:nth-child(even) .story-text { grid-column: 1; grid-row: 2; text-align: left; }
}

/* Privacy Policy and Terms pages (public; linked from Twilio's texting registration) */
.legal { max-width: 42rem; margin: 0 auto; }
.legal h2 { margin-top: 1.75rem; }
.legal li { margin-bottom: 0.4rem; }
.legal-updated { color: var(--muted); font-size: 0.9rem; }
.legal-links { font-size: 0.9rem; }
