/* ============================================================
   COMPONENTS — reusable pieces, each independent of section context
   ------------------------------------------------------------
   1. Buttons
   2. Polaroid card
   3. Envelope
   4. Modal
   5. Concert ticket
   6. Infinity mark
   7. Celebration overlay
   8. Music player
   ============================================================ */

/* ============================================================
   1. BUTTONS
   ============================================================ */
.btn {
  --btn-lift: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.05em 2.3em;
  border-radius: 100px;
  font-family: var(--font-ui);
  font-size: clamp(0.82rem, 1.1vw, 0.94rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  transform: translate3d(0, var(--btn-lift), 0);
  transition:
    transform 0.55s var(--e-out),
    box-shadow 0.55s var(--e-out),
    letter-spacing 0.55s var(--e-out);
}

.btn__label { position: relative; z-index: 2; }
.btn__arrow, .btn__heart { position: relative; z-index: 2; line-height: 1; }

/* Sheen sweep — a single specular highlight travelling across on hover */
.btn__sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 32%, rgba(255,255,255,0.55) 48%, transparent 64%);
  transform: translate3d(-130%, 0, 0);
  transition: transform 0.9s var(--e-out);
}
.btn:hover .btn__sheen,
.btn:focus-visible .btn__sheen { transform: translate3d(130%, 0, 0); }

/* --- Primary: solid rose gold --- */
.btn--primary {
  background: var(--grad-rose);
  color: var(--soft-white);
  box-shadow: var(--sh-glow-rose);
}
.btn--primary::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.24), transparent 55%);
}
.btn--primary:hover {
  --btn-lift: -3px;
  letter-spacing: 0.17em;
  box-shadow: 0 0 0 1px rgba(183,110,121,.2), 0 26px 60px -16px rgba(183,110,121,.6);
}
.btn--primary:active { --btn-lift: -1px; transition-duration: 0.12s; }

.btn--primary .btn__arrow {
  transition: transform 0.6s var(--e-spring);
}
.btn--primary:hover .btn__arrow { transform: translateY(4px); }

/* --- Love: champagne-edged glass, for the letter --- */
.btn--love {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--rose-deep);
  border: 1px solid rgba(214, 154, 162, 0.42);
  box-shadow: var(--sh-md);
  padding: 1.1em 2.6em;
}
.btn--love:hover {
  --btn-lift: -3px;
  letter-spacing: 0.17em;
  border-color: rgba(183, 110, 121, 0.7);
  box-shadow: 0 22px 54px -16px rgba(183,110,121,.45);
}
.btn--love:active { --btn-lift: -1px; transition-duration: 0.12s; }

.btn--love .btn__heart {
  display: inline-block;
  transition: transform 0.6s var(--e-spring);
}
.btn--love:hover .btn__heart { transform: scale(1.24); }

/* Heartbeat once armed, so the button asks to be pressed */
.btn--love.is-armed .btn__heart { animation: heartbeat 2.4s var(--e-in-out) infinite; }
@keyframes heartbeat {
  0%, 68%, 100% { transform: scale(1); }
  74%           { transform: scale(1.22); }
  82%           { transform: scale(1.04); }
  88%           { transform: scale(1.16); }
}

.btn--love[disabled] { opacity: 0.45; pointer-events: none; }

/* ============================================================
   2. POLAROID CARD — 3D flip, handwritten reverse
   ============================================================ */
.polaroid {
  --rot: 0deg;
  --lift: 0px;
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 63 / 76;      /* real polaroid proportion incl. chin */
  padding: 0;
  perspective: 1600px;
  transform: rotate(var(--rot)) translate3d(0, var(--lift), 0);
  transition: transform 0.7s var(--e-out), filter 0.7s var(--e-out);
  cursor: pointer;
  z-index: 1;
}

/* Hover: straighten, lift, warm glow. Fires on the wrapper so the
   inner flip transform is never fought over. */
@media (hover: hover) {
  .polaroid:hover {
    --rot: 0deg;
    --lift: -14px;
    z-index: 5;
  }
  .polaroid:hover .polaroid__face--front {
    box-shadow:
      0 34px 70px -22px rgba(110, 70, 64, 0.42),
      0 0 46px -6px rgba(214, 154, 162, 0.55);
  }
}
.polaroid:focus-visible { --lift: -14px; --rot: 0deg; z-index: 5; outline: none; }
.polaroid:focus-visible .polaroid__face--front { outline: 2px solid var(--rose); outline-offset: 6px; }

.polaroid__inner {
  /* Must be block: this is a <span>, and width/height percentages are
     ignored on inline boxes — which would collapse both absolutely
     positioned faces to zero height. */
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.95s var(--e-in-out);
}
.polaroid.is-flipped .polaroid__inner { transform: rotateY(180deg); }

.polaroid__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
}

/* --- Front: photo + white chin --- */
.polaroid__face--front {
  background: linear-gradient(168deg, #FFFEFC 0%, #FBF6EE 100%);
  padding: 5.5% 5.5% 0;
  box-shadow: var(--sh-lg);
  transition: box-shadow 0.7s var(--e-out);
}

.polaroid__frame {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #E8DED2;
  border-radius: 1px;
}

.polaroid__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Very slight film treatment so twelve different phone cameras
     read as one set */
  filter: saturate(1.04) contrast(1.03) brightness(1.01);
  transform: scale(1.001);
  transition: transform 1.4s var(--e-out);
}
.polaroid:hover .polaroid__img { transform: scale(1.045); }

/* Emulsion sheen across the photo */
.polaroid__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(122deg, rgba(255,255,255,0.3) 0%, transparent 34%, transparent 66%, rgba(183,110,121,0.14) 100%);
  pointer-events: none;
}

.polaroid__chin {
  height: 15%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0 0.35rem;
}

.polaroid__caption {
  font-family: var(--font-hand);
  font-size: clamp(0.95rem, 1.35vw, 1.22rem);
  line-height: 1;
  color: #6E5A56;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.polaroid__flip-hint {
  flex: none;
  width: 1.35rem; height: 1.35rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(183, 110, 121, 0.1);
  color: var(--rose);
  font-family: var(--font-ui);
  font-size: 0.6rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.5s var(--e-out), transform 0.5s var(--e-spring);
}
.polaroid:hover .polaroid__flip-hint { opacity: 1; transform: scale(1); }

/* --- Back: the reverse of a real polaroid --- */
.polaroid__face--back {
  transform: rotateY(180deg);
  background:
    radial-gradient(120% 90% at 20% 10%, rgba(255,255,255,0.9), transparent 60%),
    linear-gradient(160deg, #F7F1E6 0%, #EFE5D6 55%, #E9DDCB 100%);
  box-shadow: var(--sh-lg);
  padding: 9% 9% 7%;
  justify-content: space-between;
  overflow: hidden;
}

/* Paper fibre + the faint dark band real polaroids have along the top */
.polaroid__face--back::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='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23p)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
}
.polaroid__face--back::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 11%;
  background: linear-gradient(180deg, rgba(196, 178, 152, 0.36), transparent);
  pointer-events: none;
}

.polaroid__note {
  font-family: var(--font-hand);
  font-size: clamp(1.02rem, 1.62vw, 1.42rem);
  line-height: 1.46;
  color: #4B3F52;               /* ballpoint blue-black */
  letter-spacing: 0.004em;
  position: relative;
  z-index: 1;
}

.polaroid__note-mark {
  display: block;
  font-family: var(--font-hand);
  font-size: clamp(1.4rem, 2vw, 1.9rem);
  color: var(--rose);
  line-height: 1;
  margin-bottom: 0.35em;
  opacity: 0.85;
}

.polaroid__note-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--font-hand);
  font-size: clamp(0.86rem, 1.15vw, 1.05rem);
  color: #8B7A74;
}
.polaroid__note-date { transform: rotate(-1.6deg); }
.polaroid__note-sig  { color: var(--rose-deep); transform: rotate(1.2deg); font-size: 1.15em; }

/* ============================================================
   3. ENVELOPE
   ============================================================ */
.envelope {
  --flap: 0deg;
  --lift: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.envelope__body {
  position: relative;
  /* 12/5 ≈ 2.4:1, close to a real business envelope and short enough that
     all four cards fit a laptop viewport at once. max-height stops them
     growing tall again on very wide screens. */
  aspect-ratio: 12 / 5;
  max-height: 165px;
  border-radius: 6px;
  background: linear-gradient(158deg, #FBF3E9 0%, #F3E7D6 52%, #EDDFCB 100%);
  box-shadow: var(--sh-md);
  transform: translate3d(0, var(--lift), 0);
  transition: transform 0.7s var(--e-out), box-shadow 0.7s var(--e-out);
  perspective: 900px;
  overflow: hidden;
}

.envelope:hover .envelope__body,
.envelope:focus-visible .envelope__body {
  --lift: -8px;
  box-shadow: 0 32px 66px -20px rgba(110, 70, 64, 0.38), 0 0 40px -8px rgba(227, 205, 164, 0.6);
}
.envelope:focus-visible { outline: none; }
.envelope:focus-visible .envelope__body { outline: 2px solid var(--rose); outline-offset: 5px; }

/* Paper texture + inner shadow so it reads as a physical object */
.envelope__body::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 40px rgba(160, 130, 100, 0.14);
  pointer-events: none;
}

/* The two lower flaps, drawn as CSS triangles */
.envelope__pocket {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.envelope__pocket::before,
.envelope__pocket::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 62%;
  height: 100%;
  background: linear-gradient(140deg, #F6EDDF, #EBDCC6);
}
.envelope__pocket::before {
  left: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
  box-shadow: 1px 0 0 rgba(190, 165, 132, 0.5);
}
.envelope__pocket::after {
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* The card peeking out of the envelope */
.envelope__card {
  position: absolute;
  left: 8%; right: 8%;
  bottom: 12%;
  height: 62%;
  border-radius: 3px;
  background: linear-gradient(170deg, var(--soft-white), #FCF6EE);
  box-shadow: 0 -3px 14px rgba(140, 105, 90, 0.16);
  transform: translate3d(0, 42%, 0);
  transition: transform 0.85s var(--e-out);
  display: grid;
  place-items: center;
  padding: 0.8rem;
}
.envelope:hover .envelope__card,
.envelope:focus-visible .envelope__card { transform: translate3d(0, 24%, 0); }

.envelope__seal {
  width: clamp(2.2rem, 3.4vw, 3rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--grad-rose);
  box-shadow: 0 4px 14px rgba(150, 84, 95, 0.45), inset 0 1px 1px rgba(255,255,255,0.4);
  display: grid;
  place-items: center;
  color: #FFF6F2;
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 1.3vw, 1.15rem);
  transition: transform 0.7s var(--e-spring);
}
.envelope:hover .envelope__seal { transform: scale(1.1) rotate(-8deg); }

/* Top flap — hinges open on the X axis */
.envelope__flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 58%;
  transform-origin: top center;
  transform: rotateX(var(--flap));
  transform-style: preserve-3d;
  transition: transform 0.9s var(--e-in-out);
  z-index: 3;
}
.envelope__flap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(178deg, #F8F0E4 0%, #E9D9C1 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  box-shadow: 0 3px 10px rgba(150, 120, 92, 0.2);
}
.envelope:hover { --flap: -22deg; }
.envelope.is-opening { --flap: -172deg; }
.envelope.is-opening .envelope__flap { z-index: 1; }
.envelope.is-opening .envelope__card { transform: translate3d(0, -14%, 0) scale(1.02); }

/* Wax-seal glimmer that runs when the envelope is opening */
.envelope.is-opening .envelope__seal { transform: scale(0.86) rotate(14deg); opacity: 0.7; }

.envelope__label { padding-inline: 0.15rem; }

.envelope__index {
  font-family: var(--font-ui);
  font-size: var(--t-tag);
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--champagne-deep);
  display: block;
  margin-bottom: 0.3rem;
}

.envelope__title {
  /* Block, or the inline-flex "Open →" below would share this line */
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.06rem, 1.55vw, 1.3rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: var(--ink);
  transition: color 0.5s var(--e-out);
}
.envelope:hover .envelope__title { color: var(--rose-deep); }

.envelope__open {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--rose);
  opacity: 0.55;
  transition: opacity 0.5s var(--e-out), gap 0.5s var(--e-out);
}
.envelope:hover .envelope__open { opacity: 1; gap: 0.75rem; }

/* ============================================================
   4. MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 2.5rem);
  visibility: hidden;
  pointer-events: none;
}
.modal.is-open { visibility: visible; pointer-events: auto; }

.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(74, 58, 56, 0.34);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  opacity: 0;
  transition: opacity 0.7s var(--e-out);
}
.modal.is-open .modal__scrim { opacity: 1; }

.modal__panel {
  position: relative;
  width: min(660px, 100%);
  max-height: min(88vh, 900px);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius);
  background:
    radial-gradient(130% 90% at 12% 0%, rgba(255,255,255,0.95), transparent 58%),
    linear-gradient(165deg, var(--soft-white) 0%, var(--cream) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--sh-xl);
  padding: clamp(1.9rem, 4.5vw, 3.4rem);
  opacity: 0;
  transform: translate3d(0, 34px, 0) scale(0.965);
  transition:
    opacity 0.7s var(--e-out),
    transform 0.85s var(--e-out);
  -webkit-overflow-scrolling: touch;
}
.modal.is-open .modal__panel {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

/* Champagne hairline along the top edge */
.modal__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}

.modal__close {
  position: absolute;
  top: clamp(0.85rem, 1.6vw, 1.25rem);
  right: clamp(0.85rem, 1.6vw, 1.25rem);
  z-index: 4;
  width: 2.5rem; height: 2.5rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(183, 110, 121, 0.16);
  color: var(--rose-deep);
  transition: transform 0.5s var(--e-spring), background 0.4s var(--e-out);
}
.modal__close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.modal__close:hover { transform: rotate(90deg) scale(1.08); background: #fff; }

/* --- Shared modal content typography --- */
.mc { text-align: center; }

.mc__tag {
  font-family: var(--font-ui);
  font-size: var(--t-tag);
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--champagne-deep);
  margin-bottom: 1rem;
}

.mc__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.1vw, 2.3rem);
  font-weight: 500;
  line-height: 1.16;
  margin-bottom: 1.3rem;
}

.mc__text {
  font-size: var(--t-lede);
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 34rem;
  margin-inline: auto;
}
.mc__text + .mc__text { margin-top: 1rem; }
.mc__text strong { font-weight: 500; color: var(--ink); }

.mc__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.16rem, 2.1vw, 1.5rem);
  line-height: 1.5;
  color: var(--rose-deep);
  margin-block: 1.6rem;
  padding-inline: clamp(0.5rem, 3vw, 2rem);
}

.mc__figure {
  position: relative;
  margin-block: 1.6rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--sh-lg);
  background: var(--cream-deep);
}
.mc__figure img {
  width: 100%;
  max-height: 46vh;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 1.6s var(--e-out);
}
.mc__figure:hover img { transform: scale(1.06); }
.mc__figure figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2.4rem 1.2rem 0.9rem;
  background: linear-gradient(180deg, transparent, rgba(74, 58, 56, 0.72));
  color: #FFF8F4;
  font-family: var(--font-hand);
  font-size: 1.2rem;
}

.mc__sig {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--rose);
  margin-top: 1.6rem;
}

/* ============================================================
   5. CONCERT TICKET
   ============================================================ */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  margin-block: 1.8rem;
  border-radius: 14px;
  background: linear-gradient(150deg, #2A1F2B 0%, #3D2A33 42%, #241B26 100%);
  color: #F6E7E2;
  box-shadow: 0 30px 70px -22px rgba(42, 31, 43, 0.7);
  overflow: hidden;
  text-align: left;
  isolation: isolate;
}

/* Holographic wash — slow hue sweep across the whole stub */
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  /* Kept low: screen-blended over the plum base, higher alphas wash the
     whole stub to a flat brown and the gold stops reading as metal. */
  background: linear-gradient(115deg,
    rgba(214,154,162,0.22) 0%,
    rgba(227,205,164,0.18) 22%,
    rgba(168,199,214,0.20) 42%,
    rgba(214,171,214,0.20) 62%,
    rgba(227,205,164,0.18) 80%,
    rgba(214,154,162,0.22) 100%);
  background-size: 260% 100%;
  mix-blend-mode: screen;
  animation: holo 9s var(--e-in-out) infinite alternate;
}
@keyframes holo {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* Perforation between body and stub */
.ticket__perf {
  position: absolute;
  top: 0; bottom: 0;
  right: clamp(84px, 20%, 116px);
  width: 2px;
  z-index: 3;
  background-image: linear-gradient(180deg, rgba(246,231,226,0.62) 0 6px, transparent 6px 13px);
  background-size: 2px 13px;
}
/* The two notches that make the perforation read as a real tear line */
.ticket__notch {
  position: absolute;
  right: clamp(84px, 20%, 116px);
  z-index: 4;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--cream);
  transform: translateX(50%);
}
.ticket__notch--top    { top: -10px; }
.ticket__notch--bottom { bottom: -10px; }

.ticket__main {
  position: relative;
  z-index: 2;
  padding: clamp(1.3rem, 3vw, 2rem);
  padding-right: clamp(1.6rem, 4vw, 2.4rem);
}

.ticket__vip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34em 0.85em;
  border-radius: 100px;
  background: var(--grad-gold);
  color: #2A1F2B;
  font-family: var(--font-ui);
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  box-shadow: 0 3px 12px rgba(198, 164, 97, 0.5);
  margin-bottom: 1.1rem;
}
.ticket__vip::before { content: "★"; font-size: 0.8em; letter-spacing: 0; }

.ticket__label {
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: rgba(246, 231, 226, 0.5);
  margin-bottom: 0.3rem;
}

.ticket__event {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.1vw, 2.05rem);
  font-weight: 500;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.ticket__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 0.9rem 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(246, 231, 226, 0.16);
}
.ticket__val {
  font-family: var(--font-ui);
  font-size: 0.84rem;
  font-weight: 500;
  color: #F6E7E2;
}

.ticket__stub {
  position: relative;
  z-index: 2;
  width: clamp(84px, 20%, 116px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.1rem 0.5rem;
  background: rgba(0, 0, 0, 0.2);
}

.ticket__barcode {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 62px;
}
.ticket__barcode i {
  display: block;
  width: 2px;
  height: 100%;
  background: #F6E7E2;
  border-radius: 0.5px;
}

.ticket__serial {
  font-family: var(--font-ui);
  font-size: 0.54rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: rgba(246, 231, 226, 0.66);
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ============================================================
   6. INFINITY MARK
   ============================================================ */
.infinity {
  /* Both paths carry pathLength="1000", so the browser normalises the
     real geometry to 1000 units. That means the dash maths below needs
     no JS measurement and cannot desync from the path. */
  --len: 1000;
  width: min(300px, 74%);
  margin: 0.6rem auto 1.4rem;
  overflow: visible;
}
.infinity__path {
  fill: none;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke: url(#infGrad);
  filter: url(#infGlow);
}
/* Ghost track under the animated stroke */
.infinity__track {
  fill: none;
  stroke: rgba(183, 110, 121, 0.14);
  stroke-width: 3.4;
  stroke-linecap: round;
}
.infinity__path--draw {
  stroke-dasharray: var(--len) var(--len);
  stroke-dashoffset: var(--len);
  animation: inf-draw 3.4s var(--e-in-out) forwards;
}
@keyframes inf-draw { to { stroke-dashoffset: 0; } }

/* A bright travelling segment that loops forever once drawn */
.infinity__path--travel {
  stroke-dasharray: calc(var(--len) * 0.14) calc(var(--len) * 0.86);
  animation: inf-travel 4.4s linear 1.6s infinite;
  opacity: 0.9;
}
@keyframes inf-travel { to { stroke-dashoffset: calc(var(--len) * -1); } }

@media (prefers-reduced-motion: reduce) {
  .infinity__path--draw   { animation: none; stroke-dashoffset: 0; }
  .infinity__path--travel { display: none; }
}

/* ============================================================
   7. CELEBRATION OVERLAY
   ============================================================ */
.celebrate {
  position: fixed;
  inset: 0;
  z-index: 150;
  visibility: hidden;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.celebrate.is-live { visibility: visible; }

.celebrate__bloom {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 62%, rgba(255, 244, 236, 0.94) 0%, rgba(246, 222, 218, 0.55) 32%, transparent 66%);
  opacity: 0;
  transform: scale(0.4);
}
.celebrate.is-live .celebrate__bloom {
  animation: bloom 4.6s var(--e-out) forwards;
}
@keyframes bloom {
  0%   { opacity: 0;    transform: scale(0.4); }
  22%  { opacity: 0.95; transform: scale(1.05); }
  60%  { opacity: 0.7;  transform: scale(1.14); }
  100% { opacity: 0.88; transform: scale(1.2); }
}

.celebrate__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.celebrate__hearts { position: absolute; inset: 0; overflow: hidden; }

.heart-float {
  position: absolute;
  bottom: -8vh;
  font-size: var(--sz, 1.6rem);
  line-height: 1;
  opacity: 0;
  filter: drop-shadow(0 4px 10px rgba(183, 110, 121, 0.4));
  animation: heart-rise var(--dur, 7s) var(--e-out) var(--del, 0s) forwards;
  will-change: transform, opacity;
}
@keyframes heart-rise {
  0%   { opacity: 0;    transform: translate3d(0, 0, 0) scale(0.5) rotate(0deg); }
  12%  { opacity: 0.9; }
  70%  { opacity: 0.75; }
  100% { opacity: 0;    transform: translate3d(var(--dx, 0px), -112vh, 0) scale(1.1) rotate(var(--rot, 12deg)); }
}

.celebrate__line {
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(2rem, 7.5vw, 5.4rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.02em;
  text-align: center;
  padding-inline: 1rem;
  background: var(--grad-metal);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  opacity: 0;
  transform: translate3d(0, 26px, 0) scale(0.96);
  filter: blur(8px);
}
.celebrate.is-line .celebrate__line {
  animation: line-in 2.4s var(--e-out) forwards, shimmer 6s linear 2s infinite;
}
@keyframes line-in {
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* With reduced motion there are no particles, so the line and bloom ARE the
   celebration. State them explicitly rather than leaning on a zero-duration
   animation to reveal them. */
@media (prefers-reduced-motion: reduce) {
  .celebrate.is-live .celebrate__bloom { opacity: 0.9; transform: scale(1.1); }
  .celebrate.is-line .celebrate__line {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

/* Dismiss affordance appears with the line */
.celebrate__dismiss {
  position: absolute;
  bottom: clamp(2rem, 8vh, 4rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--rose-deep);
  opacity: 0;
  padding: 0.8em 1.6em;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(183, 110, 121, 0.2);
  transition: opacity 1.2s var(--e-out) 0.6s, background 0.4s var(--e-out);
  pointer-events: none;
}
.celebrate.is-line .celebrate__dismiss { opacity: 0.8; pointer-events: auto; }
.celebrate__dismiss:hover { opacity: 1; background: #fff; }

/* ============================================================
   8. MUSIC PLAYER
   ============================================================ */
.player {
  /* The document sets viewport-fit=cover, so the layout viewport runs under
     the home indicator and the phone's bottom chrome. Without the safe-area
     insets the second row (time + volume) gets clipped off the bottom edge
     on notched phones. env() falls back to 0px on anything that has no inset. */
  --player-gap: clamp(0.85rem, 2.4vw, 1.9rem);
  position: fixed;
  right: calc(var(--player-gap) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--player-gap) + env(safe-area-inset-bottom, 0px));
  z-index: 110;
  width: min(330px, calc(100vw - 1.7rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.95rem;
  border-radius: 20px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-brd);
  box-shadow: 0 20px 54px -16px rgba(110, 70, 64, 0.32), inset 0 1px 0 rgba(255,255,255,0.7);
  /* Entrance handled by JS after the hero settles */
  opacity: 0;
  transform: translate3d(0, 26px, 0);
  transition:
    opacity 0.9s var(--e-out),
    transform 0.9s var(--e-out),
    width 0.7s var(--e-out),
    padding 0.7s var(--e-out),
    grid-template-columns 0.7s var(--e-out);
}
.player.is-ready { opacity: 1; transform: translate3d(0, 0, 0); }

/* Collapsed: shrinks to just the play button */
.player.is-collapsed {
  width: auto;
  grid-template-columns: auto 0fr auto;
  gap: 0.4rem;
  padding: 0.55rem 0.6rem;
}
.player.is-collapsed .player__main {
  opacity: 0;
  overflow: hidden;
  width: 0;
  pointer-events: none;
}
.player.is-collapsed .player__collapse svg { transform: rotate(180deg); }

.player__main {
  min-width: 0;
  opacity: 1;
  transition: opacity 0.45s var(--e-out);
}

/* --- Play / pause --- */
.player__toggle {
  position: relative;
  flex: none;
  width: 2.85rem; height: 2.85rem;
  border-radius: 50%;
  background: var(--grad-rose);
  color: var(--soft-white);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px -4px rgba(150, 84, 95, 0.55), inset 0 1px 1px rgba(255,255,255,0.3);
  transition: transform 0.5s var(--e-spring);
}
.player__toggle:hover  { transform: scale(1.07); }
.player__toggle:active { transform: scale(0.94); transition-duration: 0.1s; }

.player__icon { width: 19px; height: 19px; fill: currentColor; grid-area: 1 / 1; }
.player__icon--pause { display: none; }
.player.is-playing .player__icon--play  { display: none; }
.player.is-playing .player__icon--pause { display: block; }

/* Soft halo that pulses only while audio is actually playing */
.player__pulse {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(183, 110, 121, 0.5);
  opacity: 0;
}
.player.is-playing .player__pulse { animation: pulse 2.6s var(--e-out) infinite; }
@keyframes pulse {
  0%   { opacity: 0.7; transform: scale(0.9); }
  100% { opacity: 0;   transform: scale(1.35); }
}

/* --- Meta --- */
.player__meta {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 0.42rem;
  min-width: 0;
}
.player__note { font-size: 0.72rem; flex: none; }
.player__track {
  font-family: var(--font-ui);
  font-size: 0.755rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player__by { color: var(--ink-faint); font-weight: 400; }

/* --- Scrubber --- */
.player__scrub {
  position: relative;
  height: 16px;
  margin-bottom: 0.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  touch-action: none;
}
.player__scrub-track,
.player__scrub-fill {
  position: absolute;
  left: 0;
  height: 3px;
  border-radius: 3px;
  pointer-events: none;
}
.player__scrub-track { right: 0; background: rgba(183, 110, 121, 0.18); }
.player__scrub-fill  { width: 0%; background: var(--grad-metal); box-shadow: 0 0 8px rgba(183,110,121,0.45); }

.player__scrub-knob {
  position: absolute;
  left: 0;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--soft-white);
  border: 1.5px solid var(--rose);
  box-shadow: 0 2px 6px rgba(150, 84, 95, 0.4);
  transform: translate(-50%, 0) scale(0);
  transition: transform 0.4s var(--e-spring);
  pointer-events: none;
}
.player__scrub:hover .player__scrub-knob,
.player__scrub:focus-visible .player__scrub-knob,
.player__scrub.is-dragging .player__scrub-knob { transform: translate(-50%, 0) scale(1); }
.player__scrub:hover .player__scrub-track,
.player__scrub:hover .player__scrub-fill { height: 4px; }

/* --- Bottom row: time + volume --- */
.player__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.player__time {
  font-family: var(--font-ui);
  font-size: 0.635rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.player__vol { display: flex; align-items: center; gap: 0.35rem; }

.player__mute {
  width: 1.5rem; height: 1.5rem;
  display: grid;
  place-items: center;
  color: var(--rose);
  border-radius: 6px;
  transition: color 0.35s var(--e-out), background 0.35s var(--e-out);
}
.player__mute:hover { background: rgba(183, 110, 121, 0.1); }
.player__icon--vol,
.player__icon--muted {
  width: 15px; height: 15px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.player__icon--vol .player__wave1,
.player__icon--vol .player__wave2 { fill: none; }
.player__icon--muted { display: none; fill: none; }
.player__icon--muted path:first-child { fill: currentColor; stroke: none; }
.player.is-muted .player__icon--vol   { display: none; }
.player.is-muted .player__icon--muted { display: block; }

/* Range input, restyled from scratch in both engines */
.player__vol-input {
  -webkit-appearance: none;
  appearance: none;
  width: 62px;
  height: 14px;
  background: transparent;
  cursor: pointer;
}
.player__vol-input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--rose) var(--pct, 70%), rgba(183,110,121,0.18) var(--pct, 70%));
}
.player__vol-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 9px; height: 9px;
  margin-top: -3px;
  border-radius: 50%;
  background: var(--soft-white);
  border: 1.5px solid var(--rose);
  box-shadow: 0 1px 4px rgba(150,84,95,0.4);
  transition: transform 0.3s var(--e-spring);
}
.player__vol-input:hover::-webkit-slider-thumb { transform: scale(1.25); }
.player__vol-input::-moz-range-track {
  height: 3px; border-radius: 3px;
  background: rgba(183,110,121,0.18);
}
.player__vol-input::-moz-range-progress {
  height: 3px; border-radius: 3px; background: var(--rose);
}
.player__vol-input::-moz-range-thumb {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--soft-white);
  border: 1.5px solid var(--rose);
}

/* --- Collapse chevron --- */
.player__collapse {
  flex: none;
  width: 1.5rem; height: 1.5rem;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  border-radius: 6px;
  transition: color 0.35s var(--e-out), background 0.35s var(--e-out);
}
.player__collapse:hover { color: var(--rose); background: rgba(183, 110, 121, 0.1); }
.player__collapse svg {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  transition: transform 0.6s var(--e-out);
}

/* --- Missing-track state: the player explains itself instead of breaking --- */
.player.is-unavailable .player__toggle {
  background: linear-gradient(135deg, #C9BBA6, #A99781);
  box-shadow: none;
  cursor: not-allowed;
}
.player.is-unavailable .player__scrub { pointer-events: none; opacity: 0.4; }
.player.is-unavailable .player__vol   { opacity: 0.4; pointer-events: none; }
.player.is-unavailable .player__track { color: var(--ink-faint); }

/* Mobile: the player docks to the full width of the screen bottom */
@media (max-width: 560px) {
  .player {
    left: 0.7rem;
    right: 0.7rem;
    bottom: 0.7rem;
    width: auto;
  }
  .player.is-collapsed { left: auto; width: auto; }
}
