/* Components. NO LITERAL COLORS � only var(--color-*). */

/* ---------------- HEADER / NAV ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(6px);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
}

.nav .brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--color-primary);
  text-decoration: none;
}

.nav .brand small {
  font-family: var(--font-body);
  font-size: .7rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav ul a {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--color-text);
  font-size: .92rem;
  transition: background .2s var(--ease), color .2s var(--ease);
}

.nav ul a:hover,
.nav ul a.active {
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .nav .brand {
    min-width: 0;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

  .nav ul {
    flex-basis: 100%;
    width: 100%;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s var(--ease);
  }

  .nav ul li {
    width: 100%;
  }

  .nav ul a {
    width: 100%;
    padding: 10px 12px;
  }

  .nav.open ul {
    max-height: 600px;
    padding-bottom: 10px;
  }
}

/* ---------------- FOOTER ---------------- */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  padding: 24px 0;
  text-align: center;
  font-size: .9rem;
}

/* ---------------- BUTTONS ---------------- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .2s var(--ease);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: var(--color-on-primary);
  box-shadow: 0 6px 18px var(--color-shadow);
}

.btn-primary:hover {
  color: var(--color-on-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-ghost:hover {
  background: var(--color-surface-2);
}

.btn-danger {
  background: transparent;
  color: var(--color-danger);
  border-color: var(--color-danger);
}

/* ---------------- CARD ---------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card .card-body {
  padding: 18px;
}

.card .card-img {
  aspect-ratio: 4/3;
  width: 100%;
  object-fit: cover;
  background: var(--color-surface-2);
  transition: transform .4s var(--ease);
}

.card:hover .card-img {
  transform: scale(1.04);
}

.card .pill {
  display: inline-block;
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* ---------------- HERO ---------------- */
.hero {
  padding: 60px 0;
  text-align: center;
  background:
    radial-gradient(1200px 400px at 50% -10%, var(--color-surface-2), transparent 70%);
}

.hero .formula {
  display: inline-block;
  letter-spacing: .35em;
  font-size: .8rem;
  color: var(--color-primary);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero h1 {
  font-style: italic;
}

.hero h1 span {
  color: var(--color-primary);
  font-style: normal;
}

.hero .sub {
  color: var(--color-text-muted);
  max-width: 640px;
  margin: 6px auto 24px;
}

.home-hero {
  overflow: hidden;
}

.birthday-vibe-shell {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: linear-gradient(145deg, var(--color-surface-2), var(--color-surface));
  border-inline-end: 1px solid var(--color-border);
  padding: 12px;
}

.birthday-vibe-shell.vibe-celebrate {
  animation: vibe-bounce .9s var(--ease) 1;
}

@keyframes vibe-bounce {
  0% {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
  }

  45% {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
  }

  100% {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
  }
}

.birthday-vibe-copy {
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.birthday-vibe-copy h2 {
  margin: 0;
}

.birthday-vibe-copy p {
  margin: 0;
}

.birthday-vibe-actions {
  margin-top: 6px;
}

.birthday-vibe-swiper {
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.birthday-vibe-swiper .swiper-wrapper {
  align-items: stretch;
}

.birthday-vibe-swiper .vibe-slide {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.birthday-vibe-swiper .vibe-slide.vibe-slide-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
}

.birthday-vibe-swiper .vibe-slide img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  max-height: 420px;
  object-fit: cover;
}

.birthday-vibe-swiper .swiper-pagination {
  position: static;
  margin-top: 8px;
}

.birthday-vibe-swiper .swiper-pagination-bullet {
  opacity: .48;
  background: var(--color-text-muted);
}

.birthday-vibe-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--color-primary);
}

.home-active-card {
  margin: 22px auto 0;
  width: min(980px, 100%);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  text-align: left;
}

.home-active-media {
  min-height: 300px;
}

.home-active-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
}

.home-active-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-active-meta {
  margin: 0;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .74rem;
  color: var(--color-primary);
}

.home-countdown-label {
  margin: 10px 0 0;
  text-align: center;
}

.home-active-actions {
  margin-top: 8px;
  justify-content: center;
  width: 100%;
}

.home-active-actions .btn.hidden {
  display: none;
}

.floating-music-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  box-shadow: var(--shadow-md);
}

.floating-music-btn.hidden {
  display: none;
}

.home-music-hint {
  margin-top: 14px;
  min-height: 1.2em;
}

.home-hero.celebration-live {
  background:
    radial-gradient(1200px 440px at 50% -8%, var(--color-accent), var(--color-bg));
}

.home-active-actions .btn {
  min-width: 150px;
  flex: 1 1 150px;
  text-align: center;
}

.home-active-quote {
  margin: 6px 0 0;
  text-align: center;
  line-height: 1.5;
  min-height: 3em;
}

.home-hero.celebration-live .home-active-card {
  border-color: var(--color-primary);
  animation: home-celebrate 1.8s var(--ease) 1;
}

@keyframes home-celebrate {
  0% {
    transform: scale(1);
    box-shadow: var(--shadow-sm);
  }

  40% {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
  }

  100% {
    transform: scale(1);
    box-shadow: var(--shadow-md);
  }
}

.event-hero .event-status {
  margin: 8px auto 0;
  max-width: 680px;
  color: var(--color-primary);
  letter-spacing: .04em;
}

.event-birthday .event-hero {
  background:
    radial-gradient(1200px 440px at 50% -8%, var(--color-accent), var(--color-bg));
}

.celebration-section {
  padding-top: 10px;
}

.celebration-stage {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  padding: 24px;
}

.birthday-wish-card {
  position: relative;
  z-index: 2;
  max-width: 620px;
  text-align: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 18px;
}

.birthday-wish-card h3 {
  margin-bottom: 8px;
}

.birthday-wish-card .btn {
  margin-top: 8px;
}

.party-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-party-burst {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 80;
}

.page-party-burst.hidden {
  display: none;
}

.party-pop {
  position: absolute;
  bottom: -56px;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  line-height: 1;
  filter: drop-shadow(0 4px 10px var(--color-shadow));
  animation: party-rise 2.7s linear infinite;
}

.page-party-burst .party-pop {
  bottom: -72px;
  animation-name: page-party-rise;
  animation-duration: var(--party-duration, 3.2s);
  opacity: .55;
}

.party-pop:nth-child(1) {
  left: 8%;
  animation-delay: .1s;
}

.party-pop:nth-child(2) {
  left: 15%;
  animation-delay: .5s;
}

.party-pop:nth-child(3) {
  left: 23%;
  animation-delay: .2s;
}

.party-pop:nth-child(4) {
  left: 30%;
  animation-delay: .9s;
}

.party-pop:nth-child(5) {
  left: 38%;
  animation-delay: .4s;
}

.party-pop:nth-child(6) {
  left: 45%;
  animation-delay: 1.1s;
}

.party-pop:nth-child(7) {
  left: 52%;
  animation-delay: .3s;
}

.party-pop:nth-child(8) {
  left: 60%;
  animation-delay: .7s;
}

.party-pop:nth-child(9) {
  left: 68%;
  animation-delay: .6s;
}

.party-pop:nth-child(10) {
  left: 76%;
  animation-delay: 1s;
}

.party-pop:nth-child(11) {
  left: 84%;
  animation-delay: .2s;
}

.party-pop:nth-child(12) {
  left: 91%;
  animation-delay: .8s;
}

.party-pop:nth-child(13) {
  left: 11%;
  animation-delay: 1.4s;
}

.party-pop:nth-child(14) {
  left: 20%;
  animation-delay: 1.7s;
}

.party-pop:nth-child(15) {
  left: 35%;
  animation-delay: 1.5s;
}

.party-pop:nth-child(16) {
  left: 50%;
  animation-delay: 1.8s;
}

.party-pop:nth-child(17) {
  left: 64%;
  animation-delay: 1.3s;
}

.party-pop:nth-child(18) {
  left: 73%;
  animation-delay: 1.6s;
}

.party-pop:nth-child(19) {
  left: 87%;
  animation-delay: 1.2s;
}

.party-pop:nth-child(20) {
  left: 95%;
  animation-delay: 1.9s;
}

@keyframes party-rise {
  0% {
    transform: translateY(0) scale(.9);
    opacity: .9;
  }

  100% {
    transform: translateY(-340px) scale(1.15);
    opacity: 0;
  }
}

@keyframes page-party-rise {
  0% {
    transform: translateY(0) scale(.9);
    opacity: .95;
  }

  100% {
    transform: translateY(-120vh) scale(1.2);
    opacity: 0;
  }
}

/* ---------------- COUNTDOWN ---------------- */
.countdown {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.countdown .unit {
  min-width: 92px;
  padding: 14px 10px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.countdown .num {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--color-primary);
  line-height: 1;
}

.countdown .lbl {
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ---------------- LETTER ---------------- */
.letter {
  background: var(--color-surface-2);
  border: 1px dashed var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-text);
  position: relative;
}

.letter::before,
.letter::after {
  content: "\2764\FE0F";
  position: absolute;
  color: var(--color-primary);
  font-size: 1.4rem;
}

.letter::before {
  top: 10px;
  left: 16px;
}

.letter::after {
  bottom: 10px;
  right: 16px;
}

.letter .sig {
  text-align: right;
  color: var(--color-primary);
  margin-top: 18px;
  font-style: italic;
}

.wish-wall {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.wish-card {
  background: linear-gradient(160deg, var(--color-surface), var(--color-surface-2));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.wish-card .wish-message {
  margin: 0 0 10px;
  color: var(--color-text);
}

.wish-card .wish-author {
  margin: 0;
  color: var(--color-primary);
  font-weight: 500;
}

.wish-card .wish-author span {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ---------------- TIMELINE (Journey) ---------------- */
.timeline {
  position: relative;
  padding: 20px 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--color-border);
  transform: translateX(-50%);
}

.timeline .item {
  width: 50%;
  padding: 14px 28px;
  position: relative;
}

.timeline .item:nth-child(odd) {
  left: 0;
  text-align: right;
}

.timeline .item:nth-child(even) {
  left: 50%;
}

.timeline .item .dot {
  position: absolute;
  top: 22px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary);
}

.timeline .item:nth-child(odd) .dot {
  right: -7px;
}

.timeline .item:nth-child(even) .dot {
  left: -7px;
}

.timeline .item .when {
  font-size: .8rem;
  color: var(--color-primary);
  letter-spacing: .15em;
  text-transform: uppercase;
}

.timeline .item h3 {
  margin: 4px 0;
}

.timeline .item p {
  color: var(--color-text-muted);
  margin: 0;
}

@media (max-width: 720px) {
  .timeline::before {
    left: 12px;
  }

  .timeline .item,
  .timeline .item:nth-child(even) {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 36px;
    padding-right: 10px;
  }

  .timeline .item:nth-child(odd) {
    text-align: left;
  }

  .timeline .item .dot,
  .timeline .item:nth-child(odd) .dot,
  .timeline .item:nth-child(even) .dot {
    left: 5px;
    right: auto;
  }
}

/* ---------------- GALLERY ----------------
 * Deterministic CSS grid (not column-count): every tile reserves its space
 * via aspect-ratio BEFORE the image loads, so lazy-loaded photos can never
 * reflow on top of each other on mobile. */
.masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  align-items: start;
}

/* Loading / "no photos" message spans the whole grid instead of one cell. */
.masonry>p {
  grid-column: 1 / -1;
  margin: 0;
}

.masonry .tile {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  padding: 0;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: zoom-in;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.masonry .tile:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.masonry .tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}

.masonry .tile:hover img {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .masonry {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

@media (max-width: 560px) {
  .masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 360px) {
  .masonry {
    grid-template-columns: 1fr;
  }
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.lightbox.open {
  display: flex;
}

.lightbox .lb-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 96vw;
  max-height: 92vh;
}

.lightbox img {
  max-height: 92vh;
  max-width: 96vw;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox .lb-spinner {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  animation: lb-spin .8s linear infinite;
}

@keyframes lb-spin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox .close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------------- FORM ---------------- */
input,
select,
textarea,
button {
  max-width: 100%;
}

.form {
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}

.form label {
  font-size: .85rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 4px;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  padding: 12px 14px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 1rem;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-shadow);
}

.form .alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-danger);
  font-size: .9rem;
}

.wish-editor-list {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.wish-editor-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.journey-editor-list {
  display: grid;
  gap: 12px;
}

.journey-editor-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.admin-panel-page #eventForm {
  width: 100%;
  max-width: 720px !important;
}

/* gate page wrapper */
.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(800px 400px at 50% 20%, var(--color-surface-2), var(--color-bg) 70%);
  padding: 20px;
}

.gate .card {
  width: 100%;
  max-width: 420px;
  padding: 28px;
  text-align: center;
}

.gate h1 {
  color: var(--color-primary);
}

/* theme swatches in admin */
.theme-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.theme-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  background: var(--color-surface);
  transition: transform .15s var(--ease), border-color .15s var(--ease);
}

.theme-card.selected {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.theme-card .swatches {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.theme-card .sw {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
}

.theme-card .name {
  font-size: .9rem;
  color: var(--color-text);
}

/* moments grid */
.moments {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.moments figure {
  margin: 0;
}

.moments img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.moments figcaption {
  color: var(--color-text-muted);
  font-size: .85rem;
  margin-top: 6px;
  text-align: center;
}

/* admin list */
.event-list {
  display: grid;
  gap: 10px;
}

.event-list .row-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.event-list .row-card .meta {
  flex: 1;
}

.event-list .row-card .meta small {
  color: var(--color-text-muted);
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: .7rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.badge.success {
  color: var(--color-success);
}

.badge.muted {
  color: var(--color-text-muted);
}

/* ---------------- EMOJI HELPERS ---------------- */
.emoji-xl {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1;
  display: inline-block;
}

.card .card-img.card-img-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-2);
}

/* ---------------- RESPONSIVE EXTRAS ---------------- */
@media (max-width: 1200px) {
  .home-active-card {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .home-active-card {
    grid-template-columns: 1fr;
  }

  .birthday-vibe-shell {
    border-inline-end: 0;
    border-bottom: 1px solid var(--color-border);
    padding: 12px;
  }

  .home-active-media {
    min-height: 220px;
    max-height: 420px;
    overflow: hidden;
  }

  .birthday-vibe-swiper,
  .birthday-vibe-swiper .swiper-wrapper,
  .birthday-vibe-swiper .vibe-slide {
    max-height: 400px;
  }

  .birthday-vibe-swiper .vibe-slide.vibe-slide-empty {
    min-height: 220px;
  }

  .birthday-vibe-swiper .vibe-slide img {
    min-height: 220px;
    max-height: 400px;
  }
}

@media (max-width: 820px) {
  .home-active-actions {
    justify-content: flex-start;
  }

  .admin-panel-page .nav .spacer {
    display: none;
  }

  .admin-panel-page .nav .btn {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 14px;
  }

  .nav {
    gap: 10px;
    padding: 10px 0;
  }

  .nav .brand {
    font-size: 1.2rem;
    max-width: calc(100% - 52px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav ul {
    margin-top: 4px;
  }

  main {
    padding: 24px 0 60px;
  }

  .section {
    padding: 36px 0;
  }

  .section-head {
    margin-bottom: 28px;
  }

  .section-head .eyebrow {
    letter-spacing: .18em;
  }

  .hero {
    padding: 36px 0;
  }

  .hero .formula {
    letter-spacing: .24em;
    font-size: .74rem;
  }

  .hero .sub {
    margin-bottom: 18px;
  }

  .countdown {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-active-body {
    padding: 16px 14px;
    gap: 10px;
  }

  .birthday-vibe-shell {
    padding: 10px;
  }

  .birthday-vibe-swiper .vibe-slide.vibe-slide-empty,
  .birthday-vibe-swiper .vibe-slide img {
    min-height: 190px;
  }

  .wish-wall {
    grid-template-columns: 1fr;
  }

  .home-active-meta {
    letter-spacing: .1em;
  }

  .home-active-actions .btn {
    min-width: 0;
    width: 100%;
    flex: 1 1 auto;
  }

  .home-active-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .home-active-quote {
    min-height: 2.8em;
    font-size: .92rem;
  }

  .floating-music-btn {
    right: 10px;
    bottom: 10px;
    padding: 10px 14px;
    font-size: .86rem;
  }

  .page-party-burst .party-pop {
    opacity: .4;
  }

  .event-hero .event-status {
    letter-spacing: .02em;
  }

  .celebration-stage {
    min-height: 240px;
    padding: 14px;
  }

  .birthday-wish-card {
    padding: 14px 12px;
  }

  .letter {
    padding: 20px 18px;
    font-size: 1.02rem;
  }

  .countdown .unit {
    min-width: 0;
    width: 100%;
    padding: 10px 8px;
  }

  .countdown .lbl {
    letter-spacing: .14em;
  }

  .card .card-body {
    padding: 14px;
  }

  .event-list .row-card {
    flex-wrap: wrap;
  }

  .event-list .row-card .meta {
    flex-basis: 100%;
  }

  .event-list .row-card .btn {
    width: 100%;
  }

  .admin-panel-page .nav {
    align-items: stretch;
  }

  .admin-panel-page .nav .brand {
    max-width: 100%;
  }

  .admin-panel-page .nav .btn {
    width: 100%;
    margin-left: 0;
  }

  .admin-panel-page #eventForm .row {
    gap: 10px !important;
    align-items: stretch;
  }

  .admin-panel-page #eventForm .row>div,
  .admin-panel-page .wish-editor-card .row>div,
  .admin-panel-page .journey-editor-card .row>div {
    flex: 1 1 100%;
    min-width: 0 !important;
  }

  .admin-panel-page #eventForm .row label.row {
    flex: 1 1 100%;
    margin: 0;
  }

  .admin-panel-page #eventForm .row .btn,
  .admin-panel-page .event-list .row-card .btn,
  .admin-panel-page .journey-editor-list+.row .btn {
    width: 100%;
  }

  .admin-panel-page .event-list .row-card {
    align-items: stretch;
  }
}

@media (max-width: 360px) {
  .nav .brand {
    font-size: 1.08rem;
  }

  .hero .formula {
    letter-spacing: .18em;
  }

  .home-active-actions {
    gap: 8px;
  }

  .birthday-vibe-swiper .vibe-slide.vibe-slide-empty,
  .birthday-vibe-swiper .vibe-slide img {
    min-height: 170px;
  }

  .home-countdown-label {
    font-size: .88rem;
  }

  .party-pop {
    font-size: 1rem;
  }
}

/* Touch targets: ensure all buttons are at least 40px tall. */
.btn,
.nav-toggle,
.lightbox .close {
  min-height: 40px;
}

/* ============================================================
 *  MODERN POLISH (additive — colors via var(--color-*) only)
 * ============================================================ */

/* Gentle entrance for content injected/rendered on the page. */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card,
.wish-card,
.moments figure,
.timeline .item,
.home-active-card {
  /* "backwards" (not "both"): hides the element before it animates in, but
     does NOT pin the end transform afterwards — so the depth.js pointer tilt
     can take over the transform once the entrance finishes. */
  animation: fade-up .5s var(--ease) backwards;
}

/* Stagger the event/photo grids a touch so they cascade in. */
.grid > .card:nth-child(2),
.wish-wall > .wish-card:nth-child(2) { animation-delay: .05s; }
.grid > .card:nth-child(3),
.wish-wall > .wish-card:nth-child(3) { animation-delay: .1s; }
.grid > .card:nth-child(4),
.wish-wall > .wish-card:nth-child(4) { animation-delay: .15s; }
.grid > .card:nth-child(n+5) { animation-delay: .2s; }

/* Eyebrow as a soft pill for a more finished, modern header. */
.section-head .eyebrow {
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

/* Hero title sheen — the highlighted name picks up the accent gradient. */
.hero h1 span {
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Slightly richer card depth + image overlay on hover. */
.card {
  position: relative;
}

.card .card-img {
  position: relative;
}

.card:hover {
  border-color: var(--color-primary);
}

/* Countdown units: subtle gradient surface + lift, themed per event. */
.countdown .unit {
  background: linear-gradient(160deg, var(--color-surface), var(--color-surface-2));
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}

.countdown .unit:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

/* Buttons: pressed state for tactile feedback. */
.btn:active {
  transform: translateY(1px) scale(.99);
}

/* Brand mark gets a gentle hover lift. */
.nav .brand {
  transition: transform .2s var(--ease);
}

.nav .brand:hover {
  transform: translateY(-1px);
}

/* Smooth theme/colour transitions when an event imposes its vibe. */
body,
.site-header,
.card,
.countdown .unit,
.home-active-card {
  transition: background-color .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
}

/* Respect users who prefer less motion. */
@media (prefers-reduced-motion: reduce) {
  .card,
  .wish-card,
  .moments figure,
  .timeline .item,
  .home-active-card {
    animation: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
 *  DEPTH / 3D  (Tier A)
 *  Pointer-reactive tilt, a tracking glare, hero parallax layers
 *  and soft floating orbs. The hover/parallax motion is driven by
 *  depth.js (disabled on touch + prefers-reduced-motion); the orbs
 *  are pure CSS. Colours stay theme-token only.
 * ============================================================ */

/* ---- Tilt surfaces (cards, hero card, gallery tiles) ---- */
[data-tilt] {
  --tilt-rx: 0deg;
  --tilt-ry: 0deg;
  --tilt-lift: 0px;
  --tilt-mx: 50%;
  --tilt-my: 50%;
  position: relative;
  transform: perspective(900px) rotateX(var(--tilt-rx)) rotateY(var(--tilt-ry)) translateY(var(--tilt-lift));
  transform-style: preserve-3d;
}

/* Keep the live tilt transform on hover too — overrides the translateY-only
   :hover rules defined earlier for .card and .masonry .tile. */
.card[data-tilt]:hover,
.home-active-card[data-tilt]:hover,
.masonry .tile[data-tilt]:hover {
  transform: perspective(900px) rotateX(var(--tilt-rx)) rotateY(var(--tilt-ry)) translateY(var(--tilt-lift));
}

/* Snappy transform tracking + keep the smooth themed colour transitions. */
.card[data-tilt],
.home-active-card[data-tilt],
.masonry .tile[data-tilt] {
  transition: transform .12s var(--ease), box-shadow .3s var(--ease),
    background-color .4s var(--ease), border-color .4s var(--ease), color .4s var(--ease);
}

[data-tilt].is-tilting {
  --tilt-lift: -6px;
  box-shadow: var(--shadow-lg);
  z-index: 3; /* lift the hovered element above its neighbours while tilting */
  will-change: transform; /* only promote the one element under the pointer */
}

/* Glare that follows the pointer across the surface. */
[data-tilt]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at var(--tilt-mx) var(--tilt-my),
      color-mix(in srgb, var(--color-accent) 40%, transparent), transparent 55%);
  opacity: 0;
  mix-blend-mode: overlay;
  pointer-events: none;
  transition: opacity .3s var(--ease);
  z-index: 2;
}

[data-tilt].is-tilting::after {
  opacity: .9;
}

/* ---- Hero floating orbs (depth backdrop) ---- */
.home-hero {
  position: relative;
}

/* Lift the actual hero content above the decorative backdrops. */
.home-hero > *:not(.depth-orbs):not(.hero-aurora):not(.hero-ring) {
  position: relative;
  z-index: 1;
}

.depth-orbs {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.depth-orbs .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: .42;
  will-change: transform;
}

.depth-orbs .orb-1 {
  width: 320px;
  height: 320px;
  top: -70px;
  left: -50px;
  background: radial-gradient(circle, var(--color-primary), transparent 68%);
  animation: orb-drift-a 17s ease-in-out infinite;
}

.depth-orbs .orb-2 {
  width: 260px;
  height: 260px;
  top: 10px;
  right: -60px;
  background: radial-gradient(circle, var(--color-accent), transparent 68%);
  animation: orb-drift-b 21s ease-in-out infinite;
}

.depth-orbs .orb-3 {
  width: 230px;
  height: 230px;
  bottom: -80px;
  left: 32%;
  background: radial-gradient(circle, var(--color-link), transparent 70%);
  animation: orb-drift-c 24s ease-in-out infinite;
}

@keyframes orb-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(30px, 24px, 0); }
}

@keyframes orb-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(-26px, 18px, 0); }
}

@keyframes orb-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(18px, -22px, 0); }
}

/* Smaller orbs on phones so they stay subtle and never overpower content. */
@media (max-width: 560px) {
  .depth-orbs .orb { filter: blur(34px); opacity: .35; }
  .depth-orbs .orb-1 { width: 200px; height: 200px; }
  .depth-orbs .orb-2 { width: 170px; height: 170px; }
  .depth-orbs .orb-3 { width: 150px; height: 150px; }
}

/* ============================================================
 *  CINEMATIC REDESIGN LAYER (2026)
 *  Editorial type, glass surfaces, scroll choreography, atmosphere.
 *  Rules: colors via var(--color-*)/tokens only; everything below
 *  degrades gracefully without JS and under prefers-reduced-motion.
 * ============================================================ */

/* ---- Entrances are now owned by the scroll-reveal engine (motion.js),
       so the old load-time fade-up no longer applies. Content rendered
       without JS simply shows (no hidden states in CSS alone). ---- */
.card,
.wish-card,
.moments figure,
.timeline .item,
.home-active-card {
  animation: none;
}

/* ---- Scroll reveal system.
       motion.js tags elements with .rv (+ optional .rv-scale) and flips
       .rv-in when they enter the viewport. Hidden state lives behind
       :not(.rv-in) so revealed elements fall back to their natural
       styles (and their own hover transitions). ---- */
.rv:not(.rv-done) {
  transition: opacity .9s var(--ease-out), transform .9s var(--ease-out), filter .9s var(--ease-out);
}

.rv:not(.rv-in) {
  opacity: 0;
  transform: translateY(28px);
}

.rv.rv-scale:not(.rv-in) {
  transform: scale(.92) translateY(16px);
}

.timeline .item.rv:not(.rv-in) {
  transform: translateX(-44px);
}

.timeline .item:nth-child(even).rv:not(.rv-in) {
  transform: translateX(44px);
}

@media (max-width: 720px) {
  .timeline .item.rv:not(.rv-in),
  .timeline .item:nth-child(even).rv:not(.rv-in) {
    transform: translateY(28px);
  }
}

/* ---- Split-text hero title: motion.js wraps words in .w spans. ---- */
.split-ready .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(.55em);
  filter: blur(8px);
  animation: word-in .85s var(--ease-out) forwards;
  animation-delay: calc(var(--wi, 0) * 75ms);
}

@keyframes word-in {
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* ---- Page chrome injected by motion.js ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 300;
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

.page-veil {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: var(--color-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s var(--ease);
}

.page-veil.show {
  opacity: 1;
  pointer-events: auto;
}

.grain-veil {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

.cursor-halo {
  position: fixed;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 1.5px solid color-mix(in srgb, var(--color-primary) 70%, transparent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 220;
  opacity: 0;
  transition: width .25s var(--ease-out), height .25s var(--ease-out),
    margin .25s var(--ease-out), opacity .3s var(--ease), border-color .3s var(--ease);
}

.cursor-halo.on {
  opacity: .9;
}

.cursor-halo.lg {
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-color: color-mix(in srgb, var(--color-accent) 80%, transparent);
}

/* ---- Header: glass that condenses on scroll ---- */
.site-header {
  background: color-mix(in srgb, var(--color-surface) 55%, transparent);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: transparent;
  transition: background-color .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease);
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--color-surface) 85%, transparent);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-sm);
}

.nav .brand {
  align-items: center;
  gap: 10px;
}

.nav .brand .brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--color-on-primary);
  font-family: var(--font-body);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  flex: 0 0 auto;
  align-self: center;
  box-shadow: var(--shadow-sm);
}

.nav ul a {
  position: relative;
}

.nav ul a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 5px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: var(--grad-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .35s var(--ease-out);
}

.nav ul a:hover::after,
.nav ul a.active::after {
  transform: scaleX(1);
}

.nav ul a:hover {
  background: color-mix(in srgb, var(--color-surface-2) 55%, transparent);
}

@media (max-width: 820px) {
  .nav.open ul li {
    animation: menu-in .45s var(--ease-out) backwards;
  }

  .nav.open ul li:nth-child(1) { animation-delay: .03s; }
  .nav.open ul li:nth-child(2) { animation-delay: .07s; }
  .nav.open ul li:nth-child(3) { animation-delay: .11s; }
  .nav.open ul li:nth-child(4) { animation-delay: .15s; }
  .nav.open ul li:nth-child(5) { animation-delay: .19s; }
  .nav.open ul li:nth-child(n+6) { animation-delay: .23s; }
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* ---- Hero: cinematic editorial ---- */
.hero {
  position: relative;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 1.04;
  letter-spacing: -.01em;
}

.hero .sub {
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  max-width: 56ch;
}

.home-hero {
  padding: 84px 0 64px;
}

.hero-script {
  font-family: var(--font-script);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  color: var(--color-accent);
  margin: 0 0 4px;
  line-height: 1.2;
  text-shadow: 0 2px 18px var(--color-shadow);
}

.hero-script:empty {
  display: none;
}

.hero-aurora {
  position: absolute;
  inset: -18% -8%;
  z-index: 0;
  filter: blur(64px);
  pointer-events: none;
}

.hero-aurora .aur {
  position: absolute;
  border-radius: 50%;
  opacity: .5;
}

.hero-aurora .aur-1 {
  width: 58%;
  height: 72%;
  left: -4%;
  top: -12%;
  background: conic-gradient(from 0deg,
      transparent,
      color-mix(in srgb, var(--color-primary) 36%, transparent),
      transparent 62%);
  animation: aur-spin 26s linear infinite;
}

.hero-aurora .aur-2 {
  width: 54%;
  height: 66%;
  right: -6%;
  bottom: -16%;
  background: conic-gradient(from 180deg,
      transparent,
      color-mix(in srgb, var(--color-accent) 32%, transparent),
      transparent 58%);
  animation: aur-spin 34s linear infinite reverse;
}

@keyframes aur-spin {
  to {
    transform: rotate(360deg);
  }
}

.hero-ring {
  position: absolute;
  left: 50%;
  top: 38%;
  width: min(580px, 82vw);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--color-primary) 30%, transparent);
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  animation: ring-orbit 22s linear infinite;
}

.hero-ring::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px dashed color-mix(in srgb, var(--color-accent) 35%, transparent);
  border-radius: 50%;
}

.hero-ring::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grad-accent);
  box-shadow: 0 0 14px var(--color-primary);
}

@keyframes ring-orbit {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.hero-scrollcue {
  width: 26px;
  height: 42px;
  margin: 36px auto 0;
  border: 1.5px solid color-mix(in srgb, var(--color-text-muted) 60%, transparent);
  border-radius: 14px;
  position: relative;
}

.hero-scrollcue span {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 9px;
  margin-left: -1.5px;
  border-radius: var(--radius-pill);
  background: var(--color-primary);
  animation: cue-drop 1.7s var(--ease) infinite;
}

@keyframes cue-drop {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  70% {
    transform: translateY(14px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* ---- Marquee strip (built by motion.js from admin/tenant data) ---- */
.hero-marquee {
  overflow: hidden;
  border-block: 1px solid var(--glass-border);
  padding: 13px 0;
  background: color-mix(in srgb, var(--color-surface) 40%, transparent);
}

.hero-marquee:empty {
  display: none;
}

.hero-marquee .mq-track {
  display: inline-flex;
  white-space: nowrap;
  will-change: transform;
  animation: mq-scroll var(--mq-dur, 28s) linear infinite;
}

.hero-marquee:hover .mq-track {
  animation-play-state: paused;
}

.hero-marquee .mq-item {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 0 28px;
}

.hero-marquee .mq-item::after {
  content: "\2726";
  color: var(--color-primary);
  margin-left: 56px;
  font-style: normal;
}

@keyframes mq-scroll {
  to {
    transform: translateX(-50%);
  }
}

/* ---- Buttons: tactile, magnetic (vars set by motion.js), with sheen ---- */
.btn {
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--btn-lift, 0px)), 0);
  transition: transform .2s var(--ease-out), box-shadow .25s var(--ease),
    background-color .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

.btn:hover {
  --btn-lift: -2px;
}

/* Beat the legacy per-variant :hover transforms so the magnetic offset
   (set by motion.js via --mag-*) composes with the lift instead of snapping. */
.btn-primary:hover,
.btn-ghost:hover,
.btn-danger:hover {
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--btn-lift, 0px)), 0);
}

.btn:active {
  --btn-lift: 1px;
  transform: translate3d(var(--mag-x, 0px), calc(var(--mag-y, 0px) + var(--btn-lift, 0px)), 0) scale(.99);
}

.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -80%;
  width: 45%;
  transform: skewX(-20deg);
  background: linear-gradient(105deg,
      transparent,
      color-mix(in srgb, var(--color-on-primary) 38%, transparent),
      transparent);
  transition: left .65s var(--ease-out);
  pointer-events: none;
}

.btn-primary:hover::after {
  left: 125%;
}

.btn-ghost {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---- Cards: glass + gradient border ---- */
.card,
.home-active-card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.card::before,
.home-active-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--grad-accent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.home-active-card {
  position: relative;
}

.home-active-card::before {
  opacity: .5;
}

.card:hover::before {
  opacity: .65;
}

.card:hover .card-img {
  transform: scale(1.06) rotate(.4deg);
}

.card .pill {
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
}

/* ---- Countdown: glass units, gradient numerals, second pulse ---- */
.countdown .unit {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: var(--glass-border);
}

.countdown .num {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 600;
}

.countdown .unit.pulse .num {
  animation: num-pop .5s var(--ease-spring);
}

@keyframes num-pop {
  50% {
    transform: scale(1.16);
  }
}

/* ---- Timeline: gradient spine, glowing dots ---- */
.timeline::before {
  width: 2px;
  background: linear-gradient(180deg,
      transparent,
      var(--color-primary) 12%,
      var(--color-accent) 88%,
      transparent);
}

.timeline .item .dot {
  box-shadow: 0 0 0 2px var(--color-primary), 0 0 16px color-mix(in srgb, var(--color-primary) 70%, transparent);
}

.timeline .item.rv-in .dot {
  animation: dot-pop .6s var(--ease-spring);
}

@keyframes dot-pop {
  40% {
    transform: scale(1.5);
  }
}

.timeline .item .when {
  font-weight: 600;
}

.timeline .item h3 {
  font-size: 1.45rem;
}

/* ---- Gallery tiles: gradient veil + lifted hover ---- */
.masonry .tile {
  position: relative;
}

.masonry .tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg,
      transparent 55%,
      color-mix(in srgb, var(--color-primary) 42%, transparent));
  opacity: 0;
  transition: opacity .35s var(--ease);
  pointer-events: none;
  border-radius: inherit;
}

.masonry .tile:hover::before {
  opacity: 1;
}

.moments img {
  transition: transform .45s var(--ease-out), box-shadow .35s var(--ease);
}

.moments figure:hover img {
  transform: scale(1.04) rotate(-.5deg);
  box-shadow: var(--shadow-md);
}

/* ---- Lightbox: blurred backdrop + zoom-in ---- */
.lightbox {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lightbox.open img {
  animation: lb-in .35s var(--ease-out);
}

@keyframes lb-in {
  from {
    transform: scale(.94);
    opacity: .3;
  }
}

/* ---- Letter: keepsake paper with drop cap + script signature ---- */
.letter {
  background: linear-gradient(165deg,
      var(--color-surface-2),
      color-mix(in srgb, var(--color-surface) 80%, transparent));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

.letter > p::first-letter {
  font-size: 2.6em;
  float: left;
  line-height: .86;
  padding-right: .1em;
  color: var(--color-primary);
  font-style: italic;
}

.letter .sig {
  font-family: var(--font-script);
  font-size: 1.8rem;
  font-style: normal;
}

/* ---- Wish wall: scattered keepsake notes ---- */
.wish-wall .wish-card {
  position: relative;
  transform: rotate(var(--rot, 0deg));
  transition: transform .35s var(--ease-out), box-shadow .3s var(--ease);
}

.wish-wall .wish-card:nth-child(odd) {
  --rot: -1.1deg;
}

.wish-wall .wish-card:nth-child(3n) {
  --rot: 1.2deg;
}

.wish-wall .wish-card:hover {
  --rot: 0deg;
  transform: rotate(0deg) translateY(-4px);
  box-shadow: var(--shadow-md);
}

.wish-card::before {
  content: "\201C";
  position: absolute;
  top: -6px;
  right: 10px;
  font-family: var(--font-display);
  font-size: 4.2rem;
  line-height: 1;
  color: color-mix(in srgb, var(--color-primary) 18%, transparent);
  pointer-events: none;
}

/* ---- Passkey gate: glass card over drifting orbs ---- */
.gate {
  position: relative;
  overflow: hidden;
}

.gate::before,
.gate::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(52px);
  opacity: .45;
  pointer-events: none;
}

.gate::before {
  width: 360px;
  height: 360px;
  top: -90px;
  left: -70px;
  background: radial-gradient(circle, var(--color-primary), transparent 68%);
  animation: orb-drift-a 18s ease-in-out infinite;
}

.gate::after {
  width: 300px;
  height: 300px;
  bottom: -80px;
  right: -60px;
  background: radial-gradient(circle, var(--color-accent), transparent 68%);
  animation: orb-drift-b 23s ease-in-out infinite;
}

.gate .card {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
}

.gate h1 {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Footer: gradient hairline + monogram + heartbeat ---- */
.site-footer {
  position: relative;
  padding: 36px 0;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--grad-accent);
  opacity: .6;
}

.site-footer .footer-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--glass-border);
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: .08em;
}

.site-footer .heart {
  display: inline-block;
  animation: heart-beat 1.6s ease-in-out infinite;
}

@keyframes heart-beat {
  0%, 100% {
    transform: scale(1);
  }

  12% {
    transform: scale(1.22);
  }

  24% {
    transform: scale(1);
  }
}

/* ---- Mobile + motion safety ---- */
@media (max-width: 720px) {
  .hero-aurora .aur {
    animation: none;
  }

  .hero-ring {
    display: none;
  }

  .home-hero {
    padding: 56px 0 44px;
  }
}

@media (max-width: 560px) {
  .hero-scrollcue {
    display: none;
  }

  .hero-marquee .mq-item {
    font-size: .9rem;
    padding: 0 18px;
  }

  .hero-marquee .mq-item::after {
    margin-left: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rv:not(.rv-in) {
    opacity: 1 !important;
    transform: none !important;
  }

  .split-ready .w {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none;
  }

  .hero-aurora .aur,
  .hero-ring,
  .hero-marquee .mq-track,
  .hero-scrollcue span,
  .site-footer .heart,
  .gate::before,
  .gate::after {
    animation: none !important;
  }
}

/* ============================================================
 *  INVITE CURTAIN — the wax-seal + scratch entrance (envelope.js)
 *  Sits above everything; colours are theme-token only. The <canvas>
 *  coating paints its own gradient from the same tokens in JS.
 * ============================================================ */
.invite-curtain {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 5vh, 40px);
  padding: 24px;
  background:
    radial-gradient(120% 90% at 50% 12%, var(--color-surface-2), transparent 60%),
    var(--color-bg);
  opacity: 0;
  /* Click-through until JS marks it ready, so a failed/blocked envelope.js
     can never leave an invisible layer trapping the page. */
  pointer-events: none;
  transition: opacity .7s var(--ease-out);
}

.invite-curtain.is-ready {
  opacity: 1;
  pointer-events: auto;
}

.invite-curtain.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.invite-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(86vw, 380px);
}

/* The two stages share the cell so they cross-fade in place. */
.invite-envelope,
.invite-reveal {
  grid-area: 1 / 1;
  width: 100%;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}

/* ---- Stage 1: the envelope ---- */
.invite-envelope {
  position: relative;
  aspect-ratio: 7 / 5;
  perspective: 900px;
  animation: invite-float 5.5s var(--ease) infinite;
}

.env-pocket {
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

/* Lower "pocket" triangle — the classic envelope front fold. */
.env-front {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, var(--color-surface-2), var(--color-surface));
  clip-path: polygon(0 100%, 100% 100%, 50% 32%);
  z-index: 2;
}

/* Top flap that lifts open. */
.env-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 72%;
  background: linear-gradient(200deg, var(--color-surface-2), var(--color-surface));
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform var(--dur-med) var(--ease-out), opacity var(--dur-med) var(--ease-out);
  z-index: 3;
  box-shadow: 0 6px 16px var(--color-shadow);
}

.wax-seal {
  position: absolute;
  top: 44%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(70px, 22%, 92px);
  aspect-ratio: 1;
  border: none;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--color-on-primary);
  box-shadow: 0 8px 22px var(--color-shadow), inset 0 0 0 3px color-mix(in srgb, var(--color-on-primary) 35%, transparent);
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 4;
  animation: invite-pulse 2.4s var(--ease) infinite;
  transition: transform var(--dur-fast) var(--ease-spring), opacity var(--dur-fast) var(--ease);
}

.wax-seal:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.wax-seal-initials {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 5vw, 1.4rem);
  letter-spacing: .02em;
}

.invite-taphint {
  color: var(--color-text-muted);
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  text-align: center;
  transition: opacity var(--dur-fast) var(--ease);
}

/* Opening: flap swings up, seal pops away. */
.invite-curtain.is-opening .env-flap {
  transform: rotateX(-165deg);
  opacity: .85;
}

.invite-curtain.is-opening .wax-seal {
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  pointer-events: none;
}

.invite-curtain.is-opening .invite-taphint {
  opacity: 0;
}

/* ---- Stage swap ---- */
.invite-reveal {
  opacity: 0;
  transform: translateY(14px) scale(.96);
  pointer-events: none;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 5vw, 30px);
  text-align: center;
}

.invite-curtain.stage-cards .invite-envelope {
  opacity: 0;
  transform: scale(1.08);
  pointer-events: none;
}

.invite-curtain.stage-cards .invite-reveal {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.env-eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  color: var(--color-primary);
  margin: 0 0 2px;
}

.reveal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.3rem, 6vw, 1.8rem);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 18px;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Scratch deck ---- */
.scratch-deck {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.scratch-card {
  position: relative;
  aspect-ratio: 3 / 3.4;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.sc-answer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 7vw, 2rem);
  color: var(--color-primary);
  line-height: 1;
  text-align: center;
}

.sc-coat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  transition: opacity var(--dur-fast) var(--ease);
}

.scratch-card.is-revealed .sc-coat {
  opacity: 0;
  pointer-events: none;
}

.scratch-card.is-revealed {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.scratch-hint {
  color: var(--color-text-muted);
  font-size: .86rem;
  margin: 0 0 14px;
  transition: opacity var(--dur-fast) var(--ease);
}

.scratch-hint.is-hidden {
  display: none;
}

/* Continue only appears once every tile is cleared. */
.env-continue {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-out), transform var(--dur-med) var(--ease-out);
}

.invite-curtain.all-scratched .env-continue {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@keyframes invite-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes invite-pulse {
  0%, 100% { box-shadow: 0 8px 22px var(--color-shadow), inset 0 0 0 3px color-mix(in srgb, var(--color-on-primary) 35%, transparent); }
  50% { box-shadow: 0 8px 30px var(--color-shadow), inset 0 0 0 3px color-mix(in srgb, var(--color-on-primary) 55%, transparent); }
}

@media (max-width: 360px) {
  .scratch-deck { gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .invite-envelope { animation: none; }
  .wax-seal { animation: none; }
}

/* ============================================================
 *  AMBIENT PETALS + BACK-TO-TOP  (injected by motion.js)
 *  Both are additive chrome: motion.js only runs when motion is
 *  allowed and never on /admin, so these never appear there.
 * ============================================================ */
.petal-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.to-top {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  color: var(--color-primary);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(14px) scale(.9);
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) var(--ease);
}

.to-top.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.to-top:hover {
  background: var(--color-surface);
  color: var(--color-primary-hover);
}

/* Visible, on-brand keyboard focus rings for the new interactive controls
   (ui-ux-pro-max: focus-states / High). outline-offset keeps each element's
   own box-shadow intact, and the colour stays theme-token only. */
.rsvp-choice:focus-visible,
.rsvp-submit:focus-visible,
.env-continue:focus-visible,
.to-top:focus-visible,
.wax-seal:focus-visible,
.sc-coat:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}

/* ============================================================
 *  RSVP  (rsvp.js) — admin-toggled guest form
 * ============================================================ */
.rsvp-card {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(20px, 5vw, 34px);
}

.rsvp-attend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rsvp-choice {
  padding: 13px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}

.rsvp-choice:hover {
  border-color: var(--color-primary);
}

.rsvp-choice.is-active {
  background: var(--grad-accent);
  color: var(--color-on-primary);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

.rsvp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.rsvp-field > span {
  font-size: .82rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: .02em;
}

.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .95rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.rsvp-field textarea {
  resize: vertical;
  min-height: 64px;
}

.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 22%, transparent);
}

.rsvp-when-yes {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Declining hides the headcount + preferences. */
.rsvp-declining .rsvp-when-yes {
  display: none;
}

.rsvp-submit {
  align-self: center;
  min-width: 180px;
}

.rsvp-status {
  text-align: center;
  margin: 0;
  min-height: 1.1em;
}

.rsvp-thanks {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 5vw, 1.7rem);
  color: var(--color-primary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: clamp(26px, 6vw, 40px);
}

/* Admin roster rows (panel.html) */
.rsvp-row {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.rsvp-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.rsvp-row-body {
  margin-top: 8px;
  font-size: .88rem;
  color: var(--color-text-muted);
  display: grid;
  gap: 3px;
}

.rsvp-badge {
  font-size: .74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.rsvp-badge.yes {
  background: color-mix(in srgb, var(--color-success) 18%, transparent);
  color: var(--color-success);
}

.rsvp-badge.no {
  background: color-mix(in srgb, var(--color-danger) 16%, transparent);
  color: var(--color-danger);
}

/* ============================================================
 *  WISH CAROUSEL (wishes.js) — 3D wishes deck with word blur-in
 * ============================================================ */
.wish-carousel {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  outline: none;
}

.wish-stage {
  position: relative;
  height: clamp(280px, 46vw, 340px);
  perspective: 1300px;
  transform-style: preserve-3d;
}

.wish-card3d {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(460px, 86%);
  /* transform (incl. centring) is set per-card by JS */
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: clamp(22px, 5vw, 34px);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  will-change: transform, opacity;
  transition: transform .75s var(--ease-out), opacity .6s var(--ease-out);
}

.wish-card3d.is-active {
  border-color: color-mix(in srgb, var(--color-primary) 35%, var(--glass-border));
}

.wc-avatar {
  width: 56px;
  height: 56px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--color-on-primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.wc-msg {
  margin: 0;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 3.4vw, 1.35rem);
  line-height: 1.55;
  color: var(--color-text);
}

.wc-word {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(6px);
}

.wc-msg.wc-shown .wc-word {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition: opacity .24s var(--ease-out), filter .24s var(--ease-out), transform .24s var(--ease-out);
  transition-delay: calc(var(--wi) * 28ms);
}

.wc-meta {
  margin: 0;
  font-size: .9rem;
  color: var(--color-text-muted);
}

.wc-meta span {
  opacity: .8;
}

.wish-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.wish-arrow {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--color-primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-spring);
}

.wish-arrow:hover {
  background: var(--color-surface);
  transform: scale(1.08);
}

.wish-arrow:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}

.wish-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wish-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-muted) 40%, transparent);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.wish-dot.on {
  background: var(--color-primary);
  transform: scale(1.35);
}

.wish-dot:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 2px;
}

/* ============================================================
 *  PHOTO FAN (photofan.js) — splayed featured photos
 * ============================================================ */
.photo-fan {
  position: relative;
  height: clamp(300px, 50vw, 440px);
  max-width: 920px;
  margin: 0 auto 26px;
}

.fan-track {
  position: absolute;
  inset: 0;
}

.fan-card {
  position: absolute;
  left: 50%;
  top: 52%;
  width: clamp(150px, 30vw, 220px);
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 3px solid var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-md);
  transform: translate(-50%, -50%);
  transform-origin: center bottom;
  transition: transform .55s var(--ease-out), box-shadow var(--dur-fast) var(--ease);
  will-change: transform;
}

.fan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.fan-card.is-active {
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--color-primary) 30%, var(--color-surface));
}

.fan-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}

.fan-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  display: flex;
  justify-content: center;
  gap: 18px;
  z-index: 250;
}

.fan-arrow {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--color-primary);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease-spring);
}

.fan-arrow:hover {
  background: var(--color-surface);
  transform: scale(1.08);
}

.fan-arrow:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--color-primary) 55%, transparent);
  outline-offset: 3px;
}

/* ============================================================
 *  INK REVEAL (inkreveal.js) — brush away ink to uncover a photo
 * ============================================================ */
.ink-reveal {
  position: relative;
  max-width: 560px;
  margin: 0 auto 26px;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
}

.ink-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ink-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  transition: opacity .6s var(--ease-out);
}

.ink-canvas.ink-done {
  opacity: 0;
  pointer-events: none;
}

.ink-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  color: var(--color-text);
  font-family: var(--font-script);
  font-size: 1.15rem;
  pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease);
}

.ink-reveal.ink-touched .ink-hint {
  opacity: 0;
}

/* ============================================================
 *  CASCADE TEXT (motion.js) — per-letter hover rise on nav + eyebrows
 * ============================================================ */
.cascade .cz {
  display: inline-block;
  will-change: transform;
  transition: transform .28s var(--ease-out), color .28s var(--ease);
  transition-delay: calc(var(--ci) * 24ms);
}

.cascade:hover .cz,
.cascade:focus-visible .cz {
  transform: translateY(-0.16em);
  color: var(--color-primary);
}

/* ============================================================
 *  EVENT EXPERIENCES — invitation, birthday, showcase, contact
 *  (per-type renderers in eventview-*.js). Tokens only.
 * ============================================================ */

/* ---- Shared: empty / not-found ---- */
.event-empty { padding: clamp(3rem, 10vh, 7rem) 0; }

/* ---- Wedding Invitation ---- */
.invite-page-hero { position: relative; text-align: center; overflow: hidden; }
.invite-hero-monogram {
  width: clamp(74px, 14vw, 116px);
  height: clamp(74px, 14vw, 116px);
  margin: 0 auto 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-md);
  border: 2px solid color-mix(in srgb, var(--color-on-primary) 55%, transparent);
}
.invite-hero-monogram span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: .04em;
}
.invite-hero-occasion {
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  color: var(--color-primary);
  margin-top: .25rem;
}
.invite-hero-date {
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-top: .35rem;
}

.story-spread .story-body {
  max-width: 64ch;
  margin: 0 auto;
  text-align: center;
  line-height: 1.85;
  color: var(--color-text);
}
.story-spread .story-body p + p { margin-top: 1rem; }
.story-ink { margin-top: 1.6rem; }

/* Function itinerary */
.itinerary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(.9rem, 2vw, 1.4rem);
}
.func-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.3rem 1.3rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out);
}
.func-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.func-emoji {
  display: inline-grid;
  place-items: center;
  width: 56px; height: 56px;
  margin-bottom: .5rem;
  font-size: 1.7rem;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--color-border);
}
.func-name { font-family: var(--font-display); font-size: 1.3rem; margin: .1rem 0 .35rem; }
.func-when { font-weight: 600; color: var(--color-primary); margin-bottom: .25rem; }
.func-venue { font-weight: 500; }
.func-addr { font-size: .88rem; margin-top: .1rem; }
.func-dress { font-size: .86rem; margin-top: .5rem; }
.func-dress span { color: var(--color-text-muted); }
.func-note { font-size: .9rem; font-style: italic; margin-top: .45rem; color: var(--color-text-muted); }
.func-map {
  display: inline-block;
  margin-top: .9rem;
  padding: .45rem 1rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.func-map:hover { background: color-mix(in srgb, var(--color-primary) 22%, transparent); }
.func-map::before { content: "📍 "; }

/* Families / blessings */
.families {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 3vw, 2.4rem);
  max-width: 760px;
  margin: 0 auto;
}
.family-side {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.4rem;
  text-align: center;
}
.family-side h3 {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--color-primary);
  margin-bottom: .8rem;
}
.family-side ul { list-style: none; margin: 0; padding: 0; }
.family-side li { padding: .35rem 0; border-bottom: 1px dashed var(--color-border); }
.family-side li:last-child { border-bottom: 0; }
.fam-name { display: block; font-weight: 600; }
.fam-rel { display: block; font-size: .82rem; }

@media (max-width: 560px) {
  .families { grid-template-columns: 1fr; }
}

/* ---- Birthday ---- */
.bday-hero { position: relative; text-align: center; overflow: hidden; }
.bday-date {
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: .4rem 0 1rem;
}
.bday-confetti-btn { margin-top: .4rem; }

.bday-cake-section { text-align: center; }
.bday-cake {
  width: 160px;
  margin: .5rem auto 1.4rem;
  position: relative;
}
.cake-flames { display: flex; justify-content: center; gap: 26px; margin-bottom: 4px; }
.cake-flames span {
  width: 10px; height: 18px;
  background: radial-gradient(circle at 50% 70%, var(--color-accent), color-mix(in srgb, var(--color-danger) 60%, transparent));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  transform-origin: 50% 100%;
  animation: cake-flicker 1.1s var(--ease) infinite alternate;
}
.cake-flames span:nth-child(2) { animation-delay: .25s; }
.cake-flames span:nth-child(3) { animation-delay: .5s; }
.cake-top, .cake-mid, .cake-base {
  margin: 0 auto;
  border-radius: var(--radius-md);
  background: var(--grad-accent);
  border: 1px solid color-mix(in srgb, var(--color-shadow) 18%, transparent);
}
.cake-top { width: 70%; height: 18px; }
.cake-mid { width: 88%; height: 30px; margin-top: 4px; background: var(--color-surface-2); }
.cake-base { width: 100%; height: 40px; margin-top: 4px; }
.bday-cake.cake-blown .cake-flames span {
  animation: none;
  opacity: 0;
  transform: scaleY(.2);
  transition: opacity var(--dur-med) var(--ease), transform var(--dur-med) var(--ease);
}
.cake-message {
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 3.6vw, 1.9rem);
  color: var(--color-primary);
  margin-top: .6rem;
}
@keyframes cake-flicker {
  from { transform: scaleY(1) rotate(-3deg); opacity: .85; }
  to   { transform: scaleY(1.18) rotate(3deg); opacity: 1; }
}

/* ---- Showcase grid ---- */
.showcase-card { display: block; cursor: pointer; text-decoration: none; color: inherit; }
.showcase-card .show-open {
  display: inline-block;
  margin-top: .2rem;
  color: var(--color-primary);
  font-weight: 600;
  font-size: .85rem;
}

/* ---- Contact / buy-this-site band ---- */
.contact-band {
  text-align: center;
  background: var(--grad-soft);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.contact-price {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--color-primary);
  margin: .4rem 0 .2rem;
}
.contact-price small {
  display: block;
  font-family: var(--font-body);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  justify-content: center;
  margin-top: 1.1rem;
}
.contact-note { margin-top: 1rem; color: var(--color-text-muted); font-size: .92rem; }

@media (prefers-reduced-motion: reduce) {
  .cake-flames span { animation: none; }
  .func-card:hover { transform: none; }
}
