@font-face {
  font-family: Garden;
  src: url(/CormorantGaramond.ttf);
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: Pen;
  src: url(/PinyonScript-Regular.ttf);
  font-display: swap;
}

:root {
  --wine: #693e48;
  --ink: #49382f;
  --green: #345648;
  --paper: #fffcf7;
  --floral: url(/floral-invitation.webp);
  --foot: max(12px, env(safe-area-inset-bottom));
  font-family: Georgia, serif;
  color: var(--ink);
  color-scheme: light;
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: #e2d8cd; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: 4px; }
button { cursor: pointer; }
button, a, input { touch-action: manipulation; }
:focus-visible { outline: 3px solid #7a464f; outline-offset: 4px; }
body:has(#home:not([hidden])) :is(.subhead, footer) { display: none; }
body:has(#home:not([hidden]) #gate:not([hidden])) { overflow: hidden; }
html:has(#home:not([hidden])) { scroll-snap-type: y proximity; }

.entrance {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  background: #e2d8cd;
  transition: opacity .78s ease .38s;
}

.entrance::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--floral) center / min(94vw, 76svh, 680px) auto no-repeat;
  opacity: .7;
}

.envelope {
  position: relative;
  isolation: isolate;
  width: min(80vw, 430px, 76svh);
  aspect-ratio: 1.57;
  padding: 0;
  border: 1px solid #c9a79d;
  border-radius: 4px;
  background: linear-gradient(150deg, #e3bdb3, #f3dcd0 47%, #d8b5ab);
  box-shadow: 1px 28px 27px -17px #62473d70, 0 6px 12px #653d3b29, inset 0 0 0 1px #f7ded3;
  perspective: 900px;
}

.folds, .flap { position: absolute; inset: 0; pointer-events: none; border-radius: 3px; }
.folds {
  background: linear-gradient(-34deg, transparent 49.7%, #c89c94 50%, #f4dcd2 50.4%, transparent 50.7%) left bottom / 51% 53% no-repeat,
    linear-gradient(34deg, transparent 49.7%, #c89c94 50%, #f4dcd2 50.4%, transparent 50.7%) right bottom / 51% 53% no-repeat,
    linear-gradient(0deg, #eed3c8, #e2bcb3);
}

.flap {
  background: linear-gradient(180deg, #d3b2a0, #bf9289);
  clip-path: polygon(0 0, 100% 0, 52% 58%, 50% 59%, 48% 58%);
  transform-origin: 50% 0;
  transition: transform .8s cubic-bezier(.4, 0, .22, 1);
}

.flap::before {
  content: "";
  position: absolute;
  inset: 0 0 2px;
  background: url(/lace.svg) center top / 81% 58% no-repeat, linear-gradient(170deg, #f9e8df, #e4bdaf 75%);
  clip-path: inherit;
}

.seal {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 21%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  overflow: hidden;
  border-radius: 45% 49% 47% 54% / 47% 48% 55% 45%;
  background: linear-gradient(145deg, #b77571, #dfaaa2 19%, #a45e66 36%, #7f444f 59%, #c18a83 83%, #a26867);
  box-shadow: 0 3px 5px #734a4650, inset 0 0 0 1px #9b6d68;
  transition: opacity .34s, translate .5s;
  color: #fce4cf;
}

.seal i {
  display: grid;
  place-items: center;
  width: 73%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #edc5b1;
  box-shadow: 0 0 0 2px #995f62, inset 0 1px 4px #673e4a94;
  background: linear-gradient(145deg, #b8817c, #a76a70);
  font: 400 clamp(22px, 7vw, 34px) Garden, Georgia;
  text-shadow: 0 1px 1px #593a43;
}

.tap {
  position: absolute;
  top: calc(50% + min(28vw, 157px, 28svh) + 20px);
  margin: 0;
  padding: 7px 12px;
  background: #fffcf4eb;
  color: var(--wine);
  font: 700 11px/1.4 system-ui;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.entrance.unsealing { opacity: 0; pointer-events: none; }
.unsealing .flap { transform: rotateX(155deg); }
.unsealing .seal, .unsealing .tap { opacity: 0; translate: 0 6px; }

.scene {
  min-height: 100svh;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  padding: clamp(12px, 3svh, 29px) clamp(10px, 3vw, 22px) calc(60px + var(--foot));
  text-align: center;
}

.scene:focus:not(:focus-visible) { outline: none; }

.invitation-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: min(100%, 565px);
  min-height: calc(100svh - clamp(12px, 3svh, 29px) - 60px - var(--foot));
  padding: clamp(29px, 5.5svh, 55px) clamp(24px, 8vw, 68px);
  background: var(--paper);
  box-shadow: 0 12px 35px #62475835;
}

.invitation-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--floral) center / 100% 100% no-repeat;
}

.petals { display: none; }
.direct-rsvp :is(#couple, #details) { display: none; }

.hero-copy, .details-copy, .rsvp-copy { width: min(100%, 360px); }
.hero-copy { padding: 12px 0; }
.label, .sigline {
  margin: 0;
  color: var(--wine);
  font: 700 12px/1.45 system-ui;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.names {
  margin: clamp(17px, 3.3svh, 32px) 0 0;
  color: #4a3931;
  font: 400 clamp(72px, min(21vw, 12.5svh), 116px)/.83 Pen, cursive;
}

.names span, .names i { display: block; }
.names i { margin: 5px 0 8px; color: var(--wine); font: italic 400 29px/1 Garden, Georgia; }
.orn { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 18px auto; color: #90615d; font-size: 12px; }
.orn::before, .orn::after { content: ""; width: clamp(32px, 10vw, 65px); height: 1px; background: linear-gradient(90deg, transparent, #a57866); }
.orn::after { transform: rotate(180deg); }
.greeting { font-size: 10px; }
.verse {
  max-width: 33ch;
  margin: 10px auto 0;
  font: italic 500 clamp(17px, 3svh, 21px)/1.48 Garden, Georgia;
  text-wrap: balance;
}
.sigline { margin: 19px 0; font-size: 10px; letter-spacing: .12em; }

.pill, .primary {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid #b9a495;
  border-radius: 30px;
  background: #fffcf6;
  color: var(--green);
  text-decoration: none;
  font: 650 14px/1.25 system-ui;
}
.pill:hover { background: #f5eee7; }
.primary, .pill.primary { border-color: var(--green); background: var(--green); color: #fffdf8; }
.primary:hover, .pill.primary:hover { border-color: #284236; background: #284236; }
.pill span { display: inline-block; margin-inline-start: 3px; }

.date-title {
  margin: 8px 0 0;
  font: 600 clamp(32px, 8.3vw, 49px)/1 Garden, Georgia;
  text-wrap: balance;
}
.event-time { margin: 7px 0 13px; color: var(--wine); font: 650 14px/1.4 system-ui; }
#clock {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 275px);
  margin: 0 auto 12px;
  padding: 9px 3px;
  border: 1px solid #d6caba;
  border-radius: 13px;
  background: #fffcf6ee;
}
#clock:empty { display: none; }
#clock span { font: 600 9px/1.25 system-ui; text-transform: uppercase; }
#clock span + span { border-left: 1px solid #dfd1c2; }
#clock b {
  display: block;
  margin-bottom: 2px;
  font: 650 clamp(17px, 2.8svh, 23px)/1.12 system-ui;
  font-variant-numeric: lining-nums tabular-nums;
}
.details-copy .orn { margin-block: clamp(15px, 2.6svh, 22px); }
.venue { margin: 0; font: 600 clamp(37px, 8.5vw, 53px)/.96 Garden, Georgia; }
.venue span { display: block; margin: 8px 0; color: var(--wine); font: 700 12px/1.35 system-ui; letter-spacing: .17em; text-transform: uppercase; }
address { font: 500 19px/1.29 Garden, Georgia; }

.map-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 12px;
  margin: 13px 0 17px;
}
.map-links a, .textlink, .back, .link-button { color: var(--green); font: 650 13px/1.3 system-ui; }
.map-links a, .link-button { display: inline-block; padding-block: 4px; }
.link-button { border: 0; padding-inline: 0; background: none; text-decoration: underline; text-underline-offset: 4px; }

.rsvp-copy {
  max-width: 355px;
  padding: 15px clamp(10px, 3vw, 21px);
  border-radius: 14px;
  background: #fffcf7e8;
}
.rsvp-copy h2 { margin: 2px 0 0; font: 600 clamp(40px, 10vw, 61px)/.96 Garden, Georgia; }
.rsvp-intro { margin: 8px 0 16px; font: 500 19px/1.22 Garden, Georgia; }
.rsvp-copy form { display: grid; gap: 13px; text-align: left; }
.rsvp-copy form .primary { justify-self: center; }
.field { display: grid; gap: 5px; }
.rsvp-copy :is(label, legend, [role="status"]) { font: 14px/1.35 system-ui; }
.rsvp-copy input:not([type="radio"]) {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ad9b8e;
  border-radius: 5px;
  background: #fffdfa;
  color: var(--ink);
  font: 16px system-ui;
}
.rsvp-copy fieldset { min-inline-size: 0; margin: 0; padding: 0; border: 0; }
.rsvp-copy fieldset label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 5px;
  padding: 7px 8px;
  border-radius: 5px;
  background: #edf0e9;
}
.rsvp-copy input { accent-color: var(--green); }
.rsvp-copy [role="status"]:empty { margin: 0; }
.rsvp-copy .link-button { margin-top: 10px; }

#music {
  position: fixed;
  z-index: 6;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, calc((100vw - 535px) / 2));
  width: 38px;
  height: 38px;
  border: 1px solid #b9a495;
  border-radius: 50%;
  background: #fffdf9f2;
  color: var(--green);
  font-size: 17px;
}
#music[aria-pressed="true"] { background: var(--green); color: white; }

.dock {
  position: fixed;
  z-index: 8;
  bottom: var(--foot);
  left: 50%;
  display: grid;
  grid-template-columns: .9fr 1.3fr .9fr;
  width: min(calc(100% - 36px), 375px);
  min-height: 48px;
  padding: 2px;
  transform: translateX(-50%);
  border: 1px solid #fffcfa;
  border-radius: 28px;
  background: #fffcf7f0;
  box-shadow: 0 5px 20px #5b493828;
  backdrop-filter: blur(10px);
}
.dock a {
  display: grid;
  align-content: center;
  justify-items: center;
  border-radius: 25px;
  color: var(--green);
  text-align: center;
  text-decoration: none;
  font: 700 10px/1.15 system-ui;
}
.dock b { font: 600 19px/1 Garden, Georgia; }
.dock a[aria-current], .dock a:hover { background: #e7eee4; color: #264638; }

.subhead, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  max-width: 700px;
  margin: auto;
  padding: 16px 22px;
  color: var(--wine);
}
.mark { font: 34px Pen, cursive; text-decoration: none; }
.mark span { font-size: 18px; }
.issue, .toplink, footer { font: 650 11px/1.3 system-ui; letter-spacing: .1em; text-transform: uppercase; }
#sub { max-width: 700px; min-height: 75svh; margin: auto; padding: 24px 16px; background: var(--paper) var(--floral) center / cover; }
.sheet {
  max-width: 480px;
  margin: 16px auto;
  padding: 32px clamp(20px, 5vw, 48px);
  border: 1px solid #d2c2b4;
  background: #fffcf7f5;
}
.sheet h1 { margin: 12px 0; color: var(--wine); font: 600 clamp(41px, 8vw, 61px)/1 Garden, Georgia; }
.sheet p { font-size: 18px; line-height: 1.4; }
.sheet .label { font-size: 10px; }
.sheet .back { display: inline-block; margin-top: 14px; }
.sheet article { padding: 12px 0; border-top: 1px solid #d2c2b4; overflow-wrap: anywhere; white-space: pre-line; }
@media (max-width: 360px), (max-height: 680px) {
  .invitation-card { padding-block: 26px; }
  .names { margin-top: 14px; }
  .hero-copy .orn { margin-block: 11px; }
  .sigline { margin-block: 14px; }
  .event-time { margin-bottom: 10px; }
  .map-links { margin-block: 10px 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  #gate:not(.unsealing) .seal i { animation: seal-beat 3.8s ease-in-out infinite; }
  body.unsealing .hero-copy { animation: rise 1.1s .36s ease-out both; }
  .scene .invitation-card::before { animation: floral-sway 12s ease-in-out infinite alternate paused; }
  .scene.is-current .invitation-card::before { animation-play-state: running; }

  #inside:not([inert]) .petals {
    position: fixed;
    z-index: 3;
    inset: 0;
    display: block;
    width: min(100%, 565px);
    margin-inline: auto;
    overflow: hidden;
    pointer-events: none;
  }

  .petals span {
    --sway: 43px;
    position: absolute;
    top: -12px;
    left: 9%;
    width: 8px;
    height: 5px;
    border-radius: 90% 25% 80% 45%;
    background: radial-gradient(at 68% 28%, #f8dce0, #cd8996);
    animation: petal-fall 14s -3s linear infinite;
  }
  .petals span:nth-child(2) { left: 25%; width: 6px; --sway: -42px; animation: petal-fall 16s -10s linear infinite; }
  .petals span:nth-child(3) { left: 38%; width: 7px; --sway: 28px; animation: petal-fall 18s -5s linear infinite; }
  .petals span:nth-child(4) { left: 49%; height: 6px; --sway: -35px; animation: petal-fall 17s -15s linear infinite; }
  .petals span:nth-child(5) { left: 67%; --sway: 36px; animation: petal-fall 14s -8s linear infinite; }
  .petals span:nth-child(6) { left: 75%; width: 9px; --sway: -49px; animation: petal-fall 19s -13s linear infinite; }
  .petals span:nth-child(7) { left: 87%; height: 4px; --sway: -50px; animation: petal-fall 16s -4s linear infinite; }
  .petals span:nth-child(8) { left: 93%; width: 7px; --sway: -24px; animation: petal-fall 17s -11s linear infinite; }

  #details.is-current .rsvp-cta { animation: rsvp-pulse 3.2s ease-out infinite; }
  #details.is-current .rsvp-cta span { animation: rsvp-arrow 3.2s ease-in-out infinite; }
  #details .rsvp-cta:is(:hover, :focus-visible),
  #details .rsvp-cta:is(:hover, :focus-visible) span { animation-play-state: paused; }

  @keyframes seal-beat { 0%, 46%, 100% { scale: 1; } 20% { scale: 1.09; } 35% { scale: 1.03; } }
  @keyframes rise { from { opacity: 0; transform: translateY(11px); } to { opacity: 1; transform: none; } }
  @keyframes floral-sway {
    from { transform: scale(1.025) translate(-.45%, -.35%) rotate(-.25deg); }
    to { transform: scale(1.045) translate(.6%, .4%) rotate(.35deg); }
  }
  @keyframes petal-fall {
    0% { transform: translate(0, 0) rotate(-45deg); opacity: 0; }
    12% { opacity: .6; }
    42% { transform: translate(var(--sway), 44svh) rotate(120deg); }
    72% { transform: translate(calc(var(--sway) * -.35), 76svh) rotate(230deg); }
    90% { opacity: .5; }
    100% { transform: translate(var(--sway), 103svh) rotate(355deg); opacity: 0; }
  }
  @keyframes rsvp-pulse {
    0%, 100% { box-shadow: 0 4px 10px #34564833, 0 0 0 0 #638c72; }
    14% { box-shadow: 0 6px 13px #34564836, 0 0 0 3px #638c7270; }
    40%, 99% { box-shadow: 0 4px 10px #34564833, 0 0 0 9px #638c7200; }
  }
  @keyframes rsvp-arrow {
    0%, 34%, 100% { transform: translateY(0); }
    17% { transform: translateY(3px); }
  }
}

@media (prefers-reduced-motion: no-preference) and (forced-colors: none) {
  .hero.is-current .names > * {
    --ink-color: #4a3931;
    color: transparent;
    background: linear-gradient(112deg, var(--ink-color) 36%, #9c6946 49%, #b08053 51%, var(--ink-color) 63%)
      100% 0 / 300% 100%;
    background-clip: text;
    animation: name-shine 6s .7s ease-in-out infinite;
  }
  .hero.is-current .names i { --ink-color: var(--wine); animation-delay: .92s; }
  .hero.is-current .names span:last-child { animation-delay: 1.14s; }
  @keyframes name-shine {
    0% { background-position: 100% 0; }
    42%, 100% { background-position: 0 0; }
  }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
