/* Joshua & Daphne: the moodboard's Bone White and Dark Ember with a deep green and espresso, Fraunces over Montserrat.
   The cover and event sections are photos (tinted deep green and espresso); text sits on bone, espresso for the
   countdown, reply form and footer. */

:root {
  --bone: #d7d0c0;      /* Pantone 12-0105 Bone White */
  --ember: #351c1d;     /* Dark Ember, espresso brown */
  --taupe: #5e4a40;

  --font-display: "Fraunces", Georgia, serif;
  --font-text: "Montserrat", system-ui, sans-serif;
  --green: #121e18;     /* deep green: the mass and afterparty sections */
  --espresso: #1e1011;  /* the countdown band, the dinner section, the reply form and the footer */

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.3rem + 3.2vw, 4rem);
  --monument: 12.7vw; /* the footer's cropped names */

  --margin: clamp(1.25rem, 2.2vw, 2rem);
  --gutter: clamp(1rem, 2vw, 2rem);
  --section: clamp(6rem, 12vw, 13rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-tone="bone"]    { --g: var(--bone);      --i: var(--ember); --soft: var(--taupe); --tile: #ccc4b1; }
[data-tone="espresso"] { --g: var(--espresso); --i: #fff3ee; --soft: rgb(255 238 233 / 0.75); --tile: #34201f; }
[data-from="bone"]    { --fg: var(--bone);      --fi: var(--ember); }
[data-from="espresso"] { --fg: var(--espresso); --fi: #fff3ee; }
.tone { background: var(--g); color: var(--i); }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--espresso); }
body { margin: 0; background: var(--bone); color: var(--ember); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.5; letter-spacing: -0.02em; font-kerning: normal; font-variation-settings: "WONK" 0; /* Fraunces' plain ampersand and round numerals, not its swash alternates */ -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:target { scroll-margin-top: 1rem; }
::selection { background: var(--ember); color: var(--bone); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
p { max-width: 62ch; text-wrap: pretty; }

/* ---------- type ---------- */
h1, h2, .head, .thanks-title, .foot-name {
  font-family: var(--font-display); font-weight: 400; font-optical-sizing: auto; text-wrap: balance;
}
.head { font-size: var(--step-head); line-height: 1; letter-spacing: -0.02em; }
.row-time { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- controls ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.6rem;
  background: var(--i); color: var(--g); font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform 140ms var(--ease-out), opacity 180ms ease;
}
.button:active { transform: scale(0.97); }
.button:disabled { opacity: 0.6; cursor: progress; }
.link { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 0.25em; text-decoration-thickness: 0.07em; transition: text-decoration-color 180ms ease; }
.link-plain { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 0.07em; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: currentColor; }
  .button:hover { opacity: 0.88; }
}
/* the lines of a printed reply card: you write on them */
.line-field {
  display: block; width: 100%; min-height: 3rem; padding: 0.5rem 0; background: transparent;
  border: 0; border-bottom: 2px solid currentColor; border-radius: 0; font-size: var(--step-lead); line-height: 1.3;
  transition: border-color 180ms ease;
}
textarea.line-field { resize: vertical; font-size: var(--step-body); line-height: 1.55; }
.line-field:focus { outline: none; border-bottom-color: var(--soft); }
.line-field:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.msg { min-height: 1.55em; margin-top: 0.75rem; }

/* ---------- cover ---------- */
.cover { position: relative; display: flex; flex-direction: column; padding: 0 var(--margin); overflow: hidden; }
/* the monogram and menu sit on the photos, in white */
.bar { position: absolute; z-index: 2; top: 1.25rem; left: var(--margin); right: var(--margin); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; min-height: 3.25rem; color: #fff; text-shadow: 0 1px 3px rgb(53 28 29 / 0.5), 0 0 18px rgb(53 28 29 / 0.5); }
.bar svg { filter: drop-shadow(0 0 10px rgb(53 28 29 / 0.5)); }
.mono { display: block; color: inherit; }
.mono svg { display: block; height: 3.5rem; width: auto; } /* the J&D monogram, drawn as outlines in monogram.svg */
.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 2.25rem); }
/* the photos: one fills the screen, holds, then slides sideways to the next. Six slides, the last a copy of the first,
   so after E the track lands on A and starts again from the same picture. */
.slides { position: relative; aspect-ratio: 3 / 2; margin: 0 calc(var(--margin) * -1); /* the photos' own shape, so nothing is cropped */ overflow: hidden; background: var(--tile); }
.slides-track { display: flex; width: 600%; height: 100%; animation: slides 35s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
/* a light espresso tint over every photo, so the white names sit softly on top */
.slides::before { content: ""; position: absolute; inset: 0; background: rgb(53 28 29 / 0.36); pointer-events: none; }
/* a little more shade at the top edge, so the white menu reads over a bright sky */
.slides::after { content: ""; position: absolute; inset: 0 0 auto; height: min(9rem, 40%); background: linear-gradient(rgb(53 28 29 / 0.45), rgb(53 28 29 / 0)); pointer-events: none; }
.slides img { display: block; flex: none; width: calc(100% / 6); height: 100%; object-fit: cover; }
@keyframes slides {
  0%, 16% { transform: translateX(0); }
  20%, 36% { transform: translateX(-16.6667%); }
  40%, 56% { transform: translateX(-33.3333%); }
  60%, 76% { transform: translateX(-50%); }
  80%, 96% { transform: translateX(-66.6667%); }
  100% { transform: translateX(-83.3333%); }
}
@media (prefers-reduced-motion: reduce) {
  .slides { overflow-x: auto; scroll-snap-type: x mandatory; }
  .slides-track { animation: none; }
  .slides img { scroll-snap-align: start; }
}
/* the bone band under the photos: the invitation line, centred, and the code box until a guest is in */
.invite-band { margin-inline: calc(var(--margin) * -1); padding: clamp(2.5rem, 5vw, 3.5rem) var(--margin); display: grid; justify-items: center; gap: 1.75rem; text-align: center; }
.invitation { max-width: 46ch; line-height: 1.45; letter-spacing: -0.03em; }
.gate { width: min(100%, 26rem); text-align: left; }
.gate label { display: block; color: var(--soft); }
.gate-row { display: flex; gap: 0.75rem; align-items: flex-end; margin-top: 0.25rem; }
.gate .line-field { text-transform: uppercase; letter-spacing: 0.08em; }
/* the names stay put in the middle while the photos slide past behind them */
/* the names and date stay put in the middle while the photos slide past behind them */
.hero-title {
  position: absolute; left: 50%; top: 62%; transform: translate(-50%, -50%); text-align: center; /* centred, just below your faces */
  color: #fff; text-shadow: 0 1px 3px rgb(53 28 29 / 0.5), 0 0 28px rgb(53 28 29 / 0.6); /* a soft glow keeps white legible over bright patches */
}
.names { margin: 0; font-size: clamp(2.75rem, 1rem + 5.5vw, 6.5rem); line-height: 1; letter-spacing: -0.02em; white-space: nowrap; }
.hero-date { max-width: none; margin-top: 0.75rem; font-weight: 500; letter-spacing: 0.12em; }

/* ---------- welcome ---------- */
/* the espresso countdown band, centred */
.welcome { padding: clamp(3rem, 6vw, 4.5rem) var(--margin); text-align: center; }
.welcome h2 { font-family: var(--font-text); font-size: var(--step-lead); line-height: 1.3; letter-spacing: -0.06em; }
.captions { display: grid; justify-items: center; gap: 0.5rem; margin-top: 1.5rem; }
.captions p { max-width: 46ch; color: var(--soft); }
.countdown { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem clamp(2rem, 5vw, 4rem); margin-block: 0 1.5rem; }
.countdown div { display: grid; justify-items: center; }
.countdown .n { font-family: var(--font-display); font-weight: 700; color: #fff; font-size: var(--step-head); line-height: 1; font-variant-numeric: tabular-nums lining-nums; min-width: 2ch; }
.countdown .u { font-size: var(--step-small); color: var(--soft); margin-top: 0.35rem; }

/* ---------- chapters (one per event): a darkened photo, title top left, programme bottom left, details on the right ---------- */
.chapter, .rsvp, .faq { padding: var(--section) var(--margin); }
.chapter { position: relative; isolation: isolate; display: flex; flex-direction: column; min-height: min(66.667vw, 100svh); color: #fff; --soft: rgb(255 255 255 / 0.8);
  --field: var(--green); --shade: 18 30 24; /* the section's colour, and the same colour as a tint over its photo */ }
#dinner { --field: var(--espresso); --shade: 30 16 17; }
.chapter-photo { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.chapter::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgb(var(--shade) / 0.62); }
#afterparty .chapter-photo { object-position: 66% 50%; } /* keeps Daphne, the sharp one, in a narrow crop */
.chapter h2 { max-width: 14ch; }
.chapter-grid { margin-top: auto; padding-top: clamp(3rem, 6vw, 5rem); display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
.rows { grid-column: 1 / 7; }
.facts { grid-column: 8 / 13; display: grid; gap: 1.25rem; }
.facts dt { color: var(--soft); font-size: var(--step-small); }
.facts dd { max-width: 46ch; line-height: 1.4; }
.cal { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.row { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); column-gap: 1rem; padding-block: 0.45rem; }
.row-time, .row-what { font-weight: 600; letter-spacing: 0.12em; }
.row-detail { grid-column: 2; font-size: var(--step-small); color: var(--soft); }
.row-detail:empty { display: none; }

/* ---------- reply ---------- */
.rsvp h2 { max-width: 14ch; }
.rsvp-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: clamp(3rem, 6vw, 5rem); }
.rsvp-note { grid-column: 1 / 6; display: grid; gap: 1rem; align-content: start; align-self: start; position: sticky; top: 2rem; } /* stays beside the long form */
.rsvp-note p:last-child { color: var(--soft); }
.reply, .thanks { grid-column: 7 / 13; display: grid; gap: 2.25rem; }
.f > span, .choices legend { display: block; color: var(--soft); margin-bottom: 0.25rem; }
.choices legend { font-family: var(--font-display); font-size: var(--step-lead); color: var(--i); margin-bottom: 0.9rem; }
.choices legend small { display: block; font-family: var(--font-text); font-size: var(--step-small); color: var(--soft); margin-top: 0.2rem; }
.choice-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice span { display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; min-width: 3.25rem; padding: 0 1.25rem; border: 2px solid currentColor; transition: background-color 180ms ease, color 180ms ease, transform 140ms var(--ease-out); }
.choice input:checked + span { background: var(--i); color: var(--g); }
.choice input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 4px; }
.choice input:active + span { transform: scale(0.97); }
#answers { display: grid; gap: 2.25rem; }
.send { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; }
.send .msg { margin: 0; }
.thanks { align-content: start; }
.thanks:focus { outline: none; }
.thanks-title { font-size: var(--step-head); line-height: 1; letter-spacing: -0.02em; text-wrap: balance; }
.thanks-list { display: grid; gap: 0.5rem; font-size: var(--step-lead); }
.thanks-list li span { color: var(--soft); }
.thanks .button { justify-self: start; }

/* ---------- good to know ---------- */
.qs { margin: clamp(3.5rem, 6vw, 5rem) 0 0 calc((100% + var(--gutter)) / 3); max-width: 52rem; display: grid; gap: 0.75rem; }
details { margin-inline: calc(var(--margin) * -1); padding: 0.9rem var(--margin); transition: background-color 240ms ease; }
details[open] { background: var(--tile); padding-bottom: 1.5rem; }
summary { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; font-size: var(--step-lead); cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; flex: none; width: 0.55em; height: 0.55em; margin-top: -0.3em; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); transition: transform 240ms var(--ease-out); }
details[open] summary::after { transform: translateY(0.3em) rotate(-135deg); }
details p { margin-top: 0.75rem; max-width: 48ch; }
.hotels { display: grid; gap: 0.35rem; margin-top: 0.6rem; max-width: 48ch; }

/* ---------- footer ---------- */
.foot { min-height: 100svh; display: flex; flex-direction: column; padding: var(--section) var(--margin) 0; overflow: hidden; }
.foot-top { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); }
.foot-invite { grid-column: 1 / 7; display: grid; gap: 2rem; justify-items: start; }
.foot-links { grid-column: 7 / 13; display: grid; gap: 0.6rem; align-content: start; }
.foot-legal { margin-top: auto; padding-top: 4rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: var(--step-small); color: var(--soft); }
.foot-name { --sink: 28%; font-size: var(--monument); line-height: 0.92; letter-spacing: -0.035em; white-space: nowrap; transform: translateY(var(--sink)); margin-top: 0.5rem; }


/* ---------- phone ---------- */
@media (max-width: 760px) {
  .nav { gap: 1.25rem; }
  .mono svg { height: 2.75rem; }
  .gate { width: 100%; }
  .hero-title { top: 76%; } /* the photo is short on a phone: keep the names below your faces */
  .names { font-size: 9vw; }
  .hero-date { margin-top: 0.35rem; font-size: var(--step-small); }
  .rsvp-grid, .foot-top { display: block; }
  .countdown { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; }
  .chapter-grid { display: block; }
  .facts { margin-top: 2.5rem; }
  .row { grid-template-columns: 6.25em minmax(0, 1fr); column-gap: 0.75rem; }
  .rsvp-note { margin-bottom: 3rem; position: static; }
  .qs { margin-left: 0; }
  summary { font-size: 1.1875rem; }
  .foot-invite { margin-bottom: 3rem; }
  .foot-invite .button { width: 100%; }
  .foot-name { --sink: 0%; font-size: 12vw; padding-bottom: 1.5rem; } /* the whole name fits across a phone */
  /* a phone shows each event's photo whole across the top, with the title over it, fading into the dark behind the details */
  .chapter { min-height: 0; background: var(--field); }
  .chapter-photo, .chapter::before { inset: 0 0 auto; height: auto; aspect-ratio: 3 / 2; }
  .chapter::before { background: linear-gradient(rgb(var(--shade) / 0.55), rgb(var(--shade) / 0.55) 55%, var(--field)); }
}

/* ---------- motion: content stays visible without JavaScript or with reduced motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-rise] { opacity: 0; transform: translateY(24px); animation: rise 1000ms var(--ease-out) forwards; animation-delay: calc(var(--n, 0) * 90ms + 150ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 800ms var(--ease-out), transform 1000ms var(--ease-out); transition-delay: calc(var(--d, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
  .js .shift [data-reveal] { transition-delay: calc(var(--d, 0) * 80ms + 250ms); } /* let the new light settle before the words arrive */
  /* the signature: as each part of the day scrolls in, its light replaces the last one's */
  .js .shift { transition: background-color 900ms ease, color 900ms ease; }
  .js .shift:not(.is-in) { background-color: var(--fg); color: var(--fi); }
  .js .foot-name { transition: transform 1600ms var(--ease-out); transform: translateY(60%); }
  .js .foot.is-in .foot-name { transform: translateY(var(--sink)); }
}
@keyframes rise { to { opacity: 1; transform: none; } }
