/* ============================================================
   Our Story — Amit's Kolkata, Aditi's Bareilly, one home.
   Positions are % of the 1080 x 1920 stage; type is in --u (1% of the
   stage width), like every other slide. story.js adds .st-armed (hidden,
   ready) and then .st-play (the one-shot reveal, staggered by --d).
   Without JS or with reduced motion nothing is ever hidden.
   ============================================================ */

.stage--story {
  --st-rose: var(--hn-rose);
  --st-ink: var(--hn-leaf);
  background: #f6efe6;
}

.st-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.st-head,
.st-city,
.st-label,
.st-paths,
.st-heart,
.st-milestones,
.st-finale {
  position: absolute;
  pointer-events: none;
}

/* ---- Heading ---- */
.st-head {
  left: 10%;
  top: 3.4%;
  width: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.st-title {
  margin: 0;
  padding: 0 0.2em 0.12em;
  color: var(--st-rose);
  font-family: "HN Maginia", var(--hn-serif);
  font-size: calc(var(--u) * 10.4);
  font-weight: 400;
  line-height: 1.05;
  white-space: nowrap;
  -webkit-text-stroke: 0.015em currentColor;
}

.st-intro {
  margin: calc(var(--u) * 1.2) 0 0;
  color: var(--hn-olive);
  font-family: var(--hn-serif);
  font-size: calc(var(--u) * 3.3);
  font-style: italic;
  line-height: 1.35;
  white-space: pre-line;
}

/* ---- The two cities ---- */
.st-city {
  display: block;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.st-label {
  width: 39.5%;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.st-label__name {
  color: var(--st-rose);
  font-family: "HN Hello Bride", var(--hn-serif);
  font-size: calc(var(--u) * 7);
  line-height: 1.05;
  /* keep the script's entry/exit strokes inside the box */
  padding: 0 0.3em;
}

.st-label__city {
  margin-top: calc(var(--u) * 0.2);
  color: var(--st-ink);
  font-family: var(--hn-serif);
  font-size: calc(var(--u) * 2.7);
  font-weight: 600;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
  text-transform: uppercase;
}

/* ---- The paths ---- */
.st-paths {
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.st-path {
  fill: none;
  stroke: var(--st-rose);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 0.5 15;
  opacity: 0.75;
}

/* "a pause": the paths thin out between November and April */
.st-path--pause {
  stroke-dasharray: 0.5 26;
  opacity: 0.32;
}

.st-dots circle {
  fill: var(--st-rose);
  opacity: 0.9;
  transform-box: fill-box;
  transform-origin: center;
}

.st-heart {
  height: auto;
  overflow: visible;
  fill: var(--st-rose);
  transform-origin: 50% 60%;
}

/* ---- Milestones ---- */
.st-milestones {
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-milestone {
  position: absolute;
  left: 16%;
  width: 68%;
  text-align: center;
}

.st-when {
  margin: 0;
  color: var(--st-rose);
  font-family: var(--hn-serif);
  font-size: calc(var(--u) * 2.6);
  font-weight: 600;
  letter-spacing: 0.24em;
  margin-right: -0.24em;
  text-transform: uppercase;
}

.st-text {
  margin: calc(var(--u) * 0.8) 0 0;
  color: var(--st-ink);
  font-family: var(--hn-serif);
  font-size: calc(var(--u) * 3.25);
  font-style: italic;
  line-height: 1.32;
  white-space: pre-line;
}

.st-milestone--pause .st-when,
.st-milestone--pause .st-text {
  color: var(--hn-olive);
}

/* ---- Finale ---- */
.st-finale {
  left: 8%;
  top: 84.6%;
  width: 84%;
  text-align: center;
}

.st-when--finale {
  font-size: calc(var(--u) * 3.1);
}

.st-finale__text {
  margin: calc(var(--u) * 1.4) 0 0;
  color: var(--st-rose);
  font-family: "HN Hello Bride", var(--hn-serif);
  font-size: calc(var(--u) * 5.6);
  line-height: 1.22;
  white-space: pre-line;
  padding: 0 0.3em;
}

/* ============================================================
   Motion (story.js). Only transform / opacity animate.
   ============================================================ */
.stage--story.st-armed .st-head,
.stage--story.st-armed .st-label,
.stage--story.st-armed .st-milestone,
.stage--story.st-armed .st-finale {
  opacity: 0;
  transform: translate3d(0, calc(var(--u) * 2.4), 0);
}

.stage--story.st-armed .st-city--groom {
  opacity: 0;
  transform: translate3d(calc(var(--u) * -4), 0, 0) scale(0.97);
}

.stage--story.st-armed .st-city--bride {
  opacity: 0;
  transform: translate3d(calc(var(--u) * 4), 0, 0) scale(0.97);
}

.stage--story.st-armed .st-path {
  opacity: 0;
}

.stage--story.st-armed .st-dots circle {
  opacity: 0;
  transform: scale(0.2);
}

.stage--story.st-armed .st-heart {
  opacity: 0;
  transform: scale(0.4);
}

.stage--story.st-play .st-head,
.stage--story.st-play .st-label,
.stage--story.st-play .st-milestone,
.stage--story.st-play .st-finale,
.stage--story.st-play .st-city {
  opacity: 1;
  transform: none;
  transition:
    opacity 900ms cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s),
    transform 1200ms cubic-bezier(0.22, 1, 0.36, 1) var(--d, 0s);
}

.stage--story.st-play .st-path {
  opacity: 0.75;
  transition: opacity 900ms ease var(--d, 0s);
}

.stage--story.st-play .st-path--pause {
  opacity: 0.32;
}

.stage--story.st-play .st-dots circle {
  opacity: 0.9;
  transform: none;
  transition:
    opacity 400ms ease var(--d, 0s),
    transform 700ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s);
}

.stage--story.st-play .st-heart {
  opacity: 1;
  transform: none;
  transition:
    opacity 500ms ease var(--d, 0s),
    transform 900ms cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s);
}

/* After the reveal the heart keeps a slow, quiet beat. */
.stage--story.st-beat .st-heart {
  animation: st-heartbeat 2.8s ease-in-out infinite;
}

@keyframes st-heartbeat {
  0%, 60%, 100% { transform: scale(1); }
  70% { transform: scale(1.14); }
  80% { transform: scale(0.98); }
  88% { transform: scale(1.08); }
}

/* Compositor hints only while something is moving. */
.stage--story.st-play:not(.st-done) .st-head,
.stage--story.st-play:not(.st-done) .st-city,
.stage--story.st-play:not(.st-done) .st-label,
.stage--story.st-play:not(.st-done) .st-milestone,
.stage--story.st-play:not(.st-done) .st-finale {
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .stage--story.st-beat .st-heart {
    animation: none;
  }
}
