/* Chapter layouts: opener, story, guidebook, details (full event cards), ending, event dialog.
   Flexible layout from 360x640 up to 430x932; only transform and opacity animate. */

/* ---------- opener ---------- */
.chapter--opener { position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding-bottom: calc(var(--menu-h) + env(safe-area-inset-bottom)); }
.opener__skip { position: absolute; z-index: 5; top: 14px; left: 14px; }
/* Layers, back to front: stage (bush, bike), couple photo, garland (one frame shared by both beats), beat-2 text, beat-1 text.
   The photo's own painted garland is masked off so it never doubles the garland layer while it slides away. */
.chapter--opener .garland { z-index: 2; }
.opener__photo { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 13%, #000 34%); mask-image: linear-gradient(to bottom, transparent 13%, #000 34%); }
.opener__one { position: absolute; z-index: 4; top: clamp(60px, 8.3svh, 70px); left: 16px; right: 16px;
  display: grid; gap: clamp(4px, 1.1svh, 9px); justify-items: center; text-align: center; }
.opener__welcome { font-size: clamp(40px, 5.9svh, 50px); }
.opener__pair { font-size: clamp(40px, min(6.4svh, 14vw), 54px); margin-top: 6px; white-space: nowrap; }
.opener__pair span { display: block; font: 15px/1.6 var(--fact); }
.opener__news { font-size: 20px; }
.opener__two { position: relative; z-index: 3; display: grid; gap: clamp(3px, .95svh, 8px); justify-items: center; text-align: center;
  padding: clamp(62px, 8.8svh, 74px) 16px 0; }
.opener__names { font-size: clamp(26px, 3.8svh, 32px); white-space: nowrap; }
.opener__title { font-size: clamp(46px, 7.4svh, 62px); line-height: .92; }
.opener__days { font-size: clamp(24px, 3.45svh, 29px); line-height: 1.1; margin-top: 2px; }
.opener__cities { font-size: 11.5px; letter-spacing: .11em; }
.opener__from { font: italic 500 16.5px/1.3 var(--fact); }
/* the bike grows into whatever height is left: cq units come from the stage */
.opener__stage { position: relative; flex: 1 1 0; min-height: 140px; container-type: size; display: flex; align-items: flex-end; justify-content: center; }
.opener__stage::before { content: ""; position: absolute; left: -30px; right: -30px; bottom: -16px; height: 46px; background: radial-gradient(closest-side, rgba(141,156,56,.32), transparent); }
.opener__bush { position: absolute; left: 0; bottom: -24px; width: 108px; height: min(300px, 100cqh); background: url(/assets/art/engagement-plate.jpg) 0 100% / 430px auto no-repeat;
  -webkit-mask-image: linear-gradient(to right, #000 50%, transparent 96%), linear-gradient(to bottom, transparent, #000 28%, #000 86%, transparent); -webkit-mask-composite: source-in;
          mask-image: linear-gradient(to right, #000 50%, transparent 96%), linear-gradient(to bottom, transparent, #000 28%, #000 86%, transparent); mask-composite: intersect; }
/* height left for the tag above the bike: 1.14 x bike height, plus its tilt */
.opener__ride { position: relative; width: min(368px, 94cqw, calc(140cqh - 12px)); aspect-ratio: 420 / 250; }
.opener__bike { width: 100%; height: 100%; }
.opener__string { position: absolute; left: 0; top: -12.8%; width: 16.3%; }
.opener__tag { position: absolute; left: 1%; top: -14%; transform: rotate(-5deg); padding: 5px 12px 5px 22px; border-radius: 7px; white-space: nowrap;
  background: var(--jasmine); border: 1.5px solid var(--copper); color: var(--copper); font: 700 11.5px/1.3 var(--caps); letter-spacing: .14em; text-transform: uppercase; }
.opener__tag::before { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -4px; border-radius: 50%; border: 1.5px solid var(--copper); }
.opener__hint { position: relative; z-index: 3; padding: 12px 0 4px; }

/* Beat 2 is the resting state (JS off, reduced motion). html.intro, set in <head> before first paint, holds beat 1;
   removing it plays beat 2: the couple slides out, the text rises, the bike rolls in, the tag lands. */
.opener__photo { visibility: hidden; transform: translateY(101%); transition: transform .7s cubic-bezier(.5,0,.75,0), visibility 0s .7s; }
.opener__one { visibility: hidden; opacity: 0; transition: opacity .25s, visibility 0s .25s; }
.opener__two > * { transition: opacity .5s calc(.2s + var(--i) * 70ms), transform .6s cubic-bezier(.2,.8,.2,1) calc(.2s + var(--i) * 70ms); }
.opener__ride { transition: transform 1.1s cubic-bezier(.2,.7,.25,1) .35s; }
.opener__tag { transition: opacity .25s 1.35s, transform .45s cubic-bezier(.3,1.6,.5,1) 1.35s; }
.opener__string { transition: opacity .3s 1.3s; }
.opener__hint { transition: opacity .4s 1.6s; }
.intro .opener__photo, .intro .opener__one { visibility: visible; opacity: 1; transform: none; transition: none; }
.intro .opener__two > * { opacity: 0; transform: translateY(14px); transition: none; }
.intro .opener__ride { transform: translateX(calc(-100% - 64px)); transition: none; }
.intro .opener__tag { opacity: 0; transform: rotate(-5deg) scale(.4); transition: none; }
.intro .opener__string, .intro .opener__hint { opacity: 0; transition: none; }

/* ---------- story (stub) ---------- */
.story { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; text-align: center;
  padding: 48px 24px calc(var(--menu-h) + env(safe-area-inset-bottom) + 24px); }
.story__title { font-size: 56px; }

/* ---------- guidebook ---------- */
/* a page of the pocket guide: gutter shadow on the left, thumb tabs on the right */
.guide { position: relative; display: flex; flex-direction: column; background: var(--parchment-light);
  padding: 24px 48px calc(var(--menu-h) + env(safe-area-inset-bottom) + 6px) clamp(22px, 7.7vw, 30px); }
.guide::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 20px; background: linear-gradient(90deg, rgba(144,75,18,.26), transparent); pointer-events: none; }
.guide__runhead { padding: 6px 0 9px; border-bottom: 1px solid var(--ink); font: 700 10px/1.3 var(--caps); letter-spacing: .14em; text-transform: uppercase; }
.guide__runhead span { opacity: .7; }
.guide__tabs { position: absolute; z-index: 1; right: 0; top: 128px; display: grid; gap: 6px; justify-items: end; }
.guide__tabs a { writing-mode: vertical-rl; width: 34px; min-height: 96px; text-align: center; font: 700 11px/34px var(--caps); letter-spacing: .14em; text-transform: uppercase;
  background: var(--sage-light); border: 1px solid var(--motif); border-right: 0; border-radius: 10px 0 0 10px; }
.guide__tabs a[aria-current] { width: 42px; line-height: 42px; background: var(--bridal); border-color: var(--bridal); color: var(--jasmine); }
.guide__page { display: flex; flex-direction: column; flex: 1 0 auto; }
.guide__chapter { color: var(--copper); margin-top: 16px; }
.guide__title { font: 400 54px/1 var(--script); margin: 4px 0 8px; }
.guide__standfirst { font: italic 500 17.5px/1.35 var(--fact); }
.guide__folio { margin-top: auto; padding-top: 18px; text-align: center; font: italic 500 14px var(--fact); opacity: .8; }
.route { display: flex; align-items: flex-start; margin: 16px 0 14px; list-style: none; text-align: center; }
.route li { flex: none; }
.route b { display: block; font: 700 19px/1.1 var(--fact); }
.route b::before { content: ""; display: block; width: 12px; height: 12px; margin: 0 auto 5px; border-radius: 50%; background: var(--rose); border: 2px solid var(--jasmine); box-shadow: 0 0 0 1px var(--rose); }
.route span { font: 600 13.5px/1.2 var(--fact); }
.route .route__leg { flex: 1; min-width: 0; }
.route__leg::before { content: ""; display: block; height: 2px; margin: 7px 2px 6px; background: repeating-linear-gradient(90deg, var(--copper) 0 4px, transparent 4px 9px); }
.route__leg .tbc { font-size: 11.5px; padding: 0 4px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 999px; font: 600 15px var(--fact); box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg a[aria-current] { background: var(--ink); color: var(--jasmine); }
.ways { display: grid; gap: 12px; margin: 16px 0; }
.ways > div { display: grid; grid-template-columns: 30px 1fr; align-items: start; }
.ways .icon { color: var(--copper); width: 24px; height: 24px; margin-top: 1px; }
.ways p { font-size: 17px; line-height: 1.4; }
.ways .tbc { white-space: normal; }
.js .ways__city { display: none; }
.tip { position: relative; margin-top: 12px; padding: 14px 14px 12px; border: 1.5px solid var(--ink); border-radius: 4px; font-size: 17px; line-height: 1.35; }
.tip .caps { position: absolute; left: 12px; top: -9px; padding: 0 7px; background: var(--parchment-light); font-size: 11px; color: var(--bridal); }
.more { display: flex; justify-content: space-between; align-items: center; min-height: 48px; margin-top: 12px; border-bottom: 1px solid var(--motif); font: 600 17px var(--fact); }
.guide__side { margin: 16px 0 4px; font-size: 10.5px; letter-spacing: .1em; }
.person { display: grid; grid-template-columns: 48px 1fr 46px 46px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(202,154,92,.6); }
.person__face { width: 48px; height: 48px; border-radius: 50%; border: 1.5px dashed var(--copper); background: rgba(247,195,173,.35); }
.person .small { display: block; margin-top: 2px; }
.round { width: 46px; height: 46px; border-radius: 50%; display: grid; place-content: center; box-shadow: inset 0 0 0 1.5px var(--ink); }
.round--wa { background: var(--leaf); color: var(--jasmine); box-shadow: none; }
.group { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 12px 14px; border: 1.5px dashed var(--copper); border-radius: 14px; }
.group .small { display: block; }
.group .btn { min-height: 44px; }
.guide__cc { margin-top: 12px; }

/* ---------- full event card (in #details and in the dialog) ---------- */
.details { display: grid; align-content: start; gap: 16px; padding: 48px 10px calc(var(--menu-h) + env(safe-area-inset-bottom) + 20px); }
.details__title { font-size: 52px; text-align: center; }
.details > .small { margin: -10px 0 4px; }
.card { background: var(--parchment-light); border: 1px solid var(--gold); border-radius: 22px; padding: 18px clamp(14px, 4vw, 22px) 18px; }
.card__head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.card__name { font-size: clamp(46px, 14vw, 58px); margin: 6px 0 8px; }
.card__place { font-size: 11.5px; letter-spacing: .12em; }
.card__art { position: relative; flex: none; width: clamp(84px, 26vw, 104px); height: 122px; border-radius: 14px; border: 1.5px dashed var(--copper); background: rgba(247,195,173,.3);
  display: grid; place-content: center; text-align: center; padding: 6px; color: var(--copper); }
.card__art .caps { font-size: 10px; letter-spacing: .12em; }
.card__art .sticker { position: absolute; right: -10px; bottom: -20px; width: 60px; height: 60px; outline-offset: -5px; }
.card__art .sticker b { font-size: 26px; }
.card__art .sticker span { font-size: 6px; padding: 0 4px; }
.card__when { font-size: 27px; line-height: 1.2; margin-top: 10px; }
/* the night strip: makes the midnight crossing impossible to miss */
.night { margin: 12px 0; }
.night__bar { position: relative; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--gold), var(--brass) 20%, var(--ink) 44%, var(--ink) 68%, var(--rose-soft) 90%, var(--blush)); }
.night__bar i { position: absolute; top: 50%; }
.night__arrive { left: 13%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--jasmine); border: 3px solid var(--ink); }
.night__mid { left: 50%; width: 2px; height: 26px; margin: -13px 0 0 -1px; background: var(--jasmine); box-shadow: 0 0 0 1px var(--ink); }
.night__muhurtham { left: 76%; width: 16px; height: 16px; margin: -8px 0 0 -8px; background: var(--gold); border: 2px solid var(--jasmine); transform: rotate(45deg); box-shadow: 0 0 0 1px var(--ink); }
.night__labels { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; margin-top: 8px; font-size: 14.5px; line-height: 1.3; }
.night__labels b { display: block; font-weight: 700; }
.night__labels .tbc { font-size: 13px; }
.night__midnight { font-style: italic; opacity: .8; }
.night__end { text-align: right; }
.card__facts { display: grid; gap: 10px; margin: 12px 0 14px; }
.card__facts div { display: grid; grid-template-columns: 26px 1fr; column-gap: 8px; align-items: start; }
.card__facts .icon { color: var(--copper); grid-row: span 2; margin-top: 1px; }
.card__facts dt { font: 700 11px/1.3 var(--caps); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.card__facts dd { font-size: 17.5px; line-height: 1.35; }
.card .row2 .btn { gap: 6px; padding: 0 6px; font-size: clamp(15px, 4.2vw, 17px); }
.card__note { margin-top: 9px; text-wrap: balance; }

/* the dialog: a bottom sheet holding a copy of one card */
.sheet { margin: auto auto 0; width: 100%; max-width: min(430px, 100%); max-height: calc(100dvh - 40px); padding: 0; border: 0; border-radius: 26px 26px 0 0;
  background: var(--parchment-light); color: var(--ink); box-shadow: 0 -1px 0 var(--gold); overflow: auto; overscroll-behavior: contain; }
.sheet[open] { animation: sheet-up .32s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-up { from { transform: translateY(100%); } }
.sheet::backdrop { background: rgba(51,62,28,.3); }
.sheet__bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: flex-end; padding: 10px 12px 0; background: var(--parchment-light); }
.sheet__grab { position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: var(--motif); opacity: .7; }
.sheet__body { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet .card { border: 0; border-radius: 0; padding-top: 0; }
html:has(.sheet[open]) { overflow: hidden; }

/* ---------- ending ---------- */
.chapter--ending { position: relative; overflow: hidden; display: flex; flex-direction: column;
  padding-bottom: calc(var(--menu-h) + env(safe-area-inset-bottom) + 6px); }
.ending__dusk { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(247,195,173,.6), rgba(247,195,173,0) 58%); }
.ending__text { position: relative; display: grid; gap: 6px; justify-items: center; text-align: center; padding: clamp(56px, 8.3svh, 70px) 22px 0; }
.ending__title { font-size: clamp(48px, 7.4svh, 62px); }
.ending__lede { font-size: 18px; line-height: 1.3; max-width: 300px; }
.ending__names { font-size: 33px; white-space: nowrap; margin-top: 4px; }
.ending__from { font-size: 10.5px; letter-spacing: .13em; }
.recap { position: relative; margin: clamp(10px, 2svh, 18px) 18px 0; padding: 12px 16px 10px; border-radius: 18px; background: rgba(251,240,208,.94); border: 1px solid var(--gold); }
.recap__head { padding-bottom: 7px; }
.recap__head .tbc { font-size: 12.5px; margin-left: 6px; }
.recap div { display: grid; grid-template-columns: 54px 1fr; align-items: baseline; padding: 6px 0; border-top: 1px solid rgba(202,154,92,.55); font-size: 16.5px; line-height: 1.25; }
.recap b { font: 700 20px/1.1 var(--fact); }
.recap .small { display: block; }
.ending__scene { position: relative; flex: 1 1 0; min-height: 150px; container-type: size; }
.ending__road { position: absolute; left: -20px; right: -20px; bottom: 6px; height: 20px; border-radius: 10px; background: var(--sage-light); box-shadow: 0 0 0 2px rgba(202,154,92,.5); }
.ending__sisters { position: absolute; left: 14px; bottom: 18px; }
.petal { position: absolute; width: 9px; height: 9px; border-radius: 50% 0 50% 50%; background: var(--rose-soft); transform: rotate(var(--r, 0deg)); }
.ending__ride { position: absolute; right: -22px; bottom: 4px; width: min(262px, 67cqw, 150cqh); aspect-ratio: 420 / 250; transform: rotate(-3deg); }
.ending__ride img { width: 100%; height: 100%; }
.ending__ride .dot-sticker { width: 11px; height: 11px; }
.ending__actions { position: relative; display: grid; gap: 8px; padding: 10px 18px 0; }
.ending__actions .btn { min-height: 46px; }
.ending__actions .row2 { gap: 8px; }
.ending__actions .row2 .btn { padding: 0 8px; font-size: 16px; }
html:not(.js) [data-share] { display: none; }
