:root {
  --paper: #faf6f0;
  --paper-warm: #f5ede3;
  --paper-deep: #f0e6d8;
  --ink: #4a3f35;
  --ink-soft: #8a7a6b;
  --terracotta: #c9856b;
  --lotus: #d4a5a5;
  --sage: #8a9a7b;
  --heart: #e08a8a;
  --white: #fffdf9;
  --line: rgba(74, 63, 53, 0.14);
  --shadow-soft: 0 18px 55px rgba(87, 65, 51, 0.1);
  --shadow-photo: 0 20px 60px rgba(87, 65, 51, 0.17);
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-hand: "Ma Shan Zheng", "KaiTi", cursive;
  --font-english: "Cormorant Garamond", Georgia, serif;
  --font-script: "Dancing Script", "Segoe Script", cursive;
  --content-wide: 1080px;
  --content: 860px;
  --content-narrow: 760px;
  --radius-lg: 28px;
  --radius-md: 18px;
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 18%, rgba(212, 165, 165, 0.12), transparent 28rem),
    radial-gradient(circle at 88% 64%, rgba(138, 154, 123, 0.08), transparent 30rem),
    var(--paper);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-loading {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(201, 133, 107, 0.5);
  outline-offset: 4px;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

p,
h1,
h2,
h3 {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 10002;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
  transition: transform 180ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-grain {
  position: fixed;
  z-index: 9998;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
}

.scroll-progress {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.loader {
  position: fixed;
  z-index: 10001;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--ink);
  background:
    radial-gradient(circle at center, rgba(212, 165, 165, 0.2), transparent 20rem),
    var(--paper);
  transition: opacity 700ms var(--ease-soft), visibility 700ms;
}

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader__heart {
  width: 46px;
  animation: loaderBeat 1.35s ease-in-out infinite;
  filter: drop-shadow(0 8px 15px rgba(224, 138, 138, 0.25));
}

.loader__heart svg {
  display: block;
  fill: var(--heart);
}

.loader p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.08em;
}

@keyframes loaderBeat {
  0%,
  100% {
    transform: scale(1);
  }
  12% {
    transform: scale(1.12);
  }
  24% {
    transform: scale(0.98);
  }
  36% {
    transform: scale(1.08);
  }
}

.hero {
  position: relative;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 80px 24px 130px;
  color: var(--white);
}

.hero__media {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: #4b4039;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.9;
  filter: saturate(0.72) sepia(0.14) brightness(0.93) contrast(0.98);
  animation: heroDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

.hero__wash {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(37, 31, 28, 0.33), rgba(37, 31, 28, 0.16) 42%, rgba(37, 31, 28, 0.68)),
    radial-gradient(circle at center, transparent 10%, rgba(43, 34, 28, 0.3) 100%);
}

@keyframes heroDrift {
  from {
    transform: scale(1.01);
  }
  to {
    transform: scale(1.055);
  }
}

.hero__content {
  position: relative;
  z-index: 4;
  width: min(100%, 850px);
  text-align: center;
  text-shadow: 0 3px 22px rgba(30, 24, 21, 0.3);
}

.script-kicker {
  margin-bottom: 12px;
  color: #f0d9cb;
  font-family: var(--font-script);
  font-size: clamp(2rem, 5vw, 3.65rem);
  line-height: 1;
}

.hero__eyebrow {
  margin-bottom: 24px;
  font-size: clamp(0.75rem, 1.3vw, 0.9rem);
  letter-spacing: 0.34em;
}

.hero h1 {
  margin-bottom: 26px;
  font-size: clamp(3.2rem, 9.5vw, 7.4rem);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: 0.03em;
}

.hero__intro {
  max-width: 34rem;
  margin: 0 auto;
  color: rgba(255, 253, 249, 0.84);
  font-size: clamp(0.93rem, 1.6vw, 1.08rem);
  letter-spacing: 0.08em;
}

.hero__ornament {
  position: absolute;
  z-index: 3;
  color: rgba(255, 244, 235, 0.58);
  font-family: var(--font-english);
  pointer-events: none;
  animation: ornamentFloat 7s ease-in-out infinite;
}

.hero__ornament--one {
  top: 22%;
  left: 11%;
  font-size: 28px;
}

.hero__ornament--two {
  right: 13%;
  bottom: 24%;
  font-size: 36px;
  animation-delay: -2.2s;
}

@keyframes ornamentFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
    opacity: 0.45;
  }
  50% {
    transform: translateY(-13px) rotate(7deg);
    opacity: 0.8;
  }
}

.scroll-cue {
  position: absolute;
  z-index: 4;
  bottom: max(34px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: rgba(255, 253, 249, 0.82);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-decoration: none;
  transform: translateX(-50%);
  animation: cueFloat 2.7s ease-in-out infinite;
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 38px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.8), transparent);
}

@keyframes cueFloat {
  0%,
  100% {
    transform: translate(-50%, 0);
  }
  50% {
    transform: translate(-50%, 7px);
  }
}

.section {
  position: relative;
  padding: clamp(90px, 11vw, 150px) clamp(20px, 5vw, 72px);
}

.section-shell {
  width: min(100%, var(--content-wide));
  margin: 0 auto;
}

.section-shell--narrow {
  width: min(100%, var(--content-narrow));
}

.section-heading {
  max-width: 650px;
  margin: 0 auto clamp(44px, 7vw, 76px);
  text-align: center;
}

.section-kicker {
  margin-bottom: 15px;
  color: var(--terracotta);
  font-family: var(--font-english);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.section-heading h2,
.finale h2 {
  margin-bottom: 17px;
  font-size: clamp(2rem, 4.6vw, 3.45rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.03em;
}

.section-heading > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.countdown-section {
  background:
    linear-gradient(rgba(245, 237, 227, 0.86), rgba(245, 237, 227, 0.86)),
    radial-gradient(circle at 8% 10%, var(--lotus), transparent 25rem);
}

.countdown-section::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(92%, 1180px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(74, 63, 53, 0.12), transparent);
  transform: translateX(-50%);
}

.love-clock {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 5vw, 50px) clamp(20px, 5vw, 56px);
  border: 1px solid rgba(74, 63, 53, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.78);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.love-clock::after {
  position: absolute;
  top: -65px;
  right: -55px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(201, 133, 107, 0.18);
  border-radius: 50%;
  content: "";
  box-shadow: 0 0 0 24px rgba(201, 133, 107, 0.035);
}

.love-clock > p:first-child {
  margin-bottom: 18px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  letter-spacing: 0.13em;
}

.love-clock__digits {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(12px, 3.4vw, 34px);
}

.love-clock__digits span {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.love-clock__digits b {
  min-width: 1.4em;
  font-family: var(--font-english);
  font-size: clamp(2.35rem, 6.3vw, 5rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.love-clock__digits small {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: clamp(0.66rem, 1.3vw, 0.78rem);
}

.love-clock__since {
  margin: 20px 0 0;
  color: var(--terracotta);
  font-size: 0.77rem;
  letter-spacing: 0.06em;
}

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

.info-card {
  min-height: 245px;
  padding: clamp(26px, 4vw, 38px);
  border: 1px solid rgba(74, 63, 53, 0.09);
  border-radius: var(--radius-lg);
  background: rgba(250, 246, 240, 0.75);
  box-shadow: 0 14px 40px rgba(87, 65, 51, 0.07);
}

.info-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.77rem;
  letter-spacing: 0.08em;
}

.map-visual {
  position: relative;
  width: 100%;
  min-width: 0;
  height: clamp(176px, 22vw, 214px);
  margin: 12px 0 20px;
  isolation: isolate;
}

.map-mount {
  position: absolute;
  z-index: 2;
  inset: 0;
  min-width: 0;
  opacity: 0;
  transition: opacity 700ms var(--ease-soft);
}

.map-visual.is-webgl .map-mount {
  opacity: 1;
}

.map-visual.is-webgl .map-fallback {
  opacity: 0;
  visibility: hidden;
}

.map-mount canvas,
.map-fallback canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 10px 18px rgba(135, 101, 77, 0.14));
}

.map-fallback {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  transition: opacity 500ms ease, visibility 500ms;
}

.distance-card__copy {
  margin-bottom: 8px;
  font-size: clamp(1.15rem, 2.3vw, 1.45rem);
  font-weight: 600;
}

.info-card__note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.next-days {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin: 21px 0 17px;
}

.next-days strong {
  font-family: var(--font-english);
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.next-days span {
  padding-bottom: 6px;
  color: var(--terracotta);
  font-size: 1rem;
}

.story-section {
  overflow: hidden;
}

.story-section::before {
  position: absolute;
  top: 11%;
  left: -110px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(138, 154, 123, 0.12);
  border-radius: 48% 52% 62% 38%;
  content: "";
  transform: rotate(25deg);
}

.timeline {
  position: relative;
  display: grid;
  gap: clamp(70px, 9vw, 120px);
}

.timeline::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
  content: "";
  background: linear-gradient(to bottom, transparent, rgba(201, 133, 107, 0.36) 5%, rgba(201, 133, 107, 0.36) 95%, transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr);
  align-items: center;
}

.timeline-item__card {
  grid-column: 1;
  grid-row: 1;
  padding: 12px 26px 10px 0;
  translate: 0 var(--depth-card-y, 0);
  scale: var(--depth-card-scale, 1);
}

.timeline-item__media {
  grid-column: 3;
  grid-row: 1;
  translate: 0 var(--depth-media-y, 0);
  scale: var(--depth-media-scale, 1);
}

.timeline-item:nth-child(even) .timeline-item__card {
  grid-column: 3;
  padding: 12px 0 10px 26px;
}

.timeline-item:nth-child(even) .timeline-item__media {
  grid-column: 1;
  grid-row: 1;
}

.timeline-item__marker {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 2;
  grid-row: 1;
  width: 16px;
  height: 16px;
  place-self: center;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--terracotta);
  box-shadow: 0 0 0 1px rgba(201, 133, 107, 0.45);
  translate: 0 var(--depth-node-y, 0);
}

.timeline-item__marker::after {
  position: absolute;
  top: 25px;
  left: 50%;
  width: 23px;
  height: 18px;
  content: attr(data-chapter);
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 0.66rem;
  transform: translateX(-50%);
}

.timeline-item__date {
  margin-bottom: 9px;
  color: var(--terracotta);
  font-family: var(--font-english);
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.15em;
}

.timeline-item__title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 500;
  line-height: 1.3;
}

.timeline-item__title::after {
  width: 34px;
  height: 8px;
  flex: 0 0 auto;
  border-top: 1px solid var(--lotus);
  border-radius: 50%;
  content: "";
  transform: rotate(-5deg);
}

.timeline-item__description {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 2;
}

.timeline-item--no-media .timeline-item__card {
  align-self: center;
  padding-top: 28px;
  padding-bottom: 28px;
  border-top: 1px solid rgba(201, 133, 107, 0.18);
  border-bottom: 1px solid rgba(201, 133, 107, 0.18);
}

.timeline-item--no-media .timeline-item__title::after {
  width: 52px;
}

.timeline-item--custom .timeline-item__card {
  position: relative;
  padding-right: 72px;
}

.timeline-item--custom:nth-child(even) .timeline-item__card {
  padding-right: 0;
  padding-left: 72px;
}

.story-delete-button {
  position: absolute;
  top: 12px;
  right: 6px;
  z-index: 2;
  min-width: 46px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid rgba(201, 133, 107, 0.24);
  border-radius: 999px;
  color: var(--terracotta);
  background: rgba(250, 246, 240, 0.9);
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}

.timeline-item--custom:nth-child(even) .story-delete-button {
  right: auto;
  left: 6px;
}

.story-delete-button:hover {
  border-color: rgba(201, 133, 107, 0.5);
  background: var(--paper-deep);
}

.story-editor-entry {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 32px;
}

.story-add-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  gap: 9px;
  padding: 12px 24px;
  border: 1px solid rgba(201, 133, 107, 0.36);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 12px 35px rgba(97, 70, 55, 0.08);
  font-size: 0.93rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 250ms ease, border-color 250ms ease, transform 250ms ease;
}

.story-add-button span:first-child {
  color: var(--terracotta);
  font-family: var(--font-english);
  font-size: 1.4rem;
  line-height: 1;
}

.story-add-button:hover {
  border-color: rgba(201, 133, 107, 0.72);
  background: var(--white);
  transform: translateY(-2px);
}

.story-editor-entry p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.timeline-photo {
  --base-rotation: 0.8deg;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  overflow: hidden;
  border-radius: 8px 22px 8px 22px;
  background: var(--paper-deep);
  box-shadow: var(--shadow-photo);
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) rotate(var(--base-rotation));
  transform-style: preserve-3d;
  transition: transform 550ms var(--ease-soft), box-shadow 550ms var(--ease-soft);
}

.timeline-item:nth-child(even) .timeline-photo {
  --base-rotation: -0.8deg;
}

.timeline-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  filter: saturate(0.86) contrast(0.96) sepia(0.08);
  transition: transform 900ms var(--ease-soft), filter 900ms var(--ease-soft);
}

.timeline-photo:hover img {
  filter: saturate(1) contrast(1) sepia(0.03);
  transform: scale(1.025);
}

.timeline-photo.is-tilting {
  box-shadow: 0 27px 70px rgba(87, 65, 51, 0.2);
  transition-duration: 120ms;
}

.timeline-photo::after {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.story-video {
  margin-top: 16px;
}

.story-video video,
.video-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #5c5149;
}

.story-video video {
  object-fit: cover;
  box-shadow: 0 14px 35px rgba(74, 63, 53, 0.17);
}

.video-placeholder {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  padding: 30px;
  color: var(--white);
  text-align: center;
  background:
    linear-gradient(rgba(58, 48, 42, 0.25), rgba(58, 48, 42, 0.65)),
    url("../images/story-5.jpg") center 62% / cover;
}

.video-placeholder__play {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin: 0 auto 13px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  font-size: 19px;
  backdrop-filter: blur(8px);
}

.video-placeholder p {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.quiz-section {
  background:
    linear-gradient(165deg, rgba(240, 230, 216, 0.74), rgba(250, 246, 240, 0.25) 65%);
}

.quiz-card,
.quiz-result {
  padding: clamp(26px, 5vw, 50px);
  border: 1px solid rgba(74, 63, 53, 0.1);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 249, 0.82);
  box-shadow: var(--shadow-soft);
}

.quiz-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 35px;
  color: var(--ink-soft);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.quiz-card h3 {
  margin-bottom: 28px;
  font-size: clamp(1.35rem, 3.5vw, 1.9rem);
  font-weight: 500;
  line-height: 1.6;
}

.quiz-options {
  display: grid;
  gap: 12px;
}

.quiz-option {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 16px;
  padding: 13px 18px;
  border: 1px solid rgba(74, 63, 53, 0.13);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(250, 246, 240, 0.62);
  text-align: left;
  cursor: pointer;
  transition: border-color 250ms ease, background 250ms ease, transform 250ms ease, opacity 350ms ease;
}

.quiz-option:hover {
  border-color: rgba(201, 133, 107, 0.55);
  background: rgba(245, 237, 227, 0.9);
  transform: translateX(4px);
}

.quiz-option__letter {
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--terracotta);
  background: rgba(201, 133, 107, 0.1);
  font-family: var(--font-english);
  font-size: 0.9rem;
}

.quiz-option.is-wrong {
  opacity: 0;
  transform: translateX(20px) scale(0.96);
  pointer-events: none;
}

.quiz-option.is-correct {
  border-color: var(--sage);
  background: rgba(138, 154, 123, 0.13);
}

.quiz-feedback {
  min-height: 30px;
  margin: 20px 0 0;
  color: var(--terracotta);
  font-size: 0.86rem;
}

.quiz-special-message {
  min-height: 46px;
  margin: 8px 0 0;
  color: var(--heart);
  font-family: var(--font-hand);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 900ms var(--ease-soft), transform 900ms var(--ease-soft);
}

.quiz-special-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.quiz-result {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.quiz-result::before,
.quiz-result::after {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(201, 133, 107, 0.13);
  border-radius: 50%;
  content: "";
}

.quiz-result::before {
  top: -70px;
  left: -60px;
}

.quiz-result::after {
  right: -65px;
  bottom: -80px;
}

.quiz-result__stamp {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid rgba(201, 133, 107, 0.5);
  border-radius: 999px;
  color: var(--terracotta);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  transform: rotate(-2deg);
}

.quiz-result__score {
  margin: 20px 0 8px;
  color: var(--ink);
  font-family: var(--font-english);
  font-size: clamp(2.35rem, 7.2vw, 4.6rem);
  line-height: 1;
  white-space: nowrap;
}

.quiz-result h3 {
  margin-bottom: 24px;
  font-size: 1.3rem;
  font-weight: 500;
}

.soft-button,
.text-button {
  border: 0;
  cursor: pointer;
}

.soft-button {
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid rgba(74, 63, 53, 0.12);
  border-radius: 999px;
  background: var(--paper-deep);
  transition: background 200ms ease, transform 200ms ease;
}

.soft-button:hover {
  background: #eadccb;
  transform: translateY(-2px);
}

.text-button {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(201, 133, 107, 0.45);
  color: var(--terracotta);
  background: transparent;
  font-size: 0.84rem;
}

.scratch-section {
  background: var(--paper-warm);
}

.scratch-wrap {
  width: min(100%, 620px);
  margin: 0 auto;
}

.scratch-card {
  position: relative;
  overflow: hidden;
  min-height: 315px;
  padding: clamp(32px, 6vw, 58px);
  border: 1px solid rgba(74, 63, 53, 0.11);
  border-radius: 24px 6px 24px 6px;
  background:
    repeating-linear-gradient(to bottom, transparent 0 42px, rgba(74, 63, 53, 0.045) 42px 43px),
    var(--white);
  box-shadow: var(--shadow-soft);
  isolation: isolate;
}

.scratch-card::before {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(201, 133, 107, 0.28);
  border-radius: 50%;
  content: "♡";
  color: rgba(201, 133, 107, 0.7);
  font-size: 23px;
  line-height: 44px;
  text-align: center;
}

.scratch-card__corner {
  display: block;
  margin-bottom: clamp(35px, 8vw, 70px);
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
}

.scratch-card__quote {
  width: min(100%, 440px);
  min-height: 90px;
  margin: 0 0 25px;
  font-family: var(--font-hand);
  font-size: clamp(1.55rem, 4.2vw, 2.25rem);
  line-height: 1.7;
}

.scratch-card__signature {
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--font-hand);
  font-size: 1.1rem;
  text-align: right;
}

#scratchCanvas {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  cursor: crosshair;
  touch-action: none;
}

.scratch-card__hint {
  position: absolute;
  z-index: 4;
  right: 24px;
  bottom: 18px;
  margin: 0;
  color: rgba(255, 253, 249, 0.78);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.scratch-card.is-revealed .scratch-card__hint {
  opacity: 0;
}

.scratch-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-top: 22px;
}

.finale {
  overflow: hidden;
  padding-bottom: max(50px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 40%, rgba(212, 165, 165, 0.2), transparent 25rem),
    linear-gradient(to bottom, var(--paper), #eee2d4);
}

.finale__glow {
  position: absolute;
  z-index: 0;
  top: 10%;
  left: 50%;
  width: min(82vw, 680px);
  height: min(82vw, 680px);
  border: 1px solid rgba(201, 133, 107, 0.08);
  border-radius: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.heart-canvas {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.finale > .section-shell {
  position: relative;
  z-index: 1;
}

.finale__glow::before,
.finale__glow::after {
  position: absolute;
  border: 1px solid rgba(201, 133, 107, 0.07);
  border-radius: 50%;
  content: "";
}

.finale__glow::before {
  inset: 10%;
}

.finale__glow::after {
  inset: 23%;
}

.finale__message {
  text-align: center;
}

.finale__message h2 {
  margin-bottom: 18px;
  font-size: clamp(2.25rem, 5.4vw, 4rem);
  letter-spacing: 0.1em;
}

.finale__signature {
  color: var(--ink-soft);
  font-family: var(--font-hand);
  font-size: 1.35rem;
}

.secret {
  display: grid;
  justify-items: center;
  margin: 65px auto 35px;
}

.secret__hint {
  margin-bottom: 20px;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

.hold-heart {
  position: relative;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.hold-heart::before {
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  content: "";
  background: rgba(255, 253, 249, 0.7);
  box-shadow: 0 14px 38px rgba(122, 76, 67, 0.13);
  transition: transform 350ms var(--ease-soft), background 350ms ease;
}

.hold-heart:hover::before,
.hold-heart.is-holding::before {
  background: var(--white);
  transform: scale(1.08);
}

.hold-heart__ring {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.hold-heart__track,
.hold-heart__progress {
  fill: none;
  stroke-width: 2;
}

.hold-heart__track {
  stroke: rgba(201, 133, 107, 0.16);
}

.hold-heart__progress {
  stroke: var(--heart);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
}

.hold-heart__icon {
  position: relative;
  z-index: 3;
  color: var(--heart);
  font-family: var(--font-english);
  font-size: 40px;
  line-height: 1;
  transition: transform 350ms var(--ease-soft);
}

.hold-heart.is-holding .hold-heart__icon {
  transform: scale(1.08);
}

.hold-heart.is-complete .hold-heart__icon {
  animation: completeBeat 700ms ease;
}

@keyframes completeBeat {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.35);
  }
}

.secret__label {
  margin: 11px 0 0;
  color: var(--terracotta);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.letter-panel {
  width: min(100%, 620px);
  margin: 24px auto 70px;
  padding: 18px;
  border: 1px solid rgba(74, 63, 53, 0.11);
  border-radius: 5px 20px 5px 20px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(87, 65, 51, 0.18);
  transform-origin: top center;
  animation: letterOpen 900ms var(--ease-soft) both;
}

@keyframes letterOpen {
  from {
    opacity: 0;
    transform: perspective(900px) rotateX(-24deg) translateY(-20px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: perspective(900px) rotateX(0) translateY(0) scale(1);
  }
}

.letter-panel__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 4px 14px;
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 0.69rem;
  letter-spacing: 0.15em;
}

.icon-button,
.lightbox__close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(240, 230, 216, 0.85);
  font-family: var(--font-english);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.letter-photo-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 3px 14px 3px 14px;
  background: var(--paper);
  cursor: zoom-in;
  overflow: hidden;
}

.letter-photo-button img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 700ms var(--ease-soft);
}

.letter-photo-button:hover img {
  transform: scale(1.015);
}

.letter-panel > p {
  margin: 15px 8px 4px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid rgba(74, 63, 53, 0.1);
  color: var(--ink-soft);
  font-family: var(--font-english);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-align: center;
}

.site-footer p {
  margin: 4px 0;
}

.music-button {
  position: fixed;
  z-index: 9000;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 253, 249, 0.38);
  border-radius: 50%;
  color: var(--white);
  background: rgba(74, 63, 53, 0.84);
  box-shadow: 0 9px 26px rgba(43, 34, 28, 0.2);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: transform 250ms ease, background 250ms ease;
}

.music-button:hover {
  background: rgba(79, 63, 55, 0.95);
  transform: translateY(-3px);
}

.music-button__note {
  position: relative;
  z-index: 2;
  font-family: var(--font-english);
  font-size: 26px;
  line-height: 1;
}

.music-button__pulse {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: musicPulse 2.4s ease-out infinite;
}

.music-button.is-playing .music-button__pulse {
  animation-duration: 1.2s;
  border-color: rgba(240, 217, 203, 0.6);
}

@keyframes musicPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.87);
  }
  55% {
    opacity: 0.8;
    transform: scale(1);
  }
}

.lightbox {
  position: fixed;
  z-index: 10003;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 50px);
  background: rgba(40, 33, 29, 0.88);
  backdrop-filter: blur(12px);
}

.lightbox img {
  max-width: min(92vw, 1080px);
  max-height: 88vh;
  border-radius: 4px 16px 4px 16px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.32);
}

.lightbox__close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.story-modal {
  width: min(92vw, 720px);
  max-height: min(90vh, 860px);
  padding: 0;
  border: 1px solid rgba(74, 63, 53, 0.13);
  border-radius: 28px;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 12%, rgba(212, 165, 165, 0.18), transparent 15rem),
    var(--paper);
  box-shadow: 0 35px 110px rgba(53, 40, 33, 0.28);
  overflow: auto;
}

.story-modal::backdrop {
  background: rgba(50, 40, 34, 0.56);
  backdrop-filter: blur(7px);
}

.story-form {
  display: grid;
  gap: 20px;
  padding: clamp(24px, 5vw, 42px);
}

.story-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.story-modal__eyebrow {
  margin-bottom: 8px;
  color: var(--terracotta);
  font-family: var(--font-english);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.story-modal__header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 500;
}

.story-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.story-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.82rem;
}

.story-field > span,
.story-upload__title {
  font-weight: 600;
}

.story-field small,
.story-form__hint,
.story-upload__filename {
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.6;
}

.story-field input,
.story-field textarea {
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid rgba(74, 63, 53, 0.14);
  border-radius: 11px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.8);
  font: inherit;
  font-size: 0.9rem;
}

.story-field textarea {
  min-height: 132px;
  resize: vertical;
}

.story-field input:focus,
.story-field textarea:focus {
  border-color: rgba(201, 133, 107, 0.65);
  outline: 3px solid rgba(201, 133, 107, 0.12);
}

.story-form__hint {
  margin: -4px 0;
}

.story-form__media-grid {
  align-items: start;
}

.story-upload {
  display: grid;
  min-height: 127px;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(201, 133, 107, 0.42);
  border-radius: 15px;
  background: rgba(245, 237, 227, 0.52);
  text-align: center;
  cursor: pointer;
}

.story-upload__button {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--white);
  background: var(--terracotta);
  font-size: 0.72rem;
}

.story-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.story-preview {
  position: relative;
  overflow: hidden;
  min-height: 127px;
  border-radius: 15px;
  background: var(--paper-deep);
}

.story-preview img,
.story-preview video {
  display: block;
  width: 100%;
  height: 127px;
  object-fit: cover;
  border-radius: inherit;
}

.story-preview video {
  background: #5a4b43;
}

.story-form__status {
  min-height: 20px;
  margin: -5px 0 0;
  color: var(--terracotta);
  font-size: 0.76rem;
}

.story-form__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
}

.primary-button {
  min-height: 46px;
  padding: 10px 23px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--terracotta);
  box-shadow: 0 9px 24px rgba(156, 96, 74, 0.2);
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease;
}

.primary-button:hover {
  background: #b8755d;
  transform: translateY(-2px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.toast {
  position: fixed;
  z-index: 10004;
  bottom: 88px;
  left: 50%;
  max-width: min(88vw, 420px);
  padding: 10px 17px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(74, 63, 53, 0.92);
  box-shadow: 0 10px 30px rgba(43, 34, 28, 0.2);
  font-size: 0.78rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 250ms ease, transform 250ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.floating-heart {
  position: fixed;
  z-index: 9500;
  color: var(--heart);
  font-size: 21px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 3px 7px rgba(224, 138, 138, 0.2));
  will-change: transform, opacity;
  animation: heartFloat var(--heart-duration, 3.1s) var(--ease-soft) forwards;
}

@keyframes heartFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(0);
  }
  16% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--drift)), -170px) scale(1.18) rotate(var(--rotate));
  }
}

.burst-heart {
  position: fixed;
  z-index: 9500;
  color: var(--heart);
  font-size: 20px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: heartBurst 1.15s var(--ease-soft) forwards;
}

@keyframes heartBurst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--burst-x)), calc(-50% + var(--burst-y))) scale(1.1) rotate(var(--burst-r));
  }
}

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 900ms var(--ease-soft), transform 900ms var(--ease-soft);
}

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

.timeline-item .reveal {
  transition-delay: 80ms;
}

.noscript-message {
  position: fixed;
  z-index: 10005;
  right: 20px;
  bottom: 20px;
  left: 20px;
  padding: 12px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper-deep);
  text-align: center;
}

@media (max-width: 820px) {
  .map-visual {
    height: 176px;
    margin-top: 8px;
  }

  .distance-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .info-card {
    min-height: 0;
  }

  .timeline::before {
    left: 16px;
  }

  .timeline-item {
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: start;
  }

  .timeline-item__marker,
  .timeline-item:nth-child(even) .timeline-item__marker {
    grid-column: 1;
    grid-row: 1;
    margin-top: 4px;
    place-self: start center;
  }

  .timeline-item__marker::after {
    top: 22px;
    font-size: 0.58rem;
  }

  .timeline-item__card,
  .timeline-item:nth-child(even) .timeline-item__card {
    grid-column: 2;
    grid-row: 1;
    padding: 0 0 23px 15px;
  }

  .timeline-item__media,
  .timeline-item:nth-child(even) .timeline-item__media {
    grid-column: 2;
    grid-row: 2;
    padding-left: 15px;
  }

  .timeline-photo,
  .timeline-item:nth-child(even) .timeline-photo {
    transform: rotate(0.5deg);
  }
}

@media (max-width: 560px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding-right: 18px;
    padding-left: 18px;
  }

  .hero__media img {
    object-position: 54% center;
  }

  .hero__eyebrow {
    margin-bottom: 19px;
    letter-spacing: 0.22em;
  }

  .hero h1 {
    font-size: clamp(3rem, 17vw, 4.8rem);
  }

  .hero__intro {
    max-width: 20rem;
    font-size: 0.88rem;
  }

  .hero__ornament--one {
    left: 7%;
  }

  .hero__ornament--two {
    right: 8%;
  }

  .section {
    padding-right: 18px;
    padding-left: 18px;
  }

  .section-heading {
    margin-bottom: 42px;
  }

  .section-heading > p:last-child {
    font-size: 0.87rem;
  }

  .love-clock {
    padding-right: 15px;
    padding-left: 15px;
  }

  .love-clock__digits {
    gap: 4px;
  }

  .love-clock__digits b {
    min-width: 1.5em;
    font-size: clamp(2rem, 10.5vw, 2.9rem);
  }

  .love-clock__digits small {
    font-size: 0.62rem;
  }

  .info-card {
    padding: 24px;
  }

  .timeline {
    gap: 64px;
  }

  .timeline-item__description {
    font-size: 0.88rem;
    line-height: 1.95;
  }

  .timeline-item__media,
  .timeline-item:nth-child(even) .timeline-item__media,
  .timeline-item__card,
  .timeline-item:nth-child(even) .timeline-item__card {
    padding-left: 14px;
  }

  .timeline-photo {
    border-radius: 5px 17px 5px 17px;
  }

  .timeline-item--custom .timeline-item__card,
  .timeline-item--custom:nth-child(even) .timeline-item__card {
    padding-right: 48px;
    padding-left: 14px;
  }

  .timeline-item--custom:nth-child(even) .story-delete-button,
  .story-delete-button {
    right: 0;
    left: auto;
  }

  .quiz-card__meta {
    margin-bottom: 26px;
  }

  .quiz-option {
    padding-right: 14px;
    padding-left: 14px;
  }

  .scratch-card {
    min-height: 300px;
    padding: 28px 24px;
  }

  .scratch-card__corner {
    margin-bottom: 46px;
  }

  .scratch-card__quote {
    min-height: 104px;
  }

  .scratch-actions {
    gap: 15px;
  }

  .music-button {
    width: 48px;
    height: 48px;
  }

  .story-modal {
    width: calc(100vw - 20px);
    max-height: 94dvh;
    border-radius: 21px;
  }

  .story-form {
    gap: 17px;
    padding: 23px 18px calc(24px + env(safe-area-inset-bottom));
  }

  .story-form__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .story-form__actions {
    position: sticky;
    bottom: -24px;
    padding: 14px 0 0;
    background: linear-gradient(transparent, var(--paper) 22%);
  }
}

@media (max-width: 390px) {
  .hero h1 {
    font-size: 3.05rem;
  }

  .love-clock__digits b {
    font-size: 1.83rem;
  }

  .love-clock__digits small {
    letter-spacing: -0.04em;
  }

  .info-card__topline {
    font-size: 0.69rem;
  }

  .quiz-card,
  .quiz-result {
    padding: 23px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

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

  .reveal {
    opacity: 1;
    transform: none;
  }

  .timeline-item__card,
  .timeline-item__media,
  .timeline-item__marker {
    translate: none;
    scale: none;
  }

  .timeline-photo {
    --tilt-x: 0deg;
    --tilt-y: 0deg;
  }
}
