:root {
  --paper: #f0e9dd;
  --card: #fdfcfa;
  --ink: #4a2e22;
  --ink-soft: #6f5546;
  --tan: #b2926b;
  --tan-lit: #caae87;
  --brown: #956f50;
  --deep: #4f301c;
  --red: #a8170f;
  --red-lit: #e0584d;
  --gutter: clamp(30px, 9vw, 72px);
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .29 0 0 0 0 .18 0 0 0 0 .13 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23n)'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--paper) url("assets/paper.jpg?2") 0 0 / 384px;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body::after { content: ""; position: fixed; inset: 0; z-index: 20; pointer-events: none; background: var(--grain); }
html.js.sealed, html.js.sealed body, html.modal, html.modal body { overflow: hidden; height: 100%; }
img { max-width: 100%; height: auto; display: block; }
p { margin: 0 0 1.15em; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; }

.label {
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
}
.names { font-family: var(--script); font-size: clamp(3.1rem, 13.5vw, 7rem); line-height: 1.1; white-space: nowrap; }
.names .amp { font-size: .8em; }
.names--xs { font-size: 2.3rem; }
.center { text-align: center; }

/* ---------- reveal ---------- */
.js [data-reveal] {
  opacity: 0;
  translate: 0 22px;
  transition: opacity 1s var(--ease), translate 1s var(--ease), rotate 1.2s var(--ease);
}
.js [data-reveal].in { opacity: 1; translate: 0 0; filter: none; }

/* ---------- lettering that draws itself ---------- */
.drawn svg { display: block; width: 100%; height: auto; overflow: visible; }
.drawn path { fill: var(--ink); fill-opacity: 0; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; }
.drawn--red path { fill: var(--red); stroke: var(--red); }
.drawn.go path {
  animation: letter 1.5s calc(var(--i) * .1s) ease-in-out forwards, inkin .9s calc(var(--i) * .1s + .85s) ease forwards;
}
@keyframes letter { to { stroke-dashoffset: 0; } }
@keyframes inkin { to { fill-opacity: 1; } }
.js .drawn .names { display: none; }

/* ---------- botanical art (public-domain Redoute roses, blended onto the paper) ---------- */
.rose { position: absolute; pointer-events: none; mix-blend-mode: multiply; max-width: none; height: auto; }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 130px 0 150px; overflow: hidden;
}
.hero__stage { position: relative; width: min(84vw, 470px); }
.arch {
  position: relative; z-index: 1; border-radius: 999px 999px 4px 4px; background: var(--card);
  box-shadow: 0 2px 4px rgba(74, 46, 34, .12), 0 40px 60px -34px rgba(74, 46, 34, .55);
  padding: 46% 18px 54px;
}
.arch::before { content: ""; position: absolute; inset: 9px; border-radius: inherit; border: 1px solid rgba(74, 46, 34, .32); pointer-events: none; }
.arch::after { content: ""; position: absolute; inset: 13px; border-radius: inherit; border: 1px solid rgba(74, 46, 34, .14); pointer-events: none; }
.hero__rose--a { width: 46%; left: -4%; top: -9%; rotate: -20deg; }
.hero__rose--b { width: 25%; right: 6%; bottom: -17%; rotate: 164deg; }
.js .hero__rose { opacity: 0; transition: opacity 1.6s ease 3.4s, translate 2.4s var(--ease) 3.4s; }
.js .hero__rose--a { translate: 30px 20px; } .js .hero__rose--b { translate: -30px -20px; }
.opening .hero__rose, .opened .hero__rose { opacity: 1; translate: 0 0; }
.hero__inner { position: relative; }
.hero__inner > * { opacity: 0; }
.opening .hero__inner > *, .opened .hero__inner > * { animation: rise 1.4s var(--ease) both; animation-delay: calc(3.6s + var(--d, 0s)); }
.hero__inner > .drawn { opacity: 1; animation: none !important; margin: .9rem auto .2rem; }
.hero__kicker { --d: 0s; line-height: 1.9; max-width: 15em; margin-inline: auto; }
.flourish { --d: 1.9s; display: block; width: min(230px, 62%); margin: .5rem auto .7rem; overflow: visible; opacity: 1 !important; animation: none !important; }
.flourish path, .closing__thread path { fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.opening .flourish path, .opened .flourish path { animation: letter 2.4s 5.6s var(--ease) forwards; }
.hero__date { --d: 2.4s; font-size: 1.7rem; letter-spacing: .12em; margin: 0 0 .4rem; }
.hero__city { --d: 2.7s; }
.greeting { --d: 0s; font-style: italic; font-size: 1.25rem; margin-bottom: .8rem; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.cue { position: absolute; z-index: 1; bottom: 22px; left: 0; right: 0; display: grid; justify-items: center; gap: 10px; text-decoration: none; opacity: 0; }
.opening .cue, .opened .cue { animation: rise 1.4s 7s var(--ease) both; }
.cue__line { width: 2.500px; height: 44px; background: var(--red); border-radius: 2px; transform-origin: top; animation: drip 2.2s 7.4s ease-in-out infinite; }
@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- story ---------- */
.story { position: relative; max-width: 760px; margin: 0 auto; padding-top: 30px; }
.story > * { position: relative; z-index: 1; }
.threads { position: absolute !important; z-index: 2 !important; top: 0; left: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.threads path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.t-shadow { stroke: rgba(60, 14, 6, .26); stroke-width: 6; transform: translate(2px, 4px); }
.t-base { stroke: #86110b; stroke-width: 5.2; }
.t-twist { stroke: #c2281d; stroke-width: 3.5; stroke-dasharray: 4 3.4; }
.t-hi { stroke: #f1998c; stroke-width: 1; stroke-dasharray: 1.6 5.8; stroke-dashoffset: -1.4; opacity: .8; transform: translate(-.7px, -.5px); }
.lobe-twist { opacity: 0; transition: opacity .8s ease; }
.lobe-twist.on { opacity: 1; }
html:not(.threads-ready) .threads { visibility: hidden; }

.intro { text-align: center; padding: 30px var(--gutter) 0; }
.question { font-family: var(--script); font-size: clamp(2.4rem, 10vw, 4rem); line-height: 1.3; margin: .5rem auto 1.1rem; max-width: 11em; }
.intro__text { max-width: 26em; margin-inline: auto; }
.prints { display: flex; justify-content: center; gap: 7%; margin: 2.8rem auto 0; max-width: 480px; }
.print {
  position: relative; margin: 0; flex: 1; max-width: 200px;
  background: #fff; padding: 7px 7px 0;
  box-shadow: 0 1px 2px rgba(60, 30, 25, .25), 0 22px 30px -16px rgba(60, 30, 25, .55);
}
.print img { width: 100%; aspect-ratio: 3 / 3.7; object-fit: cover; object-position: 50% 8%; }
.print figcaption { font-family: var(--script); font-size: 1.75rem; line-height: 1; padding: 9px 0 10px; }
.print::before { content: ""; position: absolute; top: -11px; left: 50%; width: 58px; height: 22px; margin-left: -29px; background: rgba(202, 174, 135, .6); box-shadow: 0 1px 1px rgba(60, 30, 25, .12); rotate: -4deg; }
.js .print--a { rotate: -9deg; } .js .print--b { rotate: 9deg; transition-delay: .25s; }
.print--a, .js .print--a.in { rotate: -3.5deg; }
.print--b, .js .print--b.in { rotate: 3deg; }
.print--b { margin-top: 26px; }

.weave { height: var(--h, 300px); }

.chapter { padding: 26px max(var(--gutter), 10.5%); }
.chapter > p:last-child { margin-bottom: 0; }
.ch { margin-bottom: 1.3rem; }
.chapter .ch { text-align: center; padding-top: 10px; }
.ch__no { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--red); }
.ch__title { font-family: var(--script); font-size: clamp(2.3rem, 9.2vw, 3.4rem); line-height: 1.3; margin-top: .1rem; }
.lede::first-letter { float: left; font-size: 3.5em; line-height: .82; padding: .06em .05em 0 0; color: var(--red); font-weight: 400; }
.gap { height: 60px; }
.chapter--center, .chapter--quote, .chapter--finale .pull { text-align: center; }
.chapter--center { padding-block: 50px 250px; font-size: 1.4rem; font-style: italic; text-wrap: balance; }
.chapter--quote { padding-block: 50px 10px; text-wrap: balance; }
.chapter--apart { padding-block: 40px; }

.places { display: flex; justify-content: space-between; margin: 0 0 1.6rem; }
.place { display: inline-flex; align-items: center; gap: 10px; font-size: .76rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.place i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); }

.years { position: relative; display: flex; justify-content: space-between; width: 190px; margin: 2.6rem auto 0; }
.years::before { content: ""; position: absolute; left: 6px; right: 6px; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--red); opacity: .5; }
.years i { position: relative; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--red); background: var(--paper); }
.years.in i { animation: yearfill .5s forwards; }
.years.in i:nth-child(1) { animation-delay: .5s; } .years.in i:nth-child(2) { animation-delay: .95s; }
.years.in i:nth-child(3) { animation-delay: 1.4s; } .years.in i:nth-child(4) { animation-delay: 1.85s; }
.years.in i:nth-child(5) { animation-delay: 2.3s; }
@keyframes yearfill { 50% { transform: scale(1.5); } 100% { background: var(--red); transform: none; } }

.big { font-size: clamp(2.1rem, 9vw, 3.2rem); line-height: 1.3; font-style: italic; font-weight: 400; text-align: center; margin: 1.2rem 0 1.4rem; }
.big--script { font-family: var(--script); font-style: normal; font-size: clamp(3.3rem, 13.5vw, 5rem); margin: 3rem 0 1rem; color: var(--red); }
.pull { font-size: clamp(1.7rem, 6.8vw, 2.4rem); line-height: 1.32; font-style: italic; font-weight: 400; margin: 2rem 0; text-wrap: balance; }

/* the message */
.msgr { margin: .2rem 0 1.5rem; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 0 rgba(60, 30, 25, .06), 0 18px 30px -22px rgba(60, 30, 25, .4); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.35; }
.msgr__head { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid #efe9e6; }
.msgr__who { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 500 1.2rem var(--serif); }
.msgr__who::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #3fbb46; border: 2px solid #fff; }
.msgr__head b { display: block; font-size: 1rem; font-weight: 600; }
.msgr__head small { display: block; font-size: .8rem; color: #6b5c58; }
.msgr__body { padding: 16px 15px 18px; min-height: 86px; }
.msgr__bubble { position: relative; display: inline-block; background: #f1ecea; border-radius: 20px 20px 20px 6px; padding: 10px 15px; font-size: 1rem; min-height: 40px; min-width: 62px; max-width: 100%; }
.msgr__dots { position: absolute; left: 15px; top: 16px; display: flex; gap: 5px; }
.msgr__dots i { width: 8px; height: 8px; border-radius: 50%; background: #a5958f; animation: dot 1s infinite ease-in-out; }
.msgr__dots i:nth-child(2) { animation-delay: .15s; }
.msgr__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.js .msgr__msg { display: block; opacity: 0; max-width: 0; max-height: 1.35em; overflow: hidden; white-space: nowrap; }
.js .msgr.in .msgr__dots { animation: gone .2s .7s forwards; }
.js .msgr.in .msgr__msg { animation: msg .5s .75s var(--ease) forwards; }
@keyframes gone { to { opacity: 0; visibility: hidden; } }
@keyframes msg {
  0% { opacity: 0; max-width: 0; max-height: 1.35em; white-space: nowrap; }
  60% { opacity: 0; max-width: 24em; max-height: 6em; white-space: normal; }
  100% { opacity: 1; max-width: 24em; max-height: 6em; white-space: normal; }
}
html:not(.js) .msgr__dots { display: none; }

.heart-anchor { height: 200px; }

.ido { padding: 6px 20px 70px; }
.ido .drawn { width: min(66vw, 330px); margin: 0 auto; }
.ido .names { display: block; text-align: center; color: var(--red); }

/* ---------- the invitation card ---------- */
.invite, .program, .note { max-width: 640px; margin: 0 auto; padding: 56px 22px; text-align: center; position: relative; }
.invite::before, .note::before { content: ""; display: block; width: 2.5px; height: 64px; background: var(--red); border-radius: 2px; margin: 0 auto 40px; }
.invite > .label { margin-bottom: 1.8rem; }
.card {
  position: relative; z-index: 1; max-width: 420px; margin: 0 auto 2.6rem;
  background: var(--card);
  box-shadow: 0 2px 4px rgba(74, 46, 34, .12), 0 40px 60px -34px rgba(74, 46, 34, .55);
}
.card-wrap { position: relative; max-width: 420px; margin: 120px auto 110px; }
.card__rose--a { width: 27%; left: 1%; top: -20%; rotate: -14deg; }
.card__rose--b { width: 25%; right: 6%; bottom: -15%; rotate: 162deg; }
.js .card { rotate: -5deg; }
.card, .js .card.in { rotate: 0deg; }
.card__inner { padding: 60px 14px 50px; outline: 1px solid rgba(74, 46, 34, .32); outline-offset: -10px; }
.card .hero__lead { margin-bottom: .2rem; font-size: 1.4rem; }
.names--card { font-size: clamp(2.7rem, 11.4vw, 3.9rem); }
.card__date { font-size: 1.6rem; letter-spacing: .12em; margin: .2rem 0 .3rem; }
.times { display: flex; justify-content: center; align-items: center; gap: clamp(16px, 6vw, 34px); margin: 2.2rem 0; }
.times__rule { width: 1px; height: 66px; background: rgba(71, 43, 40, .35); }
.time__hour { font-size: clamp(2.3rem, 10vw, 3rem); line-height: 1; margin: 0 0 .5rem; font-weight: 400; }
.time__hour small { font-size: .38em; letter-spacing: .14em; font-weight: 600; }
.venue__name { font-size: 1.5rem; font-style: italic; line-height: 1.3; margin: 0 0 .3rem; }
.attire { margin-top: 2.2rem; }
.attire__text { font-size: 1.4rem; font-style: italic; margin: .3rem 0 .9rem; }
.swatches { display: flex; justify-content: center; }
.swatches i { width: 44px; height: 44px; border-radius: 50%; background: var(--c); margin-left: -9px; box-shadow: 0 0 0 2px var(--card); }
.swatches i:first-child { margin-left: 0; }

.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.btn {
  display: inline-block; padding: 13px 24px; min-height: 46px;
  border: 1px solid var(--ink); border-radius: 999px;
  font-size: .76rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; text-decoration: none;
  transition: background .3s, color .3s, transform .2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(.97); }
.btn--solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn--solid:hover { background: var(--ink); border-color: var(--ink); }
.btn[hidden] { display: none; }
.fine { font-size: .95rem; margin: 1rem 0 0; color: var(--ink-soft); }

.band { position: relative; z-index: 21; background: var(--deep); color: #f6ede3; text-align: center; padding: 54px 20px 58px; }
.band .label { color: var(--tan-lit); }
.countdown { display: flex; justify-content: center; gap: clamp(14px, 6vw, 36px); margin: 1.4rem 0 0; }
.countdown div { display: grid; gap: 6px; min-width: 3.2em; }
.countdown b { font-size: clamp(2.2rem, 10vw, 3rem); font-weight: 400; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.countdown .label { margin: 0; font-size: .7rem; letter-spacing: .18em; }
.countdown.done { font-family: var(--script); font-size: 2.6rem; }

/* ---------- program ---------- */
.program { padding-block: 90px 110px; overflow-x: clip; }
.invite { overflow-x: clip; padding-bottom: 70px; }
.program__rose { width: min(36vw, 170px); left: 50%; margin-left: max(-43vw, -205px); top: 26px; rotate: -22deg; }
.vellum {
  position: relative; z-index: 1; padding: 78px 26px 44px; border-radius: 999px 999px 4px 4px;
  background: var(--card); outline: 1px solid rgba(74, 46, 34, .3); outline-offset: -9px;
  box-shadow: 0 2px 4px rgba(74, 46, 34, .12), 0 40px 60px -34px rgba(74, 46, 34, .5);
}
.script-h { font-family: var(--script); font-size: clamp(3.2rem, 14vw, 4.6rem); line-height: 1.1; margin-top: .4rem; }
.program__time { letter-spacing: .1em; margin: .2rem 0 1.8rem; }
.timeline { list-style: none; margin: 0 auto; padding: 0 0 0 30px; max-width: 21em; text-align: left; position: relative; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 12px; bottom: 12px; width: 1.5px; background: var(--red); opacity: .75; }
.timeline li { position: relative; padding: 9px 0; font-size: 1.28rem; line-height: 1.35; }
.timeline li::before { content: ""; position: absolute; left: -30px; top: 16px; width: 11px; height: 11px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--red); }
.timeline li:last-child::before { background: var(--red); }
.tl-heart { color: var(--red); }

/* ---------- note ---------- */
.note p { max-width: 27em; margin-inline: auto; }
.rsvp { margin: 2.6rem auto; padding: 30px 22px; max-width: 30em; border: 1px solid rgba(71, 43, 40, .3); position: relative; }
.rsvp::after { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(71, 43, 40, .15); pointer-events: none; }
.rsvp .label { color: var(--red); margin-bottom: .8rem; }
.rsvp__text { margin-bottom: 0; }
.rsvp .btn { margin-top: 1.3rem; position: relative; z-index: 1; }
.signoff { margin-top: 2.2rem; font-style: italic; }
.signoff .names { font-style: normal; display: inline-block; margin-top: .3rem; }

/* ---------- closing ---------- */
.closing { position: relative; z-index: 21; background: var(--deep); color: #f1e6df; text-align: center; padding: 90px 22px calc(120px + env(safe-area-inset-bottom)); }
.closing .label { color: var(--tan-lit); }
.closing__thread { width: min(300px, 76vw); display: block; margin: 0 auto 1.6rem; overflow: visible; }
.closing__thread path { stroke: var(--red-lit); }
.js .closing__thread { opacity: 1; translate: 0 0; filter: none; }
.closing__thread.in path, html:not(.js) .closing__thread path { animation: letter 2.6s .2s var(--ease) forwards; }
.closing__text { font-family: var(--script); font-size: clamp(2.8rem, 12vw, 3.8rem); line-height: 1.2; margin: 0 0 .7rem; }

/* ---------- song (audio only) ---------- */
.song { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 40; }
.song[hidden], .sealed .song { display: none; }
.song__btn {
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0; cursor: pointer;
  border: 1px solid rgba(74, 46, 34, .3); border-radius: 50%; background: rgba(253, 252, 250, .94);
  box-shadow: 0 10px 24px -12px rgba(74, 46, 34, .7);
}
.song__note { width: 24px; height: 24px; fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.song__note ellipse { fill: var(--red); stroke: none; }
.song.playing .song__note, .song:not(.playing) .song__bars { display: none; }
.song__bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }
.song__bars i { width: 3px; height: 5px; background: var(--red); border-radius: 2px; animation: bar 1s ease-in-out infinite; }
.song__bars i:nth-child(2) { animation-delay: .2s; }
.song__bars i:nth-child(3) { animation-delay: .45s; }
@keyframes bar { 0%, 100% { height: 4px; } 50% { height: 16px; } }

.petals { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }

@media (min-width: 700px) {
  body { font-size: 1.3rem; }
  .chapter { padding-inline: 110px; }
  .chapter--pair { padding-left: 130px; padding-right: 90px; }
  .chapter--pair[data-side="r"] { padding-left: 90px; padding-right: 130px; }
  .places { margin-inline: calc(-110px + 4.5%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .cue__line, .env__seal { animation: none; }
}

/* ---------- paper stock: textured page, bright laid cards, dark bands ---------- */
.arch, .card, .vellum, .env__card { background: var(--card) url("assets/card.jpg?2") 0 0 / 256px; }
.band, .closing { background: var(--deep) url("assets/deep.jpg?2") 0 0 / 256px; }
.arch, .card, .vellum { box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(74, 46, 34, .16), 0 44px 60px -34px rgba(74, 46, 34, .6); }
.rsvp { background: rgba(253, 251, 246, .55); }

/* ---------- the story, stitched: each chapter is a card the two threads sew through ---------- */
:root { --gold: #a5803f; --gold-ink: #856428; --foil: linear-gradient(120deg, #8a6a33, #e3c98e 28%, #a37f3e 52%, #f1ddb0 74%, #8d6c35); }
.leaf {
  margin: var(--gap, 150px) 6.500% 0; padding: 58px clamp(20px, 6vw, 44px) 62px; border-radius: 3px;
  background: var(--card) url("assets/card.jpg?2") 0 0 / 256px;
  outline: 1px solid rgba(165, 128, 63, .6); outline-offset: -8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 2px 4px rgba(74, 46, 34, .16), 0 40px 54px -34px rgba(74, 46, 34, .6);
}
.leaf[data-thread="through"]::before, .leaf[data-thread="through"]::after {
  content: ""; position: absolute; left: 50%; width: 40px; height: 16px; margin-left: -20px;
  background:
    radial-gradient(circle at 11px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px),
    radial-gradient(circle at 29px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px),
    var(--card);
}
.leaf[data-thread="through"]::before { top: 13px; }
.leaf[data-thread="through"]::after { bottom: 13px; }
.leaf.chapter--apart { --gap: 120px; margin-inline: 9%; }
.chapter--quote { padding-block: 90px 0; }
.chapter--center { padding-top: 190px; }
.intro { padding-bottom: 10px; }
.ch__no { color: var(--gold-ink); display: flex; align-items: center; justify-content: center; gap: 12px; }
.ch__no::before, .ch__no::after { content: ""; width: 26px; height: 1px; background: var(--gold); opacity: .7; }
.years i { background: var(--card); }
.place i { background: var(--gold); }

/* gold keylines and the monogram */
.arch::before { border-color: rgba(165, 128, 63, .75); }
.arch::after { border-color: rgba(165, 128, 63, .35); }
.card__inner, .vellum { outline-color: rgba(165, 128, 63, .65); }
.crest {
  position: absolute; left: 50%; top: 11%; width: 74px; height: 74px; margin-left: -37px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid rgba(165, 128, 63, .8); box-shadow: 0 0 0 3px var(--card), 0 0 0 4px rgba(165, 128, 63, .4);
  opacity: 0;
}
.opening .crest, .opened .crest { animation: rise 1.6s 3.4s var(--ease) both; }
.crest span { font-family: var(--script); font-size: 2rem; line-height: 1; padding-top: 4px; background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
.crest i { font-style: normal; font-size: .62em; margin: 0 1px; }

/* the message sits directly on its chapter card: no card-in-card */
.leaf .msgr { background: none; box-shadow: none; border-radius: 0; overflow: visible; border-block: 1px solid rgba(165, 128, 63, .45); }
.leaf .msgr__head { padding-inline: 0; border-bottom: 0; padding-bottom: 4px; }
.leaf .msgr__body { padding: 8px 0 16px; }
.leaf .msgr__bubble { background: #efe7dc; }
.leaf .msgr__who::after { border-color: var(--card); }
.leaf { padding-inline: clamp(26px, 7vw, 44px); }

/* ================= the team's design: cover, scene, and the three things that open ================= */
:root { --sheet: #fdfcf9 url("assets/card.jpg?2") 0 0 / 256px; }
.song { z-index: 95; }

/* ---------- cover ---------- */
.cover { display: none; }
.js .cover { display: block; position: fixed; inset: 0; z-index: 100; overflow: hidden; background: #fdfcf9; text-align: center; }
.cover__stage {
  position: absolute; inset: 0; display: grid; justify-items: center; align-content: center; gap: clamp(6px, 1.6vh, 18px);
  padding: 16px 0 24px; background: var(--sheet); transform-origin: 50% 47%;
}
.cover__to { margin: 0; }
.cover__hint { margin: 0; font-style: italic; font-size: 1.12rem; animation: nudge 2.4s ease-in-out infinite; }
@keyframes nudge { 50% { opacity: .45; } }
.cv { position: relative; width: min(100vw, 540px, 66vh); padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.cv img { position: relative; left: 12.400%; width: 100%; mix-blend-mode: multiply; }   /* shifted so the envelope itself, not envelope plus flowers, is centred */
.cv__seal { position: absolute; left: 49.700%; top: 34.800%; width: 14%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 1.5px solid rgba(140, 20, 24, .7); animation: ring 2.6s ease-out infinite; }
@keyframes ring { 0% { scale: .8; opacity: .8; } 100% { scale: 1.7; opacity: 0; } }
.opening .cv__seal { animation: none; scale: 4; opacity: 0; transition: scale .9s ease-out, opacity .9s ease-out; }
.opening .cover__hint, .opening .cover__to { opacity: 0; animation: none; transition: opacity .3s; }
.opening .cover__stage { opacity: 0; transition: opacity .5s ease 2.55s; }
.opening .cover { pointer-events: none; }
.opened .cover { display: none; }

/* ---------- version switch ---------- */
.vsw {
  position: fixed; z-index: 96; top: calc(8px + env(safe-area-inset-top)); left: 50%; translate: -50% 0;
  display: flex; align-items: center; gap: 4px; padding: 4px 5px 4px 14px; border-radius: 999px;
  background: rgba(79, 48, 28, .9); color: #f6ede3; font: 600 .78rem/1 var(--serif); letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 6px 16px -6px rgba(52, 30, 18, .6);
}
.vsw span { margin-right: 4px; }
.vsw button { width: 34px; height: 30px; border: 0; border-radius: 999px; background: none; color: inherit; font: 600 1rem/1 var(--serif); cursor: pointer; }
.vsw button[aria-pressed="true"] { background: #f6ede3; color: var(--deep); }
.sealed .vsw { display: none; }

/* ---------- pop-ups: shared ---------- */
.panel { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; visibility: hidden; pointer-events: none; background-color: rgba(52, 30, 18, 0); transition: background-color .45s ease, visibility 0s .7s; }
.panel.open { visibility: visible; pointer-events: auto; background-color: rgba(52, 30, 18, .58); transition: background-color .45s ease; }
.panel__sheet {
  width: min(95vw, 640px); max-height: 92vh; max-height: 92svh; overflow-y: auto; overscroll-behavior: contain; border-radius: 14px;
  background: var(--paper) url("assets/paper.jpg?2") 0 0 / 384px;
  box-shadow: 0 30px 70px -20px rgba(30, 14, 6, .75); opacity: 0; scale: .9; translate: 0 34px;
  transition: opacity .35s ease, scale .6s var(--ease), translate .6s var(--ease);
}
.panel.open .panel__sheet { opacity: 1; scale: 1; translate: 0 0; }
.panel__sheet, .panel__body, .panel__body section { scrollbar-width: none; -ms-overflow-style: none; }
.panel__sheet::-webkit-scrollbar, .panel__body::-webkit-scrollbar, .panel__body section::-webkit-scrollbar { display: none; }
.panel__bar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; margin: 0; border: 0; cursor: pointer;
  padding: 10px 12px 10px 22px; background: var(--sheet); color: var(--ink); text-align: left; border-bottom: 1px solid rgba(165, 128, 63, .5);
}
.panel__title { font-family: var(--script); font-size: 2rem; line-height: 1.2; }
.panel__x { flex: none; position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(165, 128, 63, .7); }
.panel__x::before, .panel__x::after { content: ""; position: absolute; left: 50%; top: 50%; width: 15px; height: 1.5px; margin: -.75px 0 0 -7.5px; background: var(--ink); rotate: 45deg; }
.panel__x::after { rotate: -45deg; }
.pager { display: none; }

/* less air, more page: the pop-up is small, so everything sits closer */
.panel .invite, .panel .program, .panel .note { max-width: none; }
.panel .invite { padding: 16px 14px 26px; overflow: visible; }
.panel .invite::before, .panel .note::before, .panel .invite > .label { display: none; }
.panel .card-wrap { max-width: none; margin: 0 0 20px; }
.panel .card { max-width: none; margin: 0; }
.panel .card__inner { padding: 40px 12px 38px; }
.panel .band { padding: 32px 14px 36px; }
.panel .program { padding: 22px 14px 30px; }
.panel .vellum { padding: 56px 20px 34px; }
.panel .note { padding: 30px clamp(18px, 6vw, 40px) 40px; }
.panel .rsvp { margin: 1.8rem auto; }
.panel .story { padding-top: 0; }
.panel .intro { padding: 30px clamp(18px, 6vw, 40px) 6px; }
.panel .ido { padding: 0 20px 56px; }
.panel .leaf { margin-inline: 3.500%; padding-inline: clamp(22px, 6.5vw, 44px); }
.panel .leaf.chapter--apart { margin-inline: 8.500%; }

/* ---------- version 2: one letter. No cards inside the card: a single clean sheet ---------- */
.v2 .panel__sheet { background: var(--sheet); }
.v2 .leaf, .v2 .panel .leaf.chapter--apart { background: none; box-shadow: none; outline: 0; margin-inline: 0; padding: 40px clamp(26px, 8vw, 56px) 44px; }
.v2 .leaf[data-thread="through"]::before, .v2 .leaf[data-thread="through"]::after {
  background:
    radial-gradient(circle at 11px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px),
    radial-gradient(circle at 29px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px);
}
.v2 .card, .v2 .vellum { background: none; box-shadow: none; outline: 0; border-radius: 0; }
.v2 .card__inner { outline: 0; padding: 26px 6px 8px; }
.v2 .vellum { padding: 6px 12px 10px; }
.v2 .band { background: none; color: var(--ink); margin: 0 clamp(18px, 6vw, 40px); padding: 26px 0 30px; border-block: 1px solid rgba(165, 128, 63, .55); }
.v2 .band .label { color: var(--gold-ink); }
.v2 .rsvp { background: none; }
.v2 .years i { background: #fdfcf9; }

/* ---------- the thread: finer, a sewing thread and not a cord ---------- */
.t-shadow { stroke: rgba(60, 14, 6, .2); stroke-width: 3.2; transform: translate(1px, 2px); }
.t-base { stroke: #9c140d; stroke-width: 2.4; }
.t-twist { stroke: #d2463a; stroke-width: 1; stroke-dasharray: 3 2.6; opacity: .75; }
.t-hi { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hot i, .cv__seal, .cover__hint { animation: none; }
  .panel, .panel__sheet, .scene__thread, .scene__art, .pager__fill { transition: none !important; }
}

/* the pop-up's contents settle in one after another */
@keyframes settle { from { opacity: 0; translate: 0 16px; } }
.panel.open .card__inner > *, .panel.open .note > *, .panel.open .timeline li, .panel.open .intro > *, .panel.open .countdown > div { animation: settle .7s var(--ease) both; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(1) { animation-delay: .25s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(2) { animation-delay: .33s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(3) { animation-delay: .41s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(4) { animation-delay: .49s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(5) { animation-delay: .57s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(6) { animation-delay: .65s; }
.panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > :nth-child(n+7) { animation-delay: .73s; }

@media (prefers-reduced-motion: reduce) {
  .js .scene__base { transition: none; }
  .panel.open :is(.card__inner, .note, .timeline, .intro, .countdown) > * { animation: none; }
}

/* pop-ups use nearly the whole screen */
.panel { padding: 0; }
.panel__sheet { width: min(100vw - 12px, 820px); max-height: calc(100vh - 12px); max-height: calc(100svh - 12px); }
.vsw { transition: opacity .3s ease; }
html.modal .vsw { opacity: 0; pointer-events: none; }
.panel .ido { padding-bottom: 90px; }
@media (prefers-reduced-motion: reduce) {
  .js .piece, .js .flower, .js .snap { transition: none; }
  .js .piece--tag.in, .tap.in, .tap__hint { animation: none; }
}


/* ---------- the scene: the team's layout, each element placed where they put it (page of 800 x 1800) ---------- */
.scene { position: relative; background: var(--sheet); padding: clamp(56px, 8vh, 84px) 0 4vh; overflow: hidden; overflow: clip; }
.scene__col { position: relative; width: clamp(600px, 164vw, 860px); aspect-ratio: 800 / 1800; background: var(--sheet); will-change: translate; }
.scene__string { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 6; }
.scene__string path { fill: none; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.s-shadow { stroke: rgba(60, 14, 6, .22); stroke-width: 3; transform: translate(1.5px, 2.5px); }
.s-base { stroke: #8f120c; stroke-width: 2.6; }
.s-hi { stroke: rgba(255, 150, 130, .45); stroke-width: .8; transform: translate(-.5px, -.6px); }
.piece { position: absolute; display: block; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; -webkit-tap-highlight-color: transparent; }
.piece > img { display: block; width: 100%; height: auto; }
.piece--blend { mix-blend-mode: multiply; }
.piece--open { left: 23.750%; top: 1.670%; width: 53.900%; z-index: 1; }
.piece--plate { left: 43.900%; top: 26.600%; width: 67.400%; z-index: 2; }
.piece--flower { left: 3.100%; top: 41.100%; width: 29.750%; z-index: 1; transform-origin: 0 0; }
.piece--story { left: 54.100%; top: 57.050%; width: 37.250%; z-index: 4; }
.piece--rsvp { left: 11.250%; top: 69.200%; width: 81.750%; z-index: 5; }
.piece--tag { left: 13.750%; top: 20%; width: 33.900%; z-index: 7; transform-origin: 46% 6%; filter: drop-shadow(0 6px 8px rgba(60, 30, 20, .22)); }
.polaroid { z-index: 2; background: #f6f2ea; padding: 1.3% 1.3% 5.200%; box-shadow: 0 1px 2px rgba(60, 30, 20, .18), 0 14px 22px -14px rgba(60, 30, 20, .5); }
.polaroid > img { aspect-ratio: 3 / 4; object-fit: cover; object-position: 50% 10%; }
.polaroid--a { left: 20.500%; top: 50.800%; width: 21.500%; rotate: -8deg; }
.polaroid--b { left: 38.700%; top: 49.300%; width: 23.500%; rotate: 2deg; z-index: 3; }
.tap { cursor: pointer; }
.tap:active { scale: .97; }
.tap__hint { position: absolute; left: 27%; top: 47%; rotate: -27deg; white-space: nowrap; font-size: clamp(.55rem, 2vw, .8rem); font-weight: 600; letter-spacing: .1em; color: #7a5a3c; animation: hint 2.4s ease-in-out infinite; }
@keyframes hint { 50% { opacity: .45; } }
.tap:focus-visible, .panel__bar:focus-visible, .vsw button:focus-visible, .pager button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.petals--drift { z-index: 6; }

/* arrivals: crisp, no blur */
.js .piece { opacity: 0; translate: 0 50px; transition: opacity .8s ease, translate 1.1s var(--ease), rotate 1.3s var(--ease), scale 1.1s var(--ease); }
.js .piece.in { opacity: 1; translate: 0 0; }
.js .piece--open { scale: .92; } .js .piece--open.in { scale: 1; }
.js .piece--tag { rotate: -18deg; transition-delay: .35s; } .js .piece--tag.in { rotate: 0deg; animation: sway 5.5s ease-in-out 1.8s infinite alternate; }
@keyframes sway { from { rotate: 0deg; } 50% { rotate: -2.5deg; } to { rotate: 2deg; } }
.js .piece--plate { translate: 50px 40px; rotate: 8deg; } .js .piece--plate.in { rotate: 0deg; }
.js .piece--flower { scale: .8; } .js .piece--flower.in { scale: 1; }
.js .polaroid { translate: 0 -40px; } 
.js .polaroid--a { rotate: -20deg; transition-delay: .2s; } .js .polaroid--a.in { rotate: -8deg; }
.js .polaroid--b { rotate: 14deg; transition-delay: .45s; } .js .polaroid--b.in { rotate: 2deg; }
.js .piece--story { translate: 50px 30px; rotate: 6deg; } .js .piece--story.in { rotate: 0deg; }
.js .piece--rsvp { translate: -40px 50px; rotate: -4deg; } .js .piece--rsvp.in { rotate: 0deg; }
.tap.in { animation: breathe 3.4s ease-in-out 1.6s infinite; }
@keyframes breathe { 50% { scale: 1.03; } }
@media (prefers-reduced-motion: reduce) {
  .js .piece { transition: none; }
  .js .piece--tag.in, .tap.in, .tap__hint { animation: none; }
}

/* ---------- Bicol and PNP Academy: together in the middle, a stretched thread between them (all versions) ---------- */
.panel .places { justify-content: center; align-items: center; gap: 0; margin-inline: 0; }
.panel .place--a::after { content: ""; width: clamp(36px, 13vw, 86px); margin: 0 12px; border-top: 1.5px dashed var(--red); opacity: .7; }

/* ================= version 1: Evening. Dark, candle-lit, everything centred, roman numerals ================= */
.v1 .panel__sheet {
  --ink: #f4eadc; --ink-soft: #dccbb6; --gold-ink: #dcbb7c; --gold: #c9a35e; --red: #ee8275; --paper: #4f301c;
  background: #43281a url("assets/deep.jpg?2") 0 0 / 256px; color: var(--ink);
}
.v1 .panel__bar { background: #43281a url("assets/deep.jpg?2") 0 0 / 256px; color: var(--ink); border-bottom-color: rgba(201, 163, 94, .6); }
.v1 .panel__x { border-color: rgba(201, 163, 94, .8); }
.v1 .card, .v1 .vellum, .v1 .print { --ink: #4a2e22; --ink-soft: #6f5546; --gold-ink: #856428; --gold: #a5803f; --red: #a8170f; --paper: #f0e9dd; color: var(--ink); }
.v3 .threads { display: none; }
.v1 .panel__body { position: relative; overflow: hidden; }
.v1 .panel__body::before {
  content: ""; position: absolute; z-index: 2; right: -9%; top: -34px; width: min(40%, 230px); aspect-ratio: 738 / 1149; pointer-events: none;
  background: url("assets/el-flower.webp") center / contain no-repeat; transform: scaleX(-1) rotate(-24deg);
}
.v1 .panel .invite { padding-top: 96px; }
.v1 .panel .intro { padding-top: 110px; }
.v1 .panel .note { padding-top: 120px; }
.v1 .story { counter-reset: ch; }
.v1 .panel .leaf, .v1 .panel .leaf.chapter--apart { background: none; box-shadow: none; outline: 0; margin-inline: 0; padding: 50px clamp(26px, 8vw, 64px) 52px; text-align: center; }
.v1 .ch { counter-increment: ch; }
.v1 .ch::before { content: counter(ch, upper-roman); display: block; font: 400 clamp(3rem, 13vw, 4.2rem) / 1 var(--serif); color: #dcbb7c; margin-bottom: .5rem; }
.v1 .ch__title { font-size: clamp(2.4rem, 10vw, 3.2rem); }
.v1 .lede::first-letter { float: none; font-size: 1em; padding: 0; color: inherit; }
.v1 .lede { font-size: 1.22em; font-style: italic; }
.v1 .years i { background: #43281a; }
.v1 .panel .chapter--quote { padding-inline: clamp(26px, 8vw, 64px); }
.v1 .chapter--quote .pull { color: #dcbb7c; }
.v1 .leaf .msgr { border-color: rgba(201, 163, 94, .45); text-align: left; }
.v1 .leaf .msgr__bubble { background: #f1e8dc; color: #4a2e22; }
.v1 .msgr__who { background: #dcbb7c; color: #43281a; }
.v1 .msgr__head small { color: #dccbb6; }
.v1 .leaf .msgr__who::after { border-color: #43281a; }
.v1 .panel .band { background: none; padding-block: 34px 40px; }
.v1 .countdown { gap: clamp(8px, 3vw, 20px); }
.v1 .countdown div { width: clamp(70px, 20vw, 96px); min-width: 0; aspect-ratio: 1; border: 1px solid rgba(201, 163, 94, .7); border-radius: 50%; place-content: center; gap: 2px; }
.v1 .countdown b { font-size: clamp(1.5rem, 7vw, 2.1rem); }
.v1 .countdown .label { font-size: .58rem; letter-spacing: .12em; }
.v1 .btn:hover { background: var(--ink); color: #43281a; }
.v1 .rsvp { background: rgba(255, 250, 240, .06); border-color: rgba(201, 163, 94, .7); }
.v1 .fine a { color: var(--ink-soft); }
.v1 .ido .names, .v3 .ido .names { color: var(--red); }

.v1 .panel__body::before { width: min(31%, 190px); right: -7%; top: -30px; }
.v1 .panel .intro { padding-top: 150px; }
.v1 .panel .note { padding-top: 150px; }
.v1 .panel .invite { padding-top: 104px; }

/* the cover envelope opens into the scene's envelope */
.js .piece--open { transition: opacity .8s ease, translate 1.1s var(--ease), scale 1.1s var(--ease), clip-path 1.2s cubic-bezier(.3, .7, .2, 1); clip-path: inset(0 0 0 0); }
.js .piece--open.pre { opacity: 1; translate: 0 0; scale: 1; clip-path: inset(45% 0 0 0); transition: none; }
/* version 1 (Evening): the red thread again, bright against the dark, tying the heart at the end */
.v1 .t-base { stroke: #e2584b; } .v1 .t-twist { stroke: #f8b3a8; } .v1 .t-shadow { stroke: rgba(0, 0, 0, .4); }
.tail { display: none; }
.tail path { fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* the cover's own paper clears too, so the scene's envelope shows through as the flap lifts */
.js .cover { transition: background-color .5s ease 2.55s; }
.opening.js .cover { background-color: rgba(253, 252, 249, 0); }
.v1 .leaf[data-thread="through"]::before, .v1 .leaf[data-thread="through"]::after {
  background:
    radial-gradient(circle at 11px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px),
    radial-gradient(circle at 29px 8px, #2e1c10 0 2.6px, #7b5c26 3px, #ecd49a 4.2px, #9a7636 5.6px, transparent 6.2px);
}

/* ================= version 3: Two strings. Blush paper, everything centred, and two bold threads that act the story out ================= */
.weave { display: none; }
.v3 .panel__sheet, .v3 .panel__bar { background: #f9efe9 url("assets/card.jpg?2") 0 0 / 256px; background-blend-mode: multiply; }
.v3 .story { position: relative; --side: clamp(42px, 12vw, 84px); }
.v3 .weave { display: block; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.weave path { fill: none; stroke-linecap: round; stroke-linejoin: round; visibility: hidden; }
.w-sh { stroke: rgba(90, 20, 10, .12); stroke-width: 2.6; transform: translate(1.5px, 2.5px); }
.w-a { stroke: #a8170f; stroke-width: 2; }
.w-b { stroke: #d2463a; stroke-width: 2; }
.v3 .story > section, .v3 .heart-anchor { position: relative; z-index: 1; }
.v3 .panel .intro { padding-inline: var(--side); }
.v3 .panel .leaf, .v3 .panel .leaf.chapter--apart { background: none; box-shadow: none; outline: 0; margin: 210px 0 0; padding: 6px var(--side); text-align: center; }
.v3 .panel .leaf::before, .v3 .panel .leaf::after { display: none; }
.v3 .ch__no { color: var(--red); }
.v3 .ch__title { font-size: clamp(2.8rem, 12vw, 3.8rem); color: var(--red); }
.v3 .lede { font-size: 1.2em; font-style: italic; }
.v3 .lede::first-letter { float: none; font-size: 1em; padding: 0; color: inherit; }
.v3 .panel .chapter--quote { padding: 90px var(--side) 0; }
.v3 .chapter--quote .pull { color: var(--red); margin: 0; }
.v3 .panel .chapter--center { padding: 170px var(--side) 0; }
.v3 .heart-anchor { height: 290px; }
.v3 .panel .ido { padding-top: 0; }
.v3 .years i { background: #f9efe9; }
.v3 .leaf .msgr { text-align: left; }
.v3 .leaf .msgr__who::after { border-color: #f9efe9; }
.v3 .card { border-radius: 200px 200px 6px 6px; outline: 0; }
.v3 .card__inner { padding-top: 84px; }
.v3 .panel .band { background: none; color: var(--ink); padding-block: 26px 34px; }
.v3 .band .label { color: var(--red); }
.v3 .countdown { gap: clamp(8px, 2.6vw, 16px); }
.v3 .countdown div { min-width: 0; width: clamp(68px, 19vw, 92px); padding: 14px 4px 12px; border-radius: 16px; background: rgba(255, 255, 255, .7); box-shadow: 0 10px 20px -16px rgba(120, 40, 30, .5); }
.v3 .countdown b { color: var(--red); font-size: clamp(1.7rem, 7.5vw, 2.3rem); }
.v3 .countdown .label { font-size: .58rem; letter-spacing: .12em; color: var(--ink-soft); }
.v3 .rsvp { background: rgba(255, 255, 255, .6); border-radius: 16px; border-color: rgba(168, 23, 15, .3); }


/* ---------- the cover: the sealed envelope lies exactly over the scene's open one, and opens in place ----------
   Plain white paper and no blending here, so every layer is solid: nothing shows through anything else. */
.js .cover, .js .cover__stage { background: #fff; overflow: hidden; overflow: clip; }
.js .cover__stage { display: block; padding: 0; }
.js .cover__to, .js .cover__hint { position: absolute; left: 0; right: 0; text-align: center; }
.js .cv { position: absolute; width: auto; }
.js .cv > img { mix-blend-mode: normal; pointer-events: none; }
.js .cv > img:first-child { left: 0; z-index: 2; }                                   /* the sealed envelope */
.cv__seal { left: 37.300%; z-index: 5; }
.js .cv > .cv__open, .js .cv > .cv__lift { position: absolute; left: -2.780%; top: -39.130%; width: 80.930%; }   /* the open envelope, lined up under the sealed one */
.js .cv > .cv__open { z-index: 1; clip-path: inset(46.300% 0 0 0); }                  /* its pocket: seen through the gap the flap leaves */
.js .cv > .cv__lift { z-index: 4; opacity: 0; clip-path: inset(0 0 53.700% 0); transform-origin: 50% 46.300%; transform: perspective(1000px) rotateX(-90deg); }   /* its raised flap and flowers */
.js .cv > .cv__flap { position: absolute; left: 0; top: 0; width: 100%; z-index: 3; opacity: 0; transform-origin: 37.600% 7.200%; transform: perspective(1000px) rotateX(0deg); clip-path: polygon(0% 6.500%, 72.600% 6.500%, 72.600% 18%, 50% 42%, 45% 47.500%, 37.300% 50%, 29.600% 47.500%, 24.600% 42%, 0% 17%); }
/* 1: the flap swings up towards you on its top edge (the sealed envelope keeps a flap-shaped gap)
   2: it carries on over and stands up behind the envelope, bringing the flowers with it
   3: the cover fades, leaving the same envelope in the scene */
.opening .cv > img:first-child { clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0, 0% 6.500%, 72.600% 6.500%, 72.600% 18%, 50% 42%, 45% 47.500%, 37.300% 50%, 29.600% 47.500%, 24.600% 42%, 0% 17%, 0% 6.500%, 0 0); }
.opening .cv > .cv__flap { opacity: 1; transform: perspective(1000px) rotateX(90deg); filter: brightness(.78); transition: transform .7s cubic-bezier(.3, 0, .8, .7) .12s, filter .7s linear .12s; }
.opening .cv > .cv__lift { opacity: 1; transform: perspective(1000px) rotateX(0deg); transition: opacity .01s linear .82s, transform .78s cubic-bezier(.1, .5, .3, 1) .82s; }
.opening .cover__stage { opacity: 0; transition: opacity .5s ease 1.8s; }
.js .cover { transition: background-color .5s ease 1.8s; }
.opening.js .cover { background-color: rgba(255, 255, 255, 0); }

/* Lanz's message: the bubble keeps its final size from the start (no page reflow while it "types"), only the text fades in */
.js .msgr__msg { max-width: none; max-height: none; white-space: normal; overflow: visible; }
.js .msgr.in .msgr__msg { animation: msgin .35s .6s ease forwards; }
.js .msgr.in .msgr__dots { animation: gone .15s .55s forwards; }
@keyframes msgin { to { opacity: 1; } }

/* less empty paper between "This time, they are saying," the heart and "I do." */
.v1 .panel .chapter--center, .v2 .panel .chapter--center { padding-bottom: 64px; }
.v1 .heart-anchor, .v2 .heart-anchor { height: 132px; }
.v1 .panel .ido, .v2 .panel .ido { padding-top: 0; }

/* version 3: every chapter the same distance apart; the twist sits in that space */
.v3 .panel .leaf, .v3 .panel .leaf.chapter--apart { margin-top: 150px; }
.v3 .panel .chapter--quote { margin-top: 150px; padding: 0 var(--side); }
.v3 .panel .chapter--center { margin-top: 150px; padding: 0 var(--side); }
.v3 .heart-anchor { height: 210px; }
.w-a, .w-b { stroke-width: 2.2; }

/* the heart is never shown ahead of the thread: its lighter twist only appears once the thread has drawn it */
.threads .lobe-twist { opacity: 0; transition: opacity .6s ease; }
.threads .lobe-twist.on { opacity: .75; }

/* home: no sideways travel. The layout is fitted to the screen width and only scrolls up and down */
.scene__col { width: clamp(320px, 106vw, 860px); }
.v3 .heart-anchor { height: 256px; }

/* story thread: one solid thread with a soft shadow. The dashed "yarn twist" layer and its moving clip made phones re-draw
   the whole story every frame, and made the heart look different from the string that draws it */
.threads .t-twist, .threads .t-hi, .threads [clip-path="url(#reveal)"] { display: none; }
.t-base { stroke-width: 2.6; }

/* ---------- RSVP form ---------- */
.reply { position: relative; z-index: 1; margin-top: 1.6rem; display: grid; gap: 1.25rem; text-align: left; }
.reply__field { position: relative; margin: 0; padding: 0; border: 0; min-width: 0; }
.reply__label { display: block; padding: 0; margin-bottom: .45rem; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink); opacity: .8; }
.reply__opt { letter-spacing: .04em; text-transform: none; opacity: .75; }
.reply__input { display: block; width: 100%; padding: 12px 14px; font: inherit; font-size: 1.0625rem; line-height: 1.4; color: var(--ink); background: rgba(255, 255, 255, .5); border: 1px solid rgba(71, 43, 40, .4); border-radius: 4px; resize: vertical; }
.reply__input::placeholder { color: var(--ink); opacity: .5; }
.reply__input:focus-visible, .reply__choice input:focus-visible + span, .reply__matches button:focus-visible, .reply__again:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.reply__matches { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid rgba(71, 43, 40, .3); border-radius: 4px; background: var(--paper); }
.reply__matches button { display: block; width: 100%; min-height: 44px; padding: 8px 10px; font: inherit; font-size: 1rem; text-align: left; color: var(--ink); background: none; border: 0; border-radius: 3px; cursor: pointer; }
.reply__matches button:hover { background: rgba(134, 17, 11, .08); }
.reply__choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reply__choice legend { grid-column: 1 / -1; }
.reply__choice label { display: block; cursor: pointer; }
.reply__choice input { position: absolute; opacity: 0; pointer-events: none; }
.reply__choice span { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 10px; text-align: center; font-style: italic; font-size: 1.05rem; line-height: 1.25; color: var(--ink); border: 1px solid rgba(71, 43, 40, .4); border-radius: 4px; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.reply__choice input:checked + span { background: var(--red); border-color: var(--red); color: #fff; }
.reply__error { margin: 0; color: var(--red); font-size: .95rem; }
.reply .btn { margin-top: 0; justify-self: center; }
.reply .btn:disabled { opacity: .6; cursor: default; }
.reply__done { position: relative; z-index: 1; margin-top: 1.6rem; outline: none; }
.reply__thanks { font-style: italic; font-size: 1.2rem; line-height: 1.5; }
.reply__again { margin-top: .9rem; min-height: 44px; padding: 8px 12px; font: inherit; font-size: .95rem; color: var(--ink); background: none; border: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.v1 .reply__input, .v1 .reply__choice span { border-color: rgba(255, 236, 214, .4); }
.v1 .reply__input { background: rgba(0, 0, 0, .18); }
.v1 .reply__matches { border-color: rgba(255, 236, 214, .35); background: #3a2216; }
.v1 .reply__matches button:hover { background: rgba(255, 236, 214, .1); }

/* the cover stays hidden until the envelope has been put in its place, so it never shows in the wrong spot while the page loads */
.js:not(.placed) .cover__stage { visibility: hidden; }
.js.placed .cover__stage { animation: coverIn .5s ease; }
@keyframes coverIn { from { opacity: 0; } }
