:root {
  --wine: #730e17;
  --wine-deep: #43070c;
  --wine-mid: #8c1822;
  --ribbon: #bd2430;
  --blue: #c8ddea;
  --blue-soft: #dcebf2;
  --ivory: #f7f1e3;
  --stage-width: min(100%, 520px);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--wine-deep);
}

body {
  margin: 0;
  color: var(--wine);
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.experience {
  position: relative;
  width: var(--stage-width);
  height: 100svh;
  min-height: 520px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--blue);
  box-shadow: 0 0 86px rgba(20, 0, 4, 0.48);
  perspective: 1200px;
}

.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  backface-visibility: hidden;
}

.stage {
  z-index: 3;
  background: var(--blue);
  transform: translateX(0) rotateY(0deg) scale(1);
  transform-origin: left center;
  transition: transform 0.95s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.65s ease;
}

.stage.is-card-leaving {
  transform: translateX(-104%) rotateY(10deg) scale(0.96);
  opacity: 0.55;
  pointer-events: none;
}

.invitation-reveal,
.curtain,
.name-gate {
  position: absolute;
  inset: 0;
}

.invitation-reveal {
  background: var(--blue);
}

.invitation-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  user-select: none;
  -webkit-user-drag: none;
}

.curtain {
  z-index: 7;
}

.curtain-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  overflow: hidden;
  will-change: transform;
  transition: transform 1.55s cubic-bezier(0.72, 0, 0.17, 1);
}

.curtain-panel img {
  position: absolute;
  top: 0;
  width: 200%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.curtain-panel--left {
  left: 0;
}

.curtain-panel--left img {
  left: 0;
}

.curtain-panel--right {
  right: 0;
}

.curtain-panel--right img {
  right: 0;
}

.curtain.is-open .curtain-panel--left {
  transform: translateX(-104%);
}

.curtain.is-open .curtain-panel--right {
  transform: translateX(104%);
}

.curtain.is-open {
  pointer-events: none;
}

.ribbon-handle {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 57%;
  width: 100%;
  height: min(48vh, 350px);
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.ribbon-handle:focus-visible,
.card-trigger:focus-visible,
.name-card__button:focus-visible,
.name-card input:focus-visible,
.back-button:focus-visible,
.page-trigger:focus-visible,
.toast-button:focus-visible,
.music-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 4px;
}

.ribbon-band {
  position: absolute;
  top: 43%;
  width: 51%;
  height: 10px;
  background: linear-gradient(180deg, #c82a36, #92131d);
  box-shadow: 0 2px 0 rgba(50, 1, 7, 0.2);
  transform: translateX(0) scaleX(1);
  opacity: 1;
}

.ribbon-band--left {
  left: 0;
}

.ribbon-band--right {
  right: 0;
}

.continuous-bow {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 43%;
  width: min(74vw, 305px);
  overflow: visible;
  pointer-events: none;
  transform: translate3d(-50%, -36.9%, 0);
  transform-origin: 50% 37%;
  will-change: transform, opacity;
}

.continuous-bow use {
  fill: none;
  stroke-linecap: butt;
  stroke-linejoin: round;
}

.continuous-bow__shadow {
  stroke: rgba(50, 1, 7, 0.3);
  stroke-width: 36;
  transform: translateY(4px);
}

.continuous-bow__ribbon {
  stroke: url(#ribbonVelvet);
  stroke-width: 30;
  filter: url(#ribbonBrush);
}

.continuous-bow__highlight {
  stroke: rgba(255, 166, 172, 0.28);
  stroke-width: 3;
  transform: translate(-1px, -3px);
}

.ribbon-handle__hint {
  position: absolute;
  left: 50%;
  top: calc(43% + min(23vh, 158px));
  color: rgba(200, 221, 234, 0.9);
  font-size: 0.54rem;
  letter-spacing: 0.3em;
  transform: translateX(-50%);
  animation: hint-breathe 2.2s ease-in-out infinite;
}

.curtain.is-untying .ribbon-band--left {
  animation: left-band-follow 1.42s cubic-bezier(0.42, 0, 0.2, 1) 1.72s forwards;
}

.curtain.is-untying .ribbon-band--right {
  animation: right-band-follow 1.3s cubic-bezier(0.42, 0, 0.2, 1) 1.84s forwards;
}

.curtain.is-untying .continuous-bow {
  animation: continuous-ribbon-exit 0.95s cubic-bezier(0.55, 0, 0.22, 1) 2.18s forwards;
}

.curtain.is-untying .ribbon-handle__hint {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.curtain.is-open .ribbon-handle {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}

@keyframes continuous-ribbon-exit {
  0% {
    opacity: 1;
    transform: translate3d(-50%, -36.9%, 0) rotate(0deg);
  }
  42% {
    opacity: 1;
    transform: translate3d(-18%, -39%, 0) rotate(-1deg);
  }
  78% {
    opacity: 1;
    transform: translate3d(78%, -34%, 0) rotate(2deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(165%, -38%, 0) rotate(3deg);
  }
}

@keyframes left-band-follow {
  0%, 10% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
  }
  72% {
    opacity: 1;
    transform: translateX(170%) scaleX(1.2);
  }
  100% {
    opacity: 0;
    transform: translateX(245%) scaleX(1.38);
  }
}

@keyframes right-band-follow {
  0%, 10% {
    opacity: 1;
    transform: translateX(0) scaleX(1);
  }
  72% {
    opacity: 1;
    transform: translateX(105%) scaleX(1.18);
  }
  100% {
    opacity: 0;
    transform: translateX(145%) scaleX(1.3);
  }
}

@keyframes hint-breathe {
  50% { opacity: 0.42; transform: translateX(-50%) translateY(3px); }
}

.name-gate {
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(76, 8, 14, 0.44);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.65s ease;
}

.name-gate[hidden] {
  display: none;
}

.name-gate.is-active {
  opacity: 1;
  pointer-events: auto;
}

.name-card {
  position: relative;
  width: min(86vw, 410px);
  padding: 44px 30px 34px;
  color: var(--wine);
  border: 1px solid var(--wine);
  background: rgba(220, 235, 242, 0.97);
  box-shadow: 0 0 0 5px rgba(220, 235, 242, 0.96), 0 0 0 6px rgba(115, 14, 23, 0.62), 0 24px 70px rgba(43, 2, 8, 0.42);
  text-align: center;
}

.name-card::before,
.name-card::after {
  content: "✦";
  position: absolute;
  top: 16px;
  color: var(--wine);
  font-size: 0.62rem;
}

.name-card::before { left: 18px; }
.name-card::after { right: 18px; }

.name-card__kicker {
  margin: 0 0 22px;
  font-size: 0.57rem;
  letter-spacing: 0.23em;
}

.name-card label {
  display: block;
  max-width: 290px;
  margin: 0 auto;
  font-size: clamp(1.5rem, 7vw, 2.25rem);
  line-height: 1.08;
}

.name-card__star {
  display: block;
  margin: 20px auto 14px;
  font-size: 0.72rem;
}

.name-card input {
  display: block;
  width: 100%;
  padding: 12px 6px 10px;
  border: 0;
  border-bottom: 1px solid rgba(115, 14, 23, 0.62);
  border-radius: 0;
  color: var(--wine);
  background: transparent;
  font-family: "Snell Roundhand", "Brush Script MT", "STKaiti", cursive;
  font-size: clamp(1.75rem, 8vw, 2.55rem);
  text-align: center;
}

.name-card input::placeholder {
  color: rgba(115, 14, 23, 0.42);
}

.name-card__note {
  margin: 13px 0 22px;
  font-size: 0.48rem;
  letter-spacing: 0.13em;
}

.name-card__button {
  padding: 10px 18px;
  border: 1px solid var(--wine);
  border-radius: 999px;
  color: var(--blue-soft);
  background: var(--wine);
  font-size: 0.55rem;
  letter-spacing: 0.17em;
}

.name-card.is-shaking {
  animation: name-shake 0.34s ease;
}

@keyframes name-shake {
  25% { transform: translateX(-7px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}

.card-trigger {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px;
  min-width: 154px;
  padding: 10px 18px 10px 12px;
  border: 1px solid rgba(247, 241, 227, 0.75);
  border-radius: 999px;
  color: var(--ivory);
  background: rgba(103, 10, 17, 0.88);
  backdrop-filter: blur(8px);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.stage.is-revealed.is-personalized .card-trigger {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.card-trigger__halo {
  position: absolute;
  left: 22px;
  top: 50%;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(200, 221, 234, 0.55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: wish-pulse 2.2s ease-out infinite;
}

.card-trigger__star {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--wine);
  border-radius: 50%;
  background: var(--blue);
}

@keyframes wish-pulse {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  35% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}

.quote-screen,
.info-screen {
  color: var(--blue);
  background:
    repeating-conic-gradient(
      from 215deg at 50% 100%,
      #82161f 0deg 7deg,
      #5f0d14 7deg 14deg
    );
  opacity: 0;
  transform: translateX(104%) rotateY(-10deg) scale(0.96);
  transform-origin: right center;
  pointer-events: none;
  transition: transform 0.95s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.65s ease;
}

.quote-screen { z-index: 4; }
.info-screen { z-index: 5; }

.quote-screen.is-active,
.info-screen.is-active {
  opacity: 1;
  transform: translateX(0) rotateY(0deg) scale(1);
  pointer-events: auto;
}

.quote-screen.is-leaving {
  opacity: 0.48;
  transform: translateX(-104%) rotateY(10deg) scale(0.96);
  pointer-events: none;
}

.back-button {
  position: absolute;
  z-index: 8;
  left: 24px;
  top: max(18px, env(safe-area-inset-top));
  padding: 8px 10px;
  border: 0;
  color: var(--blue);
  background: transparent;
  font-size: 0.52rem;
  letter-spacing: 0.16em;
}

.quote-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  width: calc(100% - 34px);
  height: calc(100% - 92px);
  margin: 62px auto 30px;
  padding: 38px 27px 24px;
  color: var(--wine);
  border: 2px solid var(--wine);
  background: var(--blue-soft);
  box-shadow: 0 0 0 5px var(--blue-soft), 0 0 0 7px rgba(200, 221, 234, 0.85), 0 22px 64px rgba(40, 1, 7, 0.35);
  text-align: center;
}

.quote-sheet::before,
.quote-sheet::after {
  content: "";
  position: absolute;
  width: 58px;
  height: 58px;
  border-color: var(--wine);
  pointer-events: none;
}

.quote-sheet::before {
  left: 9px;
  top: 9px;
  border-left: 2px solid;
  border-top: 2px solid;
}

.quote-sheet::after {
  right: 9px;
  bottom: 9px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.quote-kicker {
  margin: 0 0 12px;
  line-height: 1;
}

.quote-kicker span {
  display: block;
  margin-bottom: 4px;
  font-size: clamp(0.48rem, 2.1vw, 0.59rem);
  letter-spacing: 0.23em;
}

.quote-kicker strong {
  display: block;
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  font-weight: 400;
  letter-spacing: 0.025em;
}

.quote-star {
  margin-bottom: 10px;
  font-size: 0.66rem;
}

.quote-sheet h1 {
  margin: 0;
  font-size: clamp(1.23rem, 5.5vw, 1.72rem);
  line-height: 1.24;
  font-weight: 400;
}

.quote-sheet h1 em {
  display: inline-block;
  margin-block: 2px;
  font-family: "Snell Roundhand", "Brush Script MT", "STKaiti", cursive;
  font-size: 1.75em;
  font-weight: 400;
}

.quote-finale {
  margin: 14px 0 0;
  font-family: "Snell Roundhand", "Brush Script MT", "STKaiti", cursive;
  font-size: clamp(1.8rem, 8.3vw, 2.65rem);
  line-height: 0.98;
}

.quote-bow {
  display: block;
  width: min(32vw, 150px);
  height: auto;
  margin: -4px 0 -25px;
  filter: saturate(0.82) contrast(1.08);
}

.quote-signature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 15px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(0.72rem, 3vw, 0.92rem);
  letter-spacing: 0.12em;
}

.quote-signature span:last-child {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-trigger,
.toast-button {
  padding: 9px 16px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.54rem;
  letter-spacing: 0.18em;
}

.page-trigger {
  color: var(--blue-soft);
  background: var(--wine);
}

.info-sheet {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: max(50px, calc(env(safe-area-inset-top) + 42px)) 20px max(12px, env(safe-area-inset-bottom));
  text-align: center;
}

.info-arch {
  position: absolute;
  z-index: -1;
  inset: max(48px, calc(env(safe-area-inset-top) + 40px)) 14px max(12px, env(safe-area-inset-bottom));
  border: 2px solid rgba(200, 221, 234, 0.96);
  box-shadow: inset 0 0 0 4px rgba(115, 14, 23, 0.96), inset 0 0 0 6px rgba(200, 221, 234, 0.72);
  border-radius: 48% 48% 5px 5px / 13% 13% 5px 5px;
  pointer-events: none;
}

.spotlight {
  position: absolute;
  z-index: -2;
  top: 0;
  left: 50%;
  width: 84%;
  height: 58%;
  background: radial-gradient(ellipse at 50% 8%, rgba(227, 169, 158, 0.32), rgba(150, 35, 43, 0.1) 55%, transparent 78%);
  transform: translateX(-50%);
  pointer-events: none;
}

.info-kicker {
  margin: 10px 0 5px;
  font-size: clamp(0.47rem, 2.05vw, 0.58rem);
  letter-spacing: 0.22em;
}

.info-sheet h1 {
  margin: 0;
  font-family: "Snell Roundhand", "Brush Script MT", "STKaiti", cursive;
  font-size: clamp(3rem, 13.5vw, 4.45rem);
  font-weight: 400;
  line-height: 0.68;
}

.info-sheet h1 span {
  display: block;
  margin-left: 0.95em;
}

.info-hero {
  position: relative;
  display: grid;
  place-items: end center;
  width: 100%;
  height: clamp(245px, 34vh, 315px);
  margin-top: 2px;
}

.info-number {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: -1;
  color: rgba(200, 221, 234, 0.3);
  font-size: clamp(10.5rem, 57vw, 18rem);
  line-height: 0.72;
  letter-spacing: -0.08em;
  transform: translate(-52%, -48%);
}

.cake-art {
  display: block;
  width: min(72%, 345px);
  height: auto;
  filter: drop-shadow(0 11px 18px rgba(38, 1, 5, 0.4));
}

.info-age {
  margin: 2px 0 0;
  font-size: clamp(1.75rem, 7.6vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0.08em;
}

.event-details {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: min(94%, 430px);
  min-height: clamp(220px, 30vh, 270px);
  margin-top: 9px;
  padding: 14px 14px 12px;
  border: 1.5px solid rgba(200, 221, 234, 0.9);
  background: rgba(76, 8, 14, 0.48);
  box-shadow: inset 0 0 0 3px rgba(115, 14, 23, 0.72), inset 0 0 0 4px rgba(200, 221, 234, 0.25);
}

.event-details p {
  margin: 0;
  font-size: clamp(0.73rem, 3.15vw, 0.9rem);
  line-height: 1.42;
  letter-spacing: 0.09em;
}

.event-details p:first-child {
  font-size: clamp(0.88rem, 3.8vw, 1.08rem);
  line-height: 1.3;
}

.event-details .event-details__place {
  margin-top: 8px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(0.82rem, 3.5vw, 1rem);
  letter-spacing: 0.02em;
}

.event-details p:nth-of-type(3) {
  font-size: clamp(0.78rem, 3.35vw, 0.96rem);
}

.event-divider {
  display: block;
  margin: 7px auto;
  font-size: 0.52rem;
}

.event-details .event-details__dress {
  font-size: clamp(0.73rem, 3.1vw, 0.88rem);
  line-height: 1.4;
}

.toast-button {
  margin-top: 10px;
  color: var(--blue);
  background: rgba(75, 7, 12, 0.72);
}

.info-screen.is-toasting .toast-button {
  animation: toast-glow 0.9s ease;
}

.info-screen.is-toasting::after {
  content: "";
  position: absolute;
  z-index: 7;
  inset: 0;
  background:
    radial-gradient(circle at 18% 25%, var(--blue) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 18%, var(--blue) 0 2px, transparent 3px),
    radial-gradient(circle at 28% 72%, var(--blue) 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 74% 67%, var(--blue) 0 1.5px, transparent 2.5px);
  animation: spark-fade 1.2s ease forwards;
  pointer-events: none;
}

@keyframes toast-glow {
  50% { color: var(--wine); background: var(--blue); transform: scale(1.04); }
}

@keyframes spark-fade {
  0% { opacity: 0; transform: scale(0.75); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.2); }
}

.music-toggle {
  position: fixed;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  right: max(12px, calc((100vw - 520px) / 2 + 12px));
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(247, 241, 227, 0.46);
  border-radius: 50%;
  color: var(--ivory);
  background: rgba(79, 7, 13, 0.84);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.music-toggle.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.music-toggle__disc {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--wine);
  background: var(--blue);
  font-size: 0.78rem;
}

.music-toggle.is-playing .music-toggle__disc {
  animation: disc-spin 3.8s linear infinite;
}

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

.lyrics-display {
  position: fixed;
  z-index: 18;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(88vw, 440px);
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(66, 6, 11, 0.78);
  backdrop-filter: blur(8px);
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-height: 700px) {
  .ribbon-band,
  .continuous-bow {
    top: 47.5%;
  }

  .continuous-bow {
    width: min(70vw, 285px);
  }

  .ribbon-handle__hint {
    top: calc(47.5% + min(20vh, 128px));
  }

  .name-card {
    padding-block: 30px 24px;
  }

  .name-card__kicker {
    margin-bottom: 14px;
  }

  .name-card__star {
    margin-block: 12px 8px;
  }

  .quote-sheet {
    height: calc(100% - 72px);
    margin: 50px auto 22px;
    padding: 24px 24px 16px;
  }

  .quote-kicker strong {
    font-size: 2rem;
  }

  .quote-sheet h1 {
    font-size: 1.05rem;
  }

  .quote-finale {
    margin-top: 8px;
    font-size: 1.6rem;
  }

  .quote-bow {
    width: 92px;
    margin-block: -4px -20px;
  }

  .quote-signature {
    margin-block: 8px 10px;
  }

  .info-sheet {
    padding-top: max(44px, calc(env(safe-area-inset-top) + 36px));
    padding-bottom: max(9px, env(safe-area-inset-bottom));
  }

  .info-kicker {
    margin-top: 5px;
  }

  .info-sheet h1 {
    font-size: 2.7rem;
  }

  .info-hero {
    height: 205px;
  }

  .cake-art {
    width: min(62%, 275px);
  }

  .info-age {
    font-size: 1.25rem;
  }

  .event-details {
    min-height: 215px;
    margin-top: 6px;
    padding-block: 8px;
  }

  .event-divider {
    margin-block: 4px;
  }

  .toast-button {
    margin-top: 6px;
    padding-block: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
