/* Joshua & Daphne: blush and aubergine, Bodoni Moda over Jost.
   Each part of the day has its own tone: morning (dawn), evening (dusk), night. */

:root {
  --blush: #edccbe;
  --dawn: #f6e3da;
  --mauve: #6c4857;
  --aubergine: #351a2b;
  --rose: #d0aeae;

  --font-display: "Bodoni Moda", Didot, "Bodoni 72", serif;
  --font-text: "Jost", "Futura", system-ui, sans-serif;

  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.3rem + 3.2vw, 4rem);
  --monument: 15.6vw; /* app.js sets it so the names fill the cover exactly */

  --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);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

[data-tone="blush"]   { --g: var(--blush);     --i: var(--aubergine); --soft: var(--mauve); --tile: #e5bdad; }
[data-tone="morning"] { --g: var(--dawn);      --i: var(--aubergine); --soft: var(--mauve); --tile: #f0d6ca; }
[data-tone="dusk"]    { --g: var(--mauve);     --i: var(--blush);     --soft: var(--blush); --tile: #7a5464; }
[data-tone="night"]   { --g: var(--aubergine); --i: var(--blush);     --soft: var(--rose);  --tile: #46253b; }
[data-from="blush"]   { --fg: var(--blush);     --fi: var(--aubergine); }
[data-from="morning"] { --fg: var(--dawn);      --fi: var(--aubergine); }
[data-from="dusk"]    { --fg: var(--mauve);     --fi: var(--blush); }
[data-from="night"]   { --fg: var(--aubergine); --fi: var(--blush); }
.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(--aubergine); }
body { margin: 0; background: var(--blush); color: var(--aubergine); font-family: var(--font-text); font-size: var(--step-body); line-height: 1.55; letter-spacing: 0.01em; font-kerning: normal; -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(--aubergine); color: var(--blush); }
:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
p { max-width: 62ch; text-wrap: pretty; }

/* ---------- type ---------- */
h1, h2, .head, .mono, .strip-name, .thanks-title, .foot-name {
  font-family: var(--font-display); font-weight: 500; font-optical-sizing: auto; text-wrap: balance;
}
.head { font-size: var(--step-head); line-height: 1; letter-spacing: -0.02em; }
.nums, .row-time, .strip-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; min-height: 100svh; display: flex; flex-direction: column; padding: 1.25rem var(--margin) 0; overflow: hidden; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; min-height: 3.25rem; }
.mono { font-size: var(--step-lead); text-decoration: none; letter-spacing: -0.01em; }
.nav { display: flex; align-items: center; gap: clamp(1.25rem, 2.5vw, 2.25rem); }
.invitation { margin-top: clamp(3rem, 13vh, 9rem); max-width: 25ch; font-size: var(--step-lead); line-height: 1.35; }
.cover-foot { position: relative; z-index: 1; margin-top: auto; padding-top: 3rem; display: flex; justify-content: space-between; align-items: flex-end; gap: 2rem; }
.when { font-size: var(--step-lead); line-height: 1.3; }
.gate { width: min(100%, 26rem); }
.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; }
.names { font-size: var(--monument); line-height: 0.92; letter-spacing: -0.035em; white-space: nowrap; margin: 0.5rem 0 0.3em; }
.fit { display: block; width: fit-content; }
.fit > span { display: inline-block; } /* keeps each word's box to its line, so it never covers the date above */

/* ---------- welcome ---------- */
.welcome { min-height: 100svh; display: flex; flex-direction: column; padding: calc(var(--section) * 0.6) var(--margin) 0; }
.welcome h2 { max-width: 17ch; }
.captions { display: flex; gap: 3rem; margin-top: 1.75rem; }
.captions p { max-width: 26ch; }
.strip { flex: 1; min-height: 46vh; display: flex; margin: clamp(2.5rem, 6vh, 4rem) calc(var(--margin) * -1) 0; }
.strip li { flex: var(--h, 1) 1 0; display: flex; min-width: 0; }
.strip a { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem; padding: 1.5rem var(--margin) 2rem; text-decoration: none; }
.strip-time { font-size: var(--step-lead); }
.strip-name { font-size: var(--step-head); line-height: 1; letter-spacing: -0.02em; transition: transform 400ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .strip a:hover .strip-name { transform: translateX(0.75rem); } }

/* ---------- chapters (one per event) ---------- */
.chapter, .rsvp, .faq { padding: var(--section) var(--margin); }
.chapter h2 { max-width: 20ch; }
.chapter-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: clamp(3.5rem, 7vw, 6rem); align-items: start; }
.facts { grid-column: 1 / 6; grid-row: 1; align-self: end; display: grid; gap: 1.5rem; }
.facts dt { color: var(--soft); font-size: var(--step-small); }
.tname { grid-column: 7 / 8; grid-row: 1; font-size: var(--step-small); color: var(--soft); padding-top: 0.2rem; }
.rows { grid-column: 8 / 13; grid-row: 1; }
.row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) auto; gap: 1rem; padding-block: 0.8rem; align-items: baseline; }
.row-time { color: var(--soft); }
.row-detail { text-align: right; color: var(--soft); }

/* ---------- 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 / 5; display: grid; gap: 1rem; align-content: start; }
.rsvp-note p:last-child { color: var(--soft); }
.reply, .thanks { grid-column: 6 / 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; }

/* ---------- 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 / 8; display: grid; gap: 2rem; justify-items: start; }
.foot-links { grid-column: 10 / 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 { font-size: var(--monument); line-height: 0.92; letter-spacing: -0.035em; white-space: nowrap; transform: translateY(28%); margin-top: 0.5rem; }

/* ---------- tablet: the strip's blocks are too narrow for the big labels ---------- */
@media (min-width: 761px) and (max-width: 1100px) { .strip-name { font-size: var(--step-lead); } }

/* ---------- phone ---------- */
@media (max-width: 760px) {
  .nav { gap: 1.25rem; }
  .nav .wide { display: none; }
  .invitation { margin-top: clamp(2rem, 8vh, 4rem); }
  .cover-foot { flex-direction: column; align-items: stretch; gap: 1.75rem; }
  .gate { width: 100%; }
  :root { --monument: 19vw; }
  .names { line-height: 0.86; margin-bottom: 0.32em; }
  .names .fit > span { display: block; }
  .captions { flex-direction: column; gap: 0.75rem; }
  .strip { flex-direction: column; min-height: 0; }
  .strip li { flex: none; min-height: calc(var(--h, 1) * 7vh + 8vh); }
  .chapter-grid, .rsvp-grid, .foot-top { display: block; }
  .rows { margin-top: 0; }
  .tname { display: none; }
  .row { grid-template-columns: 5.5em minmax(0, 1fr); gap: 0.1rem 0.75rem; padding-block: 0.7rem; }
  .row-detail { grid-column: 2; text-align: left; }
  .facts { margin-top: 3rem; }
  .rsvp-note { margin-bottom: 3rem; }
  .qs { margin-left: 0; }
  summary { font-size: 1.1875rem; }
  .foot-invite { margin-bottom: 3rem; }
  .foot-invite .button { width: 100%; }
  .foot-name { font-size: 34vw; }
}

/* ---------- 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 .names [data-rise] { transform: translateY(18%); animation-duration: 1400ms; }
  .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 + 500ms); } /* let the new light settle before the words arrive */
  .js .strip li { clip-path: inset(0 100% 0 0); transition: clip-path 1300ms var(--ease-in-out); transition-delay: calc(var(--n, 0) * 280ms + 200ms); }
  .js .strip.is-in li { clip-path: inset(0); }
  /* the signature: as each part of the day scrolls in, its light replaces the last one's */
  .js .shift { transition: background-color 1600ms ease, color 1600ms 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(28%); }
  @media (max-width: 760px) { .js .strip li { clip-path: inset(0 0 100% 0); } }
}
@keyframes rise { to { opacity: 1; transform: none; } }
