.ai-invitation {
  --event-accent: var(--ai-accent) !important;
  --event-text: var(--ai-ink) !important;
  accent-color: var(--ai-accent);
}
.ai-invitation .event-type {
  background: transparent;
  color: var(--ai-muted);
  border-color: var(--ai-line);
}
/* Slow, template-specific opening. One clock (--ai-duration) drives the cover
   panels; details begin revealing at 30% of it while the cover still moves. */
.ai-invitation { --ai-duration: 3.2s; --ai-ease: cubic-bezier(.45,.05,.2,1); position: relative; }
.ai-invitation .ai-cover { overflow: hidden; }
.ai-invitation .ai-cover > .ai-fan { position: absolute; inset: 0; z-index: 0; pointer-events: none; visibility: hidden; }
.ai-invitation .ai-panel, .ai-invitation .ai-line, .ai-invitation .ai-iris { position: absolute; display: none; }
.ai-invitation .ai-panel { background: var(--ai-paper); will-change: transform; }
/* Cover during opening: transparent so the details show through as panels leave */
.ai-invitation.ai-opening .ai-cover { position: absolute; inset: 0; z-index: 20; min-height: 0 !important; background: transparent; }
.ai-invitation.ai-opening:not([data-preview-invitation]) .ai-cover { position: fixed; }
.ai-invitation.ai-opening .ai-fan { visibility: visible; z-index: 0; animation: ai-open-clock var(--ai-duration) linear both; }
.ai-invitation.ai-opening .ai-cover > :not(.ai-fan) { animation: ai-cover-out calc(var(--ai-duration) * .3) ease-out both; }
.ai-invitation.ai-opening .ai-open-button { cursor: wait; }
@keyframes ai-open-clock { from { opacity: 1; } to { opacity: 1; } }
@keyframes ai-cover-out { to { opacity: 0; transform: scale(.97); } }
/* Details: soft entrance that starts at 30% (per-item delay set by script) */
.ai-invitation.ai-opening > .ai-reveal-item { animation: ai-reveal var(--ai-item-duration, 1.1s) cubic-bezier(.25,.6,.3,1) var(--ai-delay, 1s) both; }
[data-ai-template="reveal_vow"].ai-opening > .ai-reveal-item { animation-name: ai-unfold; }
[data-ai-template="reveal_chapter"].ai-opening > .ai-reveal-item { animation-name: ai-page; }
[data-ai-template="reveal_studio"].ai-opening > .ai-reveal-item { animation-name: ai-studio; }
[data-ai-template="reveal_afterhours"].ai-opening > .ai-reveal-item { animation-name: ai-dissolve; }
[data-ai-template="reveal_forum"].ai-opening > .ai-reveal-item { animation-name: ai-forum; }
[data-ai-template="reveal_assembly"].ai-opening > .ai-reveal-item { animation-name: ai-assembly; }

/* Vow: two halves part from the centre like soft curtains */
[data-ai-template="reveal_vow"] .ai-panel-a, [data-ai-template="reveal_vow"] .ai-panel-b { display: block; top: 0; bottom: 0; width: 50.5%; }
[data-ai-template="reveal_vow"] .ai-panel-a { left: 0; border-right: 1px solid var(--ai-line); }
[data-ai-template="reveal_vow"] .ai-panel-b { right: 0; border-left: 1px solid var(--ai-line); }
[data-ai-template="reveal_vow"].ai-opening .ai-panel-a { animation: ai-to-left var(--ai-duration) var(--ai-ease) both; }
[data-ai-template="reveal_vow"].ai-opening .ai-panel-b { animation: ai-to-right var(--ai-duration) var(--ai-ease) both; }

/* Chapter: the page opens vertically from the centre fold */
[data-ai-template="reveal_chapter"] .ai-panel-a, [data-ai-template="reveal_chapter"] .ai-panel-b { display: block; left: 0; right: 0; height: 50.5%; }
[data-ai-template="reveal_chapter"] .ai-panel-a { top: 0; border-bottom: 1px solid var(--ai-line); }
[data-ai-template="reveal_chapter"] .ai-panel-b { bottom: 0; border-top: 1px solid var(--ai-line); }
[data-ai-template="reveal_chapter"].ai-opening .ai-panel-a { animation: ai-to-top var(--ai-duration) var(--ai-ease) both; }
[data-ai-template="reveal_chapter"].ai-opening .ai-panel-b { animation: ai-to-bottom var(--ai-duration) var(--ai-ease) both; }

/* Studio: three notebook strips slide away in turn, alternating up and down */
[data-ai-template="reveal_studio"] .ai-panel-a, [data-ai-template="reveal_studio"] .ai-panel-b, [data-ai-template="reveal_studio"] .ai-panel-c { display: block; top: 0; bottom: 0; width: 33.6%; }
[data-ai-template="reveal_studio"] .ai-panel-a { left: 0; }
[data-ai-template="reveal_studio"] .ai-panel-b { left: 33.2%; border-inline: 1px solid var(--ai-line); }
[data-ai-template="reveal_studio"] .ai-panel-c { right: 0; }
[data-ai-template="reveal_studio"].ai-opening .ai-panel-a { animation: ai-to-top calc(var(--ai-duration) * .8) var(--ai-ease) both; }
[data-ai-template="reveal_studio"].ai-opening .ai-panel-b { animation: ai-to-bottom calc(var(--ai-duration) * .8) var(--ai-ease) calc(var(--ai-duration) * .1) both; }
[data-ai-template="reveal_studio"].ai-opening .ai-panel-c { animation: ai-to-top calc(var(--ai-duration) * .8) var(--ai-ease) calc(var(--ai-duration) * .2) both; }

/* Afterhours: a soft circular opening widens from the centre */
[data-ai-template="reveal_afterhours"] .ai-iris { display: block; left: 50%; top: 50%; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%; box-shadow: 0 0 0 300vmax var(--ai-paper); transform: scale(.02); }
[data-ai-template="reveal_afterhours"].ai-opening .ai-iris { animation: ai-iris var(--ai-duration) var(--ai-ease) both; }

/* Forum: fine lines draw outward, then the two panels lift away */
[data-ai-template="reveal_forum"] .ai-panel-a, [data-ai-template="reveal_forum"] .ai-panel-b { display: block; left: 0; right: 0; height: 50.5%; }
[data-ai-template="reveal_forum"] .ai-panel-a { top: 0; }
[data-ai-template="reveal_forum"] .ai-panel-b { bottom: 0; }
[data-ai-template="reveal_forum"] .ai-line { display: block; left: 0; right: 0; top: 50%; height: 1px; background: var(--ai-accent); transform: scaleX(0); z-index: 2; }
[data-ai-template="reveal_forum"].ai-opening .ai-line { animation: ai-line var(--ai-duration) ease both; }
[data-ai-template="reveal_forum"].ai-opening .ai-panel-a { animation: ai-forum-top var(--ai-duration) var(--ai-ease) both; }
[data-ai-template="reveal_forum"].ai-opening .ai-panel-b { animation: ai-forum-bottom var(--ai-duration) var(--ai-ease) both; }

/* Assembly: four gallery bands slide off to alternating sides */
[data-ai-template="reveal_assembly"] .ai-panel { display: block; left: 0; right: 0; height: 25.5%; border-bottom: 1px solid var(--ai-line); }
[data-ai-template="reveal_assembly"] .ai-panel-a { top: 0; }
[data-ai-template="reveal_assembly"] .ai-panel-b { top: 25%; }
[data-ai-template="reveal_assembly"] .ai-panel-c { top: 50%; }
[data-ai-template="reveal_assembly"] .ai-panel-d { top: 75%; }
[data-ai-template="reveal_assembly"].ai-opening .ai-panel-a { animation: ai-to-left calc(var(--ai-duration) * .8) var(--ai-ease) both; }
[data-ai-template="reveal_assembly"].ai-opening .ai-panel-b { animation: ai-to-right calc(var(--ai-duration) * .8) var(--ai-ease) calc(var(--ai-duration) * .07) both; }
[data-ai-template="reveal_assembly"].ai-opening .ai-panel-c { animation: ai-to-left calc(var(--ai-duration) * .8) var(--ai-ease) calc(var(--ai-duration) * .14) both; }
[data-ai-template="reveal_assembly"].ai-opening .ai-panel-d { animation: ai-to-right calc(var(--ai-duration) * .8) var(--ai-ease) calc(var(--ai-duration) * .2) both; }

@keyframes ai-to-left { to { transform: translateX(-101%); } }
@keyframes ai-to-right { to { transform: translateX(101%); } }
@keyframes ai-to-top { to { transform: translateY(-101%); } }
@keyframes ai-to-bottom { to { transform: translateY(101%); } }
@keyframes ai-iris { to { transform: scale(40); } }
@keyframes ai-line { 0% { transform: scaleX(0); opacity: 1; } 35% { transform: scaleX(1); opacity: 1; } 60%, 100% { transform: scaleX(1); opacity: 0; } }
@keyframes ai-forum-top { 0%, 35% { transform: none; } 100% { transform: translateY(-101%); } }
@keyframes ai-forum-bottom { 0%, 35% { transform: none; } 100% { transform: translateY(101%); } }

/* Template picker thumbnails (inside .event-template-art) */
.ai-template-card { padding: 0; }
.ai-template-card .event-template-art { display: block; padding: 0; background: #eeece5; }
.ai-template-card .event-template-art svg { position: absolute; inset: 0 0 18px; width: 100%; height: calc(100% - 18px); }
.ai-art-label { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 2px; font: 600 11px/1.2 Georgia, serif; text-align: center; background: rgba(255,255,255,.55); }
.ai-template-card[data-ai-style="reveal_vow"] .event-template-art { background: #f6f1e8; color: #433e37; }
.ai-template-card[data-ai-style="reveal_chapter"] .event-template-art { background: #eee3da; color: #493d39; }
.ai-template-card[data-ai-style="reveal_studio"] .event-template-art { background: #e8ede6; color: #2f4037; }
.ai-template-card[data-ai-style="reveal_afterhours"] .event-template-art { background: #29282e; color: #eee8e1; }
.ai-template-card[data-ai-style="reveal_afterhours"] .ai-art-label { background: rgba(0,0,0,.35); }
.ai-template-card[data-ai-style="reveal_forum"] .event-template-art { background: #e6e9ed; color: #283342; }
.ai-template-card[data-ai-style="reveal_assembly"] .event-template-art { background: #eeece5; color: #41443e; }
.ai-template-card.is-selected { outline: none; }
@media (prefers-reduced-motion: reduce) {
  .ai-invitation.ai-opening .ai-panel, .ai-invitation.ai-opening .ai-iris, .ai-invitation.ai-opening .ai-line { animation: none !important; }
}
/* Remove the standard photo-hero layout, not just the image itself. */
.ai-invitation .public-hero,
.ai-invitation .public-hero.has-cover {
  display: block; grid-template-columns: none; min-height: 0;
  height: auto; aspect-ratio: auto; background: none !important;
  padding: clamp(28px, 6vw, 64px);
}
.ai-invitation .public-hero::before,
.ai-invitation .public-hero::after { content: none !important; display: none !important; }
.ai-invitation .public-hero-copy {
  position: static; inset: auto; width: 100%; max-width: none;
  margin: 0; padding: 0; background: none !important;
}
.ai-invitation .public-hero-image { display: none !important; }

@keyframes ai-reveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ai-unfold { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes ai-page { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes ai-studio { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ai-dissolve { from { opacity: 0; } to { opacity: 1; } }
@keyframes ai-forum { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ai-assembly { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
