:root {
  --bg: #070711;
  --bg-soft: #10101f;
  --text: #fff8f4;
  --muted: #c9bec8;
  --rose: #ff6f91;
  --rose-soft: #ffd1dc;
  --gold: #f8dca6;
  --blue: #9bd8ff;
  --mint: #b7ffd8;
  --glass: rgba(255, 255, 255, 0.11);
  --glass-strong: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.18);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 111, 145, 0.2), transparent 28rem),
    radial-gradient(circle at 82% 8%, rgba(155, 216, 255, 0.16), transparent 24rem),
    linear-gradient(145deg, #05050d 0%, #101021 48%, #170912 100%);
  overflow-x: hidden;
}

body.celebrating {
  --rose: #ff8aad;
  --glass: rgba(255, 255, 255, 0.16);
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-160%);
  border-radius: 999px;
  padding: 0.75rem 1rem;
  color: #161019;
  background: var(--text);
  transition: transform 180ms ease;
}

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

.loader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.25rem;
  background:
    radial-gradient(circle at center, rgba(255, 111, 145, 0.18), transparent 28rem),
    #070711;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader p {
  margin: 0;
  color: var(--rose-soft);
  letter-spacing: 0.04em;
}

.loader-heart {
  width: 3.2rem;
  height: 3.2rem;
  position: relative;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ff4f83, #ffd1dc);
  box-shadow: 0 0 42px rgba(255, 111, 145, 0.75);
}

.loader-heart::before,
.loader-heart::after {
  content: "";
  position: absolute;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: inherit;
}

.loader-heart::before {
  left: -1.6rem;
}

.loader-heart::after {
  top: -1.6rem;
}

.star-canvas,
.fireworks-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.star-canvas {
  z-index: 0;
}

.fireworks-canvas {
  z-index: 90;
}

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

.moon {
  position: absolute;
  right: clamp(1.5rem, 7vw, 7rem);
  top: clamp(5rem, 9vw, 7rem);
  width: clamp(5rem, 11vw, 9rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.9), transparent 0.42rem),
    radial-gradient(circle at 64% 58%, rgba(170, 150, 130, 0.22), transparent 0.78rem),
    linear-gradient(145deg, #fff7d7, #cfc2a1);
  box-shadow: 0 0 80px rgba(248, 220, 166, 0.42);
}

.moon::after {
  content: "";
  position: absolute;
  inset: -0.25rem -0.65rem 0.25rem 1.2rem;
  border-radius: 50%;
  background: #0a0a16;
}

.moon-glow {
  position: absolute;
  right: 0;
  top: 0;
  width: 24rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248, 220, 166, 0.16), transparent 66%);
  filter: blur(8px);
}

.section {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: clamp(5rem, 9vw, 8rem) clamp(1.25rem, 6vw, 6rem);
}

.section-copy {
  max-width: 48rem;
  margin: 0 auto clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  text-wrap: balance;
}

h1,
h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  line-height: 0.95;
}

h1 {
  font-size: clamp(4rem, 13vw, 10.5rem);
  letter-spacing: 0;
}

h1 span,
.final-heart {
  color: var(--rose);
  text-shadow: 0 0 34px rgba(255, 111, 145, 0.62);
}

h2 {
  font-size: clamp(2.45rem, 7vw, 6rem);
}

h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1;
}

.hero {
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-content {
  width: min(100%, 68rem);
}

.hero-subtitle {
  margin: 1.25rem auto 2.25rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.65rem, 4vw, 3rem);
  line-height: 1.05;
}

.primary-button,
.ghost-button {
  min-width: 10.5rem;
  min-height: 3.35rem;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.35rem;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 220ms ease, box-shadow 220ms ease, background 220ms ease;
}

.primary-button {
  color: #170915;
  background: linear-gradient(135deg, #fff1c8, #ff8aac 48%, #9bd8ff);
  box-shadow: 0 14px 40px rgba(255, 111, 145, 0.34);
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--glass);
  backdrop-filter: blur(16px);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-3px);
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.envelope:focus-visible,
.gallery-item:focus-visible,
.music-toggle:focus-visible,
.lightbox button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.scroll-cue {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  width: 1.55rem;
  height: 2.6rem;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
}

.scroll-cue span {
  position: absolute;
  left: 50%;
  top: 0.45rem;
  width: 0.3rem;
  height: 0.3rem;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--text);
}

.glass-panel {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--glass), rgba(255, 255, 255, 0.06));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.envelope-section {
  display: grid;
  place-items: center;
  align-content: center;
  overflow: hidden;
}

.envelope {
  position: relative;
  width: min(82vw, 25rem);
  aspect-ratio: 1.45;
  margin: 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 34px 36px rgba(0, 0, 0, 0.34));
}

.envelope > span {
  position: absolute;
  display: block;
}

.envelope-back,
.envelope-front {
  inset: 18% 0 0;
  border-radius: 0 0 1rem 1rem;
  background: linear-gradient(135deg, #fff2dc, #d9a7b1);
}

.envelope-left {
  left: 0;
  bottom: 0;
  width: 50%;
  height: 82%;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  background: #ffd7df;
}

.envelope-right {
  right: 0;
  bottom: 0;
  width: 50%;
  height: 82%;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  background: #f2bac6;
}

.envelope-front {
  clip-path: polygon(0 0, 50% 58%, 100% 0, 100% 100%, 0 100%);
  z-index: 3;
}

.envelope-flap {
  inset: 18% 0 auto;
  height: 54%;
  z-index: 4;
  transform-origin: top;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  background: linear-gradient(180deg, #ffe3ea, #cf8394);
  transition: transform 820ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.envelope-letter-mini {
  left: 9%;
  right: 9%;
  top: 24%;
  height: 58%;
  z-index: 2;
  border-radius: 0.7rem;
  background: linear-gradient(180deg, #fffaf3, #ffe7ec);
  transition: transform 900ms ease 160ms;
}

.wax-seal {
  z-index: 6;
  left: 50%;
  top: 55%;
  display: grid !important;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  color: #fff8f4;
  background: linear-gradient(135deg, #bc264f, #ff6f91);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, 0.12), 0 10px 28px rgba(188, 38, 79, 0.38);
  transition: opacity 400ms ease, transform 400ms ease;
}

.envelope.is-open .envelope-flap {
  transform: rotateX(178deg);
}

.envelope.is-open .envelope-letter-mini {
  transform: translateY(-64%);
}

.envelope.is-open .wax-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
}

.letter {
  width: min(100%, 46rem);
  max-height: 0;
  margin: 2rem auto 0;
  overflow: hidden;
  border-radius: 1.25rem;
  padding: 0 1.25rem;
  opacity: 0;
  transition: max-height 900ms ease, opacity 700ms ease, padding 700ms ease;
}

.letter.is-visible {
  max-height: 90rem;
  padding: clamp(1.4rem, 4vw, 3rem);
  opacity: 1;
}

.letter h2 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.3rem, 5vw, 4.5rem);
}

.letter-text {
  color: #fff7f3;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.34;
  white-space: pre-line;
}

.timeline {
  position: relative;
  width: min(100%, 58rem);
  margin: 0 auto;
  padding: 1rem 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.42), transparent);
}

.timeline-item {
  position: relative;
  width: calc(50% - 2.5rem);
  margin-bottom: 3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(18px);
}

.timeline-item:nth-child(odd) {
  margin-right: auto;
  text-align: right;
}

.timeline-item:nth-child(even) {
  margin-left: auto;
}

.timeline-item::after {
  content: "";
  position: absolute;
  top: 1.5rem;
  width: 1rem;
  height: 1rem;
  border: 3px solid var(--gold);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 24px rgba(255, 111, 145, 0.65);
}

.timeline-item:nth-child(odd)::after {
  right: -3.05rem;
}

.timeline-item:nth-child(even)::after {
  left: -3.05rem;
}

.timeline time {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gold);
  font-weight: 800;
}

.counter-section {
  display: grid;
  place-items: center;
  align-content: center;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(7rem, 1fr));
  width: min(100%, 62rem);
  border-radius: 1.25rem;
  overflow: hidden;
}

.counter-grid div {
  min-height: 9rem;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  border-right: 1px solid var(--line);
}

.counter-grid div:last-child {
  border-right: 0;
}

.counter-grid strong {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 5rem);
  line-height: 0.9;
}

.counter-grid span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
  gap: 1.15rem;
  width: min(100%, 76rem);
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.55rem;
  overflow: hidden;
  cursor: pointer;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 50% 12%, rgba(255, 209, 220, 0.16), transparent 12rem),
    rgba(3, 3, 10, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  border-radius: 0.7rem;
  object-fit: contain;
  object-position: center;
  transform: scale(1);
  transition: transform 700ms ease, filter 700ms ease;
}

.gallery-item:hover img {
  transform: scale(1.025);
  filter: saturate(1.18) contrast(1.04);
}

.gallery-item.tall {
  grid-row: auto;
}

.gallery-item.wide {
  grid-column: auto;
}

.reasons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: min(100%, 68rem);
  margin: 0 auto;
}

.reason-card {
  min-height: 14rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04)),
    radial-gradient(circle at 85% 10%, rgba(255, 111, 145, 0.22), transparent 9rem);
  backdrop-filter: blur(18px);
  transition: transform 240ms ease, border-color 240ms ease;
}

.reason-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 209, 220, 0.58);
}

.reason-card span {
  color: var(--gold);
  font-weight: 800;
}

.forgive-section {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.5rem;
}

.forgive-card {
  width: min(100%, 42rem);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 5vw, 3.25rem);
  text-align: center;
}

.forgive-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.teddy {
  position: relative;
  width: 9rem;
  height: 11rem;
}

.teddy .ear,
.teddy .head,
.teddy .body {
  position: absolute;
  background: linear-gradient(135deg, #e9b78f, #9b6247);
  box-shadow: inset 0 -12px 18px rgba(0, 0, 0, 0.12);
}

.teddy .ear {
  top: 0.2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.teddy .ear.left {
  left: 0.8rem;
}

.teddy .ear.right {
  right: 0.8rem;
}

.teddy .head {
  left: 1.35rem;
  top: 1.25rem;
  width: 6.3rem;
  height: 5.9rem;
  border-radius: 48% 48% 44% 44%;
}

.teddy .body {
  left: 1.6rem;
  bottom: 0;
  width: 5.8rem;
  height: 5.7rem;
  border-radius: 48% 48% 42% 42%;
}

.teddy .body span {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  color: #ff6f91;
  font-size: 2rem;
}

.teddy .eye,
.teddy .nose {
  position: absolute;
  border-radius: 50%;
  background: #20110f;
}

.teddy .eye {
  top: 2.55rem;
  width: 0.55rem;
  height: 0.55rem;
}

.teddy .eye.left {
  left: 2rem;
}

.teddy .eye.right {
  right: 2rem;
}

.teddy .nose {
  left: 50%;
  top: 3.45rem;
  width: 0.85rem;
  height: 0.65rem;
  transform: translateX(-50%);
}

.final-section {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.final-background {
  position: absolute;
  inset: 0;
  background: url("../assets/images/memory-10-wedding.jpeg") center / cover no-repeat;
  transform: scale(1.08);
}

.final-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 7, 17, 0.42), rgba(7, 7, 17, 0.82)),
    radial-gradient(circle at center, transparent, rgba(0, 0, 0, 0.34));
}

.final-copy {
  position: relative;
  z-index: 2;
  width: min(100%, 45rem);
  text-align: center;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
}

.final-copy p {
  margin: 1.2rem 0;
  color: #fff8f4;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 3.8vw, 3.1rem);
  line-height: 1.08;
}

.final-heart {
  font-size: clamp(3rem, 8vw, 6rem) !important;
  line-height: 0.8 !important;
}

.music-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80;
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  cursor: pointer;
}

.music-toggle.is-playing {
  color: #180711;
  background: var(--rose-soft);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(3, 3, 10, 0.9);
  backdrop-filter: blur(18px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  margin: 0;
  min-width: 0;
}

.lightbox img {
  width: min(100%, 76rem);
  max-height: 78svh;
  margin: 0 auto;
  border-radius: 1rem;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.lightbox figcaption {
  margin-top: 1rem;
  color: var(--text);
  text-align: center;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.3rem);
}

.lightbox button {
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}

.lightbox-nav {
  width: clamp(2.8rem, 6vw, 4rem);
  height: clamp(2.8rem, 6vw, 4rem);
  font-size: clamp(2rem, 5vw, 3rem);
}

.sparkle,
.heart-burst {
  position: fixed;
  z-index: 110;
  pointer-events: none;
}

.sparkle {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px var(--gold);
}

.heart-burst {
  color: var(--rose);
  font-size: 1.4rem;
}
