/* Gatefold invitation — watercolour card with doors and a satin bow (see app.js) */
:root {
  --paper: #fbf7ee; --ink: #40392c; --accent: #66713a; --accent2: #3d6a94; --soft: #8a8169; --table: #e9e1d0;
  --script: 'Pinyon Script', cursive; --serif: 'Cormorant Garamond', Georgia, serif; --script-style: normal; --names-scale: 1;
  --rb: #efe3c8; --rb-l: #fbf5e6; --rb-d: #cdbb93;
  --cs: .93; --band-y: 53%; --bow-w: 220px; --bow-top: 40%; --door-bg: cover;
  --ease: cubic-bezier(.22, .8, .2, 1);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--table); }
html.gf-busy, html.gf-busy body { overflow: hidden; }
body {
  font-family: var(--serif); color: var(--ink); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased;
  background: linear-gradient(color-mix(in srgb, var(--table) 62%, transparent), color-mix(in srgb, var(--table) 62%, transparent)), var(--paper-img) repeat var(--table);
  background-size: auto, 512px; -webkit-tap-highlight-color: transparent;
}
body.locked { overflow: hidden; height: 100svh; }
img { display: block; max-width: 100%; height: auto; }
.app { position: relative; max-width: 480px; margin: 0 auto; min-height: 100svh; overflow: hidden;
  background: linear-gradient(color-mix(in srgb, var(--paper) var(--veil, 55%), transparent), color-mix(in srgb, var(--paper) var(--veil, 55%), transparent)), var(--paper-img) repeat var(--paper);
  background-size: auto, 512px; box-shadow: 0 0 70px rgba(70, 50, 30, .16); }

/* ───────── hero / closed card ───────── */
.hero { position: relative; height: 100svh; overflow: hidden; background: var(--table) var(--paper-img); background-size: 512px; background-blend-mode: multiply; }
.card { position: absolute; inset: 0; perspective: 780px; perspective-origin: 50% 46%; transform: scale(var(--cs)); cursor: pointer;
  transition: transform 1s cubic-bezier(.6, 0, .2, 1); }
.card::before { content: ''; position: absolute; inset: 0; border-radius: 4px; pointer-events: none;
  box-shadow: 0 22px 46px rgba(60, 38, 18, .26), 0 3px 8px rgba(60, 38, 18, .16); transition: opacity .9s ease; }
.scene-clip { position: absolute; inset: 0; overflow: hidden; border-radius: 4px; background: var(--paper); transition: border-radius .9s; }
.scene { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.scene-img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.scene.multiply .scene-img { mix-blend-mode: multiply; }
.scene.multiply { background: linear-gradient(color-mix(in srgb, var(--paper) 72%, transparent), color-mix(in srgb, var(--paper) 72%, transparent)), var(--paper-img) var(--paper); background-size: auto, 512px; }

/* names inside the scene's empty arch / oval */
.hn { position: absolute; display: flex; align-items: center; justify-content: center; text-align: center; container-type: inline-size;
  --hn-fs: 60px; --hn-small: 11px; opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease .25s, transform 1.4s var(--ease) .25s; }
.hn-in { width: 100%; }
.hn-k { font-size: var(--hn-small); letter-spacing: .34em; text-transform: uppercase; color: var(--accent); margin-bottom: .5em; font-weight: 500; }
.hn-names { font-family: var(--script); font-style: var(--script-style); font-size: var(--hn-fs); line-height: .98; color: var(--ink); white-space: nowrap;
  text-shadow: 0 0 18px var(--paper), 0 0 2px rgba(255, 255, 255, .6); }
.hn-names .n { display: block; }
.hn-names .amp { display: block; font-size: .5em; line-height: 1; color: var(--accent); margin: .05em 0 .08em; }
.hn-rule { width: 38%; height: 1px; margin: .9em auto .7em; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .7; }
.hn-date { font-size: calc(var(--hn-small) * 1.25); letter-spacing: .26em; text-transform: uppercase; color: var(--ink); font-weight: 500; }
.hn-city { font-size: var(--hn-small); letter-spacing: .3em; text-transform: uppercase; color: var(--soft); margin-top: .35em; }
.hn-date, .hn-city, .hn-k { text-shadow: 0 0 10px var(--paper), 0 0 3px var(--paper); }

/* doors */
.door { position: absolute; top: 0; bottom: 0; width: 50%; transform-style: preserve-3d; will-change: transform;
  transition: opacity .6s ease; }
.door.l { left: 0; transform-origin: 0 50%; }
.door.r { right: 0; transform-origin: 100% 50%; }
.door .face, .door .back { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
/* WebKit honours backface-visibility only for faces with their own 3D transform */
.door .face { transform: rotateY(0deg) translateZ(.5px); }
.door.l .face { border-radius: 4px 0 0 4px; } .door.r .face { border-radius: 0 4px 4px 0; }
.door .art { position: absolute; inset: 0; background-color: var(--door-paper, var(--paper)); background-repeat: no-repeat;
  background-size: var(--door-bg); background-position: var(--door-pos, 0 50%); }
.door.r .art { transform: scaleX(-1); }
/* cardstock: a soft crease at the inner edge where the doors meet */
.door .face::after { content: ''; position: absolute; top: 0; bottom: 0; width: 14px; pointer-events: none; }
.door.l .face::after { right: 0; background: linear-gradient(90deg, transparent, rgba(80, 60, 40, .1) 85%, rgba(80, 60, 40, .22)); }
.door.r .face::after { left: 0; background: linear-gradient(270deg, transparent, rgba(80, 60, 40, .1) 85%, rgba(80, 60, 40, .22)); }
.door .dim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(40, 28, 16, .55), rgba(40, 28, 16, .25)); opacity: 0; transition: opacity 1.75s ease; }
.door.r .dim { transform: scaleX(-1); }
.door .back { opacity: 0; transform: rotateY(180deg) translateZ(.5px); background: var(--paper) var(--paper-img); background-size: 420px;
  box-shadow: inset 0 0 0 1px rgba(80, 60, 40, .08), inset 0 0 40px rgba(80, 60, 40, .12); }
/* shadow the opening doors cast on the scene */
.shade { position: absolute; top: 0; bottom: 0; width: 55%; pointer-events: none; opacity: 0; }
.shade.l { left: 0; background: linear-gradient(90deg, rgba(50, 34, 18, .45), rgba(50, 34, 18, .12) 45%, transparent); }
.shade.r { right: 0; background: linear-gradient(270deg, rgba(50, 34, 18, .45), rgba(50, 34, 18, .12) 45%, transparent); }

/* satin ribbon around the card + bow */
.ribbon { position: absolute; left: 0; right: 0; top: var(--band-y); height: 22px; margin-top: -11px; pointer-events: none; }
.ribbon i { position: absolute; top: 0; bottom: 0; width: 50%; box-shadow: 0 2px 4px rgba(60, 40, 20, .18);
  background: linear-gradient(180deg, var(--rb-d) 0%, var(--rb) 14%, var(--rb-l) 38%, var(--rb) 62%, var(--rb-d) 100%);
  transition: transform .8s cubic-bezier(.6, 0, .4, 1) .12s, opacity .6s ease .3s; }
.ribbon i::after { content: ''; position: absolute; inset: 3px 0; border-top: 1px dashed rgba(255, 255, 255, .28); border-bottom: 1px dashed rgba(0, 0, 0, .06); }
.ribbon .l { left: 0; } .ribbon .r { right: 0; }
.bow { position: absolute; left: 50%; top: var(--bow-top); width: var(--bow-w); margin-left: calc(var(--bow-w) / -2); pointer-events: none;
  transform-origin: 50% 25%; animation: sway 5s ease-in-out infinite; }
.bow-img { width: 100%; filter: drop-shadow(0 7px 9px rgba(60, 38, 18, .22)); }
@keyframes sway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-1.6deg) translateY(1px); } }

.hint { position: absolute; left: 50%; bottom: calc(7% + env(safe-area-inset-bottom) * .5); transform: translateX(-50%); z-index: 3;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); background: color-mix(in srgb, var(--paper) 96%, transparent);
  color: var(--ink); font: 500 11px/1 var(--serif); letter-spacing: .32em; text-transform: uppercase; padding: 12px 18px 12px 22px; border-radius: 99px;
  box-shadow: 0 6px 18px rgba(60, 40, 20, .14); cursor: pointer; transition: opacity .4s; white-space: nowrap; color: var(--accent); font-weight: 600; }
.hint::after { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  animation: hint 2.4s ease-out infinite; pointer-events: none; }
@keyframes hint { 0% { transform: scale(1); opacity: .9; } 70%, 100% { transform: scale(1.18, 1.5); opacity: 0; } }

/* 1 · untie */
.untie .bow { animation: untie .85s cubic-bezier(.5, 0, .7, .4) forwards; }
@keyframes untie {
  0% { transform: none; opacity: 1; }
  28% { transform: scale(1.07) rotate(-3deg); opacity: 1; }
  100% { transform: translateY(70%) scale(.55) rotate(9deg); opacity: 0; }
}
.untie .ribbon .l { transform: translateX(-104%); opacity: 0; }
.untie .ribbon .r { transform: translateX(104%); opacity: 0; }
.untie .hint { opacity: 0; }
.untie .hint::after { animation: none; }
/* 2 · doors swing open */
/* the faces swap exactly at 90° (keyframe offset .58), so no engine has to get backface-visibility right */
.open .door.l { animation: doorL 1.75s forwards; }
.open .door.r { animation: doorR 1.75s forwards; }
.open .door .face { animation: faceOff 1.75s step-end forwards; }
.open .door .back { animation: backOn 1.75s step-end forwards; }
@keyframes doorL { 0% { transform: rotateY(0); animation-timing-function: cubic-bezier(.5, 0, .85, .55); } 58% { transform: rotateY(-90deg); animation-timing-function: cubic-bezier(.15, .45, .35, 1); } 100% { transform: rotateY(-114deg); } }
@keyframes doorR { 0% { transform: rotateY(0); animation-timing-function: cubic-bezier(.5, 0, .85, .55); } 58% { transform: rotateY(90deg); animation-timing-function: cubic-bezier(.15, .45, .35, 1); } 100% { transform: rotateY(114deg); } }
@keyframes faceOff { 0% { opacity: 1; } 58%, 100% { opacity: 0; } }
@keyframes backOn { 0% { opacity: 0; } 58%, 100% { opacity: 1; } }
.open .door .dim { opacity: 1; }
.open .shade { animation: shade 1.9s ease forwards; }
@keyframes shade { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
/* 3 · the card becomes the page */
.expand .card { transform: none; cursor: default; }
.expand .card::before { opacity: 0; }
.expand .scene-clip { border-radius: 0; }
.expand .door { opacity: 0; transition: opacity .7s ease .2s; }
.expand .hn { opacity: 1; transform: none; }
.done .door, .done .ribbon, .done .bow, .done .hint, .done .shade { display: none; }
.instant .card, .instant .hn, .instant .card::before { transition: none !important; }

.cue { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); text-align: center; opacity: 0;
  transition: opacity 1s ease .6s; pointer-events: none; color: var(--ink); text-shadow: 0 0 8px var(--paper); }
.cue span { font-size: 10px; letter-spacing: .4em; text-transform: uppercase; }
.cue i { display: block; width: 1px; height: 30px; margin: 6px auto 0; background: linear-gradient(var(--ink), transparent); animation: cue 2.2s ease-in-out infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.done .cue { opacity: .85; }

/* ───────── sections ───────── */
.sec { position: relative; padding: 58px 28px; text-align: center; }
.sec p { max-width: 340px; margin: 14px auto 0; font-size: 18px; }
.kicker { font-size: 11.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--accent); font-weight: 500; }
h2.script { font-family: var(--script); font-style: var(--script-style); font-weight: 400; font-size: calc(54px * var(--names-scale)); line-height: 1.05; color: var(--ink); margin-top: 6px; }
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity 1s ease, transform 1.2s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 24px; padding: 14px 28px; border-radius: 99px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); text-decoration: none; font: 500 12px/1 var(--serif);
  letter-spacing: .26em; text-transform: uppercase; background: color-mix(in srgb, var(--paper) 70%, transparent); transition: background .3s, color .3s; }
.btn:hover { background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }
.btn.fill { background: var(--accent); color: var(--paper); border-color: var(--accent); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent); }
.divider { width: min(78%, 300px); margin: 40px auto 0; }
.divider img { width: 100%; }

.corner { position: absolute; width: 112px; pointer-events: none; opacity: .95; }
.corner.tl { left: -8px; top: -6px; }
.corner.tr { right: -8px; top: -6px; transform: scaleX(-1); }
.corner.bl { left: -8px; bottom: -6px; transform: scaleY(-1); }
.corner.br { right: -8px; bottom: -6px; transform: scale(-1, -1); }

.invite { padding-top: 124px; }
.names-big { font-family: var(--script); font-style: var(--script-style); font-size: calc(62px * var(--names-scale)); line-height: 1; color: var(--ink); margin: 18px 0 6px; overflow-wrap: anywhere; }
.names-big .n { display: block; }
.names-big .amp { display: block; font-size: .5em; color: var(--accent); margin: 2px 0; }
.dateline { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; max-width: 320px; margin: 30px auto 0; }
.dateline span { border-top: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  padding: 9px 0 8px; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; font-weight: 500; }
.dateline b { font-weight: 400; font-size: 54px; line-height: .9; color: var(--accent); }
.dateline b small { display: block; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
.timeline-words { font-style: italic; color: var(--soft); }

.countdown { padding-left: 10px; padding-right: 10px; }
.framed { position: relative; width: min(100%, 390px); margin: 0 auto; }
.framed .frame-img { width: 100%; }
.framed-in { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; container-type: inline-size; }
.cd-days b { display: block; font-size: min(26cqw, 62px); line-height: 1; font-weight: 400; color: var(--accent); }
.cd-days span, .cd-row span { display: block; font-size: min(5.6cqw, 10px); letter-spacing: .2em; text-transform: uppercase; margin-top: 4px; color: var(--soft); font-weight: 500; }
.cd-days { margin: 10px 0 12px; }
.cd-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; }
.cd-row b { display: block; font-size: min(13cqw, 30px); line-height: 1; font-weight: 400; }
.cd-row span { letter-spacing: .12em; }
.cd-t { margin-top: 12px; font-style: italic; font-size: min(8.5cqw, 17px); line-height: 1.25; color: var(--ink); }
.countdown .framed-in .kicker { font-size: min(5.8cqw, 10.5px); letter-spacing: .22em; }

.venue-art { width: min(94%, 380px); margin: 22px auto 0; }
.venue-name { font-size: 25px; letter-spacing: .14em; text-transform: uppercase; margin-top: 18px; font-weight: 500; }
.addr { color: var(--soft); margin-top: 8px !important; font-size: 17px !important; }
.when { font-style: italic; }

.prog { list-style: none; max-width: 400px; margin: 28px auto 0; }
.prog li { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 16px; text-align: left; padding: 14px 0; }
.prog li.alt { grid-template-columns: 1fr 96px; text-align: right; }
.prog li.alt .pi { order: 2; }
.prog .pi img { width: 96px; height: 96px; object-fit: contain; }
.prog time { display: block; font-style: italic; font-size: 19px; color: var(--accent); }
.prog b { display: block; font-weight: 500; font-size: 14px; letter-spacing: .2em; text-transform: uppercase; margin-top: 2px; }
.prog .pt span { display: block; font-size: 16.5px; line-height: 1.4; color: var(--soft); margin-top: 3px; }

.dress-title { font-size: 20px; letter-spacing: .2em; text-transform: uppercase; margin-top: 10px; font-weight: 500; color: var(--accent); }
.guests { width: min(100%, 400px); margin: 20px auto 0; }
.palette { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.palette span { width: 42px; height: 42px; border-radius: 47% 53% 49% 51% / 55% 45% 55% 45%; transform: rotate(var(--r));
  background: radial-gradient(circle at 38% 34%, color-mix(in srgb, var(--c) 55%, #fff) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 82%, #000) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 70%, #000 10%), 0 2px 6px rgba(60, 40, 20, .12); opacity: .92; }

.note { padding-top: 14px; padding-bottom: 14px; }
.note-card { position: relative; max-width: 360px; margin: 0 auto; padding: 30px 24px 32px; border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  background: color-mix(in srgb, var(--paper) 72%, transparent); outline: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); outline-offset: -7px; }
.note-card .note-art { width: 64px; margin: -6px auto 4px; }
.note-card .note-art img { width: 100%; }
.note h2.script { font-size: calc(42px * var(--names-scale)); margin-top: 0; }
.note p { font-size: 17px; }
.note.tint .note-card { background: color-mix(in srgb, var(--accent) 9%, var(--paper)); }
.note + .note { padding-top: 0; }
.note:last-of-type { padding-bottom: 30px; }

.rsvp { padding-top: 60px; }
.seal { position: relative; width: 116px; margin: 0 auto 22px; }
.seal img { width: 100%; filter: drop-shadow(0 8px 12px rgba(80, 50, 10, .25)); }
.seal span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--script); font-style: var(--script-style);
  font-size: 34px; color: #7a5a1c; text-shadow: 0 1px 0 rgba(255, 240, 200, .7), 0 -1px 0 rgba(90, 60, 10, .35); padding-top: 4px; }

.photos .portrait { position: relative; width: min(86%, 330px); margin: 18px auto 0; }
.portrait .ph { position: absolute; left: 17%; top: 14%; width: 66%; height: 72%; border-radius: 50%; background-size: cover; background-position: center; }
.portrait .pframe { position: relative; width: 100%; }

.foot { padding: 70px 28px 90px; }
.foot .sig { text-wrap: balance; font-family: var(--script); font-style: var(--script-style); font-size: calc(36px * var(--names-scale)); line-height: 1.15; color: var(--ink); }
.foot .mono { font-size: 13px; letter-spacing: .4em; color: var(--accent); margin-top: 14px; font-weight: 500; }

/* ───────── music ───────── */
.music-btn { position: fixed; right: max(16px, calc(50vw - 240px + 16px)); bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: color-mix(in srgb, var(--paper) 88%, transparent); color: var(--accent); cursor: pointer; display: grid; place-items: center;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(60, 40, 20, .12); }
.music-btn[hidden] { display: none; }
.music-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.music-btn.playing svg { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
html.gf-busy .music-btn, body.locked .music-btn { opacity: 0; pointer-events: none; }

button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 340px) {
  .sec { padding-left: 20px; padding-right: 20px; }
  .prog li { grid-template-columns: 76px 1fr; gap: 12px; }
  .prog li.alt { grid-template-columns: 1fr 76px; }
  .prog .pi img { width: 76px; height: 76px; }
  .corner { width: 92px; }
  h2.script { font-size: calc(48px * var(--names-scale)); }
}
@media (prefers-reduced-motion: reduce) {
  .bow, .hint::after, .cue i { animation: none !important; }
  .door, .card, .ribbon i, .hn { transition-duration: .01ms !important; transition-delay: 0s !important; }
  .untie .bow { animation: none; opacity: 0; transition: opacity .3s; }
  .open .door { animation: none !important; opacity: 0; transition: opacity .35s ease !important; }
  .open .door .face, .open .door .back { animation: none !important; }
  .open .shade { animation: none; }
  [data-reveal] { transform: none; transition: opacity .4s ease; }
}
