/* ============================================================
   DESIGN TOKENS & BASE
============================================================ */
:root {
  --blush: #f7d6d0;
  --sage: #d8e2dc;
  --cream: #faf4ee;
  --gold: #d4af37;
  --rose: #c98a82;
  --ink: #4a3f3b;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--ink);
  font-family: "Sriracha", cursive;
  overflow: clip;
  scrollbar-gutter: stable;
}

.font-script {
  font-family: "Great Vibes", cursive;
}
.font-serif {
  font-family: "Playfair Display", serif;
}

/* subtle paper-grain texture used across sections */
.grain {
  position: relative;
}
.grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  mix-blend-mode: multiply;
}

.divider-flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.divider-flourish::before,
.divider-flourish::after {
  content: "";
  height: 1px;
  width: 48px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.divider-flourish::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

/* ============================================================
   HERO / ENVELOPE
============================================================ */
#hero-pin {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(247, 214, 208, 0.55),
      transparent 55%
    ),
    radial-gradient(
      circle at 80% 85%,
      rgba(216, 226, 220, 0.6),
      transparent 55%
    ),
    var(--cream);
  overflow: hidden;
}

.envelope-scene {
  position: relative;
  width: min(88vw, 400px);
  aspect-ratio: 3/2;
  top: 6%;
  perspective: 1600px;
}

.envelope-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #fff, var(--blush) 120%);
  border-radius: 6px;
  box-shadow:
    0 25px 60px -20px rgba(74, 63, 59, 0.35),
    0 2px 0 rgba(212, 175, 55, 0.4) inset;
  overflow: visible;
  z-index: 19;
  transform-origin: top center;
  transform-style: preserve-3d;
}

.envelope-front {
  position: absolute;
  z-index: 6;
  inset: 0;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);

  will-change: transform, clip-path;

  background: linear-gradient(160deg, #fff, var(--blush) 120%);
  z-index: 23;
  transform-origin: top center;
}

.envelope-flap {
  position: absolute;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(200deg, var(--blush), #f2b9ae 120%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  box-shadow: 0 1px 0 rgba(212, 175, 55, 0.5) inset;
  z-index: 20;
}

.envelope-seal {
  position: absolute;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%);
  width: 46px;
  height: 46px;
  border-radius: 9999px;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff8ea;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 14px;
}

.invitation-card {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 8%;
  height: 84%;
  background: var(--cream);
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 4px;
  box-shadow: 0 20px 40px -15px rgba(74, 63, 59, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  z-index: 20;
  transform: translateY(0%);
}

.sparkle {
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--gold);
  clip-path: polygon(
    50% 0%,
    61% 39%,
    100% 50%,
    61% 61%,
    50% 100%,
    39% 61%,
    0% 50%,
    39% 39%
  );
  opacity: 0;
  z-index: 30;
  inset: 0;
}

.hero-copy {
  opacity: 0;
}
.tap-to-open {
  animation: scale-bounce 1.5s ease-out infinite;
}
.scroll-cue {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: var(--rose);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  animation: bounce 1.5s ease-out infinite;
  z-index: 50;
  opacity: 0;
}

/* ============================================================
   GALLERY — 3x3 flip grid
============================================================ */
.flip-card {
  aspect-ratio: 1/1;
  perspective: 1200px;
  border-radius: 10px;
}
.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.45, 0.05, 0.15, 1);
  border-radius: 10px;
  box-shadow: 0 10px 25px -10px rgba(74, 63, 59, 0.35);
}
.flip-card.is-flipped .flip-card-inner {
  transform: rotateY(180deg);
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}
.flip-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flip-back {
  transform: rotateY(180deg);
}

/* ============================================================
   COUNTDOWN
============================================================ */
.count-box {
  background: #fff;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 14px;
  box-shadow: 0 12px 30px -18px rgba(74, 63, 59, 0.4);
}

/* ============================================================
   FLIP COUNTDOWN (namespaced cd- to avoid clashing with the
   gallery's .flip-card/.flip-front/.flip-back classes)
============================================================ */
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cd-card {
  position: relative;
  width: 100%;
  max-width: 110px;
  height: clamp(64px, 16vw, 92px);
  margin: 0 auto;
  font-family: "Great Vibes", serif;
  perspective: 500px;
}

.cd-leaf {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: #fff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
}

.cd-num {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--ink);
}

.cd-top {
  top: 0;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-bottom: none;
  z-index: 1;
}
.cd-top .cd-num {
  top: 0;
}

.cd-bottom {
  bottom: 0;
  border-radius: 0 0 14px 14px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-top: none;
  box-shadow: 0 12px 30px -18px rgba(74, 63, 59, 0.4);
  z-index: 1;
}
.cd-bottom .cd-num {
  bottom: 0;
}

.cd-flip-front {
  top: 0;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-bottom: none;
  z-index: 2;
  transform-origin: bottom center;
}
.cd-flip-front .cd-num {
  top: 0;
}

.cd-flip-back {
  bottom: 0;
  border-radius: 0 0 14px 14px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-top: none;
  box-shadow: 0 12px 30px -18px rgba(74, 63, 59, 0.4);
  z-index: 2;
  transform-origin: top center;
  transform: rotateX(90deg);
}
.cd-flip-back .cd-num {
  bottom: 0;
}

.cd-fold {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 50%;
  height: 1px;
  background: rgba(212, 175, 55, 0.45);
  transform: translateY(-0.5px);
  z-index: 5;
  pointer-events: none;
}

/* ============================================================
   TIMELINE (namespaced tl-)
============================================================ */
.tl-wrap {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.tl-wrap::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(
    to bottom,
    transparent,
    var(--gold) 6%,
    var(--gold) 94%,
    transparent
  );
  opacity: 0.5;
}

.tl-item {
  position: relative;
  width: 100%;
  padding: 1rem 0;
  display: flex;
  justify-content: center;
}

.tl-item.tl-left {
  justify-content: flex-start;
}
.tl-item.tl-right {
  justify-content: flex-end;
}

.tl-node {
  position: absolute;
  top: 1rem;
  left: 50%;
  width: 48px;
  height: 48px;
  transform: translateX(-50%);
  border-radius: 9999px;
  background: #fff;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  box-shadow: 0 0 0 6px var(--cream);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.tl-node svg {
  width: 20px;
  height: 20px;
  stroke: var(--gold);
  fill: none;
  transition:
    stroke 0.35s ease,
    fill 0.35s ease;
}

.tl-card {
  width: calc(50% - 54px);
  background: #fff;
  border-radius: 14px;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 12px 30px -18px rgba(74, 63, 59, 0.4);
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease;
}

.tl-item.tl-left .tl-card {
  transform: translateX(-50px);
}
.tl-item.tl-right .tl-card {
  transform: translateX(50px);
}
.tl-item.tl-visible .tl-card {
  opacity: 1;
  transform: translateX(0);
}

.tl-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 18px 40px -16px rgba(74, 63, 59, 0.45);
}

.tl-item:hover .tl-node {
  transform: translateX(-50%) scale(1.12);
  background: var(--gold);
  box-shadow:
    0 0 0 6px var(--cream),
    0 6px 16px rgba(212, 175, 55, 0.4);
}
.tl-item:hover .tl-node svg {
  stroke: #fff;
  fill: rgba(255, 255, 255, 0.18);
}

.tl-time {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rose);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.tl-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.tl-card p {
  margin: 0;
  color: rgba(74, 63, 59, 0.72);
  font-size: 0.88rem;
  line-height: 1.55;
}

@media (max-width: 600px) {
  .tl-wrap::before {
    left: 24px;
  }
  .tl-item,
  .tl-item.tl-left,
  .tl-item.tl-right {
    justify-content: flex-start;
    padding-left: 58px;
  }
  .tl-node {
    left: 24px;
    width: 40px;
    height: 40px;
  }
  .tl-node svg {
    width: 16px;
    height: 16px;
  }
  .tl-card {
    width: 100%;
  }
  .tl-item.tl-left .tl-card,
  .tl-item.tl-right .tl-card {
    transform: translateX(28px);
  }
  .tl-item.tl-visible .tl-card {
    transform: translateX(0);
  }
}

/* ============================================================
   FLOATING HEARTS (ambient, gift section)
============================================================ */
.heart-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.floating-heart {
  position: absolute;
  bottom: -40px;
  color: var(--rose);
  opacity: 0.55;
  animation: heart-rise linear forwards;
}
@keyframes heart-rise {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.55;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-115vh) translateX(var(--drift, 20px)) rotate(20deg);
    opacity: 0;
  }
}

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

::selection {
  background: var(--gold);
  color: #fff;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  30% {
    transform: translateX(-50%) translateY(-12px);
  }
  50% {
    transform: translateX(-50%) translateY(0);
  }
  70% {
    transform: translateX(-50%) translateY(-5px);
  }
}
@keyframes scale-bounce {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.2);
  }
}

/* ============================================================
   MUSIC PLAYER — vinyl spin
============================================================ */
@keyframes vinyl-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
#vinyl-disc.spinning {
  animation: vinyl-spin 10s linear infinite;
}

/* ============================================================
   ENVELOPE FRONT — decorative pattern
============================================================ */
.envelope-front::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 24;
  pointer-events: none;
  background-image: radial-gradient(
    circle,
    rgba(212, 175, 55, 0.35) 1px,
    transparent 1.4px
  );
  background-size: 14px 14px;
  background-position: 0 0;
  opacity: 0.5;
  border-radius: 6px;
}

.envelope-front::after {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 25;
  pointer-events: none;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 4px;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(212, 175, 55, 0.12) 0px,
    rgba(212, 175, 55, 0.12) 1px,
    transparent 1px,
    transparent 10px
  );
}

.envelope-front-corner {
  position: absolute;
  width: 34px;
  height: 34px;
  z-index: 26;
  pointer-events: none;
  opacity: 0.55;
}
.envelope-front-corner svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.2;
}
.envelope-front-corner.top-left {
  top: 12px;
  left: 12px;
}
.envelope-front-corner.top-right {
  top: 12px;
  right: 12px;
  transform: scaleX(-1);
}
.flower-envelope {
  position: absolute;
  bottom: -15px;
  left: -50px;
  background-image: url(/public/images/flower.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  height: 50%;
  width: 50%;
  z-index: 27;
  opacity: 0;
}
.wedding {
  position: absolute;
  bottom: -25px;
  right: -40px;
  background-image: url(/public/images/om.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  height: 75%;
  width: 45%;
  z-index: 27;
  opacity: 0;
  animation: wiggle 2s ease-out infinite;
}

/*  */
.section-floral {
  position: absolute;
  width: 110px;
  height: 110px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
}
.section-floral.floral-tl {
  top: 12px;
  left: 12px;
}
.section-floral.floral-tr {
  top: 12px;
  right: 12px;
  transform: scaleX(-1);
}
.section-floral svg {
  width: 100%;
  height: 100%;
}
.section-floral.floral-sm {
  width: 78px;
  height: 78px;
  opacity: 0.6;
}
@media (max-width: 640px) {
  .section-floral {
    width: 68px;
    height: 68px;
  }
  .section-floral.floral-sm {
    width: 48px;
    height: 48px;
  }
}

@keyframes wiggle {
  0% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(5deg);
  }
  50% {
    transform: rotate(0deg);
  }
  75% {
    transform: rotate(10deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

.duk-dik {
  animation: wiggle 0.4s ease-in-out infinite;
}
