/* Nacre. Champagne linen, olive ink and the glow of an orangery at dusk. */
@font-face { font-family: Nacre Script; src: url("./fonts/great-vibes-regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: Nacre Serif; src: url("./fonts/cormorant-garamond-latin.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Nacre Serif; src: url("./fonts/cormorant-garamond-latin-italic.woff2") format("woff2"); font-style: italic; font-weight: 300 700; font-display: swap; }

:root {
  color-scheme: light;
  --ink: #42492f;
  --secondary: #555844;
  --paper: #eee7db;
  --ivory: #faf6ee;
  --line: #aca18a;
  --gold: #9c7f54;
  --serif: Nacre Serif, Georgia, serif;
  --script: Nacre Script, Georgia, serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  background: #e6e2d9;
  color: var(--ink);
  font: 500 18px/1.44 var(--serif);
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p, ol { margin: 0; }
a { color: inherit; }
button, input, textarea { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
img { display: block; width: 100%; height: auto; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.skip { position: fixed; inset: .5rem auto auto .5rem; z-index: 5; padding: .6rem .8rem; background: var(--ivory); }
.skip:not(:focus), .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.masthead, .invitation { width: min(100%, 444px); margin-inline: auto; }
.masthead {
  min-height: 53px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  padding: .3rem 1rem;
  background: var(--paper) url("./assets/papier.webp") center top / 444px;
}
.brand { padding: .12em .14em .08em .02em; text-decoration: none; font: 400 34px/.94 var(--script); }
.masthead nav, .languages { display: flex; align-items: center; }
.masthead nav { gap: .75rem; }
.languages { padding: 2px; border: 1px solid var(--line); border-radius: 100px; }
.languages button {
  min-width: 34px;
  min-height: 32px;
  padding-inline: .4rem;
  border: 0;
  border-radius: 100px;
  background: none;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .075em;
}
.languages [aria-pressed="true"] { color: var(--ivory); background: var(--ink); }
.nav-rsvp { min-height: 42px; display: grid; place-items: center; font-size: .78rem; font-weight: 700; text-decoration: none; letter-spacing: .06em; }
.nav-rsvp:hover { text-decoration: underline; text-underline-offset: .2em; }
.invitation {
  position: relative;
  container-type: inline-size;
  overflow: clip;
  background: var(--paper) url("./assets/papier.webp") center top / 444px;
  text-align: center;
  box-shadow: 0 16px 52px #423a2c20;
}
.overline {
  color: var(--secondary);
  font-size: .68rem;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.script { font-family: var(--script); font-weight: 400; }

.cover { position: relative; isolation: isolate; aspect-ratio: 9 / 16; overflow: clip; background: var(--paper); }
.cover-art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; }
.chandelier-light, .festoon-light { position: absolute; inset: 0; pointer-events: none; }
.glint {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(17px, 7.5cqw, 33px);
  aspect-ratio: 1;
  translate: -50% -50%;
  opacity: 0;
  background: radial-gradient(circle, #fffbed 0%, #ffe0a29c 28%, transparent 69%);
}
.chandelier-light .glint:nth-child(1) { --x: 30.7%; --y: 19%; --delay: .43s; }
.chandelier-light .glint:nth-child(2) { --x: 61.4%; --y: 17.4%; --delay: .88s; }
.chandelier-light .glint:nth-child(3) { --x: 74.7%; --y: 22%; --delay: 1.24s; }
.chandelier-light .glint:nth-child(4) { --x: 35%; --y: 33%; --delay: 1.52s; }
.chandelier-light .glint:nth-child(5) { --x: 51%; --y: 41.8%; --delay: 2.27s; }
.chandelier-light .glint:nth-child(6) { --x: 67%; --y: 28%; --delay: 2.96s; }
.glint.crystal {
  width: 15px;
  rotate: -14deg;
  background:
    linear-gradient(transparent, #fffaf1, transparent) center / 1px 100% no-repeat,
    linear-gradient(90deg, transparent, #fffaf1, transparent) center / 100% 1px no-repeat,
    radial-gradient(circle, #fff7dc 0%, transparent 63%);
}
.cover-copy { position: absolute; inset: 62% 9% auto; transform: translateY(-50%); }
.cover-copy .overline { letter-spacing: .2em; }
.cover h1 { font: 400 clamp(2.35rem, 14.1cqw, 3.43rem)/1.04 var(--script); padding: .21em .11em .12em; white-space: nowrap; }
.cover h1 i { font-size: .64em; font-style: normal; }
.cover-date { display: block; color: var(--secondary); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.cover-cupid { position: absolute; top: 73%; right: 13%; width: 22%; rotate: -8deg; }
.cover-next, .sound {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ddd0b9;
  border-radius: 50%;
  color: var(--ink);
  background: #faf6efec;
  text-decoration: none;
}
.cover-next { position: absolute; left: calc(50% - 22px); bottom: 2.65%; font-size: 23px; }
.sound { position: fixed; right: max(12px, calc((100% - 444px) / 2 + 12px)); bottom: max(12px, env(safe-area-inset-bottom)); z-index: 3; box-shadow: 0 3px 13px #41382c25; font: 19px/1 Georgia, serif; }
.sound[aria-pressed="true"] { background: var(--ink); color: var(--ivory); }

.chapter { position: relative; padding: 2.65rem clamp(1.2rem, 8cqw, 1.9rem); scroll-margin-top: .6rem; }
.chapter h2 { padding: .1em .08em .18em; font: 400 clamp(2.15rem, 11cqw, 2.78rem)/1.04 var(--script); }
.chapter h2[data-reveal] { position: relative; scroll-margin-top: .8rem; }
.chapter h2[data-reveal]::after {
  content: "";
  position: absolute;
  inset: auto 43% 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.chapter h3 { font-size: 1.31rem; font-weight: 650; line-height: 1.16; }
.countdown { padding-block: 2.1rem 2.9rem; }
.clock { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: .6rem auto 0; }
.clock div { display: grid; gap: .35rem; padding: .13rem .12rem; }
.clock div + div { border-left: 1px solid #a99b8259; }
.clock b { font: 500 clamp(1.56rem, 8.1cqw, 2.15rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.clock small { font-size: .53rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.day-of { margin-top: .75rem; font-style: italic; }

.details { padding-top: 0; }
.festoon { position: relative; width: calc(100% + 2 * clamp(1.2rem, 8cqw, 1.9rem)); margin: -.2rem 0 1.3rem calc(-1 * clamp(1.2rem, 8cqw, 1.9rem)); }
.festoon-light .glint:nth-child(1) { --x: 8.4%; --y: 26.9%; --delay: .28s; }
.festoon-light .glint:nth-child(2) { --x: 43%; --y: 50%; --delay: .64s; }
.festoon-light .glint:nth-child(3) { --x: 70%; --y: 87%; --delay: 1.04s; }
.venue {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  width: min(100%, 296px);
  aspect-ratio: 491 / 625;
  margin: 1rem auto .85rem;
  padding: 3rem 17%;
}
.venue-art { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: fill; }
.venue-copy { width: 100%; }
.venue-copy .script { margin-bottom: .28rem; font-size: 1.83rem; line-height: 1; }
.venue-copy h3 { margin-inline: auto; max-width: 15ch; }
.venue-copy > p:not(.script) { margin-top: .28rem; }
.venue-time { font-size: .89rem; color: var(--secondary); }
.venue-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: .55rem; }
.pill { display: inline-grid; place-items: center; min-height: 42px; padding: .4rem .65rem; border-radius: .32rem; background: var(--ink); color: var(--ivory); font-size: .77rem; font-weight: 650; text-decoration: none; }
.pill:hover, .submit:hover { background: #515b3b; }
.calendar summary, .gift-choices summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.calendar-links { display: grid; gap: .32rem; padding: .55rem .24rem .2rem; font-size: .85rem; }
.calendar-links a { text-underline-offset: .2em; }

.programme { padding-top: 1.25rem; }
.gramophone { width: min(38%, 136px); margin: 0 auto 1rem; }
.timeline { list-style: none; padding: 0; margin: .6rem auto 0; max-width: 28ch; }
.timeline li { position: relative; display: grid; justify-items: center; gap: .16rem; padding: .48rem 0 .25rem; }
.timeline li + li { margin-top: 1.57rem; }
.timeline li + li::before { position: absolute; top: -1.35rem; left: 50%; content: ""; width: 1px; height: 1.16rem; background: var(--gold); opacity: .66; transform-origin: center top; }
.timeline li time { color: var(--secondary); font-size: .75rem; font-weight: 700; letter-spacing: .085em; font-variant-numeric: lining-nums tabular-nums; }
.timeline li p { color: var(--secondary); }

.dress { padding-top: 2.35rem; }
.guests { position: relative; z-index: 1; width: min(100%, 345px); height: 153px; object-fit: contain; object-position: center bottom; margin: .4rem auto -1.4rem; }
.dress-note { padding: 2.1rem 1.22rem 1.3rem; border: 1px solid #bfb29b81; border-radius: 1.25rem; background: #faf6eee8; box-shadow: 0 6px 13px #69573d10; }
.dress-note p { margin-top: .48rem; }
.dress-note .dress-white { font-style: italic; color: var(--secondary); }
.gifts { padding-top: 1.8rem; }
.section-cupid { width: 78px; margin: 0 auto .45rem; rotate: -8deg; }
.envelope { width: min(53%, 163px); margin: .68rem auto 1.12rem; }
.gift-copy { max-width: 27ch; margin: 0 auto 1rem; }
.gift-choices { display: grid; gap: .47rem; }
.gift-choices details { border: 1px solid var(--line); border-radius: .34rem; text-align: left; background: #faf6ef99; }
.gift-choices summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; padding: .45rem .66rem; font-weight: 650; }
.gift-choices summary::after { content: ""; width: 7px; height: 7px; border-right: 1px solid; border-bottom: 1px solid; rotate: 45deg; translate: 0 -2px; }
.gift-choices [open] summary::after { rotate: 225deg; translate: 0 2px; }
.gift-choices p { padding: 0 .66rem .66rem; font-size: .94rem; }

.rsvp { padding-top: 2.2rem; }
.rsvp::before { content: ""; position: absolute; top: 0; left: 42%; width: 16%; border-top: 1px solid var(--line); }
.rsvp > .section-cupid { width: 63px; }
.rsvp form { display: grid; text-align: left; gap: .9rem; margin-top: 1.25rem; }
fieldset { min-inline-size: 0; border: 0; padding: 0; margin: 0; }
legend { padding: 0; }
legend, .field > span, .form-label { font-size: .9rem; font-weight: 650; }
.radio, .companion-actions { display: flex; flex-wrap: wrap; gap: .32rem .7rem; }
.radio label, .check { display: flex; align-items: center; gap: .4rem; min-height: 42px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); margin: 0; }
.field { display: grid; gap: .24rem; }
.field input, .field textarea {
  min-width: 0;
  width: 100%;
  min-height: 43px;
  padding: .4rem .55rem;
  border: 1px solid var(--line);
  border-radius: .27rem;
  background: #fbf8f04d;
}
.field textarea { resize: vertical; }
.guest-details { display: grid; gap: .9rem; }
.companion-actions { margin-top: .43rem; }
.outline, .remove { min-height: 42px; padding: .27rem .58rem; border: 1px solid var(--line); border-radius: .29rem; background: #fcf8ee6b; font-size: .85rem; }
.guest-row { display: grid; gap: .44rem; margin-top: .46rem; padding: .37rem .55rem .67rem; border: 1px solid var(--line); border-radius: .31rem; background: #faf6ee75; }
.guest-heading { display: flex; align-items: center; justify-content: space-between; font-weight: 650; }
.remove { border-color: transparent; background: none; text-decoration: underline; text-underline-offset: .18em; }
.submit { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 46px; padding: .4rem .65rem; border: 0; border-radius: .32rem; background: var(--ink); color: var(--ivory); font-weight: 700; }
.confirmation { margin-top: 1.15rem; padding: 1rem; border: 1px solid var(--line); border-radius: .4rem; background: #faf6eeaf; }
.confirmation .script { font-size: 2.05rem; }
.confirmation .outline { margin-top: .65rem; }

.endnote { display: grid; justify-items: center; gap: .3rem; padding-top: 1.7rem; }
.endnote .script { padding-inline: .15em; font-size: clamp(1.5rem, 7.3cqw, 1.98rem); line-height: 1.13; }
.window { position: relative; isolation: isolate; display: block; width: min(80%, 246px); margin-top: .8rem; }
.window::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 37% 22% 5%;
  opacity: .5;
  background: radial-gradient(ellipse at 50% 66%, #fff4d9, transparent 71%);
}
.window span { position: absolute; left: calc(50% - 18px); bottom: 14%; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--ivory); background: var(--ink); }
.endnote small { margin-top: 1rem; color: var(--secondary); font-size: .63rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

@media (min-width: 470px) {
  .masthead { margin-top: 16px; }
  .invitation { margin-bottom: 20px; }
}
@media (max-width: 350px) {
  .chapter { padding-inline: 1rem; }
  .festoon { width: calc(100% + 2rem); margin-left: -1rem; }
  .clock small { font-size: .49rem; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes arrive { from { opacity: .24; translate: 0 11px; } to { opacity: 1; translate: 0 0; } }
  @keyframes drift { from { opacity: .22; translate: 6px 5px; } to { opacity: 1; translate: 0 0; } }
  @keyframes draw { from { opacity: .35; scale: 1 .24; } to { opacity: .66; scale: 1; } }
  @keyframes ink-reveal {
    from { opacity: .45; clip-path: polygon(-16% -35%, -1% -35%, -16% 144%, -16% 144%); }
    to { opacity: 1; clip-path: polygon(-16% -35%, 121% -35%, 110% 144%, -16% 144%); }
  }
  @keyframes rule-draw { from { opacity: .2; scale: .18 1; } to { opacity: 1; scale: 1; } }
  @keyframes glimmer {
    0%, 100% { opacity: 0; scale: .64; }
    32% { opacity: .9; scale: 1.3; }
    59% { opacity: .36; scale: .9; }
    75% { opacity: .57; scale: 1.08; }
  }
  @keyframes light-sway { 32% { rotate: -.72deg; } 70% { rotate: .45deg; } }
  @keyframes paper-lift { from { opacity: .34; scale: .97; } to { opacity: 1; scale: 1; } }
  @keyframes window-light { from { opacity: 0; scale: .82; } to { opacity: .5; scale: 1; } }
  .cover-copy .overline { animation: arrive .54s var(--ease) both; }
  .cover h1 { animation: ink-reveal 1.04s .1s var(--ease) backwards; }
  .cover-date { animation: arrive .57s .48s var(--ease) both; }
  .cover-cupid { animation: drift 1.1s .25s var(--ease) both; }
  .chandelier-light .glint, .festoon.in-view .glint { animation: glimmer 2.15s var(--delay) ease-in-out both; }
  .chandelier-light .crystal { animation-duration: 1.17s; }
  img.in-view { animation: arrive .63s var(--ease) both; }
  h2.in-view { animation: arrive .68s var(--ease) both; }
  h2.in-view::after { animation: rule-draw .49s .16s var(--ease) both; }
  .clock.in-view b { animation: arrive .5s var(--ease) both; }
  .clock.in-view div:nth-child(2) b { animation-delay: .062s; }
  .clock.in-view div:nth-child(3) b { animation-delay: .12s; }
  .clock.in-view div:nth-child(4) b { animation-delay: .16s; }
  .festoon.in-view { transform-origin: center top; animation: arrive .7s var(--ease) both, light-sway 2.4s .3s ease-in-out; }
  .venue.in-view .venue-art { animation: paper-lift .74s var(--ease) both; }
  .venue.in-view .venue-copy { animation: arrive .55s .15s var(--ease) both; }
  .timeline li.in-view { animation: arrive .52s var(--ease) both; }
  .timeline li.in-view + li.in-view::before { animation: draw .58s var(--ease) both; }
  .gifts .envelope { transition: scale .25s var(--ease), rotate .25s var(--ease); }
  .gifts:has(.gift-choices [open]) .envelope { scale: 1.047; rotate: -2deg; }
  .gift-choices summary::after { transition: rotate .19s var(--ease), translate .19s var(--ease); }
  .gift-choices [open] p, .confirmation:not([hidden]) { animation: arrive .24s var(--ease) both; }
  .window:has(.in-view)::before { animation: window-light .95s .15s var(--ease) both; }
}
