:root {
  --bg: #030303;
  --card: rgba(20, 20, 22, 0.72);
  --card-border: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.70);
  --soft: rgba(255, 255, 255, 0.48);
  --cyan: #00f5ff;
  --pink: #ff00df;
  --shadow: rgba(0, 0, 0, 0.72);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(0, 245, 255, 0.13), transparent 28%),
    radial-gradient(circle at 87% 22%, rgba(255, 0, 223, 0.12), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 32%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.page {
  min-height: 100svh;
  padding: max(20px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  animation: pageFade 720ms ease both;
}

.gift-card {
  width: min(100%, 430px);
  padding: 22px;
  border: 1px solid var(--card-border);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.105), rgba(255,255,255,0.035)),
    var(--card);
  box-shadow: 0 30px 90px var(--shadow), inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.gift-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(130deg, rgba(0,245,255,0.20), transparent 27%, transparent 62%, rgba(255,0,223,0.18));
  opacity: 0.75;
  mix-blend-mode: screen;
}

.hero-shell {
  position: relative;
  z-index: 1;
  aspect-ratio: 1 / 1;
  border-radius: 27px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 32px rgba(0,245,255,0.10), 0 0 42px rgba(255,0,223,0.08);
  transform: translateZ(0);
}

.hero-shell.playing {
  animation: videoGlow 4s ease-in-out infinite alternate;
}

.cover-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  animation: breathe 8s ease-in-out infinite;
  opacity: 1;
  transform-origin: center;
  transition: opacity 580ms ease, filter 580ms ease, transform 580ms ease;
}

.video-wrap, .end-screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 650ms ease;
}

.video-wrap iframe, .player-slot {
  width: 100%;
  height: 100%;
  border: 0;
}

.end-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 34%), #000;
  text-align: center;
}

.end-screen p {
  margin: 0;
  font-size: clamp(34px, 8.8vw, 52px);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  padding: 8px 16px;
  cursor: pointer;
}

.copy, .actions {
  position: relative;
  z-index: 1;
  text-align: center;
}

.copy {
  margin-top: 20px;
  transition: transform 520ms ease, opacity 520ms ease;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.38em;
}

h1 {
  margin: 0;
  font-size: clamp(37px, 11vw, 57px);
  line-height: 0.86;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--cyan), -2px -1px 0 var(--pink), 0 11px 22px rgba(255,255,255,0.18);
}

.blurb {
  margin: 18px auto 0;
  max-width: 290px;
  font-size: clamp(18px, 5vw, 22px);
  line-height: 1.35;
  color: rgba(255,255,255,0.86);
}

.actions {
  margin-top: 24px;
  display: grid;
  justify-items: center;
  gap: 12px;
  transition: transform 520ms ease, opacity 520ms ease;
}

.primary-button {
  appearance: none;
  border: 0;
  min-width: 235px;
  padding: 17px 28px;
  border-radius: 999px;
  color: #070707;
  background: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255,0,223,0.95), 0 0 0 6px rgba(0,245,255,0.78), 0 22px 42px rgba(0,0,0,0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 160ms ease, filter 160ms ease;
}

.primary-button:active { transform: scale(0.97); }
.primary-button:focus-visible, .soundcloud-link:focus-visible, .text-button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 5px; }

.play-icon { font-size: 16px; }

.keep-line {
  margin: 8px 0 -2px;
  color: var(--soft);
  font-size: 13px;
}

.soundcloud-link {
  color: rgba(255,255,255,0.84);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.34);
  padding-bottom: 3px;
}

.soundcloud-link:active { opacity: 0.7; }

body.is-playing .cover-art {
  opacity: 0;
  filter: blur(12px);
  transform: scale(1.045);
  animation-play-state: paused;
}

body.is-playing .video-wrap {
  opacity: 1;
  pointer-events: auto;
}

body.is-playing .copy {
  transform: translateY(-2px) scale(0.96);
  opacity: 0.58;
}

body.is-playing .actions {
  transform: translateY(-6px);
}

body.is-playing .primary-button {
  display: none;
}

body.has-ended .video-wrap {
  opacity: 0;
  pointer-events: none;
}

body.has-ended .end-screen {
  opacity: 1;
  pointer-events: auto;
}

body.has-ended .copy, body.has-ended .actions {
  opacity: 0;
  pointer-events: none;
}

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

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

@keyframes videoGlow {
  from { box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 28px rgba(0,245,255,0.10), 0 0 36px rgba(255,0,223,0.08); }
  to { box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 40px rgba(0,245,255,0.16), 0 0 56px rgba(255,0,223,0.14); }
}

@media (max-height: 740px) {
  .page { align-items: start; }
  .gift-card { padding: 18px; border-radius: 28px; }
  .hero-shell { border-radius: 22px; }
  .copy { margin-top: 14px; }
  .actions { margin-top: 19px; }
  .blurb { margin-top: 13px; }
}

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