/* Hero — open layout, single column, mobile-first */

.scroll-progress {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 10001;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: right center;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(212, 63, 90, 0.65);
}

.hero {
  position: relative;
  isolation: isolate;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 20px calc(40px + env(safe-area-inset-bottom, 0px));
}

/* Title on moon — offset scales with moon size (shared --wwh-moon-* in wwh-atmosphere.css) */
.hero__title-stage {
  width: 100%;
  flex-shrink: 0;
  margin-top: calc(var(--wwh-moon-top, 6vh) + var(--wwh-moon-size, 220px) * 0.1);
  margin-bottom: 6px;
  text-align: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

@media (min-width: 769px) {
  .hero__title-stage {
    margin-top: calc(var(--wwh-moon-top, 6vh) + var(--wwh-moon-size, 220px) * 0.15);
  }
}

.hero__title-stage .hero__title {
  margin-bottom: 0;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.hero__episode-chip,
.hero__tagline,
.hero__subline {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Stage spotlight — full viewport dim (fixed), hole reveals sharp hero */
.hero-spotlight {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  z-index: 9995;
  pointer-events: none;
  opacity: 0;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background:
    linear-gradient(to bottom, rgba(4, 2, 8, 0.98) 0%, rgba(4, 2, 8, 0.95) 20%, rgba(4, 2, 8, 0.78) 38%, rgba(4, 2, 8, 0.78) 100%),
    rgba(4, 2, 8, 0.78);
  -webkit-mask-image: radial-gradient(
    circle var(--spot-r, 140px) at var(--spot-x, 50%) var(--spot-y, 38%),
    transparent 0%,
    transparent 58%,
    #000 92%
  );
  mask-image: radial-gradient(
    circle var(--spot-r, 140px) at var(--spot-x, 50%) var(--spot-y, 38%),
    transparent 0%,
    transparent 58%,
    #000 92%
  );
  transition: opacity 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Soft beam edge — follows --spot-* (handheld wobble in wwh-spotlight.js) */
.hero-spotlight__glow {
  position: fixed;
  left: var(--spot-x, 50%);
  top: var(--spot-y, 38%);
  width: calc(var(--spot-r, 140px) * 2.12);
  height: calc(var(--spot-r, 140px) * 2.12);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(255, 250, 253, 0.075) 0%,
    rgba(228, 218, 238, 0.04) 36%,
    rgba(212, 63, 90, 0.022) 52%,
    transparent 66%
  );
  filter: blur(5px);
  transition: opacity 0.45s ease;
}

.hero-spotlight.is-active .hero-spotlight__glow {
  opacity: 1;
}

.hero-spotlight.is-exit .hero-spotlight__glow,
.hero-spotlight.is-done .hero-spotlight__glow {
  opacity: 0;
}

.hero-spotlight.is-reduced .hero-spotlight__glow {
  opacity: 0.55;
  filter: blur(3px);
  background: radial-gradient(
    circle,
    rgba(255, 250, 253, 0.05) 0%,
    rgba(212, 63, 90, 0.015) 48%,
    transparent 62%
  );
}

/* Solid bleed for notch / short viewport (mask does not cover padding edge on old WebKit) */
.hero-spotlight::before {
  content: '';
  position: absolute;
  top: calc(-1 * env(safe-area-inset-top, 0px) - 72px);
  left: -15vw;
  right: -15vw;
  bottom: calc(-1 * env(safe-area-inset-bottom, 0px) - 24px);
  background: rgba(4, 2, 8, 0.92);
  z-index: -1;
  pointer-events: none;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  @media (hover: hover) and (pointer: fine) {
    .hero-spotlight:not(.is-reduced) {
      background: rgba(6, 4, 10, 0.55);
      -webkit-backdrop-filter: blur(12px) brightness(0.45) saturate(0.8);
      backdrop-filter: blur(12px) brightness(0.45) saturate(0.8);
    }
  }
}

@media (hover: none) and (pointer: coarse) {
  .hero-spotlight {
    background: rgba(4, 2, 8, 0.86);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

.hero-spotlight.is-active {
  opacity: 1;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

/*
 * Iris shutter disc — sits ON the spotlight hole only.
 * Mask / outer dim stay fixed so backdrop-filter does not flash the whole hero.
 */
.hero-spotlight__shutter {
  position: fixed;
  left: var(--spot-x, 50%);
  top: var(--spot-y, 38%);
  width: calc(var(--spot-r, 140px) * 2);
  height: calc(var(--spot-r, 140px) * 2);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: rgba(4, 2, 8, 0.96);
  box-shadow: 0 0 0 2px rgba(4, 2, 8, 0.55);
  transition: none;
}

.hero-spotlight.is-iris-closed .hero-spotlight__shutter {
  opacity: 1;
}

.hero-spotlight.is-iris-closed .hero-spotlight__glow {
  opacity: 0 !important;
  transition: none !important;
}

/* Soft lock only while spotlight runs — unlocks when sequence ends or user taps to skip */
html.wwh-spotlight-scroll-lock,
html.wwh-spotlight-scroll-lock body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  height: 100%;
}

.hero-spotlight.is-exit {
  opacity: 0;
}

.hero-spotlight.is-done {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.hero-spotlight[hidden] {
  display: none !important;
}

.hero__stack {
  position: relative;
  width: 100%;
  max-width: min(360px, calc(100% - 40px));
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.hero__ornament {
  margin: 0 0 20px;
  width: 100%;
  gap: 12px;
}

.hero__ornament .ornament__line {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.hero__date-block {
  text-align: center;
  margin-bottom: 28px;
}

.hero__episode-chip {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
}

.hero__episode-chip[hidden] {
  display: none !important;
}

.hero__tagline {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 6.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-accent-soft);
}

.hero__subline {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--color-secondary);
}

.hero__countdown-status {
  margin: 0 0 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.hero__countdown-status[hidden] {
  display: none !important;
}

.hero__stack .hero__countdown.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 0 0 24px;
  opacity: 1;
  animation: none;
  flex-wrap: nowrap;
  justify-content: stretch;
  /* RTL page: keep timer units LTR — روز | ساعت | دقیقه | ثانیه from left */
  direction: ltr;
}

.hero__countdown.countdown--past {
  opacity: 0.45;
  pointer-events: none;
}

.hero__countdown .countdown__item {
  min-width: 0;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  direction: rtl;
}

.hero__countdown .countdown__number {
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

.hero__countdown .countdown__label {
  margin-top: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-muted);
}

/* Capacity chip — gothic card accent, not a pill CTA */
.hero-capacity {
  align-self: stretch;
  max-width: 100%;
  margin: 0 0 16px;
  padding: 11px 14px 11px 12px;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-primary);
  white-space: nowrap;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  border-inline-start: 3px solid var(--color-accent);
  background: linear-gradient(135deg, rgba(212, 63, 90, 0.1), rgba(20, 20, 22, 0.85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
  text-align: center;
}

.hero-capacity::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-inline-end: 8px;
  vertical-align: middle;
  border-radius: 2px;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(212, 63, 90, 0.65);
  animation: heroCapPulse 2s ease-in-out infinite;
}

.hero-capacity.is-low {
  border-color: rgba(212, 63, 90, 0.55);
  border-inline-start-width: 4px;
  background: linear-gradient(135deg, rgba(212, 63, 90, 0.28), rgba(30, 14, 20, 0.92));
  color: var(--color-primary);
}

.hero-capacity.is-low::before {
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: none;
}

.hero-capacity.sold-out {
  border-color: var(--color-border);
  border-inline-start-color: var(--color-muted);
  background: rgba(255, 255, 255, 0.03);
  color: var(--color-muted);
  text-decoration: line-through;
}

.hero-capacity.sold-out::before {
  display: none;
}

@keyframes heroCapPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

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

.hero__cta {
  width: 100%;
  max-width: none;
  margin-inline: 0;
  gap: 14px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.hero__cta > .btn--filled {
  min-height: 56px;
  font-size: 1rem;
}

.hero__cta-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.hero__cta-secondary .btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

@media (max-width: 768px) {
  .hero__title {
    font-size: clamp(2.6rem, 12vw, 4rem);
    margin-bottom: 16px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .hero__countdown .countdown__item:hover {
    border-color: var(--color-secondary);
    transform: translateY(-2px);
  }
}

