/* Shared: intro shell + soundtrack corner + loading bar + headphone hint */

.alma-intro {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: grid;
  place-items: center;
  padding: 2rem;
  padding-top: max(2rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse 90% 70% at 50% 40%, #0a0a0a 0%, #000 72%);
  transition: opacity 0.75s cubic-bezier(0.45, 0, 0.55, 1), visibility 0.75s step-end;
}

.alma-intro.alma-intro--gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.75s cubic-bezier(0.45, 0, 0.55, 1), visibility 0s linear 0.75s;
}

.alma-intro__inner {
  text-align: center;
  max-width: min(34rem, 92vw);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.alma-intro__brand {
  margin: 0 0 0.15rem;
  line-height: 1.35;
}

.alma-intro__brand-name {
  display: block;
  font-size: clamp(1.35rem, 4.2vw, 2rem);
  font-weight: 300;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
}

.alma-intro__brand-sub {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  font-weight: 300;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  color: rgba(255, 255, 255, 0.62);
}

.alma-intro__logo {
  font-size: clamp(1.6rem, 5vw, 2.35rem);
  font-weight: 300;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 1rem;
}

.alma-intro__status {
  font-size: clamp(0.78rem, 2vw, 0.92rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.48);
  margin: 0 0 0.55rem;
}

.alma-intro__btn {
  appearance: none;
  font-family: inherit;
  font-weight: 400;
  font-size: clamp(0.78rem, 1.8vw, 0.9rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.38);
  padding: 1rem 2.2rem;
  border-radius: 9999px;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset, 0 0 32px rgba(255, 255, 255, 0.08);
  transition: border-color 0.45s, box-shadow 0.45s, background 0.45s;
}

.alma-intro__btn:hover {
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.08);
}

.alma-intro__btn:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.35);
  outline-offset: 4px;
}

.alma-intro__btn[hidden] {
  display: none;
}

.audio-corner {
  position: fixed;
  right: max(0.55rem, calc(env(safe-area-inset-right) + 0.35rem));
  bottom: max(0.5rem, calc(env(safe-area-inset-bottom) + 0.3rem));
  /* Just above .bottom-glass (1180); below full-screen modals/lightboxes (e.g. 10080+) */
  z-index: 1188;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.42rem;
  max-width: min(72vw, 10.5rem);
  opacity: 0.38;
  transition: opacity 0.55s cubic-bezier(0.45, 0, 0.55, 1);
  pointer-events: auto;
}

.audio-corner:hover,
.audio-corner:focus-within {
  opacity: 0.78;
}

.audio-corner__credits {
  text-align: right;
  line-height: 1.35;
}

.audio-corner__credit {
  font-size: clamp(0.38rem, 0.95vw, 0.48rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.22);
  margin: 0;
}

.audio-corner__dock {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.32rem;
}

.audio-corner__dock[hidden] {
  display: none !important;
}

.audio-corner__controls {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.28rem;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  max-width: 0;
  overflow: hidden;
  transition:
    opacity 0.42s cubic-bezier(0.45, 0, 0.55, 1),
    transform 0.42s cubic-bezier(0.45, 0, 0.55, 1),
    max-width 0.5s cubic-bezier(0.45, 0, 0.55, 1);
}

.audio-corner:hover .audio-corner__controls,
.audio-corner:focus-within .audio-corner__controls {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  max-width: 11rem;
}

@media (hover: none), (pointer: coarse) {
  .audio-corner__controls {
    opacity: 0.55;
    transform: translateX(0);
    max-width: 11rem;
    pointer-events: auto;
  }

  .audio-corner:active .audio-corner__controls,
  .audio-corner:focus-within .audio-corner__controls {
    opacity: 1;
  }
}

.audio-corner__peek {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.42);
  opacity: 0.55;
  transition: opacity 0.45s cubic-bezier(0.45, 0, 0.55, 1), border-color 0.45s, color 0.45s;
}

.audio-corner:hover .audio-corner__peek,
.audio-corner:focus-within .audio-corner__peek {
  opacity: 0.88;
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.72);
}

.audio-corner__peek svg {
  width: 0.88rem;
  height: 0.88rem;
  display: block;
}

.audio-corner__ctrl {
  appearance: none;
  font-family: inherit;
  display: grid;
  place-items: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.35s, border-color 0.35s, background 0.35s;
}

.audio-corner__ctrl:hover {
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.audio-corner__ctrl:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.28);
  outline-offset: 2px;
}

.audio-corner__ctrl svg {
  width: 0.82rem;
  height: 0.82rem;
  display: block;
}

.audio-corner__ctrl[hidden] {
  display: none !important;
}

/* Intro: progress bar */
.alma-intro__progress {
  width: 100%;
  max-width: 17.5rem;
  height: 3px;
  margin: 0.15rem auto 0.5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35) inset;
}

.alma-intro__progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 252, 248, 0.42) 48%,
    rgba(240, 238, 244, 0.22) 100%
  );
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.alma-intro__tagline {
  font-size: clamp(0.58rem, 1.55vw, 0.72rem);
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.34);
  margin: 0 auto 1.1rem;
  max-width: 22rem;
  line-height: 1.45;
}

@media (prefers-reduced-motion: reduce) {
  .alma-intro__progress-bar {
    transition: none;
  }
}

/* Intro: one panel — hints + media tier (legacy headphone rows still styled below) */
.alma-intro__panel {
  margin: 0 auto;
  width: 100%;
  max-width: 30rem;
  padding: 0.7rem 0.85rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.034);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.alma-intro__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
  font-size: clamp(0.62rem, 1.45vw, 0.74rem);
  font-weight: 300;
  letter-spacing: 0.035em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.48);
  text-align: center;
}

.alma-intro__meta-glyph {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.52);
  animation: alma-headphone-pulse 2.8s ease-in-out infinite;
}

.alma-intro__meta-glyph svg {
  width: 0.88rem;
  height: 0.88rem;
  display: block;
}

.alma-intro__meta-text {
  flex: 1 1 12rem;
  max-width: 22rem;
}

@media (min-width: 560px) {
  .alma-intro__meta {
    flex-wrap: nowrap;
    text-align: left;
  }

  .alma-intro__meta-text {
    text-align: left;
  }
}

/* Quiet hints — legacy markup (pages not yet on panel) */
.alma-intro__headphones {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-size: clamp(0.62rem, 1.65vw, 0.76rem);
  font-weight: 300;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 0.55rem;
  line-height: 1.5;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.alma-intro__device-hint {
  margin: 0 auto 1.25rem;
  max-width: 22rem;
  padding: 0 0.75rem;
  box-sizing: border-box;
  font-size: clamp(0.54rem, 1.35vw, 0.64rem);
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
}

.alma-intro__headphones-icon {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
  animation: alma-headphone-pulse 2.8s ease-in-out infinite;
}

.alma-intro__headphones-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}

@keyframes alma-headphone-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.04);
    opacity: 0.85;
  }
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 28px rgba(255, 252, 248, 0.1);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .alma-intro__headphones-icon {
    animation: none;
  }

  .alma-intro__meta-glyph {
    animation: none;
  }
}

body:not(.alma-ready) .audio-corner {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

body.alma-ready .audio-corner {
  visibility: visible;
}
