/* Entourage page. Numbers are design pixels (see --u in site.css): first the phone design, then the desktop design. */

.entourage {
  --pt: 30; --pb: 122;
  --tw: 326; --crest: 32; --h1: 54; --h1-mt: 5; --tlabel: 11; --tlabel-mt: 17;
  --nw: 366; --note-mt: -30; --n-pt: 66; --n-px: 14; --n-pb: 70; --key: 7;
  --orn-mt: 30; --orn-w: 44; --h2: 40; --h2-mt: 12; --h2-mb: 20;
  --gap: 18; --h3: 11; --h3-pb: 7; --name: 15; --row: 4; --sub-pt: 20;
  --seal: 74;
  padding: calc(var(--pt) * var(--u)) 0 calc(var(--pb) * var(--u));
  padding-bottom: calc(var(--pb) * var(--u) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 760px) {
  .entourage {
    --pt: 56; --pb: 160;
    --tw: 540; --crest: 53; --h1: 90; --h1-mt: 9; --tlabel: 16; --tlabel-mt: 28;
    --nw: 680; --note-mt: -46; --n-pt: 104; --n-px: 58; --n-pb: 104; --key: 9;
    --orn-mt: 44; --orn-w: 64; --h2: 56; --h2-mt: 16; --h2-mb: 28;
    --gap: 44; --h3: 13; --h3-pb: 10; --name: 20; --row: 5; --sub-pt: 30;
    --seal: 104;
  }
}

/* ---------- title card: the maroon frame turned to landscape, crest, title, nuptials line ---------- */
.head { position: relative; z-index: 3; }
.title { position: relative; width: calc(var(--tw) * var(--u)); margin: 0 auto; }
.title-bg { width: 100%; height: auto; filter: brightness(1.06) drop-shadow(1px 1.5px 1px rgba(52, 30, 18, .30)) drop-shadow(4px 9px 10px rgba(52, 30, 18, .20)); }
.tcopy { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--pearl); }
.crest { width: calc(var(--crest) * var(--u)); height: auto; }
/* the padding gives the script's swashes room inside the box (needed for the written-on reveal); the margins cancel it out */
.tcopy h1 {
  position: relative; left: -.03em; font-family: var(--script); font-size: calc(var(--h1) * var(--u)); line-height: 1;
  padding: .3em .25em .5em; margin: calc(var(--h1-mt) * var(--u) - .3em) -.25em -.5em;
}
.tlabel {
  font-family: var(--label); font-size: calc(var(--tlabel) * var(--u)); line-height: 1; text-transform: uppercase;
  letter-spacing: .3em; padding-left: .3em; margin-top: calc(var(--tlabel-mt) * var(--u)); white-space: nowrap; color: #d9dcdf;
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tlabel { background: var(--silver-foil); -webkit-background-clip: text; background-clip: text; color: transparent; }
}

.bq { position: absolute; z-index: 6; }
.bq img { width: 100%; height: auto; filter: drop-shadow(1px 2px 1.5px rgba(40, 24, 14, .26)) drop-shadow(5px 10px 9px rgba(40, 24, 14, .20)); }
.bq1 { left: calc(50% - 197 * var(--u)); top: calc(-16 * var(--u)); width: calc(106 * var(--u)); }
.bq2 { left: calc(50% + 111 * var(--u)); top: calc(-40 * var(--u)); width: calc(92 * var(--u)); }
@media (min-width: 760px) {
  .bq1 { left: calc(50% - 352px); top: -26px; width: 180px; }
  .bq2 { left: calc(50% + 248px); top: -62px; width: 150px; }
}

/* ---------- the list: ivory paper with a silver keyline ---------- */
.note {
  position: relative; z-index: 2; width: calc(var(--nw) * var(--u)); margin: calc(var(--note-mt) * var(--u)) auto 0;
  padding: calc(var(--n-pt) * var(--u)) calc(var(--n-px) * var(--u)) calc(var(--n-pb) * var(--u));
  background: linear-gradient(165deg, #f8f4ee 0%, #f1e9dd 100%);
  box-shadow: 1px 1.5px 1.5px rgba(52, 30, 18, .24), 5px 11px 14px rgba(52, 30, 18, .17);
}
.note::after {
  content: ""; position: absolute; top: calc(var(--key) * var(--u)); right: calc(var(--key) * var(--u)); bottom: calc(var(--key) * var(--u)); left: calc(var(--key) * var(--u));
  pointer-events: none; border: 1px solid transparent;
  border-image: linear-gradient(115deg, #7d8288, #d5d8db 30%, #858a90 52%, #c3c7cb 74%, #7d8288) 1;
  outline: 1px solid rgba(125, 130, 136, .32); outline-offset: 3px;
}

.orn { display: flex; align-items: center; justify-content: center; gap: calc(9 * var(--u)); margin-top: calc(var(--orn-mt) * var(--u)); }
.orn i { display: block; height: 1px; width: calc(var(--orn-w) * var(--u)); background: linear-gradient(90deg, rgba(125, 130, 136, 0), #8d9298 60%, #b9bdc2); }
.orn i:last-child { background: linear-gradient(270deg, rgba(125, 130, 136, 0), #8d9298 60%, #b9bdc2); }
.orn b { display: block; width: calc(5 * var(--u)); height: calc(5 * var(--u)); transform: rotate(45deg); background: linear-gradient(135deg, #c9cdd1, #7d8288); }

.note h2 {
  font-family: var(--script); font-size: calc(var(--h2) * var(--u)); line-height: 1; text-align: center; white-space: nowrap; color: var(--burgundy-ink);
  padding: .25em .3em .45em; margin: calc(var(--h2-mt) * var(--u) - .25em) -.3em calc(var(--h2-mb) * var(--u) - .45em);
}

/* two mirrored columns: left column reads toward the centre rule, right column away from it; each row is a pair */
.duo { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: calc(var(--gap) * var(--u)); --lead: 520ms; }
.duo.first { --lead: 0ms; }
.duo::before {
  content: ""; position: absolute; left: 50%; top: 1px; bottom: 1px; width: 1px;
  background: linear-gradient(180deg, rgba(125, 130, 136, 0), #8d9298 16%, #c9cdd1 50%, #8d9298 84%, rgba(125, 130, 136, 0));
}
.duo h3 {
  align-self: end; font-family: var(--display); font-size: calc(var(--h3) * var(--u)); line-height: 1.4; text-transform: uppercase;
  letter-spacing: .22em; padding-bottom: calc(var(--h3-pb) * var(--u)); color: var(--olive-deep);
}
.duo p { font-size: calc(var(--name) * var(--u)); font-weight: 500; line-height: 1.16; padding: calc(var(--row) * var(--u)) 0; text-wrap: balance; }
.duo .l { text-align: right; }
.duo h3.l { margin-right: -.22em; }
.duo .r { text-align: left; }
.duo .sub { padding-top: calc(var(--sub-pt) * var(--u)); }
@media (min-width: 760px) { .mb { display: none; } }

/* ---------- end of the list: wax seal on the card's edge (decoration only) and the last bouquet ---------- */
.foot { position: relative; }
.seal {
  display: block; position: relative; z-index: 5; width: calc(var(--seal) * var(--u)); margin: calc(var(--seal) * var(--u) * -.5) auto 0;
  filter: drop-shadow(1px 2px 1.5px rgba(30, 6, 10, .5)) drop-shadow(3px 6px 6px rgba(30, 6, 10, .32));
}
.seal img { width: 100%; height: auto; }

/* ====================================================================================================
   Motion. Applies only when <html> has the class "anim", which the page adds itself when motion is allowed.
   Without it (motion switched off on the phone, or scripts blocked) everything above is simply shown.
   Each piece plays once. Only opacity, transform, letter-spacing and a mask position ever change.
   ==================================================================================================== */

/* row number inside a two-column grid, used to stagger the pairs */
.duo > :nth-child(n) { --i: 0; }
.duo > :nth-child(n+3) { --i: 1; }
.duo > :nth-child(n+5) { --i: 2; }
.duo > :nth-child(n+7) { --i: 3; }
.duo > :nth-child(n+9) { --i: 4; }
.duo > :nth-child(n+11) { --i: 5; }
.duo > :nth-child(n+13) { --i: 6; }
.duo > :nth-child(n+15) { --i: 7; }
.duo > :nth-child(n+17) { --i: 8; }
.duo > :nth-child(n+19) { --i: 9; }
.duo > :nth-child(n+21) { --i: 10; }
.duo > :nth-child(n+23) { --i: 11; }

/* waiting states */
.anim:not(.ready) .head, .anim:not(.ready) .note { visibility: hidden; }
.anim [data-reveal]:not(.in) { visibility: hidden; }

/* arrival: the card settles, the crest rises, the title is written, the nuptials line eases in, the bouquet slides in, the paper rises */
.anim.ready .title { animation: a-card .6s var(--ease) both; }
.anim.ready .crest { animation: a-rise .45s var(--ease) .25s both; }
.anim.ready .tcopy h1 { animation: a-write .85s cubic-bezier(.45, .1, .3, 1) .35s both; }
.anim.ready .tlabel { animation: a-track .55s var(--ease) .85s both; }
.anim.ready .bq1 { transform-origin: 70% 80%; animation: a-bq1 .75s var(--ease) .3s both; }
.anim.ready .note { animation: a-up .6s var(--ease) .2s both; }

/* the two script lines that are "written": a soft edge sweeps across from left to right */
.anim .tcopy h1, .anim .note h2 {
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 45%, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-size: 222% 100%; mask-size: 222% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* each section, once, when it scrolls into view: lines draw out, heading is written, rule draws down, pairs glide to the centre */
.anim .sec.in .orn i { transform-origin: right center; animation: a-line .5s var(--ease) both; }
.anim .sec.in .orn i:last-child { transform-origin: left center; }
.anim .sec.in .orn b { animation: a-dia .4s var(--ease) both; }
.anim .sec.in h2 { animation: a-write .9s cubic-bezier(.45, .1, .3, 1) .12s both; }
.anim .sec.in .duo::before { transform-origin: center top; animation: a-rule .6s var(--ease) var(--lead) both; }
.anim .sec.in .duo > * { animation-duration: .45s; animation-fill-mode: both; animation-timing-function: var(--ease); animation-delay: calc(var(--lead) + 60ms + var(--i) * 70ms); }
.anim .sec.in .duo h3 { animation-name: a-fade; animation-timing-function: ease-out; }
.anim .sec.in .duo p.l { animation-name: a-in-l; }
.anim .sec.in .duo p.r { animation-name: a-in-r; }

/* end of the list: the seal is pressed on, the last bouquet slides in */
.anim .foot.in .seal { animation: a-stamp .5s cubic-bezier(.5, 0, .3, 1) both; }
.anim .foot.in .bq2 { transform-origin: 30% 20%; animation: a-bq2 .75s var(--ease) .22s both; }

@keyframes a-card { from { opacity: 0; transform: translateY(-14px) scale(1.035); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes a-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes a-up { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes a-write { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
@keyframes a-track { from { opacity: 0; letter-spacing: .52em; padding-left: .52em; } to { opacity: 1; letter-spacing: .3em; padding-left: .3em; } }
@keyframes a-bq1 { from { opacity: 0; transform: translate(-16px, -12px) rotate(-8deg); } to { opacity: 1; transform: none; } }
@keyframes a-bq2 { from { opacity: 0; transform: translate(14px, 8px) rotate(7deg); } to { opacity: 1; transform: none; } }
@keyframes a-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes a-dia { from { opacity: 0; transform: rotate(45deg) scale(0); } to { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes a-rule { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes a-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes a-in-l { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes a-in-r { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
@keyframes a-stamp { 0% { opacity: 0; transform: scale(1.42); } 55% { opacity: 1; transform: scale(.965); } 100% { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .anim *, .anim *::before { animation: none !important; visibility: visible !important; -webkit-mask-image: none !important; mask-image: none !important; }
}
