:root {
  --maroon: #7b1e3b;
  --maroon-deep: #571026;
  --marigold: #e08c2b;
  --gold: #c99a3f;
  --cream: #fdf8f1;
  --cream-2: #f6ecdf;
  --ink: #2c2019;
  --ink-soft: #6b5b4e;
  --line: rgba(124, 30, 59, 0.14);
  --shadow-sm: 0 2px 10px rgba(60, 30, 20, 0.06);
  --shadow-md: 0 14px 40px rgba(60, 30, 20, 0.12);
  --radius: 16px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  /* Stops iOS inflating text when a phone is turned sideways. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
}

p { margin: 0 0 1rem; }

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

code {
  font-size: .9em;
  background: var(--cream-2);
  padding: .1em .4em;
  border-radius: 6px;
}

.wrap {
  width: min(1120px, 100% - 3rem);
  margin-inline: auto;
  /* Keeps content clear of the rounded corners and camera notch in landscape. */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.wrap.narrow { width: min(760px, 100% - 3rem); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--maroon);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: 0 0 10px 0;
}

.skip-link:focus { left: 0; }

.noscript-note {
  margin: 0;
  padding: 1rem 1.5rem;
  background: var(--maroon);
  color: #fff;
  text-align: center;
}

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(253, 248, 241, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--maroon-deep);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--maroon), var(--marigold));
  color: #fff;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.brand-text {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: .02em;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-size: .95rem;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}

.nav a:hover,
.nav a.is-active {
  color: var(--maroon);
  border-bottom-color: var(--marigold);
}

.nav .nav-cta {
  background: var(--maroon);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: .5rem 1.15rem;
}

.nav .nav-cta:hover {
  background: var(--maroon-deep);
  color: #fff;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 40px;
  padding: 0 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--maroon);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 10vw, 7rem) 0 clamp(3rem, 8vw, 5.5rem);
  text-align: center;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(224, 140, 43, .22), transparent 70%),
    linear-gradient(180deg, var(--cream-2), var(--cream) 65%);
}

.hero-glow {
  position: absolute;
  inset: auto 50% -220px;
  width: 720px; height: 380px;
  translate: 50% 0;
  background: radial-gradient(closest-side, rgba(123, 30, 59, .16), transparent);
  filter: blur(10px);
  pointer-events: none;
}

.hero-inner { position: relative; }

.eyebrow,
.section-kicker {
  margin: 0 0 .75rem;
  font-size: .78rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
}

.couple {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(.75rem, 3vw, 2rem);
  margin: 0 0 .75rem;
  /* Lower floor than the rest of the type so long names still fit a phone. */
  font-size: clamp(2.2rem, 10vw, 6rem);
  color: var(--maroon-deep);
  text-wrap: balance;
}

.couple .amp {
  font-size: .55em;
  color: var(--marigold);
  font-style: italic;
}

.hero-line {
  margin: 0 auto .35rem;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  color: var(--ink-soft);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .65rem;
  margin: 0 0 2.25rem;
  font-size: .98rem;
  letter-spacing: .05em;
  color: var(--ink);
}

.hero-meta .dot { color: var(--marigold); }

.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(.6rem, 2.5vw, 1.5rem);
  margin-bottom: 2.25rem;
}

.cd-item {
  /* Shrinks enough to keep all four on one line down to a 320px screen. */
  min-width: clamp(64px, 18vw, 88px);
  padding: .9rem .5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.cd-num {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1;
  color: var(--maroon);
  font-variant-numeric: tabular-nums;
}

.cd-label {
  display: block;
  margin-top: .35rem;
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.cd-done {
  flex-basis: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--maroon);
}

.hero-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .85rem;
}

.btn {
  display: inline-block;
  padding: .8rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .95rem;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.btn-primary {
  background: var(--maroon);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--maroon-deep);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--maroon);
  border-color: var(--line);
}

.btn-ghost:hover {
  background: #fff;
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */

.section { padding: clamp(3.5rem, 9vw, 6rem) 0; }

.section-alt {
  background: linear-gradient(180deg, var(--cream-2), #fbf3e8);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin: 0 auto clamp(2rem, 5vw, 3rem);
  text-align: center;
}

.section-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  color: var(--maroon-deep);
}

.section-title::after {
  content: "";
  display: block;
  width: 62px;
  height: 2px;
  margin: .9rem auto 0;
  background: linear-gradient(90deg, transparent, var(--marigold), transparent);
}

.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

#story .lede { text-align: center; }

/* ---------- Timeline ---------- */

.timeline {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  padding-left: 1.5rem;
  border-left: 2px solid var(--line);
}

.tl-item { position: relative; }

.tl-item::before {
  content: "";
  position: absolute;
  left: calc(-1.5rem - 6px);
  top: .55rem;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--marigold);
  box-shadow: 0 0 0 4px var(--cream);
}

.tl-year {
  font-size: .78rem;
  letter-spacing: .16em;
  color: var(--gold);
}

.tl-item h3 { margin: .15rem 0 .25rem; font-size: 1.2rem; }
.tl-item p { margin: 0; color: var(--ink-soft); }

/* ---------- Events ---------- */

.events {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.event-card {
  display: flex;
  gap: 1.1rem;
  padding: 1.35rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.event-card.is-highlight {
  border-color: rgba(224, 140, 43, .55);
  background: linear-gradient(180deg, #fff, #fffaf2);
}

.event-date {
  flex: 0 0 64px;
  height: 68px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 12px;
  background: linear-gradient(160deg, var(--maroon), var(--maroon-deep));
  color: #fff;
}

.event-date .d {
  display: block;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
}

.event-date .m {
  display: block;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .85;
}

.event-body {
  min-width: 0;
  overflow-wrap: break-word;
}

.event-body h3 { margin: 0 0 .3rem; font-size: 1.3rem; }

.event-time {
  margin: 0 0 .2rem;
  font-weight: 600;
  color: var(--maroon);
  font-size: .95rem;
}

.event-place { margin: 0 0 .5rem; color: var(--ink); font-size: .95rem; }

.event-note { margin: 0; color: var(--ink-soft); font-size: .9rem; }

/* ---------- Cards ---------- */

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.card {
  padding: 1.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card h3 { font-size: 1.25rem; }
.card p { color: var(--ink-soft); overflow-wrap: break-word; }
.card p:last-child { margin-bottom: 0; }

.link {
  color: var(--maroon);
  text-underline-offset: 3px;
}

/* Stacked links inside a card: tight spacing, but a comfortable tap height. */
.card-link {
  margin-bottom: .25rem;
  padding: .2rem 0;
}

.card-link:last-child { margin-bottom: 0; }

/* ---------- Gallery ---------- */

.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
}

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  background-size: cover;
  background-position: center;
}

/* Replace each gradient with: background-image: url("../img/your-photo.jpg"); */
.shot-1 { background-image: linear-gradient(135deg, #f3d9b1, #e08c2b); }
.shot-2 { background-image: linear-gradient(135deg, #f6c9d3, #7b1e3b); }
.shot-3 { background-image: linear-gradient(135deg, #d9e7d4, #6f8f6a); }
.shot-4 { background-image: linear-gradient(135deg, #fae3c0, #c99a3f); }
.shot-5 { background-image: linear-gradient(135deg, #e2d3f0, #6b4a8f); }
.shot-6 { background-image: linear-gradient(135deg, #cfe3ee, #3f6f8f); }

.shot figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 1.5rem .9rem .7rem;
  background: linear-gradient(180deg, transparent, rgba(40, 20, 12, .68));
  color: #fff;
  font-size: .85rem;
  letter-spacing: .04em;
}

/* ---------- RSVP form ---------- */

.rsvp-form {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.field { margin-bottom: 1.1rem; border: 0; padding: 0; }

.field label,
.field legend {
  display: block;
  margin-bottom: .4rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .7rem .85rem;
  font: inherit;
  font-size: max(16px, .98rem);
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--marigold);
  box-shadow: 0 0 0 3px rgba(224, 140, 43, .18);
  outline: none;
}

.field input[aria-invalid="true"] { border-color: #b3261e; }

.field textarea { resize: vertical; }

.field-row {
  display: grid;
  gap: 0 1rem;
  grid-template-columns: 1fr 1fr;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  padding: .4rem 0;
  font-weight: 400;
  color: var(--ink-soft);
}

/* Overrides the full-width rule that .field input sets for text fields. */
.checks input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--maroon);
}

.form-status {
  margin: 1rem 0 0;
  min-height: 1.4em;
  font-size: .92rem;
  color: var(--ink-soft);
}

.form-status.is-error { color: #b3261e; }
.form-status.is-ok { color: #3f6f4a; }

/* ---------- FAQ ---------- */

.faq details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: .75rem;
  overflow: hidden;
}

/* Flex rather than a floated marker, so a question that wraps onto two lines
   on a narrow screen can never run underneath the +/- sign. */
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--maroon-deep);
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--marigold);
  font-size: 1.4rem;
  line-height: 1;
}

.faq details[open] summary::after { content: "\2212"; }

.faq details p {
  margin: 0;
  padding: 0 1.2rem 1.1rem;
  color: var(--ink-soft);
}

/* ---------- Footer ---------- */

.site-footer {
  padding: clamp(2.5rem, 6vw, 3.5rem) 0;
  text-align: center;
  background: var(--maroon-deep);
  color: #f4e4d6;
}

.footer-couple {
  margin: 0 0 .35rem;
  font-family: var(--serif);
  font-size: 1.9rem;
  color: #fff;
}

.footer-note {
  margin: 0 0 .9rem;
  letter-spacing: .12em;
  font-size: .82rem;
  text-transform: uppercase;
  color: rgba(244, 228, 214, .75);
}

.footer-contact { margin: 0; font-size: .95rem; overflow-wrap: break-word; }

.site-footer .link { color: #f0c88a; }

/* ---------- Motion ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .wrap, .wrap.narrow { width: min(100% - 2rem, 100%); }

  .nav-toggle { display: flex; }

  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    display: none;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  /* Scrolls internally rather than running off a short landscape screen. */
  .nav.is-open {
    display: block;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem 1rem 1rem;
  }

  .nav a {
    display: block;
    padding: .8rem .25rem;
    border-bottom: 1px solid var(--line);
  }

  /* Needs its own padding here: the base .nav .nav-cta rule outranks .nav a,
     which would otherwise leave this button short of a comfortable tap size. */
  .nav .nav-cta {
    margin-top: .75rem;
    padding: .8rem 1.15rem;
    text-align: center;
    border-bottom: 0;
  }

  .field-row { grid-template-columns: 1fr; }

  .hero-actions .btn { flex: 1 1 auto; text-align: center; }
}

/* Phones: two photos per row, otherwise the gallery alone is a very long scroll */
@media (max-width: 600px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: .6rem;
  }

  .shot figcaption {
    padding: 1.25rem .6rem .5rem;
    font-size: .74rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .cd-item { padding: .75rem .35rem; }
  .cd-label { font-size: .62rem; letter-spacing: .1em; }
  .event-card { padding: 1.1rem; gap: .85rem; }
  .event-date { flex-basis: 56px; }
  .brand-text { font-size: 1.02rem; }
}

/* Phone held sideways: reclaim the vertical space the hero would otherwise eat */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 2.25rem 0 2rem; }
  .couple { font-size: clamp(2rem, 7vw, 3.25rem); }
  .countdown { margin-bottom: 1.25rem; }
  .section { padding: 2.5rem 0; }
}

@media print {
  .site-header, .hero-actions, .nav-toggle, .rsvp-form button { display: none; }
  body { background: #fff; }
  .reveal { opacity: 1; transform: none; }
}
