:root {
  color-scheme: dark;
  --night: #12071f;
  --wine: #3b1238;
  --rose: #ff6f9f;
  --stitch: #4dc7ff;
  --lagoon: #7fe7dd;
  --cream: #fff6e8;
  --ink: #182033;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: white;
  font-family: "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 111, 159, 0.3), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(77, 199, 255, 0.26), transparent 27%),
    linear-gradient(135deg, #12071f 0%, #2c0d34 38%, #071a38 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button {
  font: inherit;
}

.particles span {
  position: fixed;
  z-index: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.72);
  pointer-events: none;
  animation: particleFloat linear infinite;
}

main {
  position: relative;
  z-index: 1;
}

.hero {
  min-height: 100vh;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 5vw, 76px);
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(28px, 6vw, 76px);
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--stitch);
  background: rgba(255, 255, 255, 0.09);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
}

.eyebrow.rose {
  color: var(--rose);
}

h1,
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-top: 20px;
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: 0.9;
  text-wrap: balance;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.hero-copy p:not(.eyebrow),
.intro-card p,
.stitch-card p,
.finale p {
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(1.02rem, 2.2vw, 1.24rem);
  line-height: 1.75;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  margin: 26px 0 0;
}

.primary-button {
  min-height: 56px;
  margin-top: 32px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  color: var(--night);
  background: linear-gradient(135deg, var(--rose), #ffad86, var(--cream));
  box-shadow: 0 18px 40px rgba(255, 111, 159, 0.3);
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 54px rgba(255, 111, 159, 0.42);
}

.hero-card {
  position: relative;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 36px;
  background: linear-gradient(135deg, rgba(255, 111, 159, 0.24), rgba(77, 199, 255, 0.24), rgba(127, 231, 221, 0.12));
  filter: blur(22px);
}

.photo-frame {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 28px 80px rgba(5, 8, 28, 0.38);
  backdrop-filter: blur(22px);
}

.photo-frame img {
  display: block;
  width: 100%;
  height: min(68vh, 650px);
  min-height: 430px;
  object-fit: cover;
  object-position: 50% 34%;
  border-radius: 22px;
}

.photo-frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, transparent 48%, rgba(18, 7, 31, 0.9));
  pointer-events: none;
}

.photo-label {
  position: absolute;
  left: 32px;
  bottom: 30px;
  z-index: 2;
}

.photo-label span {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.photo-label strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
}

.glass {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.06));
  box-shadow: 0 28px 80px rgba(5, 8, 28, 0.36);
  backdrop-filter: blur(22px);
}

.letter-section {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(42px, 8vw, 96px) clamp(18px, 5vw, 56px);
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 24px;
}

.intro-card,
.letter-card,
.stitch-card {
  border-radius: 26px;
  padding: clamp(24px, 4vw, 42px);
}

.intro-card h2,
.section-heading h2,
.stitch-card h2,
.finale h2 {
  margin-top: 14px;
  color: white;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 0.98;
}

.letter-lines {
  margin-top: 24px;
}

.letter-lines p {
  margin: 0 0 20px;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(1.08rem, 2.3vw, 1.32rem);
  line-height: 1.8;
  opacity: 0;
  transform: translateY(16px);
}

.letter-card.is-visible .letter-lines p {
  animation: lineIn 680ms ease forwards;
}

.letter-card.is-visible .letter-lines p:nth-child(2) { animation-delay: 180ms; }
.letter-card.is-visible .letter-lines p:nth-child(3) { animation-delay: 360ms; }
.letter-card.is-visible .letter-lines p:nth-child(4) { animation-delay: 540ms; }
.letter-card.is-visible .letter-lines p:nth-child(5) { animation-delay: 720ms; }
.letter-card.is-visible .letter-lines p:nth-child(6) { animation-delay: 900ms; }

.gallery-section,
.stitch-section,
.finale {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 7vw, 86px) clamp(18px, 5vw, 56px);
}

.section-heading {
  max-width: 720px;
}

.polaroids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin-top: 38px;
}

.polaroid {
  margin: 0;
  padding: 12px 12px 28px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffaf2, #f4e6d3);
  color: var(--ink);
  box-shadow: 0 24px 56px rgba(5, 8, 28, 0.32);
  transition: transform 220ms ease;
}

.polaroid:hover {
  transform: translateY(-10px) rotate(0deg);
}

.polaroid img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: 50% 35%;
  border-radius: 5px;
}

.polaroid.soft-crop img {
  object-position: 50% 18%;
}

.polaroid figcaption {
  margin-top: 16px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 700;
}

.tilt-left {
  transform: rotate(-3deg);
}

.tilt-right {
  transform: rotate(2deg);
}

.stitch-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 34px;
  align-items: center;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tags span {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-weight: 900;
}

.finale {
  min-height: 72vh;
  display: grid;
  place-items: center;
  text-align: center;
}

.finale p:not(.eyebrow) {
  max-width: 680px;
  margin: 28px auto 0;
}

.stitch-mark {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  width: 128px;
  height: 116px;
  filter: drop-shadow(0 20px 34px rgba(0, 0, 0, 0.34));
  animation: floaty 4.5s ease-in-out infinite;
}

.stitch-mark.large {
  position: relative;
  right: auto;
  bottom: auto;
  width: 160px;
  height: 142px;
}

.stitch-mark .ear {
  position: absolute;
  top: 38px;
  width: 58px;
  height: 72px;
  border: 4px solid rgba(255, 255, 255, 0.5);
  background:
    radial-gradient(circle at 56% 52%, rgba(255, 139, 180, 0.98) 0 30%, transparent 31%),
    linear-gradient(145deg, #6bd7ff, #1578ca);
}

.stitch-mark.large .ear {
  top: 46px;
  width: 72px;
  height: 88px;
}

.stitch-mark .ear.left {
  left: 0;
  border-radius: 16% 88% 30% 84%;
  transform: rotate(-31deg);
}

.stitch-mark .ear.right {
  right: 0;
  border-radius: 88% 16% 84% 30%;
  transform: rotate(31deg);
}

.stitch-mark .face {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 88px;
  height: 82px;
  transform: translateX(-50%);
  border: 4px solid rgba(255, 255, 255, 0.58);
  border-radius: 48% 48% 54% 54%;
  background: linear-gradient(145deg, #8ee4ff 0%, var(--stitch) 48%, #116eb6 100%);
  z-index: 2;
}

.stitch-mark.large .face {
  top: 34px;
  width: 110px;
  height: 100px;
}

.stitch-mark .eye {
  position: absolute;
  top: 27px;
  width: 16px;
  height: 21px;
  border-radius: 999px;
  background: #041425;
}

.stitch-mark.large .eye {
  top: 34px;
  width: 20px;
  height: 25px;
}

.stitch-mark .eye::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: white;
}

.stitch-mark .eye.left {
  left: 22px;
}

.stitch-mark .eye.right {
  right: 22px;
}

.stitch-mark.large .eye.left {
  left: 28px;
}

.stitch-mark.large .eye.right {
  right: 28px;
}

.stitch-mark .nose {
  position: absolute;
  left: 50%;
  top: 46px;
  width: 22px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #051b2f;
}

.stitch-mark.large .nose {
  top: 58px;
  width: 28px;
  height: 15px;
}

.stitch-mark .mouth {
  position: absolute;
  left: 50%;
  top: 59px;
  width: 28px;
  height: 14px;
  transform: translateX(-50%);
  border-bottom: 3px solid #051b2f;
  border-radius: 0 0 999px 999px;
}

.stitch-mark.large .mouth {
  top: 74px;
  width: 36px;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 760ms ease, transform 760ms ease;
}

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

.heart {
  position: fixed;
  z-index: 20;
  width: 14px;
  height: 14px;
  pointer-events: none;
  background: var(--rose);
  transform: rotate(45deg);
  animation: heartUp 900ms ease-out forwards;
}

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

.heart::before { left: -7px; }
.heart::after { top: -7px; }

@keyframes particleFloat {
  from {
    transform: translate3d(0, 105vh, 0) scale(0.8);
    opacity: 0;
  }
  18% { opacity: 0.75; }
  84% { opacity: 0.48; }
  to {
    transform: translate3d(var(--x-drift), -12vh, 0) scale(1.12);
    opacity: 0;
  }
}

@keyframes lineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1.5deg); }
}

@keyframes heartUp {
  from {
    opacity: 0.95;
    transform: translateY(0) rotate(45deg) scale(0.82);
  }
  to {
    opacity: 0;
    transform: translateY(-84px) rotate(45deg) scale(1.35);
  }
}

@media (max-width: 920px) {
  .hero,
  .letter-section,
  .stitch-card {
    grid-template-columns: 1fr;
  }

  .hero-card {
    order: -1;
  }

  .photo-frame img {
    height: 54vh;
    min-height: 380px;
    object-position: 50% 30%;
  }

  .polaroids {
    grid-template-columns: 1fr;
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 18px;
    gap: 18px;
  }

  h1 {
    margin-top: 14px;
    font-size: clamp(2.2rem, 10.5vw, 3.55rem);
  }

  .hero-copy p:not(.eyebrow) {
    margin-top: 18px;
    line-height: 1.58;
  }

  .primary-button {
    min-height: 50px;
    margin-top: 20px;
    padding: 0 22px;
  }

  .photo-frame {
    padding: 8px;
    border-radius: 22px;
  }

  .photo-frame img {
    height: 34vh;
    min-height: 250px;
    border-radius: 16px;
  }

  .photo-frame::after {
    inset: 8px;
    border-radius: 16px;
  }

  .stitch-mark {
    width: 98px;
    height: 92px;
    right: 14px;
    bottom: 14px;
  }

  .stitch-mark .ear {
    top: 32px;
    width: 46px;
    height: 56px;
  }

  .stitch-mark .face {
    top: 24px;
    width: 70px;
    height: 66px;
  }

  .stitch-mark .eye {
    top: 22px;
    width: 13px;
    height: 17px;
  }

  .stitch-mark .eye.left { left: 17px; }
  .stitch-mark .eye.right { right: 17px; }
  .stitch-mark .nose { top: 37px; width: 18px; height: 10px; }
  .stitch-mark .mouth { top: 49px; width: 22px; }

  .letter-section,
  .gallery-section,
  .stitch-section,
  .finale {
    padding-left: 18px;
    padding-right: 18px;
  }

  .intro-card,
  .letter-card,
  .stitch-card {
    border-radius: 20px;
    padding: 22px;
  }

  .stitch-mark.large {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
