:root {
  --bg: #050505;
  --fg: #f5f5f5;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, 0.12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Animated background gradient sweep */
body::before {
  content: "";
  position: fixed;
  inset: -50%;
  background: radial-gradient(
      circle at 30% 30%,
      rgba(255, 255, 255, 0.08),
      transparent 40%
    ),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.05), transparent 45%);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes drift {
  0% {
    transform: translate3d(-5%, -3%, 0) scale(1);
  }
  100% {
    transform: translate3d(5%, 4%, 0) scale(1.15);
  }
}

/* Subtle film grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  z-index: 2;
  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='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  z-index: 1;
  padding: 1.5rem;
}

/* Pulsing rings behind the card */
.rings {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.ring {
  position: absolute;
  width: 280px;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 50%;
  animation: pulse 4s ease-out infinite;
}

.ring:nth-child(2) {
  animation-delay: 1.3s;
}

.ring:nth-child(3) {
  animation-delay: 2.6s;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* --- Bass "boom boom" sync (active only while music plays) --- */
/* --beat is the time between kicks; ~130 BPM feel */
body.playing {
  --beat: 0.46s;
}

/* On the beat the rings punch outward like a kick drum */
body.playing .ring {
  animation: boom var(--beat) cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

body.playing .ring:nth-child(1) {
  animation-delay: 0s;
}

body.playing .ring:nth-child(2) {
  animation-delay: calc(var(--beat) / 3);
}

body.playing .ring:nth-child(3) {
  animation-delay: calc(var(--beat) / 1.5);
}

@keyframes boom {
  0% {
    transform: scale(0.85);
    opacity: 0.7;
    border-color: rgba(255, 255, 255, 0.35);
  }
  14% {
    transform: scale(1.6);
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.6);
  }
  55% {
    transform: scale(2.1);
    opacity: 0.12;
  }
  100% {
    transform: scale(2.3);
    opacity: 0;
  }
}

/* The card gives a subtle thump on every kick too */
body.playing .card {
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) both,
    thump var(--beat) ease-out infinite;
}

@keyframes thump {
  0% {
    transform: scale(1);
  }
  10% {
    transform: scale(1.018);
  }
  40% {
    transform: scale(1);
  }
  100% {
    transform: scale(1);
  }
}

.card {
  position: relative;
  text-align: center;
  padding: 3rem 2.5rem;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(6px);
  max-width: 460px;
  width: 100%;
  animation: rise 1s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.eyebrow {
  letter-spacing: 0.5em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1.4rem;
  animation: fade 1s ease 0.1s both;
}

.title {
  font-weight: 800;
  font-size: clamp(2.6rem, 9vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.title .line {
  display: block;
  overflow: hidden;
}

.title .line span,
.title .line {
  display: block;
}

.title .line:nth-child(1) {
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

.title .line:nth-child(2) {
  color: var(--muted);
  animation: slideUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.35s both;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.subtitle {
  margin: 1.2rem 0 2.2rem;
  color: var(--muted);
  font-weight: 300;
  font-size: 1rem;
  animation: fade 1s ease 0.5s both;
}

.phone {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.8rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(1.2rem, 5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: transparent;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  animation: fade 1s ease 0.65s both;
}

.phone:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-3px);
}

.phone-icon {
  display: inline-flex;
  width: 1.3em;
  height: 1.3em;
  animation: wiggle 2.5s ease-in-out infinite;
}

.phone-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes wiggle {
  0%,
  92%,
  100% {
    transform: rotate(0);
  }
  94% {
    transform: rotate(-12deg);
  }
  96% {
    transform: rotate(12deg);
  }
  98% {
    transform: rotate(-8deg);
  }
}

.note {
  margin-top: 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  animation: fade 1s ease 0.8s both, blink 2.5s ease-in-out infinite 2s;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes blink {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
}

/* Hidden YouTube player */
#yt-player {
  position: fixed;
  width: 1px;
  height: 1px;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* Floating sound / mute button */
.sound-toggle {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  color: var(--fg);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
  animation: fade 1s ease 1s both;
}

.sound-toggle:hover {
  background: var(--fg);
  color: var(--bg);
  transform: translateY(-2px);
}

.sound-icon {
  display: inline-flex;
  width: 1.2em;
  height: 1.2em;
}

.sound-icon svg {
  width: 100%;
  height: 100%;
}

/* Show the correct icon based on mute state */
.sound-toggle .sound-off {
  display: none;
}

.sound-toggle.is-muted .sound-on {
  display: none;
}

.sound-toggle.is-muted .sound-off {
  display: inline-flex;
}

/* Pulse the button while muted to hint at sound */
.sound-toggle.is-muted {
  animation: fade 1s ease 1s both, softpulse 2.4s ease-in-out infinite 2s;
}

.sound-toggle:not(.is-muted) .sound-label {
  display: none;
}

@keyframes softpulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.25);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
}

@media (max-width: 480px) {
  .sound-label {
    display: none;
  }
  .sound-toggle {
    padding: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
  }
}
