/*
 * The guest invitation (issue #14): side picker, cover card, invitation.
 * Two designs keyed by side -- .sp Song Phụng Đỏ (groom's guests), .td Tơ
 * Duyên Hồng (bride's guests) -- as settled in
 * docs/business/wedding-client-site/invitation-page/04-mockup-guest.html.
 * px/rem based: this is a web page, unlike the mm-based schedule sheet.
 * Fonts are files in /invitation/fonts/ (OFL), not inlined: nothing here is
 * rasterised, so there is no reason to make every visitor download them twice.
 */
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/PlayfairDisplay-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Playfair Display"; font-style: normal; font-weight: 400 900; font-display: swap; src: url(fonts/PlayfairDisplay-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400 900; font-display: swap; src: url(fonts/PlayfairDisplay-italic-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Playfair Display"; font-style: italic; font-weight: 400 900; font-display: swap; src: url(fonts/PlayfairDisplay-italic-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Great Vibes"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/GreatVibes-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Great Vibes"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/GreatVibes-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/Montserrat-vietnamese.woff2) format("woff2"); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/Montserrat-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-text: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-ui: var(--font-text);
  /* The couple's names (#117); Playfair is the fallback, at the larger size. */
  --font-name: "Great Vibes", "Playfair Display", Georgia, serif;
}
[hidden] { display: none !important; }
body.invitation { margin: 0; background: #fff; }
body.invitation * { box-sizing: border-box; }
.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.photo-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bad-link { display: block; background: #fff7e0; color: #7a4b00; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: 12px; }
.choose .head .retry { pointer-events: auto; margin-top: 8px; border: 1px solid #ddd; background: #fff; border-radius: 8px; padding: 6px 12px; font: 600 12px var(--font-text); cursor: pointer; }
.choose .side:disabled { cursor: default; }
.choose .side:disabled .go { opacity: .5; }

/* ============================================================ invitation */
/* Both directions share one structure; a theme class swaps the palette
   and the drawn motifs. */
.inv { min-height: 100dvh; position: relative; overflow: hidden; background: var(--page); color: var(--ink); font-family: var(--font-text); }
.sp {
  --paper: #f8e9e1; --paper-2: #f3ddd2; --ink: #4a0d0e; --accent: #710001; --accent-2: #9b1b1d;
  --soft: #e8c9bd; --gold: #d4af37; --on-accent: #fff3ea; --page: radial-gradient(circle at 50% 30%, #9b1b1d, #4f0001 75%);
}
.td {
  --paper: #fffaf6; --paper-2: #fdeef0; --ink: #842e35; --accent: #e66474; --accent-2: #c94b5d;
  --soft: #f7d3da; --gold: #e9c995; --on-accent: #ffffff; --page: linear-gradient(170deg, #ffffff, #fbe4e9 70%, #f6d0d9);
}


/* ------------------------------------------------------------- chooser */
/* First page: the guest picks a side. Groom's guests on the left (red),
   bride's guests on the right (pink); the picked half grows to fill. */
.choose { position: absolute; inset: 0; display: flex; overflow: hidden; background: #fff; font-family: var(--font-text); }
.choose .side {
  flex: 1 1 0; min-width: 0; position: relative; border: 0; margin: 0; padding: 24px 14px 40px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; text-align: center;
  transition: flex-grow .7s cubic-bezier(.6,0,.3,1), filter .4s; overflow: hidden; font: inherit;
}
.choose .side:hover, .choose .side:focus-visible { flex-grow: 1.25; }
.choose .groom { background: radial-gradient(circle at 50% 30%, #9b1b1d, #4f0001 80%); color: #f8e9e1; animation: inL .9s cubic-bezier(.2,.7,.2,1) both; }
.choose .bride { background: linear-gradient(170deg, #ffffff, #fbe4e9 60%, #f6c6d1); color: #842e35; animation: inR .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes inL { from { transform: translateX(-30%); opacity: 0; } }
@keyframes inR { from { transform: translateX(30%); opacity: 0; } }
.choose .art { position: absolute; left: 50%; top: 16%; width: 96%; max-width: 300px; translate: -50% 0; animation: float 6s ease-in-out infinite; }
.choose .art img { width: 100%; height: auto; display: block; }
/* The cream dragon faces right and the coral phoenix left as drawn: each faces
   the middle. The phoenix is a tall drawing, so it is sized narrower. */
.choose .groom .art { top: 18%; width: 84%; max-width: 260px; }
.choose .bride .art { top: 12%; width: 84%; max-width: 150px; }
.choose .who { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; position: relative; }
.choose .nm { font: 400 30px/1.1 var(--font-display); position: relative; }
.choose .bride .nm { font-style: italic; color: #e66474; }
.choose .go { position: relative; margin-top: 10px; padding: 10px 18px; border-radius: 999px; font: 700 12px var(--font-text); letter-spacing: .12em; text-transform: uppercase; }
.choose .groom .go { background: #f8e9e1; color: #710001; }
.choose .bride .go { background: #e66474; color: #fff; }
.choose .head {
  position: absolute; z-index: 2; left: 50%; top: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px);
  background: rgba(255,255,255,.94); color: #4a0d0e; padding: 12px 22px; border-radius: 14px; text-align: center;
  box-shadow: 0 12px 30px -16px rgba(0,0,0,.6); pointer-events: none; animation: rise .9s .3s both;
}
.choose .head b { display: block; font: 400 24px/1.15 var(--font-display); }
.choose .head span { font-size: 12px; letter-spacing: .1em; }
.choose.picked-groom .groom, .choose.picked-bride .bride { flex-grow: 30; }
.choose.picked-groom .bride, .choose.picked-bride .groom { flex-grow: .0001; padding-inline: 0; }
.choose.picked-groom .head, .choose.picked-bride .head { opacity: 0; transition: opacity .3s; }

/* ---------------------------------------------------------------- cover */
.cover { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px 16px; background: var(--page); z-index: 3; }
.cover-card {
  position: relative; width: min(100%, 330px); padding: 64px 24px 36px; text-align: center;
  background: var(--paper); border-radius: 10px; overflow: hidden;
  box-shadow: 0 30px 50px -24px rgba(0,0,0,.55);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
.cover-card > :not(.deco) { position: relative; z-index: 1; }
.cover-card .emblem {
  width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); font: 700 26px/1 var(--font-display);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
  animation: pulse 2.6s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 6%, transparent); } }
.cover-card h1 { font: 400 46px/1.05 var(--font-name); color: var(--accent); margin: 0; }
.cover-card h1 small { display: block; font: italic 400 18px/1 var(--font-display); margin: 4px 0; color: var(--accent-2); }
.cover-card .orn { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 14px 0 10px; color: var(--accent); }
.cover-card .orn::before, .cover-card .orn::after { content: ""; width: 48px; height: 1px; background: currentColor; opacity: .6; }
.cover-card .cdate { font: 400 18px var(--font-display); margin: 0 0 18px; }
.cover-card .greet { font: 400 17px var(--font-display); margin: 0 0 10px; }
.cover-card .pill { display: inline-block; background: var(--soft); color: var(--accent); font: 700 17px var(--font-display); padding: 9px 18px; border-radius: 10px; margin-bottom: 10px; }
.cover-card .tail { font-size: 13px; margin: 0 0 22px; color: var(--accent-2); }
.open-btn {
  border: 0; cursor: pointer; background: var(--accent); color: var(--on-accent);
  font: 700 16px var(--font-display); padding: 13px 32px; border-radius: 999px;
  box-shadow: 0 10px 20px -10px var(--accent); animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.06); } 90% { transform: scale(.98); } }
.cover-card .deco { position: absolute; pointer-events: none; }
.cover.leaving .cover-card { animation: lift .8s cubic-bezier(.6,0,.4,1) forwards; }
.cover.leaving { animation: fadeOut .5s .45s ease forwards; }
@keyframes lift { to { transform: translateY(-40px) scale(1.08); opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------------------------------------------------------------- detail */
.detail { position: relative; }
.detail.entering { animation: rise .9s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } }
.col { max-width: 520px; margin: 0 auto; position: relative; background: var(--paper); overflow: hidden; box-shadow: 0 0 60px -20px rgba(0,0,0,.4); }
.blk { padding: 24px 20px; text-align: center; position: relative; }
.h2 { font: 700 19px/1.3 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.td .h2 { font-style: italic; text-transform: none; letter-spacing: .02em; font-size: 26px; font-weight: 500; }
.cap { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2); margin: 0; }
.families { display: grid; grid-template-columns: 1fr 1px 1fr; gap: 0 14px; font-size: 13px; }
.families .sep { background: var(--accent); opacity: .5; }
.families b { display: block; font-family: var(--font-display); font-size: 15px; color: var(--accent); }
.families small { display: block; color: var(--accent-2); font-size: 11px; margin-top: 6px; }
.couple { margin: 14px 0 8px; }
.couple .nm { font: 400 46px/1.1 var(--font-name); color: var(--accent); margin: 0 0 4px; }
.couple .amp { font: italic 400 34px/1 var(--font-display); color: var(--accent-2); margin: 6px 0; }
.dateline { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 6px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: 12px; }
.dateline b { font: 400 46px/1 var(--font-display); color: var(--accent); letter-spacing: 0; }
.dateline span { border-block: 1px solid var(--soft); padding: 6px 2px; min-width: 76px; }
.lunar { font-size: 12px; color: var(--accent-2); margin: 6px 0 0; }
.when { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 18px 0 0; }
/* As on chungdoi.com: the place on a line of its own, larger, the time under it. */
.when .place { display: block; margin: 6px 0 4px; font: 400 26px/1.2 var(--font-display); letter-spacing: .02em; text-transform: none; color: var(--accent); }
.when .at { display: block; }
.families + .announce { margin-top: 24px; }
.announce { line-height: 1.7; }

/* album: a magazine page (#117); each photo is cropped to its frame and opens the viewer */
.mag-album figure { margin: 0; }
.mag-album .shot { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 4px; overflow: hidden; }
.mag-album .shot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mag-album .ph { --r: auto; width: 100%; height: 100%; }
.mag-album .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-album .spread { display: grid; grid-template-columns: 1.6fr 1fr; gap: 8px; }
.mag-album .spread.rev { grid-template-columns: 1fr 1.6fr; margin-top: 8px; }
.mag-album .spread .big { min-height: 250px; }
.mag-album .stack { display: grid; gap: 8px; }
.mag-album .stack figure { aspect-ratio: 4 / 5; }
.mag-album .quote { font: italic 500 18px/1.3 var(--font-display); color: var(--ink); border-block: 2px solid var(--ink); padding: 10px 0; margin: 12px 0; }
.mag-album .wide { aspect-ratio: 16 / 9; }
/* As many equal columns as the strip has photos (a short album leaves it one or two). */
.mag-album .strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 8px; }
.mag-album .strip figure { aspect-ratio: 3 / 4; }
/* The full-screen view: the photo at its own shape. */
.viewer { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 48px 16px; border: 0; background: rgba(15,6,8,.94); color: #fff; touch-action: pan-y; }
.viewer[open] { display: flex; align-items: center; justify-content: center; }
.viewer::backdrop { background: rgba(15,6,8,.6); }
html.viewing { overflow: hidden; }
.viewer-ph img { display: block; max-width: min(92vw, 900px); max-height: calc(100dvh - 120px); width: auto; height: auto; border-radius: 6px; -webkit-user-drag: none; }
.viewer-n { position: absolute; top: 14px; left: 0; right: 0; margin: 0; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.viewer button { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1; cursor: pointer; }
.viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.viewer-x { top: 8px; right: 10px; }
.viewer-p { left: 10px; top: 50%; translate: 0 -50%; }
.viewer-nx { right: 10px; top: 50%; translate: 0 -50%; }

.times { display: flex; justify-content: center; gap: 40px; margin: 18px 0; }
.times small { display: block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.times b { font: 700 20px var(--font-display); color: var(--accent); }
.countdown { display: flex; justify-content: center; gap: 8px; margin: 10px 0 4px; }
.countdown div { min-width: 64px; padding: 10px 4px; background: var(--paper-2); border-radius: 8px; }
.countdown b { display: block; font: 700 26px/1 var(--font-display); color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown small { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.cal { border: 1px solid var(--accent); border-radius: 12px; padding: 14px 12px; margin: 20px auto 10px; max-width: 320px; }
.cal h3 { margin: 0 0 8px; font: 700 15px var(--font-display); }
.td .cal h3 { font-style: italic; font-size: 20px; font-weight: 400; }
.cal .grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 0; font-size: 12px; font-variant-numeric: tabular-nums; }
.cal .dow { font-size: 10px; color: var(--accent-2); border-bottom: 1px solid var(--soft); padding-bottom: 4px; margin-bottom: 4px; }
.cal .d { height: 28px; display: grid; place-items: center; }
.cal .d.wed { color: var(--on-accent); position: relative; font-weight: 700; z-index: 0; }
.cal .d.wed::before { content: "♥"; position: absolute; font-size: 34px; color: var(--accent); z-index: -1; line-height: 1; animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
.link { color: var(--accent); font-size: 13px; text-underline-offset: 3px; }
.pbtn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; background: var(--accent); color: var(--on-accent); font: 700 12px var(--font-text); letter-spacing: .14em; text-transform: uppercase; padding: 12px 22px; border-radius: 8px; margin-top: 12px; }
.obtn { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--accent); background: transparent; color: var(--accent); font: 600 13px var(--font-text); padding: 10px 18px; border-radius: 999px; cursor: pointer; text-decoration: none; margin-top: 12px; }
.rsvp { display: grid; gap: 10px; text-align: left; max-width: 340px; margin: 16px auto 0; background: var(--paper-2); padding: 16px; border-radius: 12px; }
.rsvp > label { font-size: 12px; font-weight: 600; }
.rsvp .opts { display: flex; gap: 8px; flex-wrap: wrap; }
.rsvp .opts label { font-size: 13px; display: flex; gap: 6px; align-items: center; background: var(--paper); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.field { width: 100%; font: 14px var(--font-text); padding: 10px 12px; border-radius: 8px; border: 1px solid var(--accent); background: var(--paper); color: var(--ink); }
.done-msg { font-size: 13px; color: var(--accent); margin: 0; }
/* venue map (#117): the frame takes no pointer events; the link over it does */
.mapbox { position: relative; height: 200px; margin: 14px 0 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--soft); background: var(--paper-2); box-shadow: 0 14px 24px -18px rgba(0,0,0,.6); }
.mapbox iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
.mapbox .hit { position: absolute; inset: 0; z-index: 1; }
.mapbox .hit:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; border-radius: 14px; }
.mapbox .chip { position: absolute; left: 10px; bottom: 10px; z-index: 2; background: var(--paper); color: var(--accent); font: 600 12px var(--font-text); padding: 6px 10px; border-radius: 999px; box-shadow: 0 6px 14px -8px rgba(0,0,0,.5); pointer-events: none; }
.swatches { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.swatches i { width: 40px; height: 40px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), 0 4px 10px -6px rgba(0,0,0,.5); }
.timeline { display: grid; grid-template-columns: 70px 20px 1fr; text-align: left; max-width: 320px; margin: 0 auto; }
.timeline .t { font: 700 15px var(--font-display); color: var(--accent); padding: 10px 0; text-align: right; font-variant-numeric: tabular-nums; }
.timeline .dot { position: relative; }
.timeline .dot::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: var(--soft); }
.timeline .dot::after { content: ""; position: absolute; left: 5px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline .e { padding: 10px 0 10px 10px; font-size: 14px; }
.book { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; text-align: left; }
.book textarea { min-height: 84px; resize: vertical; }
.book .row { display: flex; justify-content: flex-end; }
.wishes { display: grid; gap: 10px; max-width: 360px; margin: 18px auto 0; text-align: left; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.wish { background: var(--paper); border: 1px solid var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.wish header { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--accent-2); }
.wish header b { color: var(--accent); font-size: 13px; }
.wish p { margin: 4px 0 0; }
.thanks { background: var(--accent); color: var(--on-accent); text-align: center; padding: 26px 22px; font: italic 400 17px/1.5 var(--font-display); }

/* photos (placeholders) */
.ph { position: relative; overflow: hidden; aspect-ratio: var(--r, 3/4); max-width: 100%;
  background:
    radial-gradient(120% 80% at var(--x, 30%) var(--y, 20%), var(--pa) 0%, transparent 55%),
    radial-gradient(90% 70% at 80% 90%, var(--pc) 0%, transparent 60%),
    linear-gradient(var(--ang, 160deg), var(--pb), var(--pc)); }
.ph::before { content: ""; position: absolute; left: 50%; bottom: -6%; width: 62%; height: 70%; transform: translateX(-50%);
  background:
    radial-gradient(circle at 36% 22%, var(--pf) 0 11%, transparent 11.5%),
    radial-gradient(circle at 64% 25%, var(--pf) 0 10%, transparent 10.5%),
    radial-gradient(ellipse 22% 55% at 36% 75%, var(--pf) 0 98%, transparent 100%),
    radial-gradient(ellipse 24% 52% at 64% 78%, var(--pf) 0 98%, transparent 100%);
  opacity: .55; }
.ph span { position: absolute; left: 8px; bottom: 6px; font: 600 10px/1 var(--font-ui); letter-spacing: .08em; color: rgba(255,255,255,.9); text-transform: uppercase; }
.sp { --pa: #f3b9a8; --pb: #a8302c; --pc: #3d0606; --pf: #fbe7dc; }
.td { --pa: #ffe1e6; --pb: #e898a6; --pc: #9c4352; --pf: #fff4f2; }

/* ---------------------------------------------- Song Phụng Đỏ: motifs */
/* The art box has a fixed height; the names and the band flow under it, so a
   long name (the fields are free text) wraps downwards rather than over the art. */
.sp .hero { position: relative; overflow: hidden; }
.sp .hero .pics, .td .hero .pics { position: relative; }
.sp .hero .pics { height: 398px; }
.sp .hero .names { position: relative; padding: 6px 56px 18px; text-align: center; font: 400 50px/1.05 var(--font-name); color: var(--accent); z-index: 4; text-shadow: 0 0 10px var(--paper), 0 0 4px var(--paper); overflow-wrap: break-word; }
.sp .hero .names small { display: block; font: italic 400 20px/1 var(--font-display); color: var(--accent-2); margin: 2px 0; }
.sp .band { position: relative; height: 70px; background: var(--accent); display: grid; place-items: center; }
.sp .band::before, .sp .band::after { content: ""; position: absolute; top: 12px; bottom: 12px; width: 34%; background: repeating-radial-gradient(circle at 0 50%, transparent 0 8px, rgba(212,175,55,.35) 8px 9px); }
.sp .band::before { left: 0; } .sp .band::after { right: 0; transform: scaleX(-1); }
.sp .hy { position: relative; z-index: 1; font: 700 58px/1 "Noto Serif SC", "Songti SC", "SimSun", serif; color: #fff; animation: glow 3.6s ease-in-out infinite; }
@keyframes glow { 50% { text-shadow: 0 0 22px rgba(255,214,140,.7); } }
/* Song Phụng Đỏ (#117, header A2): the dragon holds the top-left corner, the
   phoenix stands at the bride's photo on the right, a branch each in the
   top-right corner and beside the names. dragon.webp faces right and
   phoenix.webp left as drawn, so both face into the page unmirrored. */
.phoenix, .dragon, .blossom { position: absolute; pointer-events: none; }
.phoenix img, .dragon img, .blossom img { width: 100%; height: auto; display: block; }
/* The branch is drawn stem-down: the top-right one hangs from its corner. */
.blossom.tr { transform: rotate(200deg); }
.blossom.bl { transform: rotate(18deg); }
.sp .hero .dragon { width: 128px; left: -10px; top: -6px; z-index: 1; animation: soar 7s ease-in-out infinite; }
.sp .hero .phoenix { width: 88px; right: 4px; top: 212px; z-index: 3; animation: soar 6s ease-in-out infinite reverse; }
@keyframes soar { 50% { translate: 0 -8px; } }
.sp .hero .blossom { width: 44px; z-index: 3; }
.sp .hero .blossom.tr { right: 2px; top: -12px; }
.sp .hero .blossom.bl { left: 4px; top: 404px; }
/* Two photos staggered as in Tơ Duyên Hồng: the groom's lower left, the bride's higher right. */
.sp .hero .frame { position: absolute; z-index: 2; width: 42%; padding: 5px; background: var(--paper); box-shadow: 0 16px 24px -16px rgba(0,0,0,.55), 0 0 0 1px var(--soft); }
.sp .hero .frame.a { left: 8%; top: 118px; rotate: -6deg; animation: drift 7s ease-in-out infinite; }
.sp .hero .frame.b { left: 49%; top: 58px; rotate: 7deg; animation: drift 7s -3.5s ease-in-out infinite; }
/* The card is taller at both ends so the art never reaches the text. */
.sp .cover-card { padding: 100px 24px 140px; }
.sp .cover-card .dragon { width: 37%; left: -12px; top: -14px; }
.sp .cover-card .phoenix { width: 26%; right: -6px; bottom: -14px; }
.sp .cover-card .blossom { width: 16%; }
.sp .cover-card .blossom.tr { right: 6px; top: -14px; }
.sp .cover-card .blossom.bl { left: 12px; bottom: -16px; }
.sp .col::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .045;
  background: repeating-radial-gradient(circle at 50% 120%, var(--accent) 0 2px, transparent 2px 26px); }

/* ---------------------------------------------- Tơ Duyên Hồng: motifs */
.td .hero { position: relative; overflow: hidden; }
.td .hero .pics { height: 360px; }
.td .hero .frame { position: absolute; width: 42%; padding: 6px; background: var(--soft); box-shadow: 0 16px 24px -16px rgba(0,0,0,.5); }
.td .hero .frame.a { left: 9%; top: 40px; rotate: -6deg; animation: drift 7s ease-in-out infinite; }
.td .hero .frame.b { left: 48%; top: 100px; rotate: 7deg; animation: drift 7s -3.5s ease-in-out infinite; }
@keyframes drift { 50% { translate: 0 -8px; } }
.td .hero .names { position: relative; padding: 8px 20px 26px; font: 400 44px/1.15 var(--font-name); color: var(--accent); z-index: 4; overflow-wrap: break-word; }
.td .hero .names span { display: block; position: relative; }
.td .hero .names span:last-child { text-align: right; }
.td .hero .names .amp { position: absolute; left: 36%; top: -26px; font: italic 400 120px/1 var(--font-display); color: var(--soft); z-index: -1; }
/* Tơ Duyên Hồng (#117): a pink bow pinned to each photo's top corner. */
.bow { position: absolute; pointer-events: none; z-index: 3; }
.bow img { width: 100%; height: auto; display: block; }
.td .hero .bow.a { width: 74px; left: calc(9% - 14px); top: 14px; transform: rotate(-16deg); }
.td .hero .bow.b { width: 64px; left: calc(90% - 46px); top: 76px; transform: rotate(14deg) scaleX(-1); }
.ribbon { position: relative; height: 28px; margin: 0 -10%; pointer-events: none; }
.ribbon svg, .ribbon img { width: 100%; height: 100%; display: block; animation: ribbon 9s ease-in-out infinite; }
@keyframes ribbon { 50% { transform: translateX(-4%) translateY(4px); } }
/* The cover is tied with one bow on its top edge, in place of the ♥ emblem. */
.td .cover-card { padding: 168px 24px 40px; }
.td .cover-card .bow { width: 116px; left: calc(50% - 58px); top: -10px; z-index: 0; }
.td .cover-card .emblem { display: none; }


/* web view: a wider invitation, everything scaled up with it */

/* reveal on scroll: only what starts below the fold waits */
.reveal { transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.armed { opacity: 0; transform: translateY(24px); }

/* ambient particles */
.pt { position: absolute; top: -8%; animation: fall var(--d, 12s) linear var(--dl, 0s) infinite; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(var(--sx, 30px), 55vh) rotate(180deg); } 100% { transform: translate(0, 115vh) rotate(360deg); } }
.pt.petal { width: 10px; height: 13px; border-radius: 80% 0 80% 0; background: #f6a9b6; opacity: .8; }
.pt.spark { top: auto; width: 7px; height: 7px; background: #f3d27a; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle var(--d, 3s) ease-in-out var(--dl, 0s) infinite; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal.armed { opacity: 1; transform: none; }
  .ambient { display: none; }
}

/* ------------------------------------------- Tạp chí: the opening spread */
/* The "Tạp chí" concept's cover and first chapter, in this theme's colours.
   The cover photo is the first one uploaded; with none, the placeholder. */
.mag-cover { position: relative; min-height: 600px; color: #fff; }
.mag-cover > .ph { position: absolute; inset: 0; --r: auto; }
.mag-cover::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(0,0,0,.35), transparent 28%, transparent 55%, rgba(0,0,0,.55)); }
.mag-cover .mast { position: relative; z-index: 2; padding: 22px 18px 0; }
.mag-cover .mast b { display: block; font: 900 104px/.8 var(--font-display); letter-spacing: -.04em; animation: magSlide 1s cubic-bezier(.2,.7,.2,1) both; }
.mag-cover .mast small { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; border-bottom: 1px solid #fff; padding-bottom: 6px; }
.mag-cover .lines { position: absolute; z-index: 2; left: 18px; right: 18px; bottom: 24px; }
.mag-cover .lines p { margin: 0 0 10px; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; animation: magSlide 1s both; }
.mag-cover .lines p:nth-child(2) { animation-delay: .2s; } .mag-cover .lines p:nth-child(3) { animation-delay: .4s; }
.mag-cover .lines p span { display: block; font: italic 500 22px/1.2 var(--font-display); text-transform: none; letter-spacing: 0; }
@keyframes magSlide { from { transform: translateX(-30px); opacity: 0; } }
.mag-letter { padding: 28px 20px; position: relative; }
/* Chapter labels: "Chương 1 · Lời mời" opens the letter, 2 the party, 3 the guestbook. */
.chap { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-2); }
/* Left-aligned like Chương 1, even inside a centred section. */
.blk .chap { margin-bottom: 10px; text-align: left; }
.mag-letter h2 { font: 900 33px/1 var(--font-display); margin: 6px 0 14px; color: var(--ink); }
.mag-letter .drop { margin: 0; line-height: 1.6; }
.mag-letter .drop::first-letter { float: left; font: 900 58px/.8 var(--font-display); margin: 6px 8px 0 0; color: var(--accent); }
.mag-letter .pull { clear: both; font: italic 500 26px/1.25 var(--font-display); color: var(--ink); border-block: 3px solid var(--ink); padding: 16px 0; margin: 36px 0 0; }
.mag-end { text-align: center; padding-top: 8px; }
.mag-end .pull { margin: 0; }

/* Desktop: a wider invitation, everything scaled up with it. */
@media (min-width: 760px) {
  .choose .groom .art { top: 14%; max-width: 340px; }
  .choose .bride .art { top: 12%; max-width: 210px; }
  .choose .nm { font-size: 46px; }
  .choose .head b { font-size: 32px; }
  .col { max-width: 920px; }
  .mag-cover { min-height: 82vh; }
  .mag-cover .mast { padding: 32px 56px 0; }
  .mag-cover .mast b { font-size: 220px; }
  .mag-cover .lines { left: 56px; right: 56px; bottom: 40px; }
  .mag-cover .lines p { font-size: 15px; }
  .mag-cover .lines p span { font-size: 30px; }
  .mag-letter { padding: 40px 48px; font-size: 16px; }
  .mag-letter h2 { font-size: 47px; }
  .chap { font-size: 13px; }
  .mag-letter .drop::first-letter { font-size: 76px; }
  .mag-letter .pull { font-size: 34px; }
  .blk { padding: 40px 48px; }
  .blk > p, .families, .timeline, .book, .wishes, .rsvp { font-size: 16px; }
  .families { max-width: 720px; margin: 0 auto; font-size: 15px; }
  .families b { font-size: 19px; }
  .h2 { font-size: 26px; }
  .td .h2 { font-size: 34px; }
  .cap { font-size: 13px; }
  .couple .nm { font-size: 68px; }
  .dateline b { font-size: 64px; }
  .dateline { font-size: 14px; }
  .mag-album .spread .big { min-height: 460px; }
  .mag-album .quote { font-size: 26px; }
  .cal { max-width: 420px; }
  .cal .d { height: 36px; }
  .countdown div { min-width: 96px; }
  .countdown b { font-size: 36px; }
  .mapbox { height: 260px; }
  .cover-card { width: min(100%, 460px); padding: 80px 40px 44px; }
  .cover-card h1 { font-size: 60px; }
  .sp .cover-card { padding: 150px 40px 190px; }
  .td .cover-card { padding: 220px 40px 48px; }
  .td .cover-card .bow { width: 150px; left: calc(50% - 75px); }
  .sp .hero .pics { height: 590px; }
  .sp .hero .names { font-size: 76px; padding: 10px 120px 28px; }
  .sp .band { height: 100px; }
  .sp .hy { font-size: 84px; }
  .sp .hero .dragon { width: 240px; left: 10px; top: 0; }
  .sp .hero .phoenix { width: 130px; right: 60px; top: 330px; }
  .sp .hero .blossom { width: 70px; }
  .sp .hero .blossom.bl { left: 40px; top: 600px; }
  .sp .hero .frame { width: 32%; padding: 8px; }
  .sp .hero .frame.a { left: 16%; top: 150px; }
  .sp .hero .frame.b { left: 50%; top: 70px; }
  .td .hero .pics { height: 580px; }
  .td .hero .frame { width: 32%; }
  .td .hero .frame.a { left: 16%; top: 60px; }
  .td .hero .frame.b { left: 50%; top: 130px; }
  .td .hero .bow.a { width: 110px; left: calc(16% - 20px); top: 26px; }
  .td .hero .bow.b { width: 96px; left: calc(82% - 60px); top: 100px; }
  .td .hero .names { font-size: 68px; padding: 10px 64px 40px; }
  .td .hero .names .amp { font-size: 180px; top: -60px; }
  .ribbon { height: 40px; }
}

/* Real photos (the placeholder figures are for empty frames only). */
.ph.real { background: #f3e4dc; }
.ph.real::before { display: none; }
.td .ph.real { background: #f7d3da; }

/* The card's text stays readable where the corner art reaches under it. */
.cover-card > :not(.deco) { text-shadow: 0 0 6px var(--paper), 0 0 2px var(--paper); }
.cover-card .pill, .cover-card .open-btn, .cover-card .emblem { text-shadow: none; }
/* Centre the picker's notice without a transform: its entrance animation
   uses transform, and the two would fight. */
.choose .head { left: 16px; right: 16px; margin: 0 auto; transform: none; width: fit-content; }
