/* SpaceX-meets-Luxury poster canvas */

.poster-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.poster-stars {
  position: absolute;
  inset: 0;
  opacity: 0.55;
}

.poster-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 191, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 191, 255, 0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 75%);
  opacity: 0.22;
}

[data-theme="light"] .poster-grid {
  background-image:
    linear-gradient(rgba(90, 69, 212, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90, 69, 212, 0.05) 1px, transparent 1px);
  opacity: 0.14;
}

[data-theme="light"] .poster-stars {
  opacity: 0.2;
}

.poster-horizon {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 12vh;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 191, 255, 0.5) 30%,
    rgba(255, 183, 183, 0.4) 70%,
    transparent
  );
  box-shadow: 0 0 40px rgba(123, 97, 255, 0.35);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.poster-horizon-glow {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 120%;
  height: 40vh;
  background: radial-gradient(ellipse at 50% 100%, rgba(123, 97, 255, 0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

body.portal-salon-active .poster-horizon-glow {
  background: radial-gradient(ellipse at 50% 100%, rgba(123, 97, 255, 0.18) 0%, transparent 65%);
}

body.portal-client-active .poster-horizon-glow {
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 183, 183, 0.14) 0%, transparent 65%);
}

.gate {
  z-index: 2;
}

.gate.is-poster-ready .gate-brand,
.gate.is-poster-ready .gate-subtitle,
.gate.is-poster-ready .gate-headline--left,
.gate.is-poster-ready .gate-headline--right,
.gate.is-poster-ready .gate-col .portal-tile {
  animation: posterRise 1s var(--ease-silk) both;
}

.gate.is-poster-ready .gate-subtitle,
.gate.is-poster-ready .gate-headline--left,
.gate.is-poster-ready .gate-headline--right {
  animation-delay: 0.1s;
}

.gate.is-poster-ready .gate-col--left .portal-tile {
  animation-delay: 0.22s;
}

.gate.is-poster-ready .gate-col--right .portal-tile {
  animation-delay: 0.3s;
}

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

.chamber-number {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 191, 255, 0.25);
  background: rgba(11, 11, 18, 0.6);
  font-family: "Manrope", sans-serif;
  letter-spacing: 0.2em;
  white-space: nowrap;
  z-index: 1;
}

.chamber-number::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--glow-purple);
  animation: missionPulse 2s ease-in-out infinite;
}

body.portal-client-active .chamber-number::before {
  background: var(--secondary);
  box-shadow: 0 0 8px rgba(255, 178, 184, 0.6);
}

[data-theme="light"] .chamber-number {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(90, 69, 212, 0.2);
  color: var(--muted);
}

@keyframes missionPulse {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

.labyrinth.is-poster-active .chamber-inner {
  position: relative;
}

.labyrinth.is-poster-active .chamber-inner::before {
  content: "";
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(201, 191, 255, 0.06);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-chamber) var(--ease-silk);
}

.chamber.is-active .chamber-inner::before {
  opacity: 1;
  box-shadow: inset 0 0 60px rgba(123, 97, 255, 0.04);
}

.progress-thread.is-visible .thread-fill {
  filter: drop-shadow(0 0 6px rgba(123, 97, 255, 0.5));
}

.portal-tile {
  position: relative;
  overflow: hidden;
}

.portal-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(201, 191, 255, 0.08) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: transform 900ms var(--ease-silk);
  pointer-events: none;
}

.portal-tile:hover::after,
.portal-tile:focus-visible::after {
  transform: translateX(120%);
}

body.portal-salon-active .chamber.is-active .chamber-title {
  text-shadow: 0 0 40px rgba(123, 97, 255, 0.25);
}

body.portal-client-active .chamber.is-active .chamber-title {
  text-shadow: 0 0 40px rgba(255, 183, 183, 0.2);
}

.labyrinth.is-poster-active .finale {
  position: relative;
}

.labyrinth.is-poster-active .finale::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 191, 255, 0.4), transparent);
  box-shadow: 0 0 30px rgba(123, 97, 255, 0.3);
}

@media (max-width: 720px) {
  body:not(.is-labyrinth-active) .poster-field,
  body:not(.is-labyrinth-active) .poster-horizon,
  body:not(.is-labyrinth-active) .poster-horizon-glow,
  body:not(.is-labyrinth-active) .ambient-glow {
    opacity: 0;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chamber-number::before {
    animation: none;
  }
}
