:root {
  --paper: #f4eadf;
  --paper-2: #fff8f0;
  --ink: #2b1c1e;
  --ink-soft: rgba(43, 28, 30, 0.72);
  --wine: #8d3a46;
  --wine-deep: #6d2a36;
  --blush: #f0c7be;
  --night: #2a1620;
  --night-text: #f6efe8;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

[data-move] {
  animation: none;
}

html {
  overflow-x: clip;
}

body {
  --gutter: max(1.15rem, calc(50vw - 22rem));
  --scroll: 0;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Figtree, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

body:not(.is-open) {
  overflow: hidden;
  height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: #e7b0b6;
  color: #2a1216;
}

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #f6efe6;
}

.lamp {
  position: fixed;
  z-index: 1;
  left: 42%;
  top: 42%;
  width: min(780px, 78vw);
  height: 46vh;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(255, 248, 240, 0.72), transparent 68%);
  pointer-events: none;
}

body.is-dusk .lamp {
  background: radial-gradient(ellipse at center, rgba(255, 196, 186, 0.16), transparent 68%);
}

.grain {
  position: fixed;
  inset: -20%;
  z-index: 4;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: scroll(root);
}

.blob-a {
  width: min(460px, 58vw);
  height: min(460px, 58vw);
  background: #f0b7ad;
  opacity: 0.55;
  top: -8vh;
  right: -6vw;
  animation-name: blob-a;
}

.blob-b {
  width: min(380px, 50vw);
  height: min(380px, 50vw);
  background: #f3d7b0;
  opacity: 0.7;
  left: -10vw;
  top: 30vh;
  animation-name: blob-b;
}

.petals {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.petals i {
  position: absolute;
  width: 11px;
  height: 15px;
  border-radius: 70% 20% 70% 20%;
  background: #d98986;
  opacity: 0.35;
}

.petals i:nth-child(1) { left: 12%; top: 18%; animation-delay: -2s; }
.petals i:nth-child(2) { left: 78%; top: 30%; animation-delay: -6s; width: 8px; height: 12px; }
.petals i:nth-child(3) { left: 24%; top: 62%; animation-delay: -9s; }
.petals i:nth-child(4) { left: 86%; top: 72%; animation-delay: -4s; width: 9px; height: 13px; }
.petals i:nth-child(5) { left: 48%; top: 12%; animation-delay: -11s; opacity: 0.22; }

.spine {
  position: fixed;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: var(--gutter);
  width: 1px;
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  pointer-events: none;
  transition: background 0.45s ease;
}

.spine i {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--wine);
  box-shadow: 0 0 16px color-mix(in srgb, var(--wine) 80%, transparent);
  transform-origin: top center;
  transform: scaleY(var(--scroll));
}

.spine b {
  position: absolute;
  left: -5px;
  top: calc(10px + var(--scroll) * (100vh - 56px));
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--wine);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--wine) 18%, transparent),
    0 0 22px color-mix(in srgb, var(--wine) 70%, transparent);
}

main {
  position: relative;
  z-index: 2;
  width: min(42rem, calc(100vw - var(--gutter) - 3.2rem));
  margin-left: calc(var(--gutter) + 2.4rem);
  color: var(--ink);
}

body.is-dusk {
  --ink: #f6efe8;
  --ink-soft: rgba(246, 239, 232, 0.74);
  --wine: #f0c7c2;
  --wine-deep: #f6efe8;
}

body.is-dusk .blob,
body.is-dusk .petals {
  opacity: 0;
}

.blob,
.petals {
  transition: opacity 0.6s ease;
}

.mark {
  position: fixed;
  z-index: 15;
  top: calc(1.15rem + env(safe-area-inset-top));
  left: 0.75rem;
  width: calc(var(--gutter) - 2.3rem);
  text-align: right;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: 1.25rem;
  color: var(--wine-deep);
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.is-open .mark {
  opacity: 1;
  transition: opacity 0.35s ease 0.2s;
}

.sound {
  position: fixed;
  z-index: 15;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(43, 28, 30, 0.18);
  background: rgba(255, 248, 240, 0.72);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}

.sound.is-off #sound-arc {
  display: none;
}

.kicker {
  margin: 0 0 0.8rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wine);
}

.kicker.light {
  color: #e7b7b4;
}

.desk {
  --ink: #2b1c1e;
  --ink-soft: rgba(43, 28, 30, 0.72);
  --wine: #8d3a46;
  --wine-deep: #6d2a36;
  color: #2b1c1e;
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(240, 183, 173, 0.55), transparent 58%),
    #f3e7da;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.desk.leave {
  opacity: 0;
  visibility: hidden;
}

.invite {
  width: min(460px, 100%);
  background: var(--paper-2);
  color: var(--ink);
  padding: 2.2rem 1.7rem 1.8rem;
  border-radius: 2px 2px 3px 3px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 24px 50px rgba(90, 40, 40, 0.14);
  text-align: center;
  transform: rotate(-2.2deg);
  transition: transform 0.9s var(--ease);
}

.desk.is-opening .invite {
  transform: rotate(0deg) translateY(-12px) scale(1.03);
}

.invite-title {
  margin: 0.2rem 0 0.7rem;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(3.2rem, 10vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

.invite-sub {
  margin: 0 auto 1.4rem;
  max-width: 26em;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.invite .seal {
  margin-left: auto;
  margin-right: auto;
}

.seal {
  width: 54px;
  height: 54px;
  margin: 0 0 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #d57b84, #8d3040 64%, #5c1c28);
  color: #fff6f2;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-size: 1.35rem;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 8px 14px rgba(90, 20, 30, 0.22);
}

.btn {
  appearance: none;
  border: 0;
  background: var(--wine-deep);
  color: #fff8f4;
  border-radius: 999px;
  padding: 0.9rem 1.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s var(--ease);
}

.btn:hover {
  background: #541f2a;
}

.btn:active {
  transform: scale(0.98);
}

.hero-pin {
  height: auto;
}

.hero-sticky {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(18vh + env(safe-area-inset-top)) 0 10vh;
}

.hero-title {
  margin: 0;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2.7rem, 5.6vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.hero-title .line {
  display: block;
  white-space: nowrap;
}

.word {
  display: inline-block;
}

.hero-title .line:nth-child(2) {
  font-style: italic;
  font-weight: 460;
  color: var(--wine);
}

.lede {
  margin: 1.8rem 0 0;
  max-width: 28em;
  color: var(--ink-soft);
  font-size: 1.12rem;
  position: relative;
}

.hint {
  position: absolute;
  left: 0;
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--wine);
  transition: opacity 0.4s ease;
}

.hint i {
  width: 1px;
  height: 42px;
  background: var(--wine);
  transform-origin: top;
  animation: pulse 1.8s ease-in-out infinite;
}

.hint.gone {
  opacity: 0;
}

.lines {
  position: relative;
  padding: 6vh 0 4vh;
}

.line-block {
  min-height: 0;
  display: block;
  padding: 11vh 0;
}

.line-block p {
  display: inline-block;
  margin: 0;
  max-width: min(18ch, 100%);
  font-family: Fraunces, Palatino, serif;
  font-weight: 560;
  font-size: clamp(2.15rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.line-block p::after {
  content: "";
  display: block;
  height: 2px;
  margin-top: 0.7rem;
  background: var(--wine);
  transform: scaleX(0);
  transform-origin: left center;
  animation-name: underline;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: view();
  animation-range: entry 15% entry 70%;
}

.drift {
  padding: 8vh 0 4vh;
}

.drift span {
  display: block;
  max-width: 18em;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.25;
  color: var(--wine);
  white-space: normal;
}

.memories {
  padding: 6vh 0 10vh;
}

.memory {
  position: relative;
  width: auto;
  margin: 0;
  padding: 8vh 0;
  background: none;
  box-shadow: none;
  animation-name: settle;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: view();
  animation-range: entry 0% entry 45%;
}

.memory .no {
  margin: 0 0 0.35rem;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  color: var(--wine);
  font-size: 1.05rem;
}

.memory h2 {
  margin: 0.35rem 0 0.7rem;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.memory .moment-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.film-pin {
  height: 188vh;
}

.film-sticky {
  position: sticky;
  top: 8vh;
  height: auto;
  display: block;
  padding: 0 0 4vh;
}

.film-copy h2 {
  margin: 0 0 0.8rem;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.film-note {
  margin: 0;
  color: var(--ink-soft);
  max-width: 22em;
}

.video-frame {
  position: relative;
  width: 100%;
  margin-top: 1.4rem;
  min-height: 42vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(141, 58, 70, 0.28), transparent 68%),
    #2a171c;
  overflow: hidden;
  border-radius: 28px;
  transform-origin: center center;
  will-change: transform;
  box-shadow: 0 24px 60px rgba(48, 16, 28, 0.16);
  --peak: 0;
}

.video-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(18, 6, 10, 0.5) 100%);
  opacity: calc(1 - var(--peak));
}

.video-frame video {
  width: 100%;
  max-height: 68dvh;
  height: auto;
  display: block;
  background: #1a1014;
}

.play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #fff8f4;
}

.play .circle {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--wine);
  transition: transform 0.35s var(--ease);
}

.play:hover .circle {
  transform: scale(1.06);
}

.tri {
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent #fff8f4;
}

.play-label {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.66rem;
}

.missing {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 1.4rem;
  max-width: 22em;
  text-align: center;
  color: rgba(255, 248, 244, 0.8);
}

.photos h2 {
  margin: 0;
  max-width: 10em;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.zoom-pin {
  height: 152vh;
}

.zoom-sticky {
  position: sticky;
  top: 12vh;
}

.shot-caption {
  margin: 0 0 0.9rem;
  max-width: 16em;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.15;
}

.shot-frame {
  position: relative;
  width: min(100%, 26rem);
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(255, 236, 228, 0.55), transparent 62%),
    linear-gradient(165deg, #f0c2b8, #8d3a46 70%);
  box-shadow: 0 24px 50px rgba(48, 16, 28, 0.14);
  transform-origin: center center;
  will-change: transform;
  --peak: 0;
}

.shot-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, 0.42) 50%, transparent 66%);
  transform: translateX(calc((var(--peak) - 0.4) * 130%));
  mix-blend-mode: soft-light;
}

.shot-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot-frame.is-empty::after {
  content: "♡";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-size: 2.4rem;
  color: rgba(255, 248, 244, 0.82);
}

.letter-scene {
  min-height: 0;
  display: block;
  padding: 8vh 0 4vh;
}

.letter {
  width: auto;
  background: none;
  color: inherit;
  padding: 6vh 0 2vh;
  border: 0;
  box-shadow: none;
}

.letter-date {
  margin: 0 0 0.8rem;
  text-align: left;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.letter-hi {
  margin: 0 0 1rem;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
}

.letter p {
  margin: 0 0 0.95rem;
  font-size: 1.06rem;
  line-height: 1.75;
  animation-name: ink;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: view();
  animation-range: entry 5% entry 50%;
}

.letter-sign {
  margin: 1.2rem 0 0;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: 1.8rem;
  color: var(--wine-deep);
}

.poem {
  padding: 10vh 0 4vh;
}

.poem h2 {
  margin: 0 0 1rem;
  max-width: 12em;
  text-align: left;
  font-family: Fraunces, Palatino, serif;
  font-weight: 620;
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.poem ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-item {
  margin: 0;
  max-width: 16em;
  padding: 5vh 0;
  text-align: left;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
  text-wrap: balance;
  animation-name: settle;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: view();
  animation-range: entry 0% entry 50%;
}

.finale {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  text-align: left;
  padding: 18vh 0 calc(12vh + env(safe-area-inset-bottom));
  background: none;
  color: inherit;
  position: relative;
}

.heart {
  width: 46px;
  height: 46px;
  color: #e7b7b4;
  margin-bottom: 0.8rem;
}

.heart path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation-name: draw;
  animation-duration: auto;
  animation-timing-function: linear;
  animation-fill-mode: both;
  animation-timeline: view();
  animation-range: entry 10% entry 70%;
}

.finale h2 {
  margin: 0.3rem 0 0.8rem;
  max-width: 8em;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-weight: 460;
  font-size: clamp(2.8rem, 7vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.finale-alt {
  margin: 0;
  font-family: Fraunces, Palatino, serif;
  font-style: italic;
  font-size: 1.35rem;
  color: inherit;
}

.tiny {
  position: absolute;
  left: 0;
  bottom: calc(1.3rem + env(safe-area-inset-bottom));
  margin: 0;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--wine);
}

@keyframes blob-a {
  to { transform: translate3d(-12vw, 35vh, 0) scale(1.25); }
}

@keyframes blob-b {
  to { transform: translate3d(18vw, 40vh, 0) scale(0.85); }
}

@keyframes draw {
  to { stroke-dashoffset: 0; }
}

@keyframes underline {
  to { transform: scaleX(1); }
}

@keyframes settle {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ink {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  50% { transform: scaleY(0.45); opacity: 0.35; }
}

@keyframes float {
  50% { transform: translate3d(16px, -28px, 0) rotate(18deg); }
}

@media (max-width: 900px) {
  body {
    --gutter: 1.15rem;
  }

  .mark {
    position: absolute;
    left: calc(var(--gutter) + 2.4rem);
    width: auto;
    max-width: calc(100vw - var(--gutter) - 3rem);
    text-align: left;
  }

  .hero-title,
  .line-block p,
  .drift span {
    max-width: 100%;
  }

  .hero-title .line {
    white-space: normal;
  }

  .video-frame {
    min-height: 34vh;
  }

  .film-pin {
    height: 160vh;
  }

  .zoom-pin {
    height: 142vh;
  }

  .lamp {
    left: 30%;
    width: 120vw;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .spine i {
    transform: none;
  }

  .zoom-pin,
  .film-pin {
    height: auto;
  }

  .zoom-sticky,
  .film-sticky {
    position: relative;
    top: auto;
  }
}
