@font-face {
  font-family: "MarkDay";
  src: url("assets/projection/fonts/markday-web.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  --primary: #ff80ab;
  --primary-dark: #b83f69;
  --primary-deep: #7a2f4d;
  --accent: #ffb2dd;
  --paper: #fffafd;
  --ink: #69394d;
  --deck-width: min(100vw, calc(100vh * 16 / 9));
  --deck-height: min(100vh, calc(100vw * 9 / 16));
}

* {
  box-sizing: border-box;
}

html,
body,
body * {
  cursor: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #1c1118;
  font-family: "MarkDay", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button {
  font: inherit;
}

.deck {
  position: fixed;
  inset: 0;
  width: var(--deck-width);
  height: var(--deck-height);
  margin: auto;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.55);
  isolation: isolate;
}

.slide {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.slide.is-active {
  z-index: 2;
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
}

.time-flow {
  position: absolute;
  z-index: 40;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(90deg, rgba(255, 250, 253, 0), rgba(255, 234, 243, 0.9) 34%, rgba(255, 250, 253, 0.92) 50%, rgba(255, 226, 238, 0.86) 68%, rgba(255, 250, 253, 0)),
    rgba(122, 47, 77, 0.08);
}

.time-flow::before,
.time-flow::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.time-flow::before {
  top: 50%;
  left: -18%;
  width: 136%;
  height: clamp(3px, 0.35vw, 7px);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--primary), #fff 50%, var(--primary-dark), transparent);
  box-shadow:
    0 0 12px rgba(255, 128, 171, 0.72),
    0 0 38px rgba(255, 178, 221, 0.8);
  transform: scaleX(0);
  transform-origin: left center;
}

.time-flow::after {
  top: 0;
  left: -28%;
  width: 26%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.94), transparent);
  filter: blur(18px);
  transform: skewX(-12deg);
}

.time-flow.is-running {
  animation: time-flow-veil 1.35s ease-in-out both;
}

.time-flow.is-running::before {
  animation: time-flow-line 1.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.time-flow.is-running::after {
  animation: time-flow-sweep 1.35s ease-in-out both;
}

.time-flow-track {
  position: absolute;
  top: 50%;
  left: 8%;
  width: 84%;
  height: 1px;
}

.time-flow-track span {
  position: absolute;
  top: 0;
  display: grid;
  min-width: clamp(72px, 6vw, 120px);
  place-items: center;
  color: var(--primary-deep);
  opacity: 0;
  text-shadow: 0 2px 12px #fff;
  transform: translateX(calc(-50% - 4vw)) scale(0.82);
  transform-origin: top center;
}

.time-flow-track span::before {
  width: clamp(12px, 1vw, 20px);
  height: clamp(12px, 1vw, 20px);
  margin-bottom: 1.2vh;
  border: clamp(3px, 0.2vw, 4px) solid #fff;
  border-radius: 50%;
  content: "";
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(255, 128, 171, 0.2), 0 0 25px var(--accent);
  transform: translateY(-50%);
}

.time-flow-track span:nth-child(1) { left: 3%; }
.time-flow-track span:nth-child(2) { left: 27%; }
.time-flow-track span:nth-child(3) { left: 51%; }
.time-flow-track span:nth-child(4) { left: 75%; }
.time-flow-track span:nth-child(5) { left: 98%; }

.time-flow.is-running .time-flow-track span {
  animation: time-flow-year 920ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.time-flow.is-running .time-flow-track span:nth-child(1) { animation-delay: 100ms; }
.time-flow.is-running .time-flow-track span:nth-child(2) { animation-delay: 180ms; }
.time-flow.is-running .time-flow-track span:nth-child(3) { animation-delay: 260ms; }
.time-flow.is-running .time-flow-track span:nth-child(4) { animation-delay: 340ms; }
.time-flow.is-running .time-flow-track span:nth-child(5) { animation-delay: 420ms; }

.time-flow-track b {
  font-size: clamp(22px, 2vw, 40px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.time-flow-track small {
  margin-top: 0.25vh;
  font-size: clamp(13px, 0.9vw, 18px);
  letter-spacing: 0.18em;
}

.eyebrow {
  margin: 0;
  color: var(--primary-dark);
  font-size: clamp(16px, 1.25vw, 26px);
  letter-spacing: 0.26em;
}

.slide--cover {
  display: grid;
  padding: 5.5% 6.5% 6%;
  grid-template-areas: "gallery copy";
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  column-gap: 3.5%;
  align-items: center;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 178, 221, 0.58), transparent 27%),
    radial-gradient(circle at 83% 80%, rgba(241, 164, 190, 0.44), transparent 31%),
    linear-gradient(145deg, #fffafd, #fff0f6 56%, #ffe1ed);
}

.slide--cover::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(rgba(255, 128, 171, 0.25) 1px, transparent 1.4px);
  background-size: clamp(14px, 1.35vw, 28px) clamp(14px, 1.35vw, 28px);
  mask-image: linear-gradient(90deg, #000, transparent 52%, #000);
}

.cover-copy,
.cover-gallery {
  position: relative;
  z-index: 2;
}

.cover-copy {
  grid-area: copy;
  z-index: 8;
  padding: 0 2% 8% 3%;
}

.cover-copy h1 {
  margin: 2.2vh 0 1.8vh;
  color: var(--primary-deep);
  font-size: clamp(50px, 5.4vw, 108px);
  font-weight: 400;
  letter-spacing: 0.045em;
  line-height: 1.02;
}

.cover-copy h1 span,
.cover-copy h1 strong {
  display: block;
}

.cover-copy h1 strong {
  margin-top: 0.16em;
  color: var(--primary-dark);
  font-size: 1.16em;
  font-weight: 400;
}

.cover-lead {
  margin: 0;
  color: #855268;
  font-size: clamp(21px, 1.6vw, 32px);
  letter-spacing: 0.11em;
}

.cover-gallery {
  grid-area: gallery;
  width: 100%;
  aspect-ratio: 4 / 3;
  align-self: center;
  justify-self: center;
}

.cover-photo-stack {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 86%;
  aspect-ratio: 4 / 3;
  transform: translate(-50%, -50%);
}

.cover-photo-stack::before,
.cover-photo-stack::after {
  position: absolute;
  inset: 0;
  border: clamp(8px, 0.8vw, 16px) solid rgba(255, 253, 250, 0.98);
  border-radius: clamp(10px, 1vw, 20px);
  content: "";
  background: #fff9fc;
  box-shadow: 0 24px 55px rgba(105, 57, 77, 0.2);
}

.cover-photo-stack::before {
  transform: rotate(5deg) translate(2%, 1%);
}

.cover-photo-stack::after {
  transform: rotate(-4deg) translate(-2%, 2%);
}

.cover-photo {
  position: absolute;
  z-index: 1;
  inset: 0;
  margin: 0;
  padding: clamp(8px, 0.8vw, 16px);
  overflow: hidden;
  border-radius: clamp(10px, 1vw, 20px);
  background: #fff;
  box-shadow: 0 25px 60px rgba(88, 36, 57, 0.3);
  opacity: 0;
  transform: rotate(1.2deg) scale(0.975);
  transition:
    opacity 1.15s ease,
    transform 1.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.cover-photo.is-active {
  z-index: 3;
  opacity: 1;
  transform: rotate(-1.2deg) scale(1);
}

.cover-photo img {
  width: 100%;
  height: 100%;
  border-radius: clamp(6px, 0.65vw, 13px);
  object-fit: cover;
  object-position: center 43%;
  filter: saturate(0.92) contrast(1.02) brightness(1.03);
  transform: scale(1.015);
}

.cover-photo.is-active img {
  animation: cover-photo-zoom 6.2s ease-out both;
}

.cover-mascot {
  position: absolute;
  z-index: 6;
  right: 3.2%;
  bottom: 10%;
  width: 25%;
  max-height: 28%;
  object-fit: contain;
  filter: drop-shadow(0 24px 30px rgba(159, 65, 101, 0.18));
  animation: mascot-float 4.8s ease-in-out infinite;
}

.cover-glow {
  position: absolute;
  top: 10%;
  right: 3%;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  filter: blur(30px);
}

.cover-hearts i {
  position: absolute;
  z-index: 1;
  color: var(--primary);
  font-size: clamp(18px, 2.1vw, 42px);
  font-style: normal;
  opacity: 0.55;
  animation: heart-drift 4s ease-in-out infinite;
}

.cover-hearts i:nth-child(1) { top: 13%; left: 46%; }
.cover-hearts i:nth-child(2) { top: 21%; right: 6%; animation-delay: -1.3s; }
.cover-hearts i:nth-child(3) { right: 39%; bottom: 14%; animation-delay: -2.6s; }

.chapter {
  display: grid;
  grid-template-columns: 51% 49%;
  background: linear-gradient(145deg, #fffafd, #ffeaf2);
}

.chapter-photos {
  position: relative;
  overflow: hidden;
  background: #f2b9cc;
}

.chapter-photos::after {
  position: absolute;
  z-index: 5;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 68%, rgba(255, 250, 253, 0.2)),
    linear-gradient(180deg, rgba(122, 47, 77, 0.04), rgba(122, 47, 77, 0.16));
}

.projection-photo {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: clamp(5px, 0.52vw, 11px) solid rgba(255, 252, 248, 0.95);
  background: #ead7dc;
  box-shadow: 0 22px 50px rgba(83, 34, 53, 0.27);
}

.projection-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.96) contrast(1.03) brightness(1.02);
}

/* 让章节照片和首页轮播都保留人物、贺卡所在的位置。 */
.projection-photo img[src$="/在南昌大学的积云.jpg"],
.cover-photo img[src$="/在南昌大学的积云.jpg"] {
  object-position: right bottom;
  transform-origin: right bottom;
}

.projection-photo img[src$="/五周年快乐花束.jpg"],
.cover-photo img[src$="/五周年快乐花束.jpg"] {
  object-position: center bottom;
  transform-origin: center bottom;
}

/* 人物靠近照片右侧，避免被相邻的叠放照片遮住。 */
.chapter--leap .projection-photo--a {
  z-index: 1;
}

.projection-photo--a {
  top: -5%;
  left: -5%;
  width: 62%;
  height: 57%;
  transform: rotate(-3deg);
}

.projection-photo--b {
  top: 5%;
  right: -6%;
  width: 53%;
  height: 52%;
  transform: rotate(3.2deg);
}

.projection-photo--c {
  right: 7%;
  bottom: -7%;
  width: 76%;
  height: 57%;
  transform: rotate(-1.4deg);
}

.projection-photo--portrait {
  right: 4%;
  width: 43%;
  height: auto;
  z-index: 1;
}

.projection-photo--portrait img {
  display: block;
  height: auto;
  object-fit: contain;
}

.chapter-panel {
  position: relative;
  z-index: 8;
  display: flex;
  padding: 7.5% 8% 17%;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at 95% 8%, rgba(255, 178, 221, 0.35), transparent 30%),
    linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(255, 237, 244, 0.96));
}

.chapter-panel header {
  position: relative;
  z-index: 2;
  padding-bottom: 3.4vh;
  border-bottom: 1px solid rgba(184, 63, 105, 0.18);
  opacity: 0;
  transform: translateY(20px);
}

.chapter.is-active .chapter-panel header {
  animation: stage-line 850ms ease 120ms forwards;
}

.chapter-panel h2 {
  margin: 1.5vh 0 0;
  color: var(--primary-deep);
  font-size: clamp(44px, 4.2vw, 84px);
  font-weight: 400;
  letter-spacing: 0.075em;
  line-height: 1.08;
}

.story-lines {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 44%;
  margin-top: 4vh;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.15vh, 22px);
}

.story-lines--compact {
  gap: clamp(7px, 0.8vh, 15px);
}

.step {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition:
    opacity 650ms ease,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.step.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.story-lines p {
  margin: 0;
  padding-left: clamp(15px, 1.15vw, 24px);
  border-left: clamp(3px, 0.25vw, 5px) solid rgba(255, 128, 171, 0.48);
  color: var(--ink);
  font-size: clamp(28px, 2vw, 40px);
  letter-spacing: 0.045em;
  line-height: 1.48;
}

.story-lines--compact p {
  font-size: clamp(25px, 1.75vw, 36px);
  line-height: 1.42;
}

.story-lines p.step--accent {
  border-left-color: var(--primary-dark);
  color: var(--primary-deep);
  font-size: clamp(29px, 2.1vw, 43px);
}

.chapter-pet {
  position: absolute;
  z-index: 1;
  right: 2.2%;
  bottom: 1.5%;
  width: clamp(180px, 14vw, 290px);
  max-height: 38%;
  object-fit: contain;
  opacity: 0.94;
  filter: drop-shadow(0 15px 18px rgba(90, 36, 58, 0.2));
  animation: pet-bob 4s ease-in-out infinite;
}

.chapter--leap .chapter-pet { animation-delay: -0.8s; }
.chapter--beijing .chapter-pet { animation-delay: -1.6s; }
.chapter--home .chapter-pet { animation-delay: -2.4s; }
.chapter--future .chapter-pet { animation-delay: -3.2s; }

.slide--gate,
.slide--proposal {
  display: grid;
  place-items: center;
  text-align: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.98), transparent 35%),
    linear-gradient(145deg, #fffafd, #ffe4ef 58%, #ffcfe0);
}

.slide--gate::before {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0.44;
  background-image: radial-gradient(rgba(255, 128, 171, 0.24) 1px, transparent 1.5px);
  background-size: clamp(15px, 1.4vw, 29px) clamp(15px, 1.4vw, 29px);
}

.slide--gate {
  padding: 5% 6%;
  grid-template-columns: 1fr;
  place-items: center;
}

.gate-hearts {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gate-copy {
  position: relative;
  z-index: 5;
  width: min(82%, 1300px);
  max-width: none;
  margin: 0;
  padding: 0 2%;
  grid-row: 1;
  grid-column: 1;
  justify-self: center;
}

.gate-copy h2 {
  margin: 1.8vh 0 2.2vh;
  color: var(--primary-deep);
  font-size: clamp(46px, 4.6vw, 92px);
  font-weight: 400;
  letter-spacing: 0.065em;
  line-height: 1.12;
}

.gate-lead {
  margin: 0;
  color: #855268;
  font-size: clamp(26px, 2.15vw, 44px);
  letter-spacing: 0.08em;
}

.gate-tip {
  margin-top: 2vh;
  color: rgba(105, 57, 77, 0.5);
  font-size: clamp(11px, 0.72vw, 15px);
  letter-spacing: 0.08em;
}

.gate-mascot {
  position: absolute;
  z-index: 3;
  right: 2.2%;
  bottom: 1.5%;
  width: clamp(260px, 26vw, 520px);
  max-height: 34%;
  object-fit: contain;
  filter: drop-shadow(0 22px 25px rgba(122, 47, 77, 0.18));
}

.gate-hearts span {
  position: absolute;
  z-index: 2;
  color: var(--primary);
  font-size: clamp(22px, 3vw, 62px);
  opacity: 0.46;
  animation: heart-drift 4s ease-in-out infinite;
}

.gate-hearts span:nth-child(1) { top: 14%; left: 12%; }
.gate-hearts span:nth-child(2) { top: 23%; right: 9%; animation-delay: -1.4s; }
.gate-hearts span:nth-child(3) { right: 20%; bottom: 14%; animation-delay: -2.8s; }

.proposal-copy {
  position: relative;
  z-index: 5;
  width: 90%;
}

.proposal-copy > * {
  opacity: 0;
  transform: translateY(24px);
}

.slide--celebration.is-active .proposal-copy > * {
  animation: proposal-line 900ms ease forwards;
}

/* 求婚页使用 .step 手动推进，成功页保留自动淡入。 */
.slide--celebration.is-active .proposal-copy > :nth-child(1) { animation-delay: 350ms; }
.slide--celebration.is-active .proposal-copy > :nth-child(2) { animation-delay: 1050ms; }
.slide--celebration.is-active .proposal-copy > :nth-child(3) { animation-delay: 1750ms; }
.slide--celebration.is-active .proposal-copy > :nth-child(4) { animation-delay: 2850ms; }

.proposal-name {
  margin: 0 0 2vh;
  color: var(--primary-dark);
  font-size: clamp(36px, 3.5vw, 70px);
  letter-spacing: 0.35em;
  transform: translateX(0.17em);
}

.proposal-copy > p:not(.proposal-name) {
  margin: 0.55vh 0;
  color: #784258;
  font-size: clamp(29px, 2.4vw, 48px);
  letter-spacing: 0.1em;
}

.slide--celebration .proposal-copy > .celebration-thanks {
  margin: 3vh 0;
  font-size: clamp(24px, 2vw, 40px);
  letter-spacing: 0.08em;
  line-height: 1.75;
}

.proposal-copy h2 {
  margin: 4vh 0 2.4vh;
  color: #af345e;
  font-size: clamp(64px, 8.2vw, 164px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.08;
  text-shadow: 0 7px 0 rgba(255, 255, 255, 0.82);
}

.proposal-copy span {
  display: block;
  color: var(--primary-dark);
  font-size: clamp(14px, 1.1vw, 22px);
  letter-spacing: 0.38em;
}

.proposal-copy small {
  display: block;
  margin-top: 5vh;
  color: rgba(105, 57, 77, 0.56);
  font-size: clamp(12px, 0.8vw, 16px);
  letter-spacing: 0.32em;
}

.proposal-glow {
  position: absolute;
  width: 58%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.94), rgba(255, 178, 221, 0.32) 42%, transparent 72%);
  animation: glow-pulse 4.5s ease-in-out infinite;
}

.petals,
.petal {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.petals {
  z-index: 2;
  overflow: hidden;
}

.petal::before {
  position: absolute;
  top: calc(var(--deck-height) * -0.08);
  left: var(--petal-x);
  width: var(--petal-size);
  height: calc(var(--petal-size) * 0.72);
  border-radius: 80% 20% 70% 30%;
  content: "";
  background: var(--petal-color);
  opacity: 0;
  animation: petal-fall var(--petal-duration) var(--petal-delay) linear infinite;
  animation-play-state: paused;
}

.slide--proposal.is-active .petal::before {
  animation-play-state: running;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0) rotate(-0.5deg); }
  50% { transform: translateY(-12px) rotate(0.7deg); }
}

@keyframes cover-photo-zoom {
  from { transform: scale(1.015); }
  to { transform: scale(1.065); }
}

@keyframes pet-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1deg); }
}

@keyframes heart-drift {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-12px) rotate(7deg); }
}

@keyframes proposal-line {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes stage-line {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes time-flow-veil {
  0%, 100% { opacity: 0; }
  18%, 72% { opacity: 1; }
}

@keyframes time-flow-line {
  0% { opacity: 0; transform: scaleX(0); }
  18% { opacity: 1; }
  68% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

@keyframes time-flow-sweep {
  0% { opacity: 0; transform: translateX(0) skewX(-12deg); }
  18% { opacity: 0.9; }
  76% { opacity: 0.65; }
  100% { opacity: 0; transform: translateX(590%) skewX(-12deg); }
}

@keyframes time-flow-year {
  0% { opacity: 0; transform: translateX(calc(-50% - 4vw)) scale(0.82); }
  30%, 72% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(calc(-50% + 2vw)) scale(1.04); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.75; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes petal-fall {
  0% { opacity: 0; transform: translate3d(0, calc(var(--deck-height) * -0.05), 0) rotate(0deg); }
  10% { opacity: 0.78; }
  100% { opacity: 0; transform: translate3d(var(--petal-drift), calc(var(--deck-height) * 1.16), 0) rotate(var(--petal-turn)); }
}

@media (max-aspect-ratio: 4 / 3) {
  .chapter-panel {
    padding-inline: 7%;
  }

  .story-lines p {
    font-size: clamp(26px, 2.4vw, 38px);
  }
}

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