/* Everything below the opening: plain velvet, gold arches and thin gold lines.
   velvet.webp repeats down the column, so the side curtains of the final frame carry on. */
html { scroll-behavior: smooth; }

.page {
  --gold: #b98a3e;
  --gold-light: #e8c987;
  --line: color-mix(in srgb, var(--gold-light) 55%, transparent);
  position: relative;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  overflow: hidden;
  background: #5a1018 url(assets/velvet.webp) top center / 100% auto repeat-y;
  color: var(--ivory);
  font: 400 18px/1.5 "Cormorant Garamond", Georgia, serif;
  text-align: center;
}

.page[hidden] { display: none; }

/* The front edge of the stage: the flowers stand on it */
.stage-lip {
  height: 22px;
  border-top: 1px solid var(--gold-light);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(#2a0509, #160306);
  box-shadow: 0 -10px 28px rgba(255, 200, 130, .16), 0 10px 22px rgba(0, 0, 0, .55);
}

.sec {
  position: relative;
  padding: 72px 34px 40px;
}

/* Petals fall behind the content, never across a photo or a button */
.sec > :not(.petals, .flowers) {
  position: relative;
  z-index: 1;
}

.head { margin-bottom: 36px; }

.eyebrow {
  color: var(--gold-light);
  font-size: 13px;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.head h2,
.closing-names {
  color: var(--gold-light);
  font: 400 46px/1.15 "Great Vibes", "Snell Roundhand", cursive;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.rule {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 64px 0;
  color: var(--gold-light);
  font-size: 11px;
  font-style: normal;
}

.rule i { font-style: normal; }

.rule::before,
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transition: transform 1.1s cubic-bezier(.2, .7, .2, 1) .25s;
}

.rule::before { transform-origin: right; }
.rule::after { transform-origin: left; }
.head.in .rule::before,
.head.in .rule::after { transform: none; }

.lead {
  margin-top: 26px;
  font-size: 21px;
  font-style: italic;
  line-height: 1.35;
}

.sample-tag {
  margin-top: 22px;
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: .1em;
  opacity: .8;
}

/* Sections reveal as they enter view */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}

.rv.in {
  opacity: 1;
  transform: none;
}

.sample-tag.rv.in { opacity: .8; }

/* Shared pieces */
.arch-photo {
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 0 1px var(--gold-light), 0 0 0 6px rgba(26, 3, 8, .55), 0 0 0 7px var(--line), 0 10px 26px rgba(0, 0, 0, .45);
}

.arch-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.button {
  display: inline-block;
  min-height: 48px;
  padding: 12px 28px;
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  background: linear-gradient(100deg, var(--gold), var(--gold-light) 50%, var(--gold));
  color: #2c0d08;
  font: 500 18px/1.3 "Cormorant Garamond", Georgia, serif;
  text-decoration: none;
  cursor: pointer;
}

.button:disabled { opacity: .6; }

.link {
  display: inline-block;
  padding: 10px 6px;
  border: 0;
  background: none;
  color: var(--gold-light);
  font: 500 17px/1.2 "Cormorant Garamond", Georgia, serif;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
  cursor: pointer;
}

.frame {
  position: relative;
  padding: 34px 22px 30px;
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--line);
  outline-offset: -7px;
  background: rgba(26, 3, 8, .42);
}

/* Couple: two stage doors */
.doors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.door .arch-photo { aspect-ratio: 3 / 4.3; }
.door + .door { transition-delay: .18s; }

.door figcaption {
  display: grid;
  margin-top: 16px;
  line-height: 1.25;
}

.door strong {
  color: var(--gold-light);
  /* Long names shrink to fit their door, as they do inside the arch */
  font: 400 clamp(22px, calc(300px / var(--chars)), 32px)/1.2 "Great Vibes", "Snell Roundhand", cursive;
}

.door span { font-size: 15px; }

/* Save the date: the seal, then the countdown */
.seal {
  position: relative;
  display: grid;
  place-items: center;
  height: 200px;
  overflow: hidden;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 0 1px var(--gold-light), 0 0 0 6px rgba(26, 3, 8, .55), 0 0 0 7px var(--line);
  background: #1f0408;
}

.seal-date p {
  color: var(--gold-light);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
}

.seal-date span {
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.seal canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  cursor: grab;
  transition: opacity .8s ease;
}

.seal.is-revealed canvas { opacity: 0; pointer-events: none; }

.hint {
  margin-top: 14px;
  font-size: 16px;
  font-style: italic;
}

.count { margin-top: 40px; }

.count-title {
  margin-bottom: 14px;
  color: var(--gold-light);
  font-size: 19px;
  font-style: italic;
}

.units {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-block: 1px solid var(--line);
}

.units[hidden], .count-title[hidden], .hint[hidden], .link[hidden] { display: none; }

.unit { padding: 12px 0 10px; }
.unit + .unit { border-left: 1px solid var(--line); }

.unit b {
  display: block;
  color: var(--gold-light);
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}

.unit span {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

/* Events: a playbill */
.playbill {
  padding: 0;
  list-style: none;
  counter-reset: act;
}

.act {
  padding: 22px 0 16px;
  border-top: 1px solid var(--line);
  counter-increment: act;
}

.act:last-child { border-bottom: 1px solid var(--line); }

.act::before {
  content: attr(data-act) " " counter(act, upper-roman);
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.act h3 {
  color: var(--gold-light);
  font: 400 38px/1.2 "Great Vibes", "Snell Roundhand", cursive;
}

.act-when { font-size: 19px; font-weight: 500; }
.act-when span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); }
.act-where { font-size: 17px; }

/* Directions */
.frame-lantern {
  display: block;
  width: 108px;
  margin: 0 auto 12px;
}

.frame-title {
  color: var(--gold-light);
  font-size: 25px;
  font-weight: 500;
  line-height: 1.2;
}

.frame .button { margin-top: 20px; }

/* Our Story: a gold thread runs down through the scenes, one length at a time */
.thread {
  padding: 0;
  list-style: none;
  counter-reset: scene;
}

.scene {
  position: relative;
  padding-bottom: 68px;
  counter-increment: scene;
}

.scene:last-child { padding-bottom: 0; }

.scene::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 1px;
  height: 52px;
  background: var(--gold-light);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1s ease .55s;
}

.scene:last-child::after { display: none; }
.scene.in::after { transform: none; }

.scene .arch-photo {
  width: 78%;
  margin: 0 auto 20px;
  aspect-ratio: 4 / 5;
}

.scene-when {
  color: var(--gold-light);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.scene-when::before {
  content: attr(data-scene) " " counter(scene, upper-roman) " · ";
}

.scene h3 {
  color: var(--gold-light);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.25;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-flow: dense;
  gap: 18px 14px;
  padding: 0;
  list-style: none;
}

.gallery li:nth-child(even):not(.wide) { transition-delay: .12s; }
.gallery .wide { grid-column: span 2; }

.gallery button {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 0 1px var(--gold-light), 0 8px 20px rgba(0, 0, 0, .4);
  background: none;
  cursor: zoom-in;
}

.gallery .wide button { border-radius: 2px; }

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.gallery .wide img { aspect-ratio: 3 / 2; }

.viewer {
  max-width: 100vw;
  max-height: 100dvh;
  width: 100vw;
  height: 100dvh;
  padding: 0;
  border: 0;
  background: rgba(10, 1, 4, .94);
  color: var(--gold-light, #e8c987);
}

.viewer::backdrop { background: #0a0104; }

.viewer[open] {
  display: grid;
  place-items: center;
}

.viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer button {
  position: absolute;
  border: 0;
  background: rgba(10, 1, 4, .55);
  color: #e8c987;
  font: 500 18px "Cormorant Garamond", Georgia, serif;
  cursor: pointer;
}

.viewer-close {
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  padding: 10px 16px;
}

.viewer-step {
  top: 50%;
  width: 46px;
  height: 64px;
  margin-top: -32px;
  font-size: 34px !important;
}

.viewer-step.prev { left: 6px; }
.viewer-step.next { right: 6px; }

/* Film */
.film {
  border: 1px solid var(--gold-light);
  outline: 1px solid var(--line);
  outline-offset: 5px;
  background: #0a0104;
}

.film video,
.film img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.film-play {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ivory);
  font: inherit;
}

button.film-play { cursor: pointer; }

.film-play img { opacity: .72; }

.film-play span {
  position: absolute;
  inset: auto 0 14px;
  color: var(--gold-light);
  font-size: 19px;
  font-style: italic;
  text-shadow: 0 2px 8px #000;
}

/* Blessing wall */
.notes {
  display: grid;
  gap: 16px;
  padding: 0;
  list-style: none;
}

.note {
  padding: 18px 20px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(rgba(255, 200, 130, .1), transparent 70%);
  animation: note-in .7s ease both;
}

.note p {
  font-size: 19px;
  font-style: italic;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.note cite {
  display: block;
  margin-top: 6px;
  color: var(--gold-light);
  font-size: 15px;
  font-style: normal;
  overflow-wrap: anywhere;
}

@keyframes note-in {
  from { opacity: 0; transform: translateY(10px); }
}

/* Forms */
.form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
  padding: 24px 20px;
  border: 1px solid var(--line);
  background: rgba(26, 3, 8, .42);
  text-align: left;
}

.form label {
  display: grid;
  gap: 4px;
  color: var(--gold-light);
  font-size: 16px;
}

.form label[hidden] { display: none; }

.form input:not([type="radio"]),
.form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(10, 1, 4, .5);
  color: var(--ivory);
  font: 400 18px/1.35 "Cormorant Garamond", Georgia, serif;
}

.form textarea { resize: vertical; }

.form input:focus-visible,
.form textarea:focus-visible,
.page a:focus-visible,
.page button:focus-visible,
.dock a:focus-visible,
.dock button:focus-visible {
  outline: 2px solid var(--gold-light, #e8c987);
  outline-offset: 2px;
}

.form .button { justify-self: center; }
.form-note { font-style: italic; text-align: center; }

.choices { display: grid; gap: 6px; }

.choices label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: var(--ivory);
  font-size: 18px;
}

.choices input { accent-color: var(--gold-light); }

.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.status {
  min-height: 1.4em;
  font-style: italic;
  text-align: center;
}

/* Closing: the curtain call */
.closing { padding-bottom: 170px; }

.closing-photo {
  width: 66%;
  margin: 22px auto 26px;
  aspect-ratio: 4 / 5;
}

.closing-names {
  font-size: 52px;
  background: linear-gradient(100deg, var(--gold) 15%, var(--gold-light) 42%, #fff8e3 50%, var(--gold-light) 58%, var(--gold) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.closing-names span { font-size: .62em; }
.closing .button { margin-top: 26px; }

.signoff {
  margin-top: 22px;
  font-style: italic;
}

.flowers {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.flowers img { width: 38%; height: auto; }
.flowers img + img { transform: scaleX(-1); }

/* Falling petals: a few CSS shapes, running only while on screen */
.petals {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.petals i {
  position: absolute;
  top: -20px;
  width: 11px;
  height: 14px;
  border-radius: 80% 10% 80% 10%;
  background: linear-gradient(135deg, #e9828f, #8f1a30);
  opacity: 0;
  animation: fall 13s linear infinite paused;
  will-change: transform;
}

.petals.is-live i { animation-play-state: running; }

.petals i:nth-child(1) { left: 12%; animation-delay: 0s; }
.petals i:nth-child(2) { left: 30%; animation-delay: -3s; animation-duration: 16s; }
.petals i:nth-child(3) { left: 48%; animation-delay: -7s; }
.petals i:nth-child(4) { left: 64%; animation-delay: -1.5s; animation-duration: 15s; }
.petals i:nth-child(5) { left: 80%; animation-delay: -10s; }
.petals i:nth-child(6) { left: 92%; animation-delay: -5s; animation-duration: 17s; }

@keyframes fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0); }
  8% { opacity: .75; }
  85% { opacity: .75; }
  100% { opacity: 0; transform: translate3d(34px, var(--fall, 900px), 0) rotate(300deg); }
}

/* Date, venue and directions, one tap away */
.dock {
  --gold: #b98a3e;
  --gold-light: #e8c987;
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 480px;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--gold-light);
  background: #1a0308;
  color: #fbf3e4;
  font: 400 14px/1.2 "Cormorant Garamond", Georgia, serif;
  transform: translate(-50%, 102%);
  transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.dock[hidden] { display: none; }
.dock.is-up { transform: translate(-50%, 0); }

.dock a {
  color: inherit;
  text-decoration: none;
}

.dock a:first-child {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  text-align: left;
}

.dock b {
  display: block;
  color: var(--gold-light);
  font-size: 17px;
  font-weight: 500;
}

.dock span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock .dock-go {
  display: grid;
  place-items: center;
  padding: 0 18px;
  background: linear-gradient(100deg, var(--gold), var(--gold-light) 50%, var(--gold));
  color: #2c0d08;
  font-size: 17px;
  font-weight: 500;
}

.dock-music {
  width: 52px;
  border: 0;
  background: none;
  color: var(--gold-light);
  font-size: 22px;
  cursor: pointer;
}

.dock-music.is-playing { background: rgba(232, 201, 135, .18); }

/* Scroll cue on the final frame */
.cue {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 4;
  padding: 7px 16px;
  border: 1px solid var(--gold-light);
  border-radius: 999px;
  background: rgba(26, 3, 8, .78);
  color: var(--gold-light);
  font: 400 15px/1.2 "Cormorant Garamond", Georgia, serif;
  white-space: nowrap;
  text-decoration: none;
  transform: translateX(-50%);
  animation: cue-in 1s ease both, cue-bob 2.6s ease-in-out 1s infinite;
}

.cue[hidden] { display: none; }
.is-away .cue { animation-play-state: paused; }

@keyframes cue-in {
  from { opacity: 0; }
}

@keyframes cue-bob {
  50% { transform: translate(-50%, 5px); }
}

/* Tablet: the same stage with more room. Phones never reach these rules. */
@media (min-width: 700px) {
  .page {
    --fall: 1100px;
    font-size: 20px;
  }

  .sec { padding: 104px max(56px, calc((100% - 1080px) / 2)) 48px; }
  .head { margin-bottom: 52px; }

  .head h2 { font-size: 64px; }
  .eyebrow { font-size: 14px; }
  .rule { width: 280px; margin: 14px auto 0; }
  .lead { max-width: 620px; margin-inline: auto; font-size: 25px; }

  .doors { max-width: 640px; margin-inline: auto; gap: 40px; }
  .door strong { font-size: clamp(26px, calc(380px / var(--chars)), 44px); }
  .door span { font-size: 17px; }

  .seal, .hint, .count { max-width: 560px; margin-inline: auto; }
  .seal { height: 260px; }
  .seal-date p { font-size: 40px; }
  .unit b { font-size: 46px; }

  .playbill {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
  }

  .act,
  .act:last-child {
    flex: 0 1 calc(50% - 12px);
    padding: 26px 22px 16px;
    border: 1px solid var(--line);
    background: rgba(26, 3, 8, .3);
  }

  .frame { max-width: 640px; margin-inline: auto; padding: 44px 40px 40px; }
  .frame-title { font-size: 32px; }

  .scene {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 56px;
    padding-bottom: 100px;
    text-align: left;
  }

  .scene .arch-photo { grid-row: 1 / -1; width: 100%; max-width: 380px; margin: 0 0 0 auto; }
  .scene-when { grid-area: 2 / 2; }
  .scene h3 { grid-area: 3 / 2; font-size: 34px; }
  .scene > p:last-child { grid-area: 4 / 2; }

  .scene:nth-child(even) { text-align: right; }
  .scene:nth-child(even) .arch-photo { grid-column: 2; margin: 0 auto 0 0; }
  .scene:nth-child(even) .scene-when,
  .scene:nth-child(even) h3,
  .scene:nth-child(even) > p:last-child { grid-column: 1; }

  .scene::after { bottom: 20px; height: 60px; }

  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }

  .film { max-width: 760px; margin-inline: auto; }

  .notes { display: flex; flex-wrap: wrap; justify-content: center; }
  .note { flex: 0 1 calc(50% - 8px); }
  .form { max-width: 560px; margin: 36px auto 0; padding: 32px; }
  #wall .link, #wall .sample-tag { display: block; margin-inline: auto; }

  .closing { padding-bottom: 240px; }
  .closing-photo { width: 340px; }
  .closing-names { font-size: 76px; }
  .flowers img { width: min(26%, 300px); }

  /* The bar floats as a gold-edged pill rather than a full-width strip */
  .dock {
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(640px, calc(100% - 48px));
    max-width: none;
    padding-bottom: 0;
    overflow: hidden;
    border: 1px solid var(--gold-light);
    border-radius: 999px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
    font-size: 16px;
    transform: translate(-50%, 180%);
  }

  .dock a:first-child { padding: 9px 26px; }
  .dock b { font-size: 19px; }
  .dock .dock-go { padding: 0 28px; font-size: 19px; }
}

/* Desktop: sections use the width instead of stacking */
@media (min-width: 1100px) {
  .page { --fall: 1300px; }

  #date {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto auto auto auto;
    column-gap: 72px;
    justify-items: center;
  }

  #date .head { grid-column: 1 / -1; justify-self: stretch; }
  .seal { grid-area: 2 / 1; width: 100%; }
  .hint { grid-area: 3 / 1; }
  #date .link { grid-area: 4 / 1; }
  .count { grid-area: 2 / 2 / 5 / 2; align-self: center; width: 100%; margin-top: 0; }

  .act,
  .act:last-child { flex-basis: calc((100% - 48px) / 3); }

  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  .note { flex-basis: calc((100% - 32px) / 3); }

  .scene { column-gap: 88px; }
}

@media (hover: hover) {
  .gallery img { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
  .gallery button:hover img { transform: scale(1.04); }
  .button, .dock .dock-go { transition: filter .25s ease; }
  .button:hover, .dock .dock-go:hover { filter: brightness(1.1); }
  .link:hover { text-decoration-color: currentColor; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  .sample-tag.rv { opacity: .8; }
  .rule::before, .rule::after, .scene::after { transform: none; transition: none; }
  .petals { display: none; }
  .cue, .note { animation: none; }
  .seal canvas { transition: none; }
  .dock { transition: none; }
  .gallery img { transition: none; }
  .gallery button:hover img { transform: none; }
}
