/* ==========================================================================
   邀請函樣式 · Invitation styles
   1. 基礎樣式（所有範本共用的結構）
   2. 10 個範本主題（.tpl-<id>）：字體、封面版型、標題、倒數、藝廊、表單…
   字級與間距使用容器查詢單位（cqi），因此同一份 HTML 可縮放成首頁縮圖
   ========================================================================== */

/* ---------- 1. Base ---------- */
.inv {
  --cjk-serif: 'Noto Serif TC';
  --cjk-sans: 'Noto Sans TC';
  --font-display: 'Cormorant Garamond', var(--cjk-serif), serif;
  --font-body: 'Cormorant Garamond', var(--cjk-serif), serif;
  --font-script: var(--font-display);
  --fs-body: 16px;
  --radius: 0px;
  --btn-radius: 999px;
  --field-radius: 0px;
  --danger: #b3402f;
  --veil: var(--accent);
  --veil-anim: veilUp;
  /* 調色盤主色的固定副本：子元素覆寫 --accent 時，背景仍可引用原本的主色 */
  --accent-base: var(--accent);
  position: relative;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
.inv *,
.inv *::before,
.inv *::after { box-sizing: border-box; }
.inv-frame { container-type: inline-size; container-name: inv; }
.inv :where(img) { display: block; max-width: 100%; }
.inv img.is-broken { opacity: 0; }
.inv :where(p) { margin: 0; }
.inv :where(h1, h2, h3, h4) { margin: 0; font-weight: 400; }
.inv :where(a) { color: inherit; }
.inv :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.inv ::selection { background: var(--accent2); color: var(--ink); }
.orn { display: block; height: auto; }

/* ---------- Cover base ---------- */
.inv-cover {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
  padding: clamp(72px, 16cqi, 128px) clamp(20px, 7cqi, 64px) clamp(44px, 10cqi, 88px);
}
.inv-cover .cv-content { position: relative; display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 2.6cqi, 18px); width: 100%; }
.inv-cover figure { margin: 0; }
.inv-cover figure img { width: 100%; height: 100%; object-fit: cover; }

/* 進場動畫 */
.inv-cover :is(.a0, .a1, .a2, .a3, .a4, .a5) { animation: cvIn 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.inv-cover .a0 { animation-delay: 0s; }
.inv-cover .a1 { animation-delay: .15s; }
.inv-cover .a2 { animation-delay: .35s; }
.inv-cover .a3 { animation-delay: .55s; }
.inv-cover .a4 { animation-delay: .75s; }
.inv-cover .a5 { animation-delay: .95s; }
@keyframes cvIn { from { opacity: 0; translate: 0 18px; filter: blur(4px); } to { opacity: 1; translate: 0 0; filter: blur(0); } }

/* 開啟按鈕 */
.inv-open {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 30px; margin-top: clamp(6px, 2cqi, 14px);
  font: 500 12px/1 var(--font-ui, var(--font-body)); letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid currentColor; border-radius: var(--btn-radius);
  cursor: pointer; transition: background .35s, color .35s, transform .35s, box-shadow .35s;
}
.inv-open svg { width: 16px; height: 16px; transition: transform .35s; }
.inv-open:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.inv-open:hover svg { transform: translateY(2px); }
.inv-open .inv-open__scroll { display: none; }
.is-opened .inv-open .inv-open__label { display: none; }
.is-opened .inv-open .inv-open__scroll { display: inline; }
.is-opened .inv-open svg { animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }

/* 縮圖模式（首頁卡片、編輯器範本選擇） */
.mini-scale { position: absolute; top: 0; left: 0; transform-origin: top left; }
.inv.is-mini { height: 100%; overflow: hidden; pointer-events: none; user-select: none; }
.inv.is-mini .inv-frame { height: 100%; }
.inv.is-mini .inv-cover { min-height: 0; height: 100%; padding-top: 64px; padding-bottom: 40px; }

/* 開啟過場 */
.inv-veil { position: fixed; inset: 0; z-index: 80; pointer-events: none; background: var(--veil); transform: translateY(100%); }
.inv.is-opening .inv-veil { animation: var(--veil-anim) 1.3s cubic-bezier(.7, 0, .3, 1) forwards; }
@keyframes veilUp { 0% { transform: translateY(100%); } 45%, 55% { transform: translateY(0); } 100% { transform: translateY(-100%); } }
@keyframes veilFade { 0% { transform: none; opacity: 0; } 45%, 55% { transform: none; opacity: 1; } 100% { transform: none; opacity: 0; } }
@keyframes veilSplit { 0% { transform: scaleX(0); } 45%, 55% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
@keyframes veilCircle { 0% { transform: none; clip-path: circle(0% at 50% 60%); } 50% { transform: none; clip-path: circle(150% at 50% 60%); opacity: 1; } 100% { transform: none; clip-path: circle(150% at 50% 60%); opacity: 0; } }
@keyframes veilWipe { 0% { transform: translateX(-100%); } 45%, 55% { transform: none; } 100% { transform: translateX(100%); } }

/* ---------- Sections ---------- */
.inv-body[hidden] { display: none; }
.inv-sec { position: relative; scroll-margin-top: var(--topbar-h, 0px); padding: clamp(68px, 17cqi, 150px) clamp(20px, 6cqi, 48px); }
.inv-wrap { max-width: 760px; margin: 0 auto; position: relative; }
.inv-wrap--wide { max-width: 1080px; }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s cubic-bezier(.2, .7, .2, 1), transform 1s cubic-bezier(.2, .7, .2, 1); }
.reveal.is-in { opacity: 1; transform: none; }

.inv-h { text-align: center; margin-bottom: clamp(30px, 7cqi, 60px); }
.inv-h__num { display: none; }
.inv-h__eyebrow { margin-bottom: 8px; font: 500 11px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .34em; text-transform: uppercase; color: var(--accent); }
.inv-h__title { overflow-wrap: break-word; hyphens: auto; font-family: var(--font-display); font-size: clamp(30px, 8cqi, 58px); line-height: 1.15; margin-top: .3em; letter-spacing: .01em; }
.inv-h__orn { color: var(--accent); display: flex; justify-content: center; margin-top: 16px; }
.inv-h__orn:empty { display: none; }
.inv-h__orn .orn { width: 150px; }
.inv-lead { text-align: center; font-size: 1.08em; max-width: 34em; margin: 0 auto 2.6em; text-wrap: pretty; }
.inv-sub { font-family: var(--font-display); font-size: clamp(20px, 5cqi, 28px); margin-bottom: .8em; }
.inv-prose p + p { margin-top: 1em; }
.inv-prose { text-wrap: pretty; }
.inv-hint, .inv-deadline { text-align: center; color: var(--muted); font-size: .9em; margin: -1.6em auto 2em; }
.inv-deadline { margin-top: -1.8em; font-style: italic; }
.inv-demo { font-size: 12px; line-height: 1.6; color: var(--muted); margin-top: 14px; text-align: center; }
.inv-mono { font-variant-numeric: tabular-nums; letter-spacing: .08em; }

/* Story */
.inv-couple, .inv-honoree { margin-top: 18px; display: grid; gap: clamp(24px, 6cqi, 48px); align-items: center; margin-bottom: clamp(40px, 9cqi, 72px); }
.inv-couple__photo, .inv-honoree__photo { margin: 0 auto; width: 100%; max-width: 420px; aspect-ratio: 4 / 5; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.inv-couple__photo img, .inv-honoree__photo img { width: 100%; height: 100%; object-fit: cover; }
.inv-couple__people { display: grid; gap: 18px; text-align: center; }
.inv-couple__amp { font-family: var(--font-display); font-size: 40px; color: var(--accent); line-height: 1; }
.inv-person { text-align: center; }
.inv-role { font: 500 11px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); }
.inv-pname { font-family: var(--font-display); font-size: clamp(28px, 7cqi, 44px); margin: .15em 0 .35em; line-height: 1.15; }
.inv-bio { color: var(--muted); max-width: 26em; margin: 0 auto; }
.inv-storybox { max-width: 36em; margin: 0 auto; text-align: center; }
.inv-timeline { list-style: none; padding: 0; margin: clamp(40px, 9cqi, 72px) auto 0; max-width: 520px; position: relative; }
.inv-timeline::before { content: ''; position: absolute; left: 50px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.inv-timeline li { display: grid; grid-template-columns: 100px 1fr; gap: 0; padding: 12px 0; position: relative; }
.inv-timeline li::before { content: ''; position: absolute; left: 46px; top: 24px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--accent); }
.inv-timeline__date { font-family: var(--font-display); color: var(--accent); font-size: 15px; padding-top: 6px; text-align: left; padding-left: 0; width: 40px; }
.inv-timeline h4 { font-family: var(--font-display); font-size: 21px; }
.inv-timeline p { color: var(--muted); font-size: .95em; }
@container inv (min-width: 720px) {
  .inv-couple { grid-template-columns: 1fr 1fr; }
  .inv-couple__people { text-align: left; }
  .inv-couple .inv-person, .inv-couple .inv-bio { text-align: left; margin-left: 0; }
  .inv-honoree { grid-template-columns: 1fr 1.1fr; }
  .inv-honoree .inv-person { text-align: left; }
  .inv-honoree .inv-bio { margin-left: 0; }
}

/* Countdown */
.inv-cd { display: flex; justify-content: center; align-items: flex-start; gap: clamp(6px, 2.4cqi, 20px); }
.inv-cd__cell { display: flex; flex-direction: column; align-items: center; min-width: clamp(60px, 18cqi, 120px); }
.inv-cd__num { font-family: var(--font-display); font-size: clamp(36px, 12cqi, 80px); line-height: 1.05; font-variant-numeric: tabular-nums; }
.inv-cd__num.is-tick { animation: tick .5s ease; }
@keyframes tick { from { opacity: .3; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.inv-cd__lbl { font: 500 10px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.inv-cd__sep { font-family: var(--font-display); font-size: clamp(28px, 8cqi, 54px); color: var(--accent); opacity: .6; line-height: 1.2; }
.inv-cd__status { text-align: center; margin-top: 28px; color: var(--muted); font-style: italic; }
.sec-countdown[data-state='live'] .inv-cd__status,
.sec-countdown[data-state='ended'] .inv-cd__status { color: var(--accent); font-size: 1.1em; font-style: normal; }
.sec-countdown[data-state='live'] .inv-cd,
.sec-countdown[data-state='ended'] .inv-cd { opacity: .35; }

/* Details */
.inv-info { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(16px, 5cqi, 40px); margin: 0 0 32px; }
.inv-info__item { padding: 18px 0; border-top: 1px solid var(--line); }
.inv-info__item--wide { grid-column: 1 / -1; }
.inv-info dt { font: 500 10.5px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.inv-info dd { margin: 0; font-size: 1.06em; }
.inv-info dd strong { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.3em; line-height: 1.3; }
.inv-info dd span { color: var(--muted); }
.inv-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: clamp(40px, 9cqi, 64px); }
.inv-schedule { max-width: 520px; margin: 0 auto; text-align: center; }
.inv-schedule ol { list-style: none; margin: 0; padding: 0; text-align: left; }
.inv-schedule li { display: grid; grid-template-columns: 80px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.inv-schedule time { font-family: var(--font-display); font-size: 1.25em; color: var(--accent); font-variant-numeric: tabular-nums; }

/* Buttons */
.inv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 50px; padding: 0 26px; cursor: pointer; text-decoration: none;
  font: 500 12.5px/1.2 var(--font-ui, var(--font-body)); letter-spacing: .16em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); border-radius: var(--btn-radius);
  transition: transform .25s, box-shadow .25s, background .25s, color .25s, opacity .25s;
}
.inv-btn svg { width: 18px; height: 18px; flex: none; }
.inv-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px var(--accent); }
.inv-btn:disabled { opacity: .6; cursor: progress; transform: none; }
.inv-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.inv-btn--ghost:hover { border-color: var(--accent); color: var(--accent); box-shadow: none; }
.inv-btn--block { width: 100%; }
.inv-btn--sm { min-height: 40px; padding: 0 16px; font-size: 11px; }
.inv-btn.is-done { color: var(--accent); border-color: var(--accent); }

/* Forms */
.inv-form { background: var(--surface); padding: clamp(22px, 6cqi, 48px); border-radius: var(--radius); }
.inv-form__grid { display: grid; gap: 0 18px; }
@container inv (min-width: 560px) { .inv-form__grid { grid-template-columns: 1fr 1fr; } }
.inv-form__alert { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); padding: 12px 16px; border-radius: var(--field-radius); margin-bottom: 18px; font-size: 14px; }
.inv-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; transition: opacity .3s; }
.inv-field label, .inv-field legend { display: block; font: 500 11px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; padding: 0; }
.inv-field input, .inv-field select, .inv-field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; font: 16px/1.5 var(--font-body); color: var(--ink);
  background: var(--field-bg, var(--bg)); border: 1px solid var(--line); border-radius: var(--field-radius);
  transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.inv-field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.inv-field textarea { resize: vertical; min-height: 96px; }
.inv-field input::placeholder, .inv-field textarea::placeholder { color: var(--muted); opacity: .7; }
.inv-field input:focus, .inv-field select:focus, .inv-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.inv-field.has-error input, .inv-field.has-error select, .inv-field.has-error textarea { border-color: var(--danger); }
.inv-field.has-error .inv-choice span { border-color: var(--danger); }
.inv-err { color: var(--danger); font-size: 13px; min-height: 0; margin-top: 6px; }
.inv-err:empty { display: none; }
.inv-field.is-disabled { opacity: .45; }
.inv-field.is-hidden { display: none; }
.inv-field__foot { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.inv-count { font-size: 12px; color: var(--muted); margin-top: 6px; margin-left: auto; font-variant-numeric: tabular-nums; }
.inv-choices { display: grid; gap: 8px; }
@container inv (min-width: 520px) { .inv-choices { grid-template-columns: repeat(3, 1fr); } }
.inv-choice { position: relative; cursor: pointer; display: block; margin: 0 !important; text-transform: none !important; letter-spacing: 0 !important; }
.inv-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.inv-choice span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--field-radius); background: var(--field-bg, var(--bg)); font: 15px/1.3 var(--font-body); color: var(--ink); transition: all .2s; }
.inv-choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.inv-choice input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.inv-ok { color: var(--accent); text-align: center; margin-top: 12px; font-weight: 500; }

.inv-success { text-align: center; background: var(--surface); padding: clamp(28px, 7cqi, 56px); border-radius: var(--radius); outline: none; animation: cvIn .8s both; }
.inv-success__icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--on-accent); margin-bottom: 16px; }
.inv-success__icon svg { width: 30px; height: 30px; }
.inv-success h3 { font-family: var(--font-display); font-size: clamp(22px, 6cqi, 32px); margin-bottom: .4em; }
.inv-success__sum { color: var(--muted); margin: 6px 0 22px; font-size: .92em; }

/* Gallery */
.inv-gal__item { display: block; padding: 0; border: 0; background: var(--surface); cursor: zoom-in; overflow: hidden; position: relative; width: 100%; }
.inv-gal__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1), filter .6s; }
.inv-gal__item:hover img { transform: scale(1.05); }
.inv-gal--masonry { columns: 2; column-gap: 12px; }
.inv-gal--masonry .inv-gal__item { margin-bottom: 12px; break-inside: avoid; border-radius: var(--radius); }
.inv-gal--masonry .inv-gal__item:nth-child(3n + 1) { aspect-ratio: 3 / 4; }
.inv-gal--masonry .inv-gal__item:nth-child(3n + 2) { aspect-ratio: 1; }
.inv-gal--masonry .inv-gal__item:nth-child(3n) { aspect-ratio: 4 / 5; }
.inv-gal--grid, .inv-gal--arches, .inv-gal--polaroid, .inv-gal--tilted, .inv-gal--deco { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(8px, 2cqi, 18px); }
.inv-gal--grid .inv-gal__item { aspect-ratio: 1; }
.inv-gal--arches .inv-gal__item { aspect-ratio: 3 / 4; border-radius: 999px 999px 0 0; }
.inv-gal--editorial { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.inv-gal--editorial .inv-gal__item { grid-column: span 3; aspect-ratio: 4 / 5; }
.inv-gal--editorial .inv-gal__item:nth-child(1) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.inv-gal--editorial .inv-gal__item:nth-child(4) { grid-column: span 4; aspect-ratio: 4 / 3; }
.inv-gal--editorial .inv-gal__item:nth-child(5) { grid-column: span 2; aspect-ratio: auto; }
.inv-gal--editorial .inv-gal__item:nth-child(6) { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.inv-gal--scroll { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 18px; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.inv-gal--scroll .inv-gal__item { flex: 0 0 72%; aspect-ratio: 3 / 4; scroll-snap-align: center; }
.inv-gal--polaroid .inv-gal__item { background: #fff; padding: 8px 8px 30px; box-shadow: 0 14px 30px -18px rgba(60, 40, 80, .45); border-radius: 4px; }
.inv-gal--polaroid .inv-gal__item img { aspect-ratio: 1; height: auto; border-radius: 2px; }
.inv-gal--polaroid .inv-gal__item:nth-child(odd) { transform: rotate(-2.5deg); }
.inv-gal--polaroid .inv-gal__item:nth-child(even) { transform: rotate(2deg) translateY(10px); }
.inv-gal--polaroid .inv-gal__item:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.inv-gal--tilted .inv-gal__item { aspect-ratio: 1; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 14px; transition: transform .3s; }
.inv-gal--tilted .inv-gal__item:nth-child(odd) { transform: rotate(-1.5deg); }
.inv-gal--tilted .inv-gal__item:nth-child(even) { transform: rotate(1.5deg); }
.inv-gal--tilted .inv-gal__item:hover { transform: rotate(0) translate(-2px, -2px); }
.inv-gal--deco .inv-gal__item { aspect-ratio: 3 / 4; border: 1px solid var(--accent); padding: 6px; background: transparent; }
.inv-gal--deco .inv-gal__item img { outline: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); outline-offset: -8px; }
@container inv (min-width: 720px) {
  .inv-gal--masonry { columns: 3; }
  .inv-gal--grid, .inv-gal--arches, .inv-gal--polaroid, .inv-gal--tilted, .inv-gal--deco { grid-template-columns: repeat(3, 1fr); }
  .inv-gal--scroll .inv-gal__item { flex-basis: 36%; }
}

/* Lightbox */
.inv-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(12, 11, 10, .94); display: grid; place-items: center; opacity: 0; transition: opacity .25s; touch-action: pan-y; }
.inv-lightbox[hidden] { display: none; }
.inv-lightbox.is-open { opacity: 1; }
.inv-lightbox__stage { width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 12px; }
.inv-lightbox img { max-width: min(92vw, 1400px); max-height: calc(100vh - 140px); max-height: calc(100svh - 140px); object-fit: contain; border-radius: 2px; transition: opacity .3s; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.inv-lightbox.is-loading img { opacity: .2; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; backdrop-filter: blur(6px); transition: background .2s; }
.lb-btn:hover { background: rgba(255, 255, 255, .2); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: rgba(255, 255, 255, .75); font: 13px/1 var(--font-ui, sans-serif); letter-spacing: .2em; }
@media (max-width: 640px) { .lb-prev, .lb-next { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; } .lb-prev { left: 20px; } .lb-next { right: 20px; } }
html.lb-open, html.lb-open body { overflow: hidden; }

/* Guestbook */
.inv-wishes { display: grid; gap: 28px; }
@container inv (min-width: 820px) { .inv-wishes { grid-template-columns: 1fr 1fr; align-items: start; } }
.inv-wishlist__count { font: 500 11px/1.4 var(--font-ui, var(--font-body)); letter-spacing: .24em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.inv-wishlist ul { list-style: none; padding: 0 6px 0 0; margin: 0; max-height: 540px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.inv-wish { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.inv-wish.is-new { animation: cvIn .8s both; }
.inv-wish__avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent2); color: var(--ink); font-family: var(--font-display); font-size: 18px; }
.inv-wish__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 14px; }
.inv-wish__meta strong { font-weight: 600; }
.inv-wish__meta time, .inv-wish__tag { color: var(--muted); font-size: 12px; }
.inv-wish__tag { border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; }
.inv-wish__msg { margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.inv-wish--empty { color: var(--muted); padding: 20px 0; }

/* Gift accordion */
.inv-acc { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 560px; margin: 0 auto; }
.inv-acc__toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; background: none; border: 0; cursor: pointer; padding: 20px 4px; font: 500 15px/1.4 var(--font-body); color: var(--ink); text-align: left; }
.inv-acc__toggle svg { width: 22px; height: 22px; color: var(--accent); transition: transform .35s; flex: none; }
.inv-acc__toggle[aria-expanded='true'] svg { transform: rotate(45deg); }
.inv-acc__panel { max-height: 0; overflow: hidden; transition: max-height .5s cubic-bezier(.2, .7, .2, 1); }
.inv-acc__inner { padding: 4px 4px 26px; }
.inv-acc__inner > p { color: var(--muted); margin-top: 14px; font-size: .95em; }
.inv-bank { background: var(--surface); border-radius: var(--radius); padding: 20px; display: grid; gap: 16px; }
.inv-bank dl { margin: 0; display: grid; gap: 10px; }
.inv-bank dl div { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.inv-bank dt { color: var(--muted); font-size: 13px; }
.inv-bank dd { margin: 0; font-weight: 500; }
.inv-ideas { margin: 0; padding: 0; list-style: none; }
.inv-ideas li { padding: 12px 0 12px 28px; position: relative; border-bottom: 1px dashed var(--line); }
.inv-ideas li::before { content: '✦'; position: absolute; left: 4px; color: var(--accent); }

/* Footer */
.inv-foot { text-align: center; padding: clamp(64px, 16cqi, 130px) 24px clamp(110px, 20cqi, 150px); background: var(--surface); }
.inv-foot__orn { color: var(--accent); display: flex; justify-content: center; margin-bottom: 20px; }
.inv-foot__orn .orn { width: 160px; }
.inv-foot__names { font-family: var(--font-script); font-size: clamp(34px, 10cqi, 64px); line-height: 1.2; }
.inv-foot__names .nm-amp { color: var(--accent); margin: 0 .2em; }
.inv-foot__thanks { margin-top: 12px; color: var(--muted); }
.inv-foot__date { margin-top: 18px; letter-spacing: .3em; font-size: 13px; }
.inv-foot__made { margin-top: 36px; font-size: 11px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }

/* Music button */
.inv-music {
  position: fixed; z-index: 66; top: calc(14px + env(safe-area-inset-top) + var(--topbar-h, 0px)); right: 14px;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--bg) 78%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .25s, background .25s;
}
.inv-music:hover { transform: scale(1.06); }
.inv-music__icon svg { width: 20px; height: 20px; display: block; }
.inv-music__bars { display: none; gap: 2px; align-items: flex-end; height: 16px; }
.inv-music__bars i { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.inv-music__bars i:nth-child(2) { animation-delay: -.3s; }
.inv-music__bars i:nth-child(3) { animation-delay: -.6s; }
.inv-music__bars i:nth-child(4) { animation-delay: -.15s; }
.inv-music.is-playing .inv-music__icon { display: none; }
.inv-music.is-playing .inv-music__bars { display: flex; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }

/* Section dock */
.inv-dock {
  position: fixed; z-index: 55; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 84%, transparent); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 12px 30px -18px rgba(0, 0, 0, .35);
  transform: translate(-50%, 140%); opacity: 0; transition: transform .6s cubic-bezier(.2, .7, .2, 1), opacity .6s; max-width: calc(100vw - 100px);
}
.inv.is-opened .inv-dock { transform: translate(-50%, 0); opacity: 1; }
.inv-dock a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 10px; min-width: 54px; border-radius: 999px; text-decoration: none; color: var(--muted); font: 500 10px/1.2 var(--font-ui, var(--font-body)); letter-spacing: .04em; transition: color .2s, background .2s; white-space: nowrap; }
.inv-dock a svg { width: 20px; height: 20px; }
.inv-dock a:hover, .inv-dock a.is-active { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, transparent); }
@media (max-width: 420px) { .inv-dock a { min-width: 0; padding: 6px 8px; } .inv-dock a span { font-size: 9px; } }

@media (prefers-reduced-motion: reduce) {
  .inv *, .inv *::before, .inv *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   2. Templates
   ========================================================================== */

/* ---------- W01 Classic Romance ---------- */
.tpl-classic-romance { --font-display: 'Cormorant Garamond', var(--cjk-serif), serif; --font-body: 'Cormorant Garamond', var(--cjk-serif), serif; --font-script: 'Great Vibes', var(--cjk-serif), cursive; --font-ui: 'Jost', var(--cjk-sans), sans-serif; --fs-body: 18px; --btn-radius: 0; --veil-anim: veilFade; --veil: var(--bg); }
.cv-arch { background: radial-gradient(120% 70% at 50% 0%, var(--surface), var(--bg) 62%); }
.cv-arch .cv-paper { position: absolute; inset: clamp(10px, 3cqi, 22px); border: 1px solid var(--accent2); pointer-events: none; z-index: -1; }
.cv-arch .cv-paper::after { content: ''; position: absolute; inset: 5px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.cv-arch .cv-content { max-width: 560px; }
.cv-arch .cv-eyebrow { font: 500 clamp(9px, 2.6cqi, 12px)/1.7 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); max-width: 30em; }
.cv-arch .cv-photo { position: relative; width: min(58cqi, 290px); aspect-ratio: 3 / 4; margin: 10px 0 6px; }
.cv-arch .cv-photo img { border-radius: 999px 999px 0 0; }
.cv-arch .cv-photo__line { position: absolute; inset: -10px; border: 1px solid var(--accent); border-radius: 999px 999px 0 0; border-bottom: 0; }
.cv-arch .cv-names { font-family: var(--font-script); font-size: calc(clamp(36px, 13.5cqi, 92px) * var(--k, 1)); line-height: 1.1; }
.cv-arch .nm-amp { color: var(--accent); margin: 0 .18em; font-size: .78em; }
.cv-arch .cv-title { font-style: italic; font-size: clamp(14px, 4.4cqi, 22px); color: var(--muted); }
.cv-arch .cv-orn { color: var(--accent); width: min(48cqi, 220px); }
.cv-arch .cv-date { display: flex; align-items: center; gap: clamp(10px, 3cqi, 16px); font-size: clamp(17px, 5.4cqi, 28px); letter-spacing: .14em; }
.cv-arch .cv-date i { width: 1px; height: .9em; background: var(--accent); }
.cv-arch .cv-venue { font: 400 clamp(9px, 2.8cqi, 13px)/1.6 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cv-arch .inv-open { color: var(--accent); }
.tpl-classic-romance .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-classic-romance .inv-h__title { font-family: var(--font-script); font-size: clamp(40px, 11cqi, 68px); line-height: 1.2; }
.tpl-classic-romance .inv-h__orn .orn { width: 180px; }
.tpl-classic-romance .inv-couple__photo { border-radius: 999px 999px 0 0; outline: 1px solid var(--accent); outline-offset: 8px; }
.tpl-classic-romance .inv-honoree__photo { border-radius: 999px 999px 0 0; }
.tpl-classic-romance .inv-pname { font-family: var(--font-script); font-size: clamp(36px, 9cqi, 52px); }
.tpl-classic-romance .inv-lead { font-style: italic; font-size: 1.2em; }
.tpl-classic-romance .inv-cd__cell { border: 1px solid var(--accent2); outline: 1px solid var(--accent2); outline-offset: -6px; padding: 18px 6px 14px; }
.tpl-classic-romance .inv-cd__sep { display: none; }
.tpl-classic-romance .inv-form { background: var(--bg); border: 1px solid var(--accent2); }
.tpl-classic-romance .sec-rsvp, .tpl-classic-romance .sec-rsvp .inv-success { background: var(--surface); }
.tpl-classic-romance .inv-field input, .tpl-classic-romance .inv-field select, .tpl-classic-romance .inv-field textarea { border-width: 0 0 1px; background: transparent; padding-left: 2px; }
.tpl-classic-romance .inv-field textarea { border-width: 1px; padding-left: 12px; }

/* ---------- W02 Modern Minimal ---------- */
.tpl-modern-minimal { --font-display: 'Jost', var(--cjk-sans), sans-serif; --font-body: 'Jost', var(--cjk-sans), sans-serif; --font-ui: 'Jost', var(--cjk-sans), sans-serif; --fs-body: 15.5px; --btn-radius: 0; --veil-anim: veilWipe; }
.cv-split { display: grid; grid-template-rows: minmax(0, 56svh) auto; padding: 0; text-align: left; align-items: stretch; justify-content: stretch; }
.cv-split .cv-photo { overflow: hidden; background: var(--surface); }
.cv-split .cv-photo img { filter: grayscale(1) contrast(1.05); transition: filter 1.2s; }
.cv-split .cv-text { padding: 7cqi 7cqi 9cqi; display: flex; flex-direction: column; gap: clamp(14px, 5cqi, 36px); justify-content: flex-end; }
.cv-split .cv-mono { display: flex; justify-content: space-between; gap: 12px; font: 400 clamp(9px, 2.6cqi, 12px)/1.4 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; border-top: 1px solid var(--ink); padding-top: 12px; }
.cv-split .cv-names { font-weight: 300; font-size: calc(clamp(38px, 15cqi, 128px) * var(--k, 1)); line-height: .92; letter-spacing: -.02em; text-transform: uppercase; display: flex; flex-direction: column; }
.cv-split .nm-amp { font-size: .34em; color: var(--muted); line-height: 1.6; letter-spacing: 0; }
.cv-split .cv-meta { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 8px clamp(16px, 6cqi, 48px); font-size: clamp(11px, 3.2cqi, 15px); }
.cv-split .cv-k { display: block; font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.cv-split .cv-index { position: absolute; top: calc(16px + var(--topbar-h, 0px)); left: 7cqi; font: 400 11px/1 var(--font-ui); letter-spacing: .3em; color: #fff; mix-blend-mode: difference; }
.cv-split .inv-open { margin-top: 0; }
.inv.is-mini .cv-split { grid-template-rows: 50% 1fr; padding: 0; }
.inv.is-mini .cv-split .cv-text { padding: 6cqi 7cqi 8cqi; }
@container inv (min-width: 760px) {
  .cv-split { grid-template-columns: 1.05fr 1fr; grid-template-rows: 1fr; }
  .cv-split .cv-photo { order: 2; height: auto; }
  .cv-split .cv-text { padding: 9cqi 6cqi 6cqi 7cqi; justify-content: center; }
  .cv-split .cv-names { font-size: clamp(40px, 9cqi, 132px); }
}
.tpl-modern-minimal .inv-h { text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline; border-top: 1px solid var(--ink); padding-top: 14px; }
.tpl-modern-minimal .inv-h__num { display: block; grid-row: span 2; font: 300 13px/1.4 var(--font-ui); letter-spacing: .1em; color: var(--muted); }
.tpl-modern-minimal .inv-h__eyebrow { color: var(--muted); }
.tpl-modern-minimal .inv-h__title { font-weight: 300; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(28px, 7.5cqi, 54px); margin-top: .1em; }
.tpl-modern-minimal .inv-lead { text-align: left; margin-left: 0; font-size: 1.15em; font-weight: 300; }
.tpl-modern-minimal .inv-storybox, .tpl-modern-minimal .inv-schedule, .tpl-modern-minimal .inv-person, .tpl-modern-minimal .inv-couple__people { text-align: left; }
.tpl-modern-minimal .inv-bio { margin-left: 0; }
.tpl-modern-minimal .inv-couple__photo img, .tpl-modern-minimal .inv-honoree__photo img, .tpl-modern-minimal .inv-gal__item img { filter: grayscale(1); }
.tpl-modern-minimal .inv-gal__item:hover img { filter: grayscale(0); }
.tpl-modern-minimal .inv-pname, .tpl-modern-minimal .inv-sub { font-weight: 300; text-transform: uppercase; letter-spacing: .04em; }
.tpl-modern-minimal .inv-couple__amp { display: none; }
.tpl-modern-minimal .inv-cd { justify-content: space-between; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 26px 0; }
.tpl-modern-minimal .inv-cd__num { font-weight: 200; font-size: clamp(40px, 14cqi, 100px); letter-spacing: -.03em; }
.tpl-modern-minimal .inv-cd__sep { color: var(--muted); opacity: 1; font-weight: 200; }
.tpl-modern-minimal .inv-cd__status { text-align: left; font-style: normal; }
.tpl-modern-minimal .inv-actions { justify-content: flex-start; }
.tpl-modern-minimal .inv-form { background: transparent; padding: 0; }
.tpl-modern-minimal .inv-field input, .tpl-modern-minimal .inv-field select { border-width: 0 0 1px; border-color: var(--ink); background: transparent; padding-left: 0; }
.tpl-modern-minimal .inv-field textarea { border-color: var(--ink); background: transparent; }
.tpl-modern-minimal .inv-foot { background: var(--ink); color: var(--bg); --muted: color-mix(in srgb, var(--bg) 62%, var(--ink)); --accent: var(--bg); }
.tpl-modern-minimal .inv-foot__names { font-family: var(--font-display); font-weight: 300; text-transform: uppercase; letter-spacing: .06em; }
.tpl-modern-minimal .inv-timeline__date { font-family: var(--font-ui); font-weight: 300; }

/* ---------- W03 Garden Wedding ---------- */
.tpl-garden-wedding { --font-display: 'Lora', var(--cjk-serif), serif; --font-body: 'Lora', var(--cjk-serif), serif; --font-script: 'Parisienne', var(--cjk-serif), cursive; --font-ui: 'Jost', var(--cjk-sans), sans-serif; --fs-body: 16px; --btn-radius: 999px; --field-radius: 14px; --radius: 28px; }
.cv-oval { background: radial-gradient(90% 60% at 50% 45%, var(--bg), var(--surface)); }
.cv-oval .cv-botanical { position: absolute; width: min(52cqi, 340px); color: var(--accent); opacity: .5; z-index: -1; }
.cv-oval .cv-botanical.tl { top: 0; left: 0; transform: scaleY(-1); }
.cv-oval .cv-botanical.br { bottom: 0; right: 0; transform: scaleX(-1); }
.cv-oval .cv-content { max-width: 520px; }
.cv-oval .cv-eyebrow { font: 400 clamp(9px, 2.6cqi, 12px)/1.7 var(--font-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--accent); max-width: 28em; }
.cv-oval .cv-photo { width: min(56cqi, 290px); aspect-ratio: 3 / 4.1; border-radius: 50%; overflow: hidden; border: 6px solid var(--bg); outline: 1px solid var(--accent); outline-offset: 6px; margin: 12px 0 8px; box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.cv-oval .cv-names { font-family: var(--font-script); font-size: calc(clamp(38px, 13cqi, 88px) * var(--k, 1)); line-height: 1.1; color: var(--ink); }
.cv-oval .nm-amp { color: var(--accent); margin: 0 .15em; }
.cv-oval .cv-title { font-style: italic; color: var(--muted); font-size: clamp(14px, 4cqi, 20px); }
.cv-oval .cv-date { font-size: clamp(14px, 4.2cqi, 20px); }
.cv-oval .cv-venue { font: 400 clamp(9px, 2.8cqi, 13px)/1.6 var(--font-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.cv-oval .inv-open { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tpl-garden-wedding .inv-sec:nth-child(odd) { background: var(--surface); }
.tpl-garden-wedding .inv-sec:nth-child(odd) .inv-form, .tpl-garden-wedding .inv-sec:nth-child(odd) .inv-success, .tpl-garden-wedding .inv-sec:nth-child(odd) .inv-bank { background: var(--bg); }
.tpl-garden-wedding .inv-h__title { font-family: var(--font-script); font-size: clamp(40px, 11cqi, 66px); }
.tpl-garden-wedding .inv-h__orn .orn { width: 120px; }
.tpl-garden-wedding .inv-couple__photo, .tpl-garden-wedding .inv-honoree__photo { border-radius: 50%; aspect-ratio: 3 / 4; }
.tpl-garden-wedding .inv-cd__cell { width: clamp(66px, 19cqi, 120px); min-width: 0; aspect-ratio: 1; justify-content: center; border-radius: 50%; background: var(--bg); border: 1px solid var(--line); }
.tpl-garden-wedding .inv-cd__num { font-size: clamp(26px, 8cqi, 52px); }
.tpl-garden-wedding .inv-cd__lbl { margin-top: 2px; }
.tpl-garden-wedding .inv-cd__sep { display: none; }
.tpl-garden-wedding .inv-info { background: var(--bg); border-radius: var(--radius); padding: 6px 24px; }
.tpl-garden-wedding .inv-info__item:first-child, .tpl-garden-wedding .inv-info__item:nth-child(2) { border-top: 0; }
.tpl-garden-wedding .inv-pname, .tpl-garden-wedding .inv-foot__names { font-family: var(--font-script); }

/* ---------- W04 Editorial Vogue ---------- */
.tpl-editorial-vogue { --font-display: 'Playfair Display', var(--cjk-serif), serif; --font-body: 'DM Sans', var(--cjk-sans), sans-serif; --font-ui: 'DM Sans', var(--cjk-sans), sans-serif; --font-script: 'Playfair Display', var(--cjk-serif), serif; --fs-body: 15.5px; --btn-radius: 0; --veil: #111; --veil-anim: veilUp; }
.cv-magazine { color: #fff; align-items: flex-end; justify-content: flex-start; text-align: left; padding: 0; background: #1b1b1b; }
.inv-cover.cv-magazine .cv-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; animation: cvIn 1.2s both, kenburns 22s ease-out both; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
.cv-magazine .cv-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, .05) 50%, rgba(0, 0, 0, .72) 100%); }
.cv-mast { position: absolute; top: calc(clamp(14px, 4.5cqi, 36px) + var(--topbar-h, 0px)); left: 5cqi; right: 5cqi; }
.cv-issue { display: flex; justify-content: space-between; gap: 8px; font: 500 clamp(8px, 2.5cqi, 12px)/1 var(--font-ui); letter-spacing: .24em; text-transform: uppercase; border-bottom: 1px solid rgba(255, 255, 255, .55); padding-bottom: 8px; }
.cv-masthead { font: 900 clamp(70px, 34cqi, 330px)/.82 var(--font-display); letter-spacing: -.035em; margin-top: .06em; text-align: center; }
.cv-lines { padding: 0 5cqi clamp(40px, 11cqi, 90px); max-width: 760px; position: relative; }
.cv-kicker { display: inline-block; font: 600 clamp(9px, 2.6cqi, 12px)/1 var(--font-ui); letter-spacing: .26em; text-transform: uppercase; background: var(--accent2); color: #111; padding: 7px 10px; }
.cv-magazine .cv-names { font: italic 400 calc(clamp(40px, 14cqi, 124px) * var(--k, 1))/.98 var(--font-display); margin: .18em 0 .2em; display: flex; flex-direction: column; letter-spacing: -.01em; }
.cv-magazine .nm-amp { font-style: normal; font-size: .46em; line-height: 1.3; color: var(--accent2); }
.cv-dek { font-size: clamp(12px, 3.5cqi, 17px); max-width: 32em; opacity: .92; margin-bottom: 4px; }
.cv-magazine .inv-open { background: #fff; color: #111; border-color: #fff; }
.cv-magazine .inv-open:hover { background: var(--accent2); border-color: var(--accent2); color: #111; }
.cv-side { position: absolute; right: 2.4cqi; top: 34%; writing-mode: vertical-rl; font: 500 clamp(7px, 2cqi, 10px)/1 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; opacity: .8; max-height: 40%; overflow: hidden; }
.cv-barcode { position: absolute; right: 5cqi; bottom: clamp(40px, 11cqi, 90px); display: flex; gap: 2px; align-items: stretch; height: clamp(26px, 8cqi, 46px); background: #fff; padding: 4px 6px 14px; }
.cv-barcode i { width: 2px; background: #111; }
.cv-barcode i:nth-child(3n) { width: 1px; }
.cv-barcode i:nth-child(4n) { width: 3px; }
.cv-barcode span { position: absolute; bottom: 2px; left: 0; right: 0; text-align: center; font: 7px/1 monospace; color: #111; letter-spacing: .1em; }
@container inv (max-width: 520px) { .cv-barcode { display: none; } }
.tpl-editorial-vogue .inv-h { text-align: left; display: grid; grid-template-columns: auto 1fr; column-gap: clamp(14px, 4cqi, 28px); align-items: end; border-bottom: 1px solid var(--ink); padding-bottom: 14px; }
.tpl-editorial-vogue .inv-h__num { display: block; grid-row: span 2; font: 900 clamp(56px, 18cqi, 140px)/.8 var(--font-display); color: color-mix(in srgb, var(--accent2) 78%, var(--ink)); }
.tpl-editorial-vogue .inv-h__title { font-style: italic; font-size: clamp(30px, 9cqi, 64px); margin-top: .05em; }
.tpl-editorial-vogue .inv-h__eyebrow { color: var(--ink); }
.tpl-editorial-vogue .inv-lead { text-align: left; margin-left: 0; font: italic 400 clamp(19px, 5cqi, 28px)/1.45 var(--font-display); border-left: 3px solid var(--accent2); padding-left: 18px; max-width: none; }
.tpl-editorial-vogue .inv-storybox { text-align: left; max-width: none; }
.tpl-editorial-vogue .inv-prose p:first-child::first-letter { float: left; font: 900 4.4em/.78 var(--font-display); margin: .06em .1em 0 0; color: var(--accent); }
@container inv (min-width: 720px) { .tpl-editorial-vogue .inv-prose { columns: 2; column-gap: 40px; column-rule: 1px solid var(--line); } }
.tpl-editorial-vogue .inv-couple__people, .tpl-editorial-vogue .inv-person { text-align: left; }
.tpl-editorial-vogue .inv-bio { margin-left: 0; }
.tpl-editorial-vogue .inv-pname { font-style: italic; }
.tpl-editorial-vogue .inv-couple__amp { color: color-mix(in srgb, var(--accent2) 78%, var(--ink)); font-style: italic; }
.tpl-editorial-vogue .inv-cd { justify-content: space-between; gap: 0; }
.tpl-editorial-vogue .inv-cd__cell { flex: 1; border-left: 1px solid var(--line); }
.tpl-editorial-vogue .inv-cd__cell:first-child { border-left: 0; }
.tpl-editorial-vogue .inv-cd__num { font-weight: 900; font-size: clamp(38px, 13cqi, 96px); }
.tpl-editorial-vogue .inv-cd__sep { display: none; }
.tpl-editorial-vogue .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-editorial-vogue .inv-foot { background: #111; color: #f4f1ec; --muted: #a8a29a; --accent: var(--accent2); }
.tpl-editorial-vogue .inv-foot__names { font: italic 400 clamp(36px, 11cqi, 72px)/1.1 var(--font-display); }

/* ---------- W05 Oriental Grace ---------- */
.tpl-oriental-grace { --font-display: 'Noto Serif TC', serif; --font-body: 'Noto Serif TC', serif; --font-script: 'Noto Serif TC', serif; --font-ui: 'Noto Serif TC', serif; --fs-body: 15.5px; --btn-radius: 2px; --field-radius: 2px; --veil-anim: veilSplit; }
.tpl-oriental-grace { background-image: radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent2) 10%, transparent), transparent 40%), radial-gradient(circle at 80% 80%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 40%); }
.cv-moongate { background: var(--bg); }
.cv-gate::before { content: ''; position: absolute; inset: -14%; border-radius: 50%; background: var(--surface); z-index: -1; }
.cv-moongate .cv-clouds svg { position: absolute; width: min(40cqi, 260px); color: var(--accent2); opacity: .55; z-index: -1; }
.cv-moongate .cv-clouds svg:first-child { top: calc(10cqi + var(--topbar-h, 0px)); left: 3cqi; }
.cv-moongate .cv-clouds svg:last-child { bottom: 8cqi; right: 3cqi; transform: scaleX(-1); }
.cv-moongate .cv-eyebrow { font-size: clamp(13px, 4cqi, 20px); letter-spacing: .5em; color: var(--accent); padding-left: .5em; font-weight: 500; }
.cv-gate { position: relative; width: min(62cqi, 320px); aspect-ratio: 1; margin: 5cqi 0 3cqi; }
.cv-gate img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.cv-ring { position: absolute; inset: -3.4cqi; border-radius: 50%; border: 1px solid var(--accent2); }
.cv-ring::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent2) 50%, transparent); }
.cv-seal { position: absolute; right: -3cqi; bottom: 2cqi; width: clamp(34px, 14cqi, 68px); aspect-ratio: 1; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 clamp(20px, 8.4cqi, 40px)/1 var(--font-display); border-radius: 4px; transform: rotate(-8deg); box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px color-mix(in srgb, var(--on-accent) 70%, transparent); }
.cv-vnames { display: flex; justify-content: center; align-items: center; gap: clamp(10px, 4cqi, 26px); font-weight: 700; font-size: calc(clamp(22px, 8cqi, 50px) * var(--k, 1)); letter-spacing: .12em; line-height: 1.2; flex-wrap: wrap; }
.cv-vnames .nm-amp { font-size: .5em; color: var(--accent); font-weight: 400; }
.cv-vnames.is-vertical { flex-direction: row-reverse; flex-wrap: nowrap; }
.cv-vnames.is-vertical .nm { writing-mode: vertical-rl; letter-spacing: .3em; font-size: 1.05em; }
.cv-moongate .cv-date { font-size: clamp(12px, 3.6cqi, 17px); letter-spacing: .14em; margin-top: 2cqi; }
.cv-moongate .cv-venue { font-size: clamp(11px, 3.2cqi, 15px); color: var(--muted); letter-spacing: .1em; }
.cv-moongate .inv-open { background: var(--accent); color: var(--on-accent); border-color: var(--accent); letter-spacing: .3em; }
.tpl-oriental-grace .inv-h__eyebrow { color: var(--accent); letter-spacing: .4em; }
.tpl-oriental-grace .inv-h__title { font-weight: 600; letter-spacing: .24em; font-size: clamp(26px, 7cqi, 44px); padding-left: .24em; }
.tpl-oriental-grace .inv-h__orn { color: var(--accent2); }
.tpl-oriental-grace .inv-h__orn .orn { width: 100px; }
.tpl-oriental-grace .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-oriental-grace .inv-couple__photo { border-radius: 50%; aspect-ratio: 1; max-width: 340px; outline: 1px solid var(--accent2); outline-offset: 10px; }
.tpl-oriental-grace .inv-honoree__photo { border-radius: 50%; aspect-ratio: 1; }
.tpl-oriental-grace .inv-pname { font-weight: 600; letter-spacing: .14em; }
.tpl-oriental-grace .inv-couple__amp { font-size: 22px; }
.tpl-oriental-grace .inv-cd__cell { border: 1px solid var(--accent); padding: 14px 4px 10px; position: relative; background: var(--bg); }
.tpl-oriental-grace .inv-cd__cell::before { content: ''; position: absolute; inset: 3px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); pointer-events: none; }
.tpl-oriental-grace .inv-cd__num { color: var(--accent); font-weight: 600; font-size: clamp(28px, 9cqi, 60px); }
.tpl-oriental-grace .inv-cd__sep { display: none; }
.tpl-oriental-grace .inv-gal--scroll .inv-gal__item { border: 6px solid var(--bg); outline: 1px solid var(--accent2); }
.tpl-oriental-grace .inv-foot { background: var(--accent-base); color: var(--on-accent); --muted: color-mix(in srgb, var(--on-accent) 78%, var(--accent-base)); --accent: var(--accent2); }
.tpl-oriental-grace .inv-foot__names { font-family: var(--font-display); font-weight: 600; letter-spacing: .14em; font-size: clamp(26px, 8cqi, 46px); }

/* ---------- B01 Elegant Soirée ---------- */
.tpl-elegant-soiree { --font-display: 'Bodoni Moda', var(--cjk-serif), serif; --font-body: 'Cormorant Garamond', var(--cjk-serif), serif; --font-script: 'Bodoni Moda', var(--cjk-serif), serif; --font-ui: 'Jost', var(--cjk-sans), sans-serif; --fs-body: 18px; --btn-radius: 0; --veil-anim: veilFade; --veil: var(--surface); }
.cv-numeral { flex-direction: column; gap: 4cqi; background: linear-gradient(180deg, var(--surface), var(--bg) 70%); }
.cv-big { position: absolute; top: calc(6cqi + var(--topbar-h, 0px)); left: 50%; transform: translateX(-50%); font: italic 400 clamp(170px, 76cqi, 620px)/.8 'Bodoni Moda', serif; color: transparent; -webkit-text-stroke: 1px var(--accent); opacity: .5; z-index: -1; letter-spacing: -.05em; white-space: nowrap; }
.cv-numeral .cv-photo { width: min(46cqi, 300px); aspect-ratio: 2 / 3; overflow: hidden; margin-top: 16cqi; box-shadow: 0 40px 70px -40px rgba(40, 20, 25, .55); }
.cv-numeral .cv-photo img { filter: saturate(.75) contrast(1.02); }
.cv-numeral .cv-text { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 2cqi, 14px); }
.cv-numeral .cv-eyebrow { font: 400 clamp(9px, 2.6cqi, 12px)/1.6 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); }
.cv-numeral .cv-names { font: italic 400 calc(clamp(42px, 15cqi, 110px) * var(--k, 1))/1 var(--font-display); }
.cv-numeral .cv-title { font: 500 clamp(10px, 3cqi, 14px)/1.6 var(--font-ui); letter-spacing: .26em; text-transform: uppercase; color: var(--accent); }
.cv-numeral .cv-orn { color: var(--accent); width: 120px; }
.cv-numeral .cv-date { font-size: clamp(15px, 4.6cqi, 22px); font-style: italic; }
.cv-numeral .cv-venue { font-size: clamp(12px, 3.4cqi, 16px); color: var(--muted); }
@container inv (min-width: 760px) {
  .cv-numeral { flex-direction: row; gap: 7cqi; text-align: left; }
  .cv-numeral .cv-photo { margin-top: 0; width: min(34cqi, 380px); }
  .cv-numeral .cv-text { align-items: flex-start; max-width: 520px; }
  .cv-big { top: 50%; transform: translate(-50%, -50%); }
}
.tpl-elegant-soiree .inv-h__title { font-style: italic; }
.tpl-elegant-soiree .inv-h__eyebrow { color: var(--muted); }
.tpl-elegant-soiree .inv-h__orn .orn { width: 120px; }
.tpl-elegant-soiree .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-elegant-soiree .inv-pname { font-style: italic; }
.tpl-elegant-soiree .inv-honoree__photo { aspect-ratio: 2 / 3; max-width: 360px; }
.tpl-elegant-soiree .inv-cd__num { font-style: italic; }
.tpl-elegant-soiree .inv-cd__cell { padding: 0 clamp(4px, 2cqi, 16px); }
.tpl-elegant-soiree .inv-cd__sep { font-family: var(--font-body); color: var(--accent); }
.tpl-elegant-soiree .inv-gal--grid .inv-gal__item { aspect-ratio: 4 / 5; }
.tpl-elegant-soiree .inv-gal__item img { filter: saturate(.8); }
.tpl-elegant-soiree .inv-foot__names { font-style: italic; }

/* ---------- B02 Pastel Dream ---------- */
.tpl-pastel-dream { --font-display: 'Fraunces', var(--cjk-sans), serif; --font-body: 'Quicksand', var(--cjk-sans), sans-serif; --font-ui: 'Quicksand', var(--cjk-sans), sans-serif; --font-script: 'Fraunces', var(--cjk-sans), serif; --fs-body: 16px; --btn-radius: 999px; --field-radius: 18px; --radius: 30px; --veil-anim: veilCircle; --veil: color-mix(in srgb, var(--accent2) 70%, #fff); }
.cv-bubble { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 40%, #fff), color-mix(in srgb, var(--accent2) 60%, #fff) 45%, color-mix(in srgb, #bfe9e0 70%, #fff) 80%, color-mix(in srgb, var(--accent) 30%, #fff)); background-size: 300% 300%; animation: pastel 16s ease infinite; }
@keyframes pastel { 0%, 100% { background-position: 0% 30%; } 50% { background-position: 100% 70%; } }
.cv-bubbles i { position: absolute; bottom: -20%; border-radius: 50%; background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .35) 35%, rgba(255, 255, 255, .05) 70%); border: 1px solid rgba(255, 255, 255, .7); animation: floatUp linear infinite; z-index: -1; }
.cv-bubbles i:nth-child(1) { left: 6%; width: 16cqi; aspect-ratio: 1; animation-duration: 16s; }
.cv-bubbles i:nth-child(2) { left: 22%; width: 7cqi; aspect-ratio: 1; animation-duration: 11s; animation-delay: -4s; }
.cv-bubbles i:nth-child(3) { left: 40%; width: 11cqi; aspect-ratio: 1; animation-duration: 14s; animation-delay: -9s; }
.cv-bubbles i:nth-child(4) { left: 62%; width: 20cqi; aspect-ratio: 1; animation-duration: 19s; animation-delay: -2s; }
.cv-bubbles i:nth-child(5) { left: 80%; width: 9cqi; aspect-ratio: 1; animation-duration: 12s; animation-delay: -7s; }
.cv-bubbles i:nth-child(6) { left: 90%; width: 13cqi; aspect-ratio: 1; animation-duration: 17s; animation-delay: -12s; }
.cv-bubbles i:nth-child(7) { left: 12%; width: 5cqi; aspect-ratio: 1; animation-duration: 9s; animation-delay: -5s; }
.cv-bubbles i:nth-child(8) { left: 52%; width: 6cqi; aspect-ratio: 1; animation-duration: 10s; animation-delay: -1s; }
.cv-bubbles i:nth-child(9) { left: 72%; width: 4cqi; aspect-ratio: 1; animation-duration: 8s; animation-delay: -3s; }
@keyframes floatUp { 0% { transform: translateY(0) translateX(0); opacity: 0; } 10% { opacity: 1; } 50% { transform: translateY(-70vh) translateX(14px); } 100% { transform: translateY(-140vh) translateX(-10px); opacity: 0; } }
.cv-bubble .cv-eyebrow { font: 600 clamp(10px, 2.8cqi, 13px)/1.6 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); opacity: .75; }
.inv-cover .cv-blob { width: min(58cqi, 300px); aspect-ratio: 1; overflow: hidden; border: 6px solid rgba(255, 255, 255, .85); box-shadow: 0 30px 60px -30px color-mix(in srgb, var(--accent) 80%, transparent); border-radius: 42% 58% 62% 38% / 45% 40% 60% 55%; animation: cvIn 1.2s .35s both, blob 12s ease-in-out infinite; margin: 8px 0; }
@keyframes blob { 0%, 100% { border-radius: 42% 58% 62% 38% / 45% 40% 60% 55%; } 50% { border-radius: 58% 42% 40% 60% / 55% 60% 40% 45%; } }
.cv-bubble .cv-names { font: italic 600 calc(clamp(48px, 18cqi, 130px) * var(--k, 1))/1 var(--font-display); color: var(--ink); position: relative; display: inline-flex; align-items: flex-start; }
.cv-bubble .cv-age { font: 700 clamp(13px, 4.4cqi, 24px)/1 var(--font-ui); font-style: normal; display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; background: #fff; color: var(--accent); margin-left: .2em; box-shadow: 0 8px 20px -10px var(--accent); transform: rotate(12deg); }
.cv-bubble .cv-title { font: 600 clamp(14px, 4.4cqi, 22px)/1.4 var(--font-ui); }
.cv-pill { background: rgba(255, 255, 255, .7); padding: 8px 18px; border-radius: 999px; font: 600 clamp(11px, 3.2cqi, 15px)/1.4 var(--font-ui); backdrop-filter: blur(6px); }
.cv-bubble .cv-venue { font-size: clamp(11px, 3.2cqi, 15px); opacity: .8; }
.cv-bubble .inv-open { background: #fff; border-color: #fff; color: var(--ink); font-weight: 700; letter-spacing: .12em; box-shadow: 0 14px 30px -14px var(--accent); }
.cv-bubble .inv-open:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.tpl-pastel-dream .inv-sec:nth-child(odd) { background: linear-gradient(180deg, var(--bg), color-mix(in srgb, var(--accent2) 18%, var(--bg))); }
.tpl-pastel-dream .inv-sec:nth-child(even) { background: linear-gradient(180deg, color-mix(in srgb, var(--accent2) 18%, var(--bg)), var(--bg)); }
.tpl-pastel-dream .inv-h__title { font-style: italic; font-weight: 600; }
.tpl-pastel-dream .inv-h__eyebrow { font-weight: 700; letter-spacing: .2em; }
.tpl-pastel-dream .inv-h__orn { color: var(--accent2); }
.tpl-pastel-dream .inv-h__orn .orn { width: 90px; }
.tpl-pastel-dream .inv-form, .tpl-pastel-dream .inv-success, .tpl-pastel-dream .inv-bank, .tpl-pastel-dream .inv-info { background: rgba(255, 255, 255, .78); box-shadow: 0 20px 50px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.tpl-pastel-dream .inv-info { border-radius: var(--radius); padding: 6px 24px; }
.tpl-pastel-dream .inv-info__item:first-child, .tpl-pastel-dream .inv-info__item:nth-child(2) { border-top: 0; }
.tpl-pastel-dream .inv-honoree__photo { border-radius: 42% 58% 62% 38% / 45% 40% 60% 55%; aspect-ratio: 1; }
.tpl-pastel-dream .inv-pname { font-style: italic; font-weight: 600; }
.tpl-pastel-dream .inv-cd__cell { background: #fff; border-radius: 26px; padding: 16px 6px 12px; box-shadow: 0 16px 34px -22px var(--accent); }
.tpl-pastel-dream .inv-cd__cell:nth-of-type(2n) { background: color-mix(in srgb, var(--accent2) 35%, #fff); }
.tpl-pastel-dream .inv-cd__num { font-weight: 600; color: var(--accent); font-size: clamp(30px, 10cqi, 66px); }
.tpl-pastel-dream .inv-cd__sep { display: none; }
.tpl-pastel-dream .inv-btn { font-weight: 700; letter-spacing: .1em; }
.tpl-pastel-dream .inv-wish__avatar { background: color-mix(in srgb, var(--accent) 30%, #fff); }
.tpl-pastel-dream .inv-foot { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 30%, #fff), color-mix(in srgb, var(--accent2) 45%, #fff)); }
.tpl-pastel-dream .inv-foot__names { font-style: italic; font-weight: 600; }

/* ---------- B03 Pop Party ---------- */
.tpl-pop-party { --font-display: 'Syne', var(--cjk-sans), sans-serif; --font-body: 'Space Grotesk', var(--cjk-sans), sans-serif; --font-ui: 'Space Grotesk', var(--cjk-sans), sans-serif; --font-script: 'Syne', var(--cjk-sans), sans-serif; --fs-body: 16px; --btn-radius: 14px; --field-radius: 12px; --radius: 22px; --veil: var(--pop); --veil-anim: veilWipe; }
.cv-poster { background: var(--accent); color: #fff; text-align: left; justify-content: flex-start; align-items: center; padding-bottom: clamp(80px, 18cqi, 120px); }
.cv-poster .cv-content { align-items: flex-start; max-width: 900px; margin: 0 auto; }
.cv-shapes i { position: absolute; z-index: -1; }
.cv-shapes .s1 { width: 70cqi; aspect-ratio: 1; border-radius: 50%; background: var(--pop); top: -22cqi; right: -24cqi; }
.cv-shapes .s2 { width: 38cqi; aspect-ratio: 1; background: var(--accent2); bottom: 6cqi; left: -14cqi; transform: rotate(18deg); border-radius: 18px; }
.cv-shapes .s3 { width: 26cqi; aspect-ratio: 1; border: 3px solid rgba(255, 255, 255, .55); border-radius: 50%; bottom: 22cqi; right: 8cqi; }
.cv-shapes .s4 { inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .22) 1.4px, transparent 1.6px); background-size: 18px 18px; }
.cv-sticker { display: inline-block; background: var(--pop); color: var(--ink); padding: 8px 14px; border-radius: 999px; transform: rotate(-3deg); font: 700 clamp(10px, 2.8cqi, 13px)/1.3 var(--font-ui); letter-spacing: .04em; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); max-width: 90%; }
.cv-poster .cv-names { font: 800 calc(clamp(64px, 30cqi, 250px) * var(--k, 1))/.82 var(--font-display); text-transform: uppercase; letter-spacing: -.04em; margin: 2cqi 0 0; color: #fff; text-shadow: 5px 5px 0 var(--ink); }
.cv-row { display: flex; align-items: center; gap: 5cqi; }
.cv-poster .cv-photo { width: clamp(90px, 40cqi, 300px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); background: var(--pop); }
.cv-poster .cv-age { width: clamp(64px, 24cqi, 170px); aspect-ratio: 1; border-radius: 50%; background: var(--accent2); display: grid; place-items: center; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); animation: wobble 4s ease-in-out infinite; }
.cv-poster .cv-age span { font: 800 clamp(26px, 11cqi, 80px)/1 var(--font-display); color: #fff; }
@keyframes wobble { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(-6deg) scale(1.04); } }
.cv-poster .cv-title { font: 700 clamp(16px, 5.4cqi, 32px)/1.2 var(--font-display); max-width: 18em; }
.cv-poster .inv-open { background: var(--pop); color: var(--ink); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-weight: 700; }
.cv-poster .inv-open:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); background: #fff; color: var(--ink); border-color: var(--ink); }
.cv-marquee { position: absolute; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--pop); overflow: hidden; white-space: nowrap; padding: 12px 0; font: 700 clamp(11px, 3.4cqi, 15px)/1 var(--font-ui); letter-spacing: .06em; text-transform: uppercase; }
.cv-track { display: inline-flex; gap: 16px; animation: marquee 26s linear infinite; padding-left: 16px; }
.cv-track b { color: #fff; font-weight: 400; }
@keyframes marquee { to { transform: translateX(-50%); } }
.tpl-pop-party .inv-h { text-align: left; }
.tpl-pop-party .inv-h__eyebrow { display: inline-block; background: var(--pop); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 12px; transform: rotate(-2deg); font-weight: 700; letter-spacing: .12em; }
.tpl-pop-party .inv-h__title { font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; font-size: clamp(28px, 7.4cqi, 60px); line-height: 1; margin-top: .3em; }
.tpl-pop-party .inv-lead { text-align: left; margin-left: 0; font-size: 1.2em; font-weight: 500; }
.tpl-pop-party .inv-storybox, .tpl-pop-party .inv-person, .tpl-pop-party .inv-schedule { text-align: left; }
.tpl-pop-party .inv-bio { margin-left: 0; }
.tpl-pop-party .inv-sec:nth-child(4n + 2) { background: var(--accent-base); color: #fff; --ink: #fff; --muted: rgba(255, 255, 255, .8); --line: rgba(255, 255, 255, .35); --accent: var(--pop); --on-accent: #14161f; }
.tpl-pop-party .inv-sec:nth-child(4n + 2) .inv-h__eyebrow { color: #14161f; border-color: #14161f; }
.tpl-pop-party .inv-honoree__photo, .tpl-pop-party .inv-form, .tpl-pop-party .inv-success, .tpl-pop-party .inv-bank { border: 2px solid #14161f; box-shadow: 8px 8px 0 #14161f; }
.tpl-pop-party .inv-honoree__photo { aspect-ratio: 1; border-radius: 50%; }
.tpl-pop-party .inv-form, .tpl-pop-party .inv-success { background: #fff; color: #14161f; --ink: #14161f; --muted: #5e6070; --line: #14161f; --bg: #fff; }
.tpl-pop-party .inv-pname { font-weight: 800; text-transform: uppercase; }
.tpl-pop-party .inv-cd { gap: clamp(8px, 2.4cqi, 16px); }
.tpl-pop-party .inv-cd__cell { flex: 1 1 0; min-width: 0 !important; max-width: 150px; }
.tpl-pop-party .inv-cd__cell { background: #fff; color: #14161f; border: 2px solid #14161f; box-shadow: 5px 5px 0 #14161f; border-radius: 18px; padding: 14px 8px 10px; min-width: clamp(64px, 19cqi, 120px); }
.tpl-pop-party .inv-cd__cell:nth-of-type(1) { transform: rotate(-3deg); background: var(--pop); }
.tpl-pop-party .inv-cd__cell:nth-of-type(2) { transform: rotate(2deg); }
.tpl-pop-party .inv-cd__cell:nth-of-type(3) { transform: rotate(-2deg); background: var(--accent2); color: #fff; }
.tpl-pop-party .inv-cd__cell:nth-of-type(4) { transform: rotate(3deg); }
.tpl-pop-party .inv-cd__num { font-weight: 800; font-size: clamp(26px, 9cqi, 60px); }
.tpl-pop-party .inv-cd__lbl { color: inherit; opacity: .7; }
.tpl-pop-party .inv-cd__sep { display: none; }
.tpl-pop-party .inv-btn { border: 2px solid #14161f; box-shadow: 4px 4px 0 #14161f; font-weight: 700; }
.tpl-pop-party .inv-btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #14161f; }
.tpl-pop-party .inv-btn--ghost { background: #fff; color: #14161f; }
.tpl-pop-party .inv-info__item { border-top: 2px solid var(--line); }
.tpl-pop-party .inv-foot { background: #14161f; color: #fff; --muted: rgba(255, 255, 255, .65); --accent: var(--pop); }
.tpl-pop-party .inv-foot__names { font-weight: 800; text-transform: uppercase; font-size: clamp(44px, 14cqi, 100px); }

/* ---------- B04 Floral Fête ---------- */
.tpl-floral-fete { --font-display: 'Marcellus', var(--cjk-serif), serif; --font-body: 'Lora', var(--cjk-serif), serif; --font-script: 'Allura', var(--cjk-serif), cursive; --font-ui: 'Jost', var(--cjk-sans), sans-serif; --fs-body: 16px; --btn-radius: 999px; --field-radius: 12px; --radius: 18px; --veil-anim: veilCircle; --veil: var(--accent2); }
.cv-wreath { flex-direction: column; justify-content: flex-start; padding-top: 0; }
.cv-wreath > .cv-photo { position: absolute; top: 0; left: 0; right: 0; height: 40%; z-index: -1; }
.cv-wreath > .cv-photo::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 22px; background: radial-gradient(circle at 11px 0, transparent 11px, var(--bg) 11.5px) repeat-x; background-size: 22px 22px; }
.cv-wreath > .cv-photo::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--bg) 40%, transparent)); }
.cv-wreath .cv-content { margin-top: max(26%, 26vh); }
.inv.is-mini .cv-wreath .cv-content { margin-top: 26%; }
.cv-wreathbox { position: relative; width: min(84cqi, 420px); aspect-ratio: 1; margin: 0 auto; display: grid; place-items: center; }
.cv-wreath-svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: cvIn 1.2s .35s both, spin 140s linear infinite; }
.cv-wreath-svg .fl-a { fill: var(--accent); opacity: .85; }
.cv-wreath-svg .fl-b { fill: var(--accent2); }
.cv-wreath-svg .fl-c { fill: #f3d9a4; }
.cv-wreath-svg .fl-berry { fill: var(--accent); opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.cv-wreath .cv-center { position: relative; background: var(--bg); width: 64%; aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 6%; box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.cv-wreath .cv-eyebrow { font: 400 clamp(7px, 2.2cqi, 11px)/1.6 var(--font-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.cv-wreath .cv-names { font-family: var(--font-script); font-size: calc(clamp(36px, 15cqi, 96px) * var(--k, 1)); line-height: 1.05; color: var(--accent); }
.cv-agel { font: 400 clamp(11px, 3.2cqi, 16px)/1.4 var(--font-display); letter-spacing: .2em; text-transform: uppercase; }
.cv-wreath .cv-title { font-family: var(--font-display); font-size: clamp(16px, 5cqi, 26px); letter-spacing: .08em; margin-top: 2cqi; }
.cv-wreath .cv-date { font-style: italic; font-size: clamp(13px, 3.8cqi, 18px); }
.cv-wreath .cv-venue { color: var(--muted); font-size: clamp(11px, 3.2cqi, 15px); }
.cv-wreath .inv-open { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.tpl-floral-fete .inv-h__title { overflow-wrap: break-word; hyphens: auto; font-family: var(--font-display); text-transform: uppercase; letter-spacing: .12em; font-size: clamp(24px, 7cqi, 44px); }
.tpl-floral-fete .inv-h__eyebrow { font-family: var(--font-script); text-transform: none; letter-spacing: 0; font-size: clamp(26px, 7cqi, 38px); color: var(--accent); }
.tpl-floral-fete .inv-h__orn .orn { width: 120px; }
.tpl-floral-fete .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-floral-fete .inv-honoree__photo { border-radius: 50% 50% 18px 18px; border: 8px solid var(--bg); box-shadow: 0 0 0 1px var(--accent2); }
.tpl-floral-fete .inv-pname { font-family: var(--font-script); font-size: clamp(40px, 10cqi, 60px); color: var(--accent); }
.tpl-floral-fete .inv-cd__cell { background: var(--bg); border-radius: 50% 50% 46% 54% / 60% 58% 42% 40%; padding: 18px 8px 14px; border: 1px solid var(--accent2); }
.tpl-floral-fete .inv-cd__num { color: var(--accent); }
.tpl-floral-fete .inv-cd__sep { display: none; }
.tpl-floral-fete .inv-gal__item { border-radius: var(--radius); }
.tpl-floral-fete .inv-foot__names { color: var(--accent); }

/* ---------- B05 Noir & Gold Gala ---------- */
.tpl-noir-gala { --font-display: 'Cinzel', var(--cjk-serif), serif; --font-body: 'Cormorant Garamond', var(--cjk-serif), serif; --font-script: 'Cinzel', var(--cjk-serif), serif; --font-ui: 'Cinzel', var(--cjk-serif), serif; --fs-body: 18px; --btn-radius: 0; --field-radius: 0; --danger: #f0907f; --veil-anim: veilSplit; --gold: linear-gradient(100deg, color-mix(in srgb, var(--accent) 65%, #000) 0%, color-mix(in srgb, var(--accent) 55%, #fff) 30%, var(--accent) 52%, color-mix(in srgb, var(--accent) 45%, #fff) 74%, color-mix(in srgb, var(--accent) 70%, #000) 100%); color-scheme: dark; }
.tpl-noir-gala .gold, .cv-deco .cv-names, .cv-deco .cv-roman, .tpl-noir-gala .inv-h__title, .tpl-noir-gala .inv-cd__num, .tpl-noir-gala .inv-foot__names { background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cv-deco { background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--accent) 18%, var(--bg)), var(--bg) 62%); padding-left: clamp(14px, 5cqi, 64px); padding-right: clamp(14px, 5cqi, 64px); }
.cv-rays { position: absolute; width: max(170cqi, 900px); aspect-ratio: 1; top: 46%; left: 50%; translate: -50% -50%; color: var(--accent); opacity: .2; z-index: -1; animation: spin 160s linear infinite; }
.cv-frame { position: relative; width: min(100%, 540px); padding: clamp(36px, 11cqi, 72px) clamp(22px, 8cqi, 60px); color: var(--accent); }
.cv-deco-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.cv-deco .cv-content { color: var(--ink); gap: clamp(6px, 2.2cqi, 14px); }
.cv-deco .cv-eyebrow { font: 400 clamp(8px, 2.4cqi, 11px)/1.7 var(--font-ui); letter-spacing: .3em; text-transform: uppercase; color: var(--accent); max-width: 26em; }
.cv-deco .cv-photo { width: min(42cqi, 220px); aspect-ratio: 3 / 4; padding: 2px; background: var(--gold); clip-path: polygon(30% 0, 70% 0, 70% 5%, 85% 5%, 85% 10%, 100% 10%, 100% 100%, 0 100%, 0 10%, 15% 10%, 15% 5%, 30% 5%); margin: 6px 0; }
.cv-deco .cv-photo img { clip-path: polygon(30% 0, 70% 0, 70% 5%, 85% 5%, 85% 10%, 100% 10%, 100% 100%, 0 100%, 0 10%, 15% 10%, 15% 5%, 30% 5%); filter: contrast(1.05) saturate(.85); }
.cv-roman { font: 600 clamp(20px, 7cqi, 44px)/1 var(--font-display); letter-spacing: .3em; padding-left: .3em; }
.cv-deco .cv-names { font: 500 calc(clamp(32px, 12cqi, 84px) * var(--k, 1))/1.05 var(--font-display); letter-spacing: .1em; text-transform: uppercase; }
.cv-deco .cv-title { font-style: italic; font-size: clamp(14px, 4.4cqi, 21px); color: var(--muted); }
.cv-deco .cv-orn { color: var(--accent); width: min(52cqi, 220px); }
.cv-deco .cv-date { font: 400 clamp(10px, 3cqi, 14px)/1.6 var(--font-ui); letter-spacing: .2em; text-transform: uppercase; }
.cv-deco .cv-venue { font-size: clamp(13px, 3.8cqi, 17px); color: var(--muted); }
.cv-deco .inv-open { color: var(--accent); }
.tpl-noir-gala .inv-sec { border-top: 1px solid var(--line); }
.tpl-noir-gala .inv-sec:nth-child(even) { background: var(--surface); }
.tpl-noir-gala .inv-h__title { text-transform: uppercase; letter-spacing: .12em; font-weight: 500; font-size: clamp(26px, 7.4cqi, 50px); }
.tpl-noir-gala .inv-h__eyebrow { letter-spacing: .4em; }
.tpl-noir-gala .inv-h__orn .orn { width: 180px; }
.tpl-noir-gala .inv-honoree__photo { clip-path: polygon(30% 0, 70% 0, 70% 5%, 85% 5%, 85% 10%, 100% 10%, 100% 100%, 0 100%, 0 10%, 15% 10%, 15% 5%, 30% 5%); }
.tpl-noir-gala .inv-pname { text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.tpl-noir-gala .inv-cd__cell { border: 1px solid var(--accent); padding: 16px 6px 12px; position: relative; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px), 0 10px); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.tpl-noir-gala .inv-cd__sep { display: none; }
.tpl-noir-gala .inv-cd__num { font-weight: 500; }
.tpl-noir-gala .inv-btn { background: var(--gold); border: 0; color: var(--on-accent); font-family: var(--font-ui); font-weight: 600; }
.tpl-noir-gala .inv-btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.tpl-noir-gala .inv-form, .tpl-noir-gala .inv-success { background: transparent; border: 1px solid var(--line); }
.tpl-noir-gala .inv-field input, .tpl-noir-gala .inv-field select, .tpl-noir-gala .inv-field textarea, .tpl-noir-gala .inv-choice span { background: color-mix(in srgb, var(--surface) 70%, #000); }
.tpl-noir-gala .inv-wish__avatar { background: var(--gold); color: var(--on-accent); }
.tpl-noir-gala .inv-foot { background: #000; }
.tpl-noir-gala .inv-foot__names { text-transform: uppercase; letter-spacing: .12em; font-family: var(--font-display); }
.tpl-noir-gala .inv-lightbox { background: rgba(0, 0, 0, .96); }
.inv-wish-more { display: flex; margin: 14px auto 0; }
.inv-consent { font-size: 11.5px; line-height: 1.6; color: var(--muted); text-align: center; margin: 12px 0 0; }
.inv-consent a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
