/*
  home.css
  Styles for index.html, in page order:
  1. launch screen  2. music section (3D ring)  3. footer  4. song dialog
*/

/* ===================== 1. Launch screen ===================== */

.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(600px, 100vh);
  min-height: max(600px, 100svh);
  overflow: hidden;
  background: #070507;
}

.intro__bg {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.intro__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  animation: intro-zoom 2.6s var(--ease-out) both;
}

/* Dark fade over the photo so the text stays readable */
.intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 5, 7, 0.65) 0%, rgba(7, 5, 7, 0.05) 32%, rgba(7, 5, 7, 0.5) 62%, var(--bg) 100%);
}

.site-header {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  padding: 22px 5%;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav .pill {
  padding: 9px 16px;
  font-size: 14px;
}

.intro__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: auto;
  padding: 0 5% clamp(96px, 14vh, 150px);
  will-change: opacity, transform;
}

.badge--glass {
  padding: 8px 14px;
  font-size: 13px;
  background: rgba(10, 6, 8, 0.45);
  backdrop-filter: blur(4px);
}

.intro__title {
  margin: 0 0 8px;
  font-size: clamp(66px, 11vw, 184px);
  line-height: 0.9;
  letter-spacing: -0.01em;
}

/* One line on tablets and computers, so "me" doesn't drop onto its own line */
@media (min-width: 641px) {
  .intro__title {
    white-space: nowrap;
  }
}

@media (min-width: 641px) and (max-width: 1100px) {
  .intro__actions .btn {
    padding: 13px 22px;
    font-size: 14px;
  }

  .intro__actions .btn--big {
    padding: 15px 26px;
    font-size: 16px;
  }
}

/* Each word of the title rises in one after another */
.intro__title span {
  display: inline-block;
  animation: rise 1.2s var(--ease-out) both;
  animation-delay: calc(var(--delay) + 0.7s);
}

.intro__sub {
  margin: 0;
  font-size: 15px;
  color: #e4d9dc;
}

.intro__quote {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 32px);
}

.intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.scroll-cue {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 42px;
  background: linear-gradient(#fff, rgba(255, 255, 255, 0));
  animation: scroll-line 1.8s ease-in-out infinite;
}

/* Anything with .fade appears after its --delay */
.fade {
  animation: fade-up 1s ease-out both;
  animation-delay: var(--delay);
}

/* The header only fades (no movement). Movement would trap the ☰ menu inside it. */
.site-header.fade {
  animation-name: fade-in;
}

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

@keyframes intro-zoom {
  from { transform: scale(1.18); filter: brightness(0.15); }
  to { transform: scale(1); filter: brightness(1); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(55%); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes scroll-line {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ===================== 2. Music section ===================== */

.music {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: max(640px, 100vh);
  min-height: max(640px, 100svh);
  padding-top: 20px;
  overflow: hidden;
}

.music__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  opacity: 0.3;
  pointer-events: none;
}

.music::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 5, 7, 0.55) 0%, rgba(7, 5, 7, 0.2) 40%, rgba(7, 5, 7, 0.85) 100%);
}

.music__head {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4px 5% 0;
  text-align: center;
}

.music__label {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 30px);
}

/*
  The 3D ring.
  --radius: distance of each card from the centre
  --size:   card width and height
*/
.stage {
  --radius: clamp(150px, 30vw, 450px);
  --size: clamp(116px, 15vw, 210px);

  position: relative;
  z-index: 2;
  flex: 1;
  min-height: clamp(340px, 46vw, 540px);
  perspective: 1500px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

.stage:active {
  cursor: grabbing;
}

.stage:focus-visible {
  outline: 2px solid var(--red-light);
  outline-offset: -8px;
}

.tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}

.floor-ring {
  position: absolute;
  left: 50%;
  top: 47%;
  width: calc(var(--radius) * 2.4);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(255, 59, 78, 0.35);
  transform: translate(-50%, -50%) translateY(calc(var(--size) * 0.72)) rotateX(84deg);
}

.ring {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  transform-style: preserve-3d;
  will-change: transform;
}

/* --angle is set per card in home.js */
.card {
  position: absolute;
  left: calc(var(--size) / -2);
  top: calc(var(--size) / -2);
  width: var(--size);
  height: var(--size);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(var(--angle)) translateZ(var(--radius)) scale(var(--scale, 1));
  transition: transform 0.8s var(--ease-out);
}

.card.is-front {
  --scale: 1.12;
}

/* The record that slides out of the front "don't scare me" card */
.card__record {
  position: absolute;
  inset: 5%;
  transition: transform 1.1s var(--ease-out) 0.15s;
}

.card__record .record {
  animation-play-state: paused;
}

.card.is-front .card__record {
  transform: translateX(50%);
}

.card.is-front .card__record .record {
  animation-play-state: running;
}

.card__face {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #140c10;
  color: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

.card__face--soon {
  border: 1px solid rgba(255, 59, 78, 0.45);
}

.card__face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
}

/* Gradient so the number and title are readable on the photo */
.card__face::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.85) 100%);
}

/* Cards that aren't at the front are dimmed */
.card__face::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.45;
  transition: opacity 0.8s;
}

.card.is-front .card__face::after {
  opacity: 0;
}

.card__num {
  position: absolute;
  top: 10px;
  left: 12px;
  font-size: clamp(24px, 2.6vw, 38px);
  font-weight: 800;
  line-height: 1;
}

/* Little lock icon on songs that aren't out yet */
.card__face--soon .card__num::after {
  content: "";
  position: absolute;
  top: 2px;
  left: calc(var(--size) - 46px);
  width: 22px;
  height: 22px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff3b4e' stroke-width='2'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") no-repeat center / contain;
}

.card__caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  font-size: clamp(10px, 0.9vw, 12px);
  line-height: 1.3;
}

.card__title {
  display: block;
  font-size: clamp(17px, 1.7vw, 24px);
}

.card__caption small {
  font-size: inherit;
  opacity: 0.8;
}

.dots {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 2px 5% 12px;
}

.dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: width 0.5s var(--ease-out), background-color 0.5s;
}

.dot.is-front {
  width: 30px;
  background: var(--red);
}

.now-showing {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding: 8px 5% 28px;
}

.now-showing__kicker {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.now-showing__title {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.1;
}

.now-showing__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.now-showing__insta {
  font-size: 13px;
}

/* ===================== 3. Footer ===================== */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 48px 5% 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--bg-deep);
}

.site-footer__heading {
  margin: 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(26px, 3vw, 34px);
  text-align: center;
}

.site-footer .apps {
  justify-content: center;
  max-width: 920px;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  width: 100%;
  margin-top: 18px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--muted);
}

.site-footer__bottom .logo {
  font-size: 15px;
}

.site-footer__bottom nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.site-footer__bottom nav a {
  color: var(--ink-soft);
}

.site-footer__bottom p {
  margin: 0;
}

/* ===================== 4. Song dialog ===================== */

.song {
  width: min(900px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid rgba(255, 59, 78, 0.3);
  border-radius: 26px;
  background: #0e080b;
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7), 0 0 90px rgba(255, 31, 61, 0.25);
  overflow-x: hidden;
}

.song[open] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  animation: pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.12) both;
}

.song::backdrop {
  background: rgba(4, 2, 4, 0.8);
  backdrop-filter: blur(8px);
}

.song__listen {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-right: 52px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--red);
  color: #fff;
}

.song__listen:hover {
  background: var(--red-light);
  color: #fff;
}

.song__listen strong {
  font-size: 17px;
  font-weight: 800;
}

.song__listen span {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.song__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
}

.song__cover {
  position: relative;
  flex: 0 1 300px;
  width: min(100%, 300px);
  aspect-ratio: 1;
  margin-right: clamp(0px, 7vw, 90px);
}

.song__record {
  position: absolute;
  inset: 4%;
  transform: translateX(32%);
}

.song__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.song__info {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.song__info p {
  margin: 0;
}

.song__eyebrow {
  font-size: 14px;
  font-weight: 500;
  color: var(--red-text);
}

.song__title {
  margin: 0;
  font-size: clamp(44px, 6vw, 72px);
  line-height: 0.95;
}

.song__writeup {
  max-width: 460px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.song__writeup em {
  font-family: var(--font-serif);
  font-size: 21px;
  color: var(--ink);
}

.song__release {
  font-size: 14px;
  color: #c9bcc0;
}

.song__player {
  min-height: 152px;
  border-radius: 14px;
  overflow: hidden;
  background: #140c10;
}

.song__player iframe {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
}

.song__link {
  align-self: flex-start;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ===================== Toast ===================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 30;
  max-width: 90vw;
  padding: 14px 22px;
  border: 1px solid var(--red-light);
  border-radius: 999px;
  background: #1a0b10;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  animation: toast-in 0.3s ease-out both;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===================== Phones ===================== */

@media (max-width: 640px) {
  .hide-on-phone {
    display: none;
  }

  .site-header {
    flex-wrap: nowrap;
    padding: 16px 5%;
  }

  .intro__body {
    align-items: center;
    text-align: center;
  }

  .intro__actions,
  .intro__body .also {
    justify-content: center;
  }

  .intro__actions {
    gap: 8px;
  }

  .intro__actions .btn {
    padding: 12px 18px;
    font-size: 14px;
  }

  .intro__actions .btn--big {
    padding: 14px 24px;
    font-size: 15px;
  }


  .intro__bg img {
    object-position: center 35%;
  }

  .music {
    min-height: auto;
    padding-top: 36px;
  }

  .stage {
    --radius: 205px;
    --size: min(54vw, 215px);
    flex: none;
    height: 440px;
  }

  .music__bg {
    opacity: 0.42;
    object-position: center 70%;
  }

  .card.is-front {
    --scale: 1.04;
  }

  .card.is-front .card__record {
    transform: translateX(30%);
  }

  .now-showing {
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding-bottom: 22px;
    text-align: center;
  }

  .site-footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  .site-footer__bottom nav {
    justify-content: center;
  }

  .apps__link {
    padding: 9px 14px 9px 10px;
    font-size: 13px;
  }

  .song[open] {
    gap: 24px;
  }

  .song__listen {
    margin-top: 44px;
    margin-right: 0;
  }

  .song__cover {
    flex-basis: 220px;
    width: min(64%, 230px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro__bg img,
  .intro__title span,
  .fade,
  .scroll-cue i {
    animation: none;
  }
}
