/* ============================================================
   TOKENS
   Palette values are close approximations of the wedding colors.
   Swap in exact hex codes from your stationery/florist if you have them.
   Contrast notes (on --paper):
     navy, sage-ink, rust  -> safe for body text
     sage, terracotta      -> large text, illustration, and accents only
   ============================================================ */
:root {
  --paper: #F7F6F1;
  --beige: #EDE4D3;
  --beige-deep: #E0D3BC;
  --navy: #1F2B47;
  --sage: #6F7F68;
  --sage-ink: #4E5C49;
  --rust: #9A4526;
  --terracotta: #C4704D;
  --line: rgba(31, 43, 71, 0.14);

  --font-display: "Newsreader", Georgia, "Times New Roman", serif;
  --font-body: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: 1.875rem;
  --step-3: 2.625rem;
  --step-4: clamp(2.75rem, 7vw, 5.25rem);

  --wrap: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 350;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rust); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
  color: var(--navy);
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); font-weight: 500; }
p { margin: 0 0 1em; max-width: 34em; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--paper); padding: 0.5rem 1rem; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky; top: 0; z-index: 5;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 4.25rem; gap: 1rem;
}
.monogram {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.monogram em { font-style: italic; color: var(--sage); padding: 0 0.15em; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  font: inherit; font-size: var(--step--1); color: var(--navy);
  padding: 0.35rem 0.9rem; cursor: pointer;
}
.nav-list { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.nav-list a {
  color: var(--navy); text-decoration: none; font-size: var(--step--1);
  letter-spacing: 0.04em; padding: 0.25rem 0; border-bottom: 1px solid transparent;
}
.nav-list a:hover { border-bottom-color: var(--sage); }
.nav-list a[aria-current="page"] { border-bottom-color: var(--rust); }

@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); display: none; }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; gap: 0; padding: 0.5rem var(--gutter) 1rem; }
  .nav-list a { display: block; padding: 0.7rem 0; font-size: var(--step-0); }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { text-align: center; padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem); }
.hero-sprig { width: min(22rem, 80%); margin: 0 auto 1.75rem; color: var(--sage); }
.hero h1 {
  font-size: var(--step-4);
  font-style: italic;
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.hero h1 .amp {
  display: block;
  font-size: 0.5em;
  color: var(--terracotta);
  margin: 0.15em 0;
}
.hero-meta { margin: 1.75rem auto 0; font-size: var(--step-1); font-weight: 300; max-width: none; }
.hero-meta span { display: block; font-size: var(--step-0); color: var(--sage-ink); margin-top: 0.25rem; }
.hero-count { font-size: var(--step--1); color: var(--sage-ink); margin: 1.25rem auto 0; max-width: none; }
.hero .button { margin-top: 2rem; }

/* The one orchestrated moment: the botanical line draws itself on load */
.draw path {
  stroke-dasharray: var(--len, 400);
  stroke-dashoffset: var(--len, 400);
  animation: draw 2.4s cubic-bezier(.5, 0, .2, 1) forwards;
  animation-delay: var(--delay, 0s);
}
.draw .berry { opacity: 0; animation: pop 0.6s ease forwards; animation-delay: 2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .draw path { animation: none; stroke-dashoffset: 0; }
  .draw .berry { animation: none; opacity: 1; }
}

/* ============================================================
   SECTIONS (program layout: title column + content column)
   ============================================================ */
.section { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--line); }
.section--band { background: var(--beige); border-top: 0; }
.section-grid { display: grid; grid-template-columns: minmax(12rem, 1fr) 2.2fr; gap: 2rem 4rem; align-items: start; }
.section-title { position: sticky; top: 6rem; }
.section-title p { color: var(--sage-ink); font-size: var(--step--1); margin-top: 0.75rem; }
.section-more { margin-top: 1.75rem; }
@media (max-width: 760px) {
  .section-grid { grid-template-columns: 1fr; }
  .section-title { position: static; }
}

.page-head { padding: clamp(3rem, 8vw, 5rem) 0 2rem; }
.page-head h1 { font-size: var(--step-4); font-style: italic; }
.page-head p { margin-top: 1rem; font-size: var(--step-1); font-weight: 300; }
.page-head .sprig-small { width: 12rem; color: var(--sage); margin-bottom: 1.5rem; }

/* ============================================================
   CONTENT PIECES
   ============================================================ */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1.5rem 2rem; margin: 0 0 2rem; }
.facts dt { font-size: var(--step--1); color: var(--sage-ink); }
.facts dd { margin: 0.2rem 0 0; font-family: var(--font-display); font-size: var(--step-1); }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--sage); }
.timeline li { position: relative; padding: 0 0 1.5rem 1.75rem; display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.25rem 1rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -5px; top: 0.55em;
  width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1px solid var(--sage);
}
.timeline li.is-key::before { background: var(--terracotta); border-color: var(--terracotta); }
.timeline-day { font-size: var(--step-0); font-family: var(--font-body); font-weight: 450; color: var(--sage-ink); margin: 0 0 1rem; }
.timeline + .timeline-day { margin-top: 2.25rem; }
.timeline time { font-size: var(--step--1); color: var(--sage-ink); padding-top: 0.2em; }
.timeline strong { font-weight: 450; display: block; }
.timeline span { color: var(--sage-ink); font-size: var(--step--1); }
@media (max-width: 480px) { .timeline li { grid-template-columns: 1fr; } }

.notes { display: grid; gap: 1.5rem; margin-top: 2rem; }
.notes h3 { margin-bottom: 0.35rem; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain > li { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.list-plain > li:first-child { padding-top: 0; }
.list-plain h3 { margin-bottom: 0.35rem; }
.list-plain p { margin-bottom: 0.4rem; }
.small { font-size: var(--step--1); color: var(--sage-ink); }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.1rem 2rem 1.1rem 0; position: relative;
  font-family: var(--font-display); font-size: var(--step-1);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0.25rem; top: 50%; transform: translateY(-50%);
  font-family: var(--font-body); font-weight: 300; font-size: 1.5rem; color: var(--sage);
  transition: transform 0.25s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding-bottom: 1.1rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.button {
  display: inline-block; font: inherit; font-size: var(--step--1); letter-spacing: 0.04em;
  padding: 0.85rem 1.75rem; border-radius: 999px; text-decoration: none; cursor: pointer;
  background: var(--rust); color: var(--paper); border: 1px solid var(--rust);
  transition: background 0.2s ease, color 0.2s ease;
}
.button:hover { background: var(--navy); border-color: var(--navy); }
.button--ghost { background: transparent; color: var(--navy); border-color: var(--navy); }
.button--ghost:hover { background: var(--navy); color: var(--paper); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button[disabled] { opacity: 0.55; cursor: wait; }

/* ============================================================
   RSVP
   ============================================================ */
.rsvp-card { background: var(--paper); border: 1px solid var(--beige-deep); padding: clamp(1.5rem, 4vw, 2.5rem); max-width: 38rem; }
.section--band .rsvp-card { border-color: var(--beige-deep); }
.field { margin-bottom: 1.25rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }
label, legend { display: block; font-size: var(--step--1); color: var(--sage-ink); margin-bottom: 0.35rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; color: var(--navy); background: #fff;
  border: 1px solid var(--beige-deep); border-radius: 3px; padding: 0.7rem 0.85rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sage); outline-offset: 0; border-color: var(--sage); }
textarea { min-height: 6rem; resize: vertical; }

.guest { border: 0; border-top: 1px solid var(--line); padding: 1.25rem 0 0.5rem; margin: 0; }
.guest legend { font-family: var(--font-display); font-size: var(--step-1); color: var(--navy); padding: 0; margin-bottom: 0.75rem; }
.choice { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  margin: 0; cursor: pointer; font-size: var(--step--1); color: var(--navy);
  border: 1px solid var(--beige-deep); border-radius: 999px; padding: 0.55rem 1.1rem; background: #fff;
}
.choice input:checked + label { background: var(--sage-ink); border-color: var(--sage-ink); color: var(--paper); }
.choice input:focus-visible + label { outline: 2px solid var(--rust); outline-offset: 2px; }

.message { padding: 0.9rem 1rem; border-left: 3px solid var(--terracotta); background: var(--beige); margin-bottom: 1.25rem; font-size: var(--step--1); }
.message--ok { border-left-color: var(--sage); }
.hp { position: absolute; left: -9999px; }
.demo-flag { font-size: var(--step--1); color: var(--rust); margin-bottom: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); padding: 3rem 0; text-align: center; }
.site-footer .sprig-small { width: 11rem; margin: 0 auto 1rem; color: var(--sage); transform: scaleX(-1); }
.site-footer p { margin: 0 auto; max-width: none; font-size: var(--step--1); color: var(--sage-ink); }
.site-footer .names { font-family: var(--font-display); font-style: italic; font-size: var(--step-1); color: var(--navy); margin-bottom: 0.25rem; }
.rsvp-card h2 { margin-bottom: 0.6rem; font-size: var(--step-2); }
.plusone { border-top: 1px dashed var(--beige-deep); padding-top: 1rem; margin-top: 0.25rem; }
.plusone-q { margin-bottom: 0.6rem; }
.check { display: flex; align-items: center; gap: 0.6rem; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--sage-ink); margin: 0; }
.check label { margin: 0; color: var(--navy); font-size: var(--step-0); }
.photos-card--wide { max-width: none; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.album-card { display: block; text-decoration: none; color: var(--navy); }
.album-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: var(--beige); transition: opacity 0.2s ease; }
.album-card:hover img { opacity: 0.9; }
.album-meta { display: block; padding-top: 0.6rem; }
.album-meta strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); }
.album-meta span { font-size: var(--step--1); color: var(--sage-ink); }
.more-photos { margin: 2.5rem 0 1rem; }

.gallery { columns: 3 14rem; column-gap: 0.75rem; margin-top: 1.5rem; }
.gallery-item { display: block; width: 100%; margin: 0 0 0.75rem; padding: 0; border: 0; background: var(--beige); cursor: zoom-in; break-inside: avoid; border-radius: 2px; }
.gallery-item img { width: 100%; height: auto; border-radius: 2px; }

.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(20, 28, 46, 0.96); color: var(--paper); }
.lightbox::backdrop { background: rgba(20, 28, 46, 0.96); }
.lb-bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 1.25rem; padding: 1rem 1.25rem; z-index: 2; }
.lb-count { margin-right: auto; font-size: var(--step--1); }
.lb-download, .lb-close { color: var(--paper); font: inherit; font-size: var(--step--1); background: none; border: 1px solid rgba(247, 246, 241, 0.4); border-radius: 999px; padding: 0.4rem 1rem; cursor: pointer; text-decoration: none; }
.lb-download:hover, .lb-close:hover { border-color: var(--paper); }
.lb-stage { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4.5rem 4rem 2rem; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 8rem); object-fit: contain; }
.lb-stage figcaption { margin-top: 0.75rem; font-size: var(--step--1); min-height: 1em; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--paper); font-size: 2.75rem; line-height: 1; padding: 1rem; cursor: pointer; opacity: 0.75; }
.lb-nav:hover { opacity: 1; }
.lb-prev { left: 0.25rem; }
.lb-next { right: 0.25rem; }
@media (max-width: 600px) {
  .lb-stage { padding: 4.5rem 0.5rem 1.5rem; }
  .lb-nav { top: auto; bottom: 0.5rem; transform: none; font-size: 2.25rem; }
}
.lightbox :focus-visible { outline-color: var(--paper); }
.activities { list-style: none; padding: 0; margin: 0 0 1.75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.6rem 2rem; }
.activities li { padding-left: 1.1rem; position: relative; }
.activities li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--sage); }
.choice--stack { flex-direction: column; align-items: flex-start; }
.bullets { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.bullets li { padding-left: 1.1rem; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 0.65em; width: 6px; height: 6px; border-radius: 50%; background: var(--terracotta); }

/* ============================================================
   MARGIN VINES (assets/js/vines.js)
   ============================================================ */
.vines { position: absolute; top: 0; left: 0; right: 0; pointer-events: none; z-index: 1; color: var(--sage); }
.vine { position: absolute; top: 0; overflow: visible; }
.vine--left { left: 0; }
.vine--right { right: 0; }
.vine-stem { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 0.35s linear; }
.vines--intro .vine-stem { transition: stroke-dashoffset 1.6s cubic-bezier(.5, 0, .2, 1); }
.vine-part { opacity: 0; transform: scale(0.15); transform-origin: 0 0; transition: opacity 0.5s ease, transform 0.7s cubic-bezier(.3, 1.3, .5, 1); }
.vine-part.on { opacity: 1; transform: none; }
.vines--still .vine-stem, .vines--still .vine-part { transition: none; }
