/* ------------------------------------------------------------------
   Allison & Matthew — wedding site
   Palette pulled from the papyrus fabric.
   Type: Cormorant Garamond for text, Jost for small capitals.
------------------------------------------------------------------- */
:root {
  --ivory: #f6f2e7;
  /* ivory cotton paper: a seamless 1024px tile shown at 512px (sharp on retina).
     It averages to exactly --ivory, so colours and contrast are unchanged. */
  --paper-tile: 512px 512px;
  --ink: #1e2a2d;          /* fabric navy-black */
  --ink-soft: #3c4a4d;
  --teal: #2e5662;         /* fan band */

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --nav-h: 58px;
  --nav-slot: 112px;       /* each menu word sits centred in a slot this wide (7× the 16px link size) */
  --rule: rgba(30, 42, 45, .22);   /* the menu bar's hairline */
}

/* Reserve the scrollbar's space on every page, so pages that scroll (Details, RSVP)
   and pages that don't (Home, Registry) have the same width and nothing shifts sideways. */
html {
  scrollbar-gutter: stable;
  /* the paper (where a scrollbar lane is reserved, it shows the plain ivory) */
  background: var(--ivory) url("assets/paper.jpg") 0 0 / var(--paper-tile) repeat;
}

*, *::before, *::after { box-sizing: border-box; }
/* keep [hidden] working on elements that set their own display (e.g. the RSVP form after sending) */
[hidden] { display: none !important; }

body {
  margin: 0;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.5;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ---------- top navigation ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  /* same paper, so the bar blends in (it lines up exactly until the page scrolls) */
  background: var(--ivory) url("assets/paper.jpg") 0 0 / var(--paper-tile) repeat;
  border-bottom: 1px solid var(--rule);
}
.topbar nav {
  /* three equal slots, each word centred in its own: the words can't nudge each other
     (e.g. while the web font loads), and RSVP sits exactly on the page's centre line */
  display: grid;
  grid-template-columns: repeat(3, minmax(0, var(--nav-slot)));
  justify-content: center;
  justify-items: center;
  align-items: center;
  column-gap: clamp(0px, calc(10vw - 37px), 103px);
  height: var(--nav-h);
  padding: 0 16px;
}
.topbar a {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar a:hover,
.topbar a:focus-visible,
.topbar a[aria-current="page"] { border-bottom-color: currentColor; }

/* ---------- home ---------- */
.home-hero {
  flex: 1;
  display: grid;
  place-items: center;
  padding: clamp(20px, 4vh, 48px) 16px;
  text-align: center;
}
.title { margin: 0; line-height: 0; }
/* title and arrow share one width so they line up and scale together */
.home-hero { --hero-w: min(660px, 88vw, 78vh); }
/* the couple's own handwriting, traced to SVG (≈2.05 : 1) */
.title-art {
  display: block;
  width: var(--hero-w);
  height: auto;
  margin: 0 auto;
}
/* tucked up under "are getting married": the heart sits just below the words
   and the shaft crosses the tail of the "g" */
.arrow-heart {
  display: block;
  width: var(--hero-w);
  height: auto;
  margin: calc(var(--hero-w) * -0.136) auto 0;
}
/* date and location in the site serif's capitals, lighter so the handwriting leads */
.dateline {
  margin: clamp(16px, 3.4vh, 30px) 0 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 2.3vw, 25px);
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.5;
}
.dateline span { display: block; }

/* ---------- inner pages ---------- */
.page {
  /* content-height, so the leopards follow the text rather than sinking to the window bottom */
  width: min(880px, 100%);
  margin: 0 auto;
  padding: clamp(12px, 2.2vh, 22px) clamp(20px, 5vw, 48px) clamp(36px, 5vh, 52px);
  text-align: center;
}
.home-mark { display: inline-block; margin-bottom: 14px; }
.home-mark img { display: block; width: 150px; height: auto; }
.page-title {
  margin: 0 0 clamp(28px, 5vh, 48px);
  font-family: var(--sans);
  font-weight: 800;
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: .3em;
  text-transform: uppercase;
}
/* page titles in the couple's own handwriting (traced SVGs) instead of type.
   Widths differ because the scans came in at different scales: these sizes give
   matching letter heights and stroke weights. */
.page-title--hand { line-height: 0; letter-spacing: 0; }
.page-title--hand img { display: inline-block; max-width: 70vw; height: auto; }
.title-details  { width: 170px; }
.title-rsvp     { width: 123px; }
.title-registry { width: 230px; }
/* Registry's long "y" tail already leaves room below the letters, so the text can sit closer */
.page-title--tail { margin-bottom: 12px; }

/* Details: laid out like a printed programme. Hairline rows, with the day and
   time on the left and the event, notes and venue under the title.
   The empty third column mirrors the date column, so the middle column sits on
   the page's centre line. */
.programme {
  max-width: 680px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  text-align: left;
  border-top: 1px solid rgba(30, 42, 45, .18);
}
.row {
  display: grid;
  grid-template-columns: 160px 1fr 160px;
  column-gap: 24px;
  padding: 30px 0 32px;
  border-bottom: 1px solid rgba(30, 42, 45, .18);
}
.when { padding-top: 7px; }
.day {
  display: block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
}
/* three tiers only: bold date label, event name, then ONE quiet size for everything else */
.time { display: block; margin-top: 6px; font-size: 16px; color: var(--ink-soft); }
/* the event text keeps one shared left line, set 75px left of the centre line,
   so a typical event name sits centred under the handwritten title */
/* The event text spans the middle and the empty right column, so a long note stays on one line.
   Its padding puts the shared left line 75px left of the page centre: the middle column is the
   area minus the 160px column and 24px gap, so half of it is (100% - 184px) / 2. */
.what { grid-column: 2 / 4; padding-left: calc(50% - 167px); }
.what h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: .005em;
}
/* every supporting line: same size, same soft italic */
.what p { margin: 0; font-size: 16px; line-height: 1.5; font-style: italic; color: var(--ink-soft); }
.note { font-style: italic; color: var(--ink-soft); }
/* the venue is the same size, but upright and in full ink so it reads as the link */
.venue {
  display: inline-block;
  margin-top: 8px;
  font-weight: 500;
  font-size: 16px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(30, 42, 45, .45);
  transition: text-decoration-color .3s;
}
.venue:hover, .venue:focus-visible { text-decoration-color: currentColor; }

/* RSVP */
/* RSVP text matches the Registry copy (17px), so the page sits quietly with Details and Registry */
.lede { margin: -12px 0 32px; font-style: italic; font-size: 17px; }
/* hairline fields: just a fine line to write on, no boxes */
.rsvp { display: grid; gap: 28px; max-width: 520px; margin: 0 auto; text-align: left; font-size: 17px; }
.field { display: grid; gap: 4px; }
.field > span, .choices legend {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.field input, .field textarea {
  width: 100%;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(30, 42, 45, .35);
  border-radius: 0;
  padding: 8px 0;
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus {
  outline: none;
  border-bottom-color: var(--ink);
  box-shadow: 0 1px 0 var(--ink);      /* the line thickens while typing */
}
/* reply options are the words themselves: tap one and it darkens and underlines */
.choices { border: 0; margin: 0; padding: 0; min-width: 0; }
.choices legend { float: left; width: 100%; padding: 0; margin-bottom: 10px; }
.choice-row { clear: both; display: flex; flex-wrap: wrap; column-gap: 40px; row-gap: 10px; }
.choice { position: relative; cursor: pointer; font-style: italic; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.choice span {
  color: rgba(30, 42, 45, .6);
  border-bottom: 1px solid rgba(30, 42, 45, .2);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.choice:hover span { color: var(--ink); }
.choice input:checked + span { color: var(--ink); border-bottom-color: var(--ink); }
.choice input:focus-visible + span { outline: 1px solid var(--ink); outline-offset: 5px; }
/* outlined button that fills with ink on hover */
.button {
  justify-self: center;
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 14px 38px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.button:hover, .button:focus-visible { background: var(--ink); color: var(--ivory); }
.form-error { margin: 0; text-align: center; font-style: italic; }   /* site ink, like all other text */
.button:disabled { opacity: .6; cursor: progress; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* step 1: find your invitation */
.find { max-width: 420px; }
.hint { font-size: 15px; font-style: italic; color: var(--ink-soft); }
.replied-note { margin: 0; text-align: center; }
/* step 2: one block per invited guest, the name heading their own reply and dietary line.
   Space, not rules, between guests, so a dietary underline never doubles up with a divider. */
.party { display: grid; gap: 36px; margin: 0; padding: 0; list-style: none; }
.guest { display: grid; gap: 16px; }
.choices .guest-name {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 8px;
}
.again {
  justify-self: center;
  margin-top: -14px;
  padding: 4px;
  font: inherit;
  font-size: 15px;
  font-style: italic;
  color: var(--ink-soft);
  background: none;
  border: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: rgba(30, 42, 45, .35);
  cursor: pointer;
}
.again:hover, .again:focus-visible { color: var(--ink); }
.thanks-script { margin: 0; font-style: italic; font-weight: 400; font-size: 38px; line-height: 1.2; }
.thanks-note { margin: 8px 0 0; font-size: 17px; }

/* Registry */
/* a short, narrow centred block (like a printed card), sized just above the 16px detail text */
.registry-copy { max-width: 430px; margin: 0 auto; font-size: 17px; line-height: 1.65; text-wrap: balance; }
.registry-copy p { margin: 0 0 1em; }
.registry-copy p:last-child { margin-bottom: 0; }
.registry-copy a { text-underline-offset: 4px; text-decoration-thickness: 1px; }
.registry-copy a:hover { color: var(--teal); }
/* page not found: the same quiet copy, a little below the arrow (there's no handwritten title) */
.not-found { margin-top: clamp(20px, 4vh, 36px); }

/* Footer (inner pages): the leopard pair, solid ink, purely decorative */
.footer { text-align: center; padding: 12px 16px 44px; }
.leopards { display: inline-block; width: 110px; height: auto; }
.footer-home { display: inline-block; vertical-align: top; }   /* the leopards also lead home */
.footer-home .leopards { display: block; }
/* privacy note: the paper's own colour, so it's there without being seen */
.privacy { margin: 6px auto 0; max-width: 150px; font-style: italic; font-size: 6px; line-height: 1.4; color: var(--ivory); -webkit-text-size-adjust: none; text-size-adjust: none; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  :root { --nav-h: 52px; --nav-slot: 98px; }
  body { font-size: 19px; }
  .topbar a { font-size: 14px; letter-spacing: .2em; }
  .home-mark img { width: 120px; }
}
/* Details rows stack once the three columns get tight: day and time share a
   centred line above the event */
@media (max-width: 720px) {
  .row { grid-template-columns: 1fr; row-gap: 10px; padding: 26px 0 28px; }
  .when { padding-top: 0; display: flex; justify-content: center; align-items: baseline; gap: 14px; }
  .time { margin-top: 0; }
  .what { grid-column: auto; padding-left: 0; text-align: center; }
}
