:root {
  --bg: #f4eee2;
  --ink: #1f1712;
  --muted: #6a5647;
  --paper: #fffaf1;
  --line: #ddcfbf;
  --accent: #9b5e40;
  --accent-soft: #cb9a7a;
  --shadow: 0 18px 40px rgba(20, 10, 4, 0.15);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 5%, #fff8ed 0%, #f3e8d8 50%, #ebdcc9 100%);
}

.effects-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

#petalLayer,
#sparkLayer {
  position: absolute;
  inset: 0;
}

.petal {
  position: absolute;
  top: -24px;
  font-size: 18px;
  opacity: 0.9;
  will-change: transform, opacity;
  animation: petalFall linear forwards;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

.spark-burst {
  position: absolute;
  width: 0;
  height: 0;
}

.spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 20px;
  border-radius: 999px;
  transform-origin: 50% 100%;
  transform: rotate(var(--rot)) translateY(0);
  background: linear-gradient(180deg, #fff7d5 0%, #ffc867 45%, rgba(255, 130, 85, 0) 100%);
  animation: sparkBurst 0.75s ease-out forwards;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  line-height: 1.05;
}

.cover {
  min-height: 100vh;
  position: relative;
  color: #fff;
  overflow: hidden;
}

.cover-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(8, 4, 2, 0.8), rgba(52, 24, 9, 0.34));
}

.top-nav,
.cover-content {
  position: relative;
  z-index: 2;
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.3rem 6vw;
}

.brand {
  letter-spacing: 0.28rem;
  font-size: 0.94rem;
  font-weight: 700;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
}

.nav-links a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

.cover-content {
  max-width: 760px;
  padding: 17vh 6vw 0;
}

.issue,
.tag {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.72rem;
}

.cover-content h1 {
  margin-top: 0.55rem;
  font-size: clamp(2.8rem, 6.2vw, 5.6rem);
}

.sub {
  margin-top: 0.9rem;
  max-width: 540px;
  line-height: 1.72;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.8rem 1.45rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-soft));
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  margin-top: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(107, 60, 36, 0.34);
}

.btn-ghost {
  background: transparent;
  border: 1.4px solid #89614a;
  color: #664533;
}

main {
  padding: 4rem 6vw 4.8rem;
}

.journey-intro {
  max-width: 760px;
  margin: 0 auto 2.3rem;
  text-align: center;
}

.journey-intro h2 {
  margin-top: 0.45rem;
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.journey-intro p:last-child {
  margin-top: 0.75rem;
  line-height: 1.7;
  color: var(--muted);
}

.story-journey {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

.snake-rail {
  position: absolute;
  left: 50%;
  top: 0;
  width: 240px;
  height: 100%;
  transform: translateX(-50%);
  overflow: visible;
  z-index: 1;
}

.rail-left,
.rail-right {
  fill: none;
  stroke: #6d6d6d;
  stroke-width: 4;
  stroke-linecap: round;
}

.rail-ties {
  fill: none;
  stroke: #8b6c4f;
  stroke-width: 14;
  stroke-linecap: round;
  stroke-dasharray: 1 30;
  opacity: 0.82;
}

.rail-progress {
  fill: none;
  stroke: url(#trailGradient);
  stroke: #ffb869;
  stroke-width: 8;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(255, 178, 89, 0.75));
}

.trail-dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7d3, #ffb95d);
  box-shadow: 0 0 18px rgba(255, 179, 82, 0.75);
  transition: top 0.2s linear;
  z-index: 2;
}

.trail-train {
  position: absolute;
  left: 0;
  top: 0;
  width: 62px;
  height: 42px;
  transform: translate(-50%, -56%);
  transition: top 0.2s linear;
  animation: trainBounce 0.45s ease-in-out infinite;
  z-index: 3;
}

.train-body {
  position: absolute;
  left: 10px;
  bottom: 12px;
  width: 34px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, #3f4a58 0%, #1f2732 100%);
  border: 1px solid #121821;
}

.train-cabin {
  position: absolute;
  left: 35px;
  bottom: 17px;
  width: 17px;
  height: 13px;
  border-radius: 3px 3px 2px 2px;
  background: linear-gradient(180deg, #59697e 0%, #2a3443 100%);
  border: 1px solid #121821;
}

.train-window {
  position: absolute;
  left: 39px;
  bottom: 21px;
  width: 8px;
  height: 6px;
  border-radius: 2px;
  background: #cbe4ff;
  border: 1px solid rgba(17, 31, 46, 0.5);
}

.train-chimney {
  position: absolute;
  left: 15px;
  bottom: 25px;
  width: 8px;
  height: 10px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #465669 0%, #212b37 100%);
  border: 1px solid #121821;
}

.train-smoke {
  position: absolute;
  left: 13px;
  bottom: 33px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(236, 236, 236, 0.9);
  box-shadow: 7px -5px 0 rgba(226, 226, 226, 0.7), 13px -10px 0 rgba(215, 215, 215, 0.5);
  animation: smoke 1.6s ease-out infinite;
}

.wheel {
  position: absolute;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9daab9 0%, #2d3744 72%);
  border: 1px solid #141b23;
}

.wheel-1 {
  left: 11px;
}

.wheel-2 {
  left: 25px;
}

.wheel-3 {
  left: 40px;
}

.coffee-cup {
  display: none;
}

.trail-train.is-coffee {
  width: 120px;
  height: 120px;
  animation: coffeePop 0.45s ease forwards;
}

.trail-train.is-coffee .train-smoke,
.trail-train.is-coffee .train-body,
.trail-train.is-coffee .train-cabin,
.trail-train.is-coffee .train-window,
.trail-train.is-coffee .train-chimney,
.trail-train.is-coffee .wheel {
  display: none;
}

.trail-train.is-coffee .coffee-cup {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.25));
}

.fairy-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(1px);
  animation: float 5.5s ease-in-out infinite;
  z-index: 0;
}

.orb-1 {
  width: 24px;
  height: 24px;
  left: 20%;
  top: 16%;
  background: rgba(255, 202, 130, 0.48);
}

.orb-2 {
  width: 18px;
  height: 18px;
  right: 19%;
  top: 42%;
  background: rgba(255, 166, 110, 0.45);
  animation-delay: 0.8s;
}

.orb-3 {
  width: 20px;
  height: 20px;
  left: 28%;
  bottom: 20%;
  background: rgba(255, 217, 153, 0.5);
  animation-delay: 1.4s;
}

.story-step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 240px 1fr;
  align-items: center;
  margin-bottom: 4.4rem;
  z-index: 2;
}

.step-center {
  grid-column: 2;
  justify-self: center;
}

.step-node {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fffaf0;
  border: 4px solid #c69d7b;
  box-shadow: 0 0 10px rgba(198, 157, 123, 0.35);
}

.step-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  width: min(100%, 430px);
}

.story-step:nth-child(odd) .step-card {
  grid-column: 1;
  justify-self: end;
  margin-right: 24px;
}

.story-step:nth-child(even) .step-card {
  grid-column: 3;
  justify-self: start;
  margin-left: 24px;
}

.story-step:nth-child(3n + 1) .step-card {
  width: min(100%, 460px);
}

.story-step:nth-child(3n + 2) .step-card {
  width: min(100%, 390px);
}

.story-step:nth-child(3n) .step-card {
  width: min(100%, 440px);
}

.story-step:nth-child(odd) .step-card::after,
.story-step:nth-child(even) .step-card::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 74px;
  height: 2px;
  background: #ccb298;
}

.story-step:nth-child(odd) .step-card::after {
  right: -74px;
}

.story-step:nth-child(even) .step-card::after {
  left: -74px;
}

.step-card img {
  width: 100%;
  height: 400px;
  object-fit: contain;
  display: block;
  background: #191310;
}

.step-text {
  padding: 0.85rem 0.9rem 0.95rem;
}

.step-text h3 {
  font-size: 1.28rem;
}

.step-text p {
  margin: 0.4rem 0 0;
  color: #4f3f35;
  line-height: 1.45;
}

.date-section {
  margin-top: 3.2rem;
}

.date-section.locked {
  opacity: 0;
  transform: translateY(28px);
  pointer-events: none;
}

.date-section.unlocked {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.date-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  padding: 1.7rem;
}

.date-scene {
  position: relative;
  height: 120px;
  margin: -0.35rem auto 0.6rem;
  max-width: 320px;
}

.scene-couple {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 46px;
}

.person {
  position: relative;
  width: 56px;
  height: 92px;
  animation: sway 2.2s ease-in-out infinite;
}

.person .head {
  position: absolute;
  left: 18px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f8ceb3;
  border: 1px solid rgba(68, 37, 18, 0.18);
}

.person .body {
  position: absolute;
  left: 11px;
  top: 24px;
  width: 34px;
  height: 56px;
  border-radius: 16px 16px 10px 10px;
}

.person .cup {
  position: absolute;
  left: 2px;
  top: 40px;
  width: 14px;
  height: 12px;
  border-radius: 0 0 6px 6px;
  background: #fff;
  border: 1px solid #d8cdc0;
}

.person .cup::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 2px;
  width: 4px;
  height: 6px;
  border: 1px solid #d8cdc0;
  border-left: 0;
  border-radius: 0 5px 5px 0;
}

.person-boy {
  transform-origin: 80% 85%;
}

.person-boy .body {
  background: linear-gradient(180deg, #44556a, #293445);
}

.person-girl {
  transform-origin: 20% 85%;
  animation-delay: 0.2s;
}

.person-girl .body {
  background: linear-gradient(180deg, #7d506b, #4f3146);
}

.scene-heart {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  color: #d34f6d;
  font-size: 1.2rem;
  animation: heartPop 1.6s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(211, 79, 109, 0.3);
}

.steam {
  position: absolute;
  width: 6px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(188, 170, 154, 0.8);
  border-color: rgba(188, 170, 154, 0.8) transparent transparent transparent;
  animation: steamRise 1.8s ease-out infinite;
}

.steam-1 {
  left: calc(50% - 34px);
  top: 47px;
}

.steam-2 {
  left: calc(50% + 24px);
  top: 49px;
  animation-delay: 0.35s;
}

.date-box h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.date-box > p {
  margin-top: 0.5rem;
  color: #514136;
}

.answer-buttons {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

#noBtn {
  position: relative;
  transition: transform 0.2s ease;
}

form {
  display: grid;
  gap: 0.82rem;
  margin-top: 0.65rem;
}

label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.93rem;
  font-weight: 600;
}

input,
textarea,
select {
  border: 1px solid #d5c8b8;
  border-radius: 0.66rem;
  padding: 0.7rem;
  font: inherit;
  background: #fff;
}

.success {
  color: #2f6b2a;
  font-weight: 700;
  margin-top: 0.8rem;
}

.note {
  color: #6e4f40;
  margin-top: 0.65rem;
}

.hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

@keyframes petalFall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(var(--drift), 115vh, 0) rotate(560deg);
    opacity: 0;
  }
}

@keyframes trainBounce {
  0%,
  100% {
    transform: translate(-50%, -56%);
  }
  50% {
    transform: translate(-50%, -63%);
  }
}

@keyframes smoke {
  0% {
    opacity: 0.8;
    transform: translate(0, 0) scale(0.9);
  }
  100% {
    opacity: 0;
    transform: translate(8px, -12px) scale(1.3);
  }
}

@keyframes sparkBurst {
  0% {
    transform: rotate(var(--rot)) translateY(0) scaleY(0.6);
    opacity: 1;
  }
  100% {
    transform: rotate(var(--rot)) translateY(-42px) scaleY(1);
    opacity: 0;
  }
}

@keyframes coffeePop {
  0% {
    transform: translate(-50%, -56%) scale(1);
  }
  100% {
    transform: translate(-50%, -66%) scale(1.08);
  }
}

@keyframes sway {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes heartPop {
  0%,
  100% {
    transform: translateX(-50%) scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-50%) scale(1.2);
    opacity: 1;
  }
}

@keyframes steamRise {
  0% {
    opacity: 0.75;
    transform: translateY(0) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translateY(-16px) scale(1.2);
  }
}

@media (max-width: 980px) {
  main {
    padding: 3rem 5vw 4rem;
  }

  .cover-content {
    max-width: 620px;
    padding-top: 15vh;
  }

  .cover-content h1 {
    font-size: clamp(2.3rem, 7vw, 4.2rem);
  }

  .sub {
    font-size: 0.98rem;
  }

  .journey-intro {
    margin-bottom: 1.5rem;
  }

  .story-step {
    grid-template-columns: 44px 1fr;
    margin-bottom: 2.2rem;
  }

  .snake-rail {
    left: 12px;
    transform: none;
    width: 44px;
    height: 100%;
  }

  .step-center {
    grid-column: 1;
  }

  .story-step .step-card {
    grid-column: 2 !important;
    justify-self: start;
    margin: 0;
    width: 100%;
  }

  .story-step .step-card::after {
    left: -30px !important;
    right: auto !important;
    width: 30px !important;
  }
}

@media (max-width: 640px) {
  .top-nav {
    padding: 1rem 5vw;
  }

  .top-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .brand {
    font-size: 0.84rem;
    letter-spacing: 0.2rem;
  }

  .nav-links {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
  }

  .nav-links a {
    font-size: 0.84rem;
  }

  .cover {
    min-height: 90vh;
  }

  .cover-content {
    padding: 12vh 5vw 0;
  }

  .cover-content h1 {
    font-size: clamp(2rem, 8.8vw, 3rem);
    line-height: 1.08;
  }

  .sub {
    font-size: 0.92rem;
    line-height: 1.6;
    max-width: 100%;
  }

  main {
    padding: 2.2rem 4vw 3rem;
  }

  .journey-intro {
    text-align: left;
    margin-bottom: 1.2rem;
  }

  .journey-intro h2 {
    font-size: clamp(1.7rem, 7.6vw, 2.4rem);
  }

  .story-journey {
    padding: 0.6rem 0 1.6rem;
  }

  .snake-rail {
    left: 10px;
    width: 36px;
  }

  .rail-left,
  .rail-right {
    stroke-width: 3;
  }

  .rail-ties {
    stroke-width: 10;
  }

  .trail-train {
    width: 50px;
    height: 34px;
  }

  .trail-train.is-coffee {
    width: 88px;
    height: 88px;
  }

  .trail-train.is-coffee .coffee-cup {
    font-size: 3.5rem;
  }

  .story-step {
    grid-template-columns: 34px 1fr;
    margin-bottom: 1.2rem;
  }

  .story-step .step-card::after {
    left: -20px !important;
    width: 20px !important;
  }

  .step-node {
    width: 14px;
    height: 14px;
    border-width: 3px;
  }

  .step-card img {
    height: 260px;
  }

  .step-text {
    padding: 0.72rem 0.75rem 0.8rem;
  }

  .step-text h3 {
    font-size: 1.05rem;
  }

  .step-text p {
    font-size: 0.86rem;
  }

  .fairy-orb {
    opacity: 0.55;
  }

  .orb-2,
  .orb-3 {
    display: none;
  }

  .date-section {
    margin-top: 2rem;
  }

  .date-box {
    padding: 1rem;
    border-radius: 0.9rem;
  }

  .date-scene {
    height: 100px;
    max-width: 260px;
  }

  .scene-couple {
    gap: 30px;
  }

  .person {
    width: 48px;
    height: 84px;
  }

  .person .head {
    width: 20px;
    height: 20px;
    left: 15px;
  }

  .person .body {
    left: 9px;
    width: 30px;
    height: 50px;
  }

  .date-box h2 {
    font-size: clamp(1.6rem, 7.6vw, 2.2rem);
  }

  .date-box > p {
    font-size: 0.9rem;
  }

  .answer-buttons .btn {
    width: 100%;
    text-align: center;
  }

  label {
    font-size: 0.88rem;
  }

  input,
  textarea,
  select {
    padding: 0.62rem;
    font-size: 0.93rem;
  }

  .petal {
    font-size: 15px;
  }

  .spark {
    width: 3px;
    height: 16px;
  }
}
