/* Tactile glass — shared pressable surfaces */
.glass {
  position: relative;
  isolation: isolate;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.glass-press {
  --glass-rx: 0deg;
  --glass-ry: 0deg;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
  transform: perspective(700px) rotateX(var(--glass-rx)) rotateY(var(--glass-ry)) translateY(0) scale(1);
  transform-style: preserve-3d;
  transition:
    transform var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.glass-ripple {
  position: absolute !important;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  overflow: hidden;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.55) 0%,
    rgb(var(--accent-glow-r) var(--accent-glow-g) var(--accent-glow-b) / 0.28) 32%,
    rgba(255, 255, 255, 0.06) 55%,
    transparent 72%
  );
  transform: scale(0);
  opacity: 0.95;
  animation: glass-ripple-out 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Beat .navlinks a > * { position: relative } so ripples never inflate the tab */
.navlinks a > .glass-ripple,
.navicons a > .glass-ripple,
.bottom-tab > .glass-ripple,
.bottom-links-btn > .glass-ripple,
.glass-press > .glass-ripple {
  position: absolute !important;
  flex: none !important;
  align-self: auto !important;
}

.navlinks a,
.navicons a,
.bottom-tab,
.bottom-links-btn {
  overflow: hidden;
}

@keyframes glass-ripple-out {
  0% {
    transform: scale(0);
    opacity: 0.9;
  }
  55% {
    opacity: 0.45;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

.glass-press:hover,
.glass-press.is-proximity-hover {
  box-shadow: var(--glass-shadow-lift);
}

.glass-press:active,
.glass-press.is-pressed {
  transform: perspective(700px) rotateX(var(--glass-rx)) rotateY(var(--glass-ry)) translateY(2px) scale(0.98);
  box-shadow: var(--glass-shadow-pressed);
}

.glass-press:focus-visible {
  outline: 2px solid rgb(var(--accent-bright-r) var(--accent-bright-g) var(--accent-bright-b) / 0.55);
  outline-offset: 3px;
}

/* Shared glass CTA — contact buttons, hero listen/watch, etc. */
.contact-cta {
  --mouse-x: 50%;
  --mouse-y: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.75rem 1.2rem;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: rgba(232, 236, 234, 0.96);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  background:
    linear-gradient(
      180deg,
      rgb(var(--accent-glow-r) var(--accent-glow-g) var(--accent-glow-b) / 0.1) 0%,
      rgb(var(--accent-deep-r) var(--accent-deep-g) var(--accent-deep-b) / 0.08) 100%
    ),
    var(--glass-bg);
  border-color: rgb(var(--accent-bright-r) var(--accent-bright-g) var(--accent-bright-b) / 0.32);
  box-shadow: var(--glass-shadow);
  transition:
    color 0.2s ease,
    background 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.contact-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    var(--theme-hover-glow) 0%,
    var(--theme-hover-glow-soft) 35%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.contact-cta > * {
  position: relative;
  z-index: 1;
}

.contact-cta:hover {
  color: #fff;
  background:
    linear-gradient(
      180deg,
      rgb(var(--accent-glow-r) var(--accent-glow-g) var(--accent-glow-b) / 0.16) 0%,
      rgb(var(--accent-deep-r) var(--accent-deep-g) var(--accent-deep-b) / 0.12) 100%
    ),
    var(--glass-bg);
  border-color: rgb(var(--accent-bright-r) var(--accent-bright-g) var(--accent-bright-b) / 0.45);
  box-shadow: var(--glass-shadow-lift);
}

.contact-cta:hover::before {
  opacity: 1;
}

/* Proximity only lights the border — keep resting glass shadow */
.contact-cta.glass-press.is-proximity-hover:not(:hover) {
  box-shadow: var(--glass-shadow);
}

button.contact-cta {
  width: auto;
}

/* Featured primary / secondary CTAs — home + films featured sections */
.film-featured-cta {
  --mouse-x: 50%;
  --mouse-y: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0.75rem 1.2rem;
  box-sizing: border-box;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: rgba(232, 236, 234, 0.96);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    transform var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.film-featured-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle at var(--mouse-x) var(--mouse-y),
    var(--theme-hover-glow) 0%,
    var(--theme-hover-glow-soft) 35%,
    transparent 55%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}

.film-featured-cta > * {
  position: relative;
  z-index: 1;
}

.film-featured-cta:not(.is-secondary) {
  background:
    linear-gradient(
      180deg,
      rgb(var(--accent-glow-r) var(--accent-glow-g) var(--accent-glow-b) / 0.1) 0%,
      rgb(var(--accent-deep-r) var(--accent-deep-g) var(--accent-deep-b) / 0.08) 100%
    ),
    var(--glass-bg);
  border-color: rgb(var(--accent-bright-r) var(--accent-bright-g) var(--accent-bright-b) / 0.32);
  box-shadow: var(--glass-shadow);
}

.film-featured-cta:not(.is-secondary):hover {
  color: #fff;
  background:
    linear-gradient(
      180deg,
      rgb(var(--accent-glow-r) var(--accent-glow-g) var(--accent-glow-b) / 0.16) 0%,
      rgb(var(--accent-deep-r) var(--accent-deep-g) var(--accent-deep-b) / 0.12) 100%
    ),
    var(--glass-bg);
  border-color: rgb(var(--accent-bright-r) var(--accent-bright-g) var(--accent-bright-b) / 0.45);
  box-shadow: var(--glass-shadow-lift);
}

.film-featured-cta:not(.is-secondary):hover::before {
  opacity: 1;
}

.film-featured-cta.is-secondary {
  color: rgba(232, 236, 234, 0.78);
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

.film-featured-cta.is-secondary:hover {
  color: rgba(232, 236, 234, 0.96);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: var(--glass-shadow-lift);
}

.film-featured-cta.is-secondary:hover::before {
  opacity: 1;
}

/* Proximity only lights the border — keep resting glass shadow */
.film-featured-cta.glass-press.is-proximity-hover:not(:hover) {
  box-shadow: var(--glass-shadow);
}

.film-featured-cta.is-secondary.glass-press.is-proximity-hover:not(:hover) {
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.14);
}

.film-featured-cta-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  fill: currentColor;
  opacity: 0.92;
}

.film-featured-cta-icon.is-arrow {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  opacity: 0.75;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.film-featured-cta.is-secondary:hover .film-featured-cta-icon.is-arrow {
  opacity: 1;
  transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
  .film-featured-cta-icon.is-arrow {
    transition: none;
  }

  .film-featured-cta.is-secondary:hover .film-featured-cta-icon.is-arrow {
    transform: none;
  }
}

.navlinks a:active,
.navlinks a.is-pressed,
.navicons a:active,
.navicons a.is-pressed,
.bottom-tab:active,
.bottom-links-btn:active {
  box-shadow: var(--glass-shadow-pressed);
}

.film-card,
.film-featured-link,
.contact-card-btn,
.album-dropdown {
  --glass-rx: 0deg;
  --glass-ry: 0deg;
  transition:
    transform var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    box-shadow var(--glass-press-duration, 0.18s) var(--glass-press-ease, cubic-bezier(0.22, 1, 0.36, 1)),
    border-color 0.2s ease;
  transform: perspective(800px) rotateX(var(--glass-rx)) rotateY(var(--glass-ry));
}

.film-card:active,
.film-card.is-pressed,
.film-featured-link:active,
.film-featured-link.is-pressed,
.contact-card-btn:active,
.contact-card-btn.is-pressed,
.album-dropdown:active,
.album-dropdown.is-pressed {
  transform: perspective(800px) translateY(2px) scale(0.985);
  box-shadow: var(--glass-shadow-pressed);
}

.header .header-gradient-text,
.musicheader .headermusicinfo h1 {
  font-family: var(--font-display) !important;
  letter-spacing: -0.03em;
}

@media (prefers-reduced-motion: reduce) {
  .glass-ripple {
    display: none !important;
  }
  .glass-press,
  .navlinks a,
  .film-card,
  .film-featured-link,
  .contact-card-btn,
  .album-dropdown {
    transition: box-shadow 0.15s ease, border-color 0.15s ease !important;
    transform: none !important;
  }
  .glass-press:active,
  .glass-press.is-pressed,
  .film-card:active,
  .film-card.is-pressed,
  .film-featured-link:active,
  .contact-card-btn:active {
    transform: none !important;
    box-shadow: var(--glass-shadow-pressed);
  }
}
