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

:root {
  --black: #0a0a0a;
  --black-light: #111111;
  --burgundy: #6b1d2a;
  --burgundy-deep: #4a0e1a;
  --wine: #8c2f3e;
  --rose: #c4515e;
  --gold: #c9a84c;
  --gold-light: #e2c97e;
  --gold-pale: #f0dda0;
  --cream: #f5e6d0;
  --white-soft: #ede0d4;
  --text: #d4c5b5;
  --text-dim: #8a7e74;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--burgundy) var(--black);
}

body {
  background: var(--black);
  color: var(--text);
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ========== OPENING SCENE ========== */

.opening {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(
    ellipse at 50% 80%,
    var(--burgundy-deep) 0%,
    var(--black) 70%
  );
}

.opening::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1px 1px at 20% 30%, rgba(201, 168, 76, 0.3), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(201, 168, 76, 0.2), transparent),
    radial-gradient(1px 1px at 50% 70%, rgba(201, 168, 76, 0.15), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(201, 168, 76, 0.2), transparent),
    radial-gradient(1px 1px at 90% 60%, rgba(201, 168, 76, 0.15), transparent);
  animation: shimmer 8s ease-in-out infinite alternate;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.opening-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 1.5rem;
}

.subtitle-intro {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(0.85rem, 2vw, 1.1rem);
  font-weight: 300;
  letter-spacing: 0.45em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0;
  animation: fadeUp 2s ease 0.5s forwards;
  margin-bottom: 1.5rem;
}

.names {
  font-family: "Playfair Display", serif;
  font-size: clamp(2.4rem, 7vw, 5.5rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.15;
  opacity: 0;
  animation: fadeUp 2.5s ease 1.5s forwards;
  position: relative;
}

.names .ampersand {
  display: block;
  font-family: "La Belle Aurore", cursive;
  font-size: 0.5em;
  color: var(--gold);
  margin: 0.1em 0;
}

.opening-line {
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 2rem auto;
  opacity: 0;
  animation: fadeUp 2s ease 2.8s forwards;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  opacity: 0;
  animation: fadeUp 2s ease 3.5s forwards;
  z-index: 3;
}

.btn-begin {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 0.9rem 2.5rem;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.6s ease;
  white-space: nowrap;
}

.btn-begin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--burgundy-deep), rgba(74, 14, 26, 0.6));
  opacity: 0;
  transition: opacity 0.6s ease;
}

.btn-begin:hover {
  color: var(--cream);
  border-color: var(--gold-light);
  box-shadow: 0 0 30px rgba(201, 168, 76, 0.15);
}

.btn-begin:hover::before {
  opacity: 1;
}

.btn-begin span {
  position: relative;
  z-index: 1;
  font-size: inherit;
  letter-spacing: inherit;
  color: inherit;
}

.btn-begin.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  position: relative;
  overflow: hidden;
}

.scroll-arrow::after {
  content: "";
  position: absolute;
  top: -40px;
  left: 0;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, transparent, var(--gold));
  animation: scrollDown 2s ease-in-out infinite;
}

/* Auto-scroll pause indicator */
.pause-indicator {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  font-family: "Cormorant Garamond", serif;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
  opacity: 0;
  transition: all 0.5s ease;
  z-index: 100;
  pointer-events: none;
  white-space: nowrap;
}

.pause-indicator.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== TIMELINE SECTION ========== */

.timeline-section {
  position: relative;
  padding: 8rem 1.5rem 6rem;
  max-width: 900px;
  margin: 0 auto;
}

.timeline-header {
  text-align: center;
  margin-bottom: 6rem;
}

.timeline-header h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 400;
  color: var(--cream);
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-header h2.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-header .header-line {
  width: 60px;
  height: 1px;
  background: var(--gold);
  margin: 1.5rem auto 0;
  opacity: 0;
  transition: opacity 1.2s ease 0.3s;
}

.timeline-header h2.visible + .header-line {
  opacity: 1;
}

.timeline {
  position: relative;
  padding-left: 40px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--burgundy) 10%,
    var(--gold) 50%,
    var(--burgundy) 90%,
    transparent
  );
}

.milestone {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(40px);
  transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
  padding: clamp(2rem, 4vh, 4rem) 0;
}

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

.milestone-content {
  position: relative;
}

.milestone-dot {
  position: absolute;
  left: -40px;
  top: 0.5rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--black);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 15px rgba(201, 168, 76, 0.3);
  transition: all 0.5s ease;
}

.milestone.visible .milestone-dot {
  background: var(--gold);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.5);
}

.milestone-date {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.milestone-title {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1.2rem;
  font-style: italic;
}

.milestone-text {
  display: grid;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 300;
  line-height: 1.8;
  color: var(--text);
}

.milestone-text > * {
  grid-area: 1 / 1;
}

.text-spacer {
  visibility: hidden;
}

.text-typed {
  visibility: visible;
}

.typewriter-cursor {
  display: inline-block;
  width: 1.5px;
  height: 1.1em;
  background: var(--gold);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

/* ========== POLAROID PHOTO COLLAGE ========== */

.polaroid {
  perspective: 800px;
  width: 100%;
  max-width: 380px;
  margin-bottom: 1.8rem;
}

.polaroid-wrapper {
  position: relative;
  background: #f2ece4;
  padding: 12px 12px 40px 12px;
  border-radius: 12px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

.milestone:nth-child(1) .polaroid-wrapper {
  transform: rotate(-2deg);
}

.milestone:nth-child(2) .polaroid-wrapper {
  transform: rotate(1.5deg);
}

.milestone:nth-child(3) .polaroid-wrapper {
  transform: rotate(-1deg);
}

.milestone:nth-child(4) .polaroid-wrapper {
  transform: rotate(2.5deg);
}

.milestone:nth-child(5) .polaroid-wrapper {
  transform: rotate(-1.8deg);
}

.polaroid-wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    transparent 50%,
    rgba(0, 0, 0, 0.03) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.polaroid-glare {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
  border-radius: 12px;
}

.polaroid-glare-inner {
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.12) 0%,
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  transform: translate(0, 0) scale(1.5);
}

.polaroid-wrapper:hover .polaroid-glare-inner {
  opacity: 1;
}

.polaroid-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
  border-radius: 8px;
}

.polaroid-image-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(145deg, #1a0a10, #0d0d0d);
  position: relative;
}

.polaroid-image-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 30% 40%,
      rgba(201, 168, 76, 0.05) 0%,
      transparent 60%
    ),
    radial-gradient(
      ellipse at 70% 60%,
      rgba(107, 29, 42, 0.12) 0%,
      transparent 50%
    );
}

.photo-icon {
  position: relative;
  z-index: 1;
}

.photo-icon svg {
  width: 32px;
  height: 32px;
  stroke: var(--gold);
  opacity: 0.3;
  stroke-width: 1;
  fill: none;
}

.photo-label {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #8a7e74;
  opacity: 0.5;
  position: relative;
  z-index: 1;
}

.polaroid-caption {
  font-family: "La Belle Aurore", cursive;
  font-size: 0.85rem;
  color: #4a3f35;
  text-align: center;
  padding-top: 8px;
  line-height: 1.3;
}

/* polaroid tape effect on alternating items */
.milestone:nth-child(odd) .polaroid-wrapper::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-1deg);
  width: 60px;
  height: 18px;
  background: rgba(201, 168, 76, 0.12);
  border: 1px solid rgba(201, 168, 76, 0.08);
  border-radius: 2px;
  z-index: 4;
}

.milestone:nth-child(even) .polaroid-wrapper::after {
  content: "";
  position: absolute;
  top: -6px;
  right: 20px;
  width: 50px;
  height: 18px;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.06);
  border-radius: 2px;
  transform: rotate(2deg);
  z-index: 4;
}

/* ========== LOVE LETTER SECTION ========== */

.letter-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem;
  background: radial-gradient(
    ellipse at 50% 30%,
    rgba(74, 14, 26, 0.4) 0%,
    var(--black) 70%
  );
}

.letter-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 80px;
  background: linear-gradient(to bottom, transparent, var(--gold));
}

.letter-container {
  max-width: 620px;
  width: 100%;
}

.letter-label {
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 3rem;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.2s ease;
}

.letter-label.visible {
  opacity: 1;
  transform: translateY(0);
}

.letter-body {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.1rem, 2.8vw, 1.35rem);
  font-weight: 300;
  line-height: 2;
  color: var(--text);
  text-align: left;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.2s ease 0.3s;
  white-space: pre-wrap;
}

.letter-body.visible {
  opacity: 1;
  transform: translateY(0);
}

.letter-dear {
  font-family: "La Belle Aurore", cursive;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  color: var(--gold-light);
  display: block;
  margin-bottom: 1.5rem;
}

/* ========== QUESTION SECTION ========== */

.question-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.question-text {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 400;
  color: var(--cream);
  text-align: center;
  margin-bottom: 3.5rem;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1);
  line-height: 1.4;
}

.question-text.visible {
  opacity: 1;
  transform: translateY(0);
}

.question-text em {
  color: var(--gold-light);
  font-style: italic;
}

.buttons-container {
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: all 1.2s ease 0.5s;
  position: relative;
  min-height: 80px;
  width: 100%;
  max-width: 400px;
}

.buttons-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-yes {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 1rem 3rem;
  border: 1.5px solid var(--gold);
  background: transparent;
  color: var(--gold);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
  z-index: 1;
}

.btn-yes::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-deep));
  opacity: 0;
  transition: opacity 0.5s ease;
}

.btn-yes:hover {
  color: var(--cream);
  border-color: var(--gold-light);
  box-shadow:
    0 0 30px rgba(201, 168, 76, 0.2),
    inset 0 0 30px rgba(201, 168, 76, 0.05);
  transform: scale(1.05);
}

.btn-yes:hover::before {
  opacity: 1;
}

.btn-yes span {
  position: relative;
  z-index: 1;
}

.btn-no {
  font-family: "Cormorant Garamond", serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.7rem 1.8rem;
  border: 1px solid var(--text-dim);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-no:hover {
  border-color: var(--text-dim);
}

/* ========== CELEBRATION ========== */

.celebration {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.celebration.active {
  opacity: 1;
  pointer-events: auto;
}

#confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebration-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  transform: scale(0.8);
  transition: all 1.5s cubic-bezier(0.22, 1, 0.36, 1) 0.5s;
}

.celebration.active .celebration-content {
  opacity: 1;
  transform: scale(1);
}

.celebration-emoji {
  font-size: 3rem;
  margin-bottom: 2rem;
  animation: pulse 2s ease-in-out infinite;
}

.celebration h2 {
  font-family: "Playfair Display", serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 400;
  color: var(--cream);
  margin-bottom: 1rem;
}

.celebration p {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 300;
  color: var(--gold-light);
  line-height: 1.8;
}

.celebration .heart-signature {
  margin-top: 2.5rem;
  font-family: "La Belle Aurore", cursive;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  color: var(--rose);
}

/* ========== KEYFRAMES ========== */

@keyframes shimmer {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

@keyframes scrollDown {
  0% { top: -40px; }
  100% { top: 40px; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(25px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* ========== RESPONSIVE ========== */

@media (max-width: 600px) {
  .timeline {
    padding-left: 30px;
  }
  .milestone-dot {
    left: -30px;
  }
  .timeline::before {
    left: 4px;
  }
  .milestone {
    padding: 3rem 0;
  }
  .polaroid {
    max-width: 100%;
  }
  .polaroid-wrapper {
    padding: 8px 8px 32px 8px;
  }
  .polaroid-caption {
    font-size: 0.75rem;
  }
  .buttons-container {
    flex-direction: column;
    gap: 1.5rem;
  }
  .celebration-content {
    padding: 1.5rem;
  }
}

/* ========== NOISE OVERLAY ========== */

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}
