/* The invitation itself. All colours and faces come from the template through custom properties. */

.nyota-invite {
  --pad: clamp(20px, 6vw, 36px);
  position: relative;
  min-height: 100svh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.55;
  overflow: hidden;
  isolation: isolate;
}
.nyota-invite *, .nyota-invite *::before, .nyota-invite *::after { box-sizing: border-box; }
.nyota-invite img { display: block; max-width: 100%; }
.nyota-invite h1, .nyota-invite h2, .nyota-invite h3, .nyota-invite p { margin: 0; }

/* On wide screens the invite is a phone-width column over a darkened, blurred copy of its photograph. */
.iv-backdrop {
  position: fixed; inset: -40px; z-index: -2;
  background-size: cover; background-position: center;
  filter: blur(28px) brightness(0.45) saturate(1.1);
  transform: scale(1.1);
}
.mode-preview .iv-backdrop, .mode-card .iv-backdrop { position: absolute; }
.iv-col {
  position: relative;
  width: min(100%, 500px);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100svh;
}
@media (min-width: 560px) { .mode-live .iv-col { box-shadow: 0 0 80px rgba(0, 0, 0, 0.45); } }
.iv-particles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.mode-preview .iv-particles { position: absolute; }

/* ---------- First screen ---------- */
.iv-hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 72px var(--pad) 64px;
  gap: 10px;
  overflow: hidden;
}
.mode-card .iv-hero { min-height: 0; height: 640px; padding: 56px 28px 40px; }
.mode-card .iv-col { min-height: 0; width: 400px; }
.mode-card { min-height: 0; width: 400px; height: 640px; font-size: 16px; }

.iv-blessing { font-family: var(--f-body); font-size: 0.95em; letter-spacing: 0.04em; color: var(--accent); }
.iv-kicker { font-family: var(--f-body); font-style: italic; font-size: 1.05em; opacity: 0.9; }
.iv-names {
  font-family: var(--f-script);
  font-weight: 400;
  font-size: clamp(44px, 13vw, 64px);
  line-height: 1;
  display: flex; flex-direction: column; align-items: center;
  color: var(--ink);
  margin-top: 6px;
}
.mode-card .iv-names { font-size: 50px; }
.iv-names .joiner { font-family: var(--f-display); font-size: 0.42em; color: var(--accent); margin: 0.1em 0; }
.font-cap .iv-names, .nyota-invite[style*="Cinzel"] .iv-names .joiner { letter-spacing: 0.02em; }
.iv-headline { font-family: var(--f-display); font-size: 0.85em; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent); }
.iv-when { font-family: var(--f-script); font-size: 1.6em; line-height: 1; margin-top: 10px; color: var(--accent); }
.iv-date { font-family: var(--f-display); font-size: 1em; letter-spacing: 0.06em; }
.iv-time { font-size: 0.95em; margin-top: -6px; }
.iv-place { font-size: 0.95em; opacity: 0.85; }

/* The portrait and its frame. */
.iv-portrait { position: relative; width: 62%; aspect-ratio: 3 / 4; margin: 14px 0 6px; flex-shrink: 0; }
.mode-card .iv-portrait { width: 52%; }
.iv-photo { position: absolute; inset: 6%; overflow: hidden; }
.iv-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 18%; }
.iv-art { background: var(--soft); display: grid; place-items: center; }
.iv-art-ring { position: absolute; inset: 8%; display: grid; place-items: center; opacity: 0.55; animation: iv-spin 120s linear infinite; }
.iv-art-ring svg { width: 100%; height: auto; aspect-ratio: 1; }
.iv-art-mono { position: relative; font-family: var(--f-script); font-size: 3.4em; color: var(--accent); line-height: 1; }
.iv-art-mono span { font-size: 0.5em; margin: 0 0.12em; }
.shape-arch .iv-photo { inset: 5%; border-radius: 50% 50% 0 0 / 34% 34% 0 0; }
.shape-circle { aspect-ratio: 1; width: 58%; }
.shape-circle .iv-photo { inset: 9%; border-radius: 50%; }
.shape-oval .iv-photo { inset: 5%; border-radius: 50%; }
.shape-rect .iv-photo { inset: 7%; }
.orn { pointer-events: none; }
.orn svg { width: 100%; height: 100%; display: block; }
.orn-arch, .orn-mandala, .orn-ring { position: absolute; inset: 0; }
.orn-mandala { inset: -12%; animation: iv-spin 80s linear infinite; }
.orn-ring { border: 2px solid var(--accent); border-radius: 50%; box-shadow: inset 0 0 0 7px var(--bg), inset 0 0 0 8px var(--accent); }
.orn-oval { border-radius: 50%; }
.orn-toran { position: absolute; top: 0; left: 0; right: 0; height: 120px; }
.orn-corner { position: absolute; width: 38%; aspect-ratio: 1; opacity: 0.95; }
.orn-corner.tl { top: 0; left: 0; }
.orn-corner.tr { top: 0; right: 0; transform: scaleX(-1); }
.orn-corner.bl { bottom: 0; left: 0; transform: scaleY(-1); }
.orn-corner.br { bottom: 0; right: 0; transform: scale(-1, -1); }
.orn-page { position: absolute; inset: 12px; }
.orn-crescent { position: absolute; top: 8px; left: 0; right: 0; height: 120px; opacity: 0.9; }
.orn-confetti { position: absolute; inset: 0; opacity: 0.5; }
.orn-mandala-bg { position: absolute; width: 150%; aspect-ratio: 1; left: -25%; top: -30%; opacity: 0.12; animation: iv-spin 160s linear infinite; }
.orn-lights { position: absolute; top: 0; left: 0; right: 0; height: 46%; opacity: 0.95; }
.orn-lights .bulb { animation: iv-twinkle 2.4s ease-in-out infinite; }
.orn-balustrade { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; opacity: 0.95; }
.orn-balustrade .flame { animation: iv-flicker 0.9s ease-in-out infinite alternate; transform-origin: center bottom; transform-box: fill-box; }
.motif-palace .iv-hero { padding-bottom: 130px; padding-top: 110px; }
.motif-toran .iv-hero, .motif-crescent .iv-hero { padding-top: 120px; }
.motif-palace.mode-card .iv-hero { padding-top: 96px; padding-bottom: 100px; }
.motif-palace.mode-card .orn-balustrade { height: 80px; }
.motif-palace.mode-card .iv-portrait { width: 42%; }

@keyframes iv-spin { to { transform: rotate(360deg); } }
@keyframes iv-twinkle { 50% { opacity: 0.25; } }
@keyframes iv-flicker { to { transform: scale(0.85, 1.1); opacity: 0.85; } }

/* Hero entrance once the intro has gone: each line rises in turn, the names write on. */
.mode-live .iv-hero > *:not(.orn), .mode-preview .iv-hero > *:not(.orn) { opacity: 0; transform: translateY(18px); }
.iv-hero.play > *:not(.orn) { animation: iv-rise 1s cubic-bezier(.2, .7, .2, 1) forwards; }
.iv-hero.play > :nth-child(2) { animation-delay: .1s; } .iv-hero.play > :nth-child(3) { animation-delay: .25s; }
.iv-hero.play > :nth-child(4) { animation-delay: .4s; } .iv-hero.play > :nth-child(5) { animation-delay: .7s; }
.iv-hero.play > :nth-child(6) { animation-delay: 1s; } .iv-hero.play > :nth-child(7) { animation-delay: 1.2s; }
.iv-hero.play > :nth-child(8) { animation-delay: 1.35s; } .iv-hero.play > :nth-child(9) { animation-delay: 1.5s; }
.iv-hero.play > :nth-child(10) { animation-delay: 1.65s; }
.iv-hero.play .iv-names { animation: iv-write 1.6s cubic-bezier(.4, 0, .2, 1) forwards; animation-delay: .7s; clip-path: inset(0 100% 0 0); transform: none; }
@keyframes iv-rise { to { opacity: 1; transform: none; } }
@keyframes iv-write { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 100% { opacity: 1; clip-path: inset(0 0 0 0); } }

/* ---------- Sections ---------- */
.iv-sec { padding: 56px var(--pad); text-align: center; position: relative; z-index: 1; }
.iv-h2 { font-family: var(--f-script); font-weight: 400; font-size: 2.3em; line-height: 1.1; color: var(--accent); margin-bottom: 22px; }
.iv-divider { width: 180px; margin: 0 auto; opacity: 0.9; }
.iv-dear { font-family: var(--f-script); font-size: 1.7em; color: var(--accent); margin-bottom: 14px; }
.iv-msg { font-size: 1.15em; font-style: italic; max-width: 32ch; margin: 0 auto; }
.iv-hosts { margin-top: 20px; font-family: var(--f-display); font-size: 0.85em; letter-spacing: 0.08em; opacity: 0.85; }

.iv-clock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 380px; margin: 0 auto; }
.iv-clock div { background: var(--soft); padding: 16px 4px 12px; display: flex; flex-direction: column; align-items: center; }
.iv-clock b { font-family: var(--f-display); font-weight: 400; font-size: 1.9em; line-height: 1; font-variant-numeric: tabular-nums; }
.iv-clock span { font-size: 0.75em; margin-top: 6px; opacity: 0.8; }

.iv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.iv-event { background: var(--soft); padding: 22px 18px; position: relative; }
.iv-event::before, .iv-event::after { content: ''; position: absolute; width: 14px; height: 14px; border: 1.5px solid var(--accent); }
.iv-event::before { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.iv-event::after { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }
.iv-event h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.5em; color: var(--accent); }
.iv-ev-date { margin-top: 4px; }
.iv-ev-time { opacity: 0.85; font-size: 0.95em; }

.iv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iv-grid figure { margin: 0; aspect-ratio: 3 / 4; overflow: hidden; }
.iv-grid figure.wide { grid-column: span 2; aspect-ratio: 4 / 3; }
.iv-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.iv-grid figure:hover img { transform: scale(1.05); }

.iv-venue-name { font-family: var(--f-display); font-size: 1.4em; }
.iv-address { opacity: 0.85; margin-bottom: 18px; }
.iv-map { aspect-ratio: 4 / 3; margin: 0 0 18px; background: var(--soft); }
.iv-map iframe { width: 100%; height: 100%; border: 0; filter: saturate(0.8); }
.iv-dress { margin-top: 18px; font-size: 0.95em; }
.iv-btn {
  display: inline-block; font: inherit; font-family: var(--f-display); font-size: 0.9em; letter-spacing: 0.08em;
  background: var(--accent); color: var(--bg); border: 0; padding: 14px 26px; text-decoration: none; cursor: pointer;
  transition: transform .2s ease, filter .2s ease;
}
.iv-btn:hover { filter: brightness(1.08); } .iv-btn:active { transform: scale(0.97); }
.iv-btn:focus-visible, .iv-form input:focus-visible, .iv-form textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.iv-form { display: grid; gap: 14px; text-align: left; max-width: 380px; margin: 0 auto; }
.iv-form label { display: grid; gap: 6px; font-size: 0.9em; }
.iv-form input:not([type=radio]), .iv-form textarea {
  font: inherit; color: var(--ink); background: var(--soft); border: 0; border-bottom: 1.5px solid var(--accent); padding: 10px 12px;
}
.iv-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.iv-choice label { display: block; }
.iv-choice input { position: absolute; opacity: 0; }
.iv-choice span { display: block; text-align: center; padding: 12px 8px; background: var(--soft); cursor: pointer; font-size: 0.95em; transition: background .2s, color .2s; }
.iv-choice input:checked + span { background: var(--accent); color: var(--bg); }
.iv-choice input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.iv-form .iv-btn { justify-self: stretch; text-align: center; }
.iv-thanks { text-align: center; color: var(--accent); }

.iv-foot { padding: 48px var(--pad) 72px; text-align: center; position: relative; z-index: 1; }
.iv-foot-names { font-family: var(--f-script); font-size: 3em; color: var(--accent); line-height: 1; }
.iv-foot-names span { font-size: 0.5em; margin: 0 0.2em; }
.iv-made { display: inline-block; margin-top: 22px; font-size: 0.8em; color: inherit; opacity: 0.6; }

.iv-music {
  position: fixed; right: 18px; bottom: 18px; z-index: 30; width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: var(--bg); border: 0; display: grid; place-items: center; cursor: pointer;
}
.mode-preview .iv-music { position: absolute; }
.iv-music svg { width: 22px; height: 22px; }
.iv-music[aria-pressed=true] svg { animation: iv-spin 4s linear infinite; }

.rv { opacity: 0; transform: translateY(24px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
.rv.in { opacity: 1; transform: none; }
.iv-list .rv:nth-child(2) { transition-delay: .08s; } .iv-list .rv:nth-child(3) { transition-delay: .16s; }
.iv-list .rv:nth-child(4) { transition-delay: .24s; } .iv-list .rv:nth-child(5) { transition-delay: .32s; }

/* Watermark on unpaid previews. */
.iv-wm {
  position: fixed; inset: -20%; z-index: 40; pointer-events: none;
  display: flex; flex-wrap: wrap; gap: 46px 60px; align-content: flex-start; justify-content: center;
  transform: rotate(-24deg); padding-top: 80px;
}
.mode-preview .iv-wm { position: absolute; }
.iv-wm span { font: 700 20px/1 system-ui, sans-serif; letter-spacing: 0.2em; color: var(--ink); opacity: 0.13; white-space: nowrap; user-select: none; }

/* ---------- Intros ---------- */
html.ix-lock, html.ix-lock body { overflow: hidden; }
.ix { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; cursor: pointer; overflow: hidden; perspective: 1400px; }
.mode-preview .ix { position: absolute; }
.ix.gone { opacity: 0; pointer-events: none; transition: opacity .8s ease; }
.ix-center { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; transition: opacity .5s ease; }
.ix.open .ix-center { opacity: 0; }
.ix-mono { font-family: var(--f-script); font-size: 72px; line-height: 1; color: var(--accent); }
.ix-mono span { font-size: 0.5em; margin: 0 0.15em; }
.ix-tap {
  font: inherit; font-family: var(--f-display); font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid var(--accent); padding: 12px 22px; cursor: pointer;
  animation: ix-pulse 1.8s ease-in-out infinite;
}
@keyframes ix-pulse { 50% { transform: scale(1.05); } }

.ix-door { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--soft); transition: transform 1.6s cubic-bezier(.6, 0, .2, 1); display: grid; place-items: center; }
.ix-door.l { left: 0; transform-origin: left center; border-right: 2px solid var(--accent); }
.ix-door.r { right: 0; transform-origin: right center; border-left: 2px solid var(--accent); }
.ix-arch { width: 70%; height: 80%; opacity: 0.8; }
.ix-arch svg { width: 100%; height: 100%; }
.ix-knob { position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.ix-knob { top: 72%; }
.ix-door.l .ix-knob { right: 16px; } .ix-door.r .ix-knob { left: 16px; }
.ix-doors.open .ix-door.l { transform: rotateY(-105deg); }
.ix-doors.open .ix-door.r { transform: rotateY(105deg); }
.ix-doors { background: transparent; }

.ix-curtain { background: transparent; }
.ix-drape { position: absolute; top: 0; bottom: 0; width: 52%; z-index: 1; transition: transform 1.8s cubic-bezier(.7, 0, .2, 1);
  background: repeating-linear-gradient(90deg, var(--soft) 0 18px, color-mix(in srgb, var(--soft) 70%, #000) 18px 30px, var(--soft) 30px 46px); }
.ix-drape.l { left: 0; } .ix-drape.r { right: 0; }
.ix-valance { position: absolute; top: 0; left: 0; right: 0; height: 60px; background: var(--accent); z-index: 2; transition: transform 1.4s ease .6s; }
.ix-valance::after { content: ''; position: absolute; left: 0; right: 0; bottom: -14px; height: 14px; background: radial-gradient(circle at 14px 0, var(--accent) 13px, transparent 14px) repeat-x; background-size: 28px 14px; }
.ix-curtain.open .ix-drape.l { transform: translateX(-100%) skewX(-6deg); }
.ix-curtain.open .ix-drape.r { transform: translateX(100%) skewX(6deg); }
.ix-curtain.open .ix-valance { transform: translateY(-130%); }

.ix-envelope { background: var(--bg); flex-direction: column; display: flex; justify-content: center; gap: 28px; }
.ix-env { position: relative; width: min(78vw, 340px); aspect-ratio: 4 / 3; }
.mode-preview .ix-env { width: 78%; max-width: 320px; }
.ix-env-back, .ix-env-front, .ix-flap { position: absolute; inset: 0; }
.ix-env-back { background: color-mix(in srgb, var(--soft) 80%, #000); }
.ix-env-front { background: var(--soft); clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); z-index: 3; }
.ix-flap { background: color-mix(in srgb, var(--soft) 88%, var(--accent)); clip-path: polygon(0 0, 100% 0, 50% 60%); transform-origin: top; z-index: 4; transition: transform .9s ease, z-index 0s .45s; }
.ix-letter { position: absolute; left: 6%; right: 6%; top: 8%; bottom: 6%; background: var(--bg); z-index: 2; display: grid; place-items: center; padding: 16px; transition: transform 1s cubic-bezier(.2, .7, .2, 1) .7s; border: 1px solid var(--accent); }
.ix-letter p { font-family: var(--f-script); font-size: 30px; color: var(--accent); text-align: center; line-height: 1.1; }
.ix-seal { position: absolute; left: 50%; top: 56%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; z-index: 5; border: 0; cursor: pointer;
  background: #8e1b1b; color: #f6d6a8; font-family: var(--f-script); font-size: 22px; box-shadow: inset 0 0 0 4px #a52a2a, inset 0 0 0 6px #7a1414; transition: opacity .4s ease, transform .4s ease; }
.ix-seal span { font-size: 0.6em; }
.ix-hint { font-family: var(--f-display); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; transition: opacity .3s; }
.ix-envelope.open .ix-seal { opacity: 0; transform: scale(1.4); }
.ix-envelope.open .ix-flap { transform: rotateX(180deg); z-index: 1; }
.ix-envelope.open .ix-letter { transform: translateY(-62%); }
.ix-envelope.open .ix-hint { opacity: 0; }

.ix-titles { background: #000; }
.ix-titles .ix-center { gap: 14px; padding: 0 24px; }
.ix-titles .ix-t1 { font-family: var(--f-display); letter-spacing: 0.3em; text-transform: uppercase; font-size: 12px; color: #d8d2c4; }
.ix-titles .ix-t2 { font-family: var(--f-script); font-size: 54px; color: var(--accent); line-height: 1.05; }
.ix-bars::before, .ix-bars::after { content: ''; position: absolute; left: 0; right: 0; height: 12vh; background: #000; z-index: 4; transition: transform 1.2s ease 2.6s; }
.ix-bars::before { top: 0; } .ix-bars::after { bottom: 0; }
.ix-titles.open .ix-center { opacity: 1; }
.ix-titles.open .ix-tap { opacity: 0; transition: opacity .3s; }
.ix-titles.open .ix-t1 { animation: ix-title 3.4s ease forwards; }
.ix-titles.open .ix-t2 { animation: ix-title 3.4s ease .5s both; }
.ix-titles .ix-t1, .ix-titles .ix-t2 { opacity: 0; }
@keyframes ix-title { 0% { opacity: 0; letter-spacing: 0.5em; filter: blur(6px); } 30%, 75% { opacity: 1; filter: blur(0); } 100% { opacity: 0; } }
.ix-titles.open { background: transparent; transition: background 1.4s ease 2.6s; }
.ix-titles.open .ix-bars::before { transform: translateY(-100%); } .ix-titles.open .ix-bars::after { transform: translateY(100%); }

.ix-petals { background: var(--bg); }
.ix-ring { position: absolute; width: 300px; aspect-ratio: 1; left: 50%; top: 50%; margin: -150px 0 0 -150px; animation: iv-spin 40s linear infinite; opacity: 0.7; }
.ix-ring svg { width: 100%; height: 100%; }
.ix-petals .ix-center { min-height: 300px; justify-content: center; }
.ix-petals.open { transform: scale(1.15); transition: transform 1.8s ease; }

.ix-diya { background: #0b0604; }
.ix-diya .ix-mono { color: #f6d39a; }
.ix-diya svg.ix-diya { width: 130px; height: 130px; background: none; }
.ix-glow { opacity: 0.12; transition: opacity 1s ease, transform 1.4s ease; transform-origin: center; transform-box: fill-box; }
.ix-flame { opacity: 0.15; transform-origin: center bottom; transform-box: fill-box; animation: iv-flicker .8s ease-in-out infinite alternate; }
.ix-diya.open .ix-center { opacity: 1; }
.ix-diya.open .ix-tap { opacity: 0; transition: opacity .3s; }
.ix-diya.open .ix-flame { opacity: 1; }
.ix-diya.open .ix-glow { opacity: 0.55; transform: scale(3); }
.ix-diya.open { background: var(--bg); transition: background 1.6s ease .4s; }

@media (prefers-reduced-motion: reduce) {
  .nyota-invite *, .nyota-invite *::before, .nyota-invite *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rv { opacity: 1; transform: none; }
}
