/* ═══════════════════════════════════════════════════════════
   Nasij Hero — opening.css
   Opening overlay styles. Removed from DOM after completion.
   ═══════════════════════════════════════════════════════════ */

/* ── Scroll lock ───────────────────────────────────────── */
body.scroll-locked {
  overflow: hidden !important;
  height: 100dvh;
  touch-action: none;
}

/* ── Overlay ───────────────────────────────────────────── */
.opening-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-overlay--exiting {
  opacity: 0;
  pointer-events: none;
}

/* ── Background ────────────────────────────────────────── */
.opening-bg {
  position: absolute;
  inset: 0;
  background: #14143a;
  transition: background-color 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-bg--cream {
  background: #f7f1e3;
}

/* ── Stage ─────────────────────────────────────────────── */
.opening-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

/* ── Ember point ───────────────────────────────────────── */
.opening-point {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e8744d;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: absolute;
  z-index: 5;
  box-shadow: 0 0 0 rgba(232, 116, 77, 0);
}

.opening-point--visible {
  opacity: 1;
  transform: scale(1);
  box-shadow: 0 0 60px rgba(232, 116, 77, 0.5), 0 0 120px rgba(232, 116, 77, 0.2);
  animation: opening-point-pulse 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s 1;
}

.opening-point--expanding {
  transform: scale(3);
  opacity: 0.8;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease;
}

.opening-point--fading {
  opacity: 0;
  transform: scale(6);
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

@keyframes opening-point-pulse {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.8); }
  100% { transform: scale(1); }
}

/* ── Logo reveal ───────────────────────────────────────── */
.opening-logo-reveal {
  position: relative;
  width: 200px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  clip-path: circle(0% at 50% 50%);
  transition: none;
}

.opening-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: filter 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-logo-reveal--active {
  opacity: 1;
}

.opening-logo-reveal--expanding {
  clip-path: circle(75% at 50% 50%);
  transition: clip-path 1.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-logo-reveal--breathing {
  animation: opening-logo-breathe 3s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

.opening-logo-reveal--on-cream .opening-logo-img {
  filter: brightness(1) invert(0);
}

@keyframes opening-logo-breathe {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0px rgba(232, 116, 77, 0));
  }
  50% {
    transform: scale(1.02);
    filter: drop-shadow(0 0 30px rgba(232, 116, 77, 0.15));
  }
}

/* ── Brand text ────────────────────────────────────────── */
.opening-brand-text {
  text-align: center;
  margin-top: 28px;
  position: relative;
  z-index: 3;
}

.opening-brand-name {
  font-family: 'Rakkas', serif;
  font-size: clamp(42px, 8vw, 64px);
  font-weight: 400;
  color: #14143a;
  margin: 0;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(20px);
  filter: blur(8px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-brand-name--visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.opening-brand-tagline {
  font-family: 'Tajawal', sans-serif;
  font-size: clamp(14px, 2.2vw, 18px);
  font-weight: 400;
  color: rgba(20, 20, 58, 0.55);
  margin: 14px 0 0;
  letter-spacing: 2px;
  opacity: 0;
  transform: translateY(12px);
  filter: blur(4px);
  transition:
    opacity 1s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 1s cubic-bezier(0.16, 1, 0.3, 1),
    letter-spacing 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.opening-brand-tagline--visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
  letter-spacing: 0.3px;
}

/* ── Skip button ───────────────────────────────────────── */
.opening-skip {
  position: absolute;
  bottom: 32px;
  left: 32px;
  background: none;
  border: 1px solid rgba(247, 241, 227, 0.15);
  color: rgba(247, 241, 227, 0.4);
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 22px;
  border-radius: 9999px;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition:
    opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  animation: opening-skip-fade 0.5s 2s forwards;
}

.opening-skip:hover {
  background: rgba(247, 241, 227, 0.08);
  color: rgba(247, 241, 227, 0.75);
  border-color: rgba(247, 241, 227, 0.3);
}

.opening-skip:focus-visible {
  outline: 2px solid #e8744d;
  outline-offset: 3px;
  opacity: 1;
}

@keyframes opening-skip-fade {
  to { opacity: 1; }
}

/* Skip adapts on cream bg */
.opening-bg--cream ~ .opening-stage ~ .opening-skip,
.opening-bg--cream ~ .opening-skip {
  border-color: rgba(20, 20, 58, 0.15);
  color: rgba(20, 20, 58, 0.4);
}

.opening-bg--cream ~ .opening-stage ~ .opening-skip:hover,
.opening-bg--cream ~ .opening-skip:hover {
  background: rgba(20, 20, 58, 0.05);
  color: rgba(20, 20, 58, 0.65);
  border-color: rgba(20, 20, 58, 0.25);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .opening-logo-reveal {
    width: 150px;
    height: 110px;
  }

  .opening-skip {
    bottom: 20px;
    left: 20px;
    font-size: 12px;
    padding: 6px 16px;
  }
}

/* ── High contrast ─────────────────────────────────────── */
.hc .opening-bg {
  background: #14143a;
}

.hc .opening-bg--cream {
  background: #ffffff;
}

.hc .opening-point {
  background: #ffffff;
}

.hc .opening-skip {
  border-color: rgba(255, 255, 255, 0.4);
  color: rgba(255, 255, 255, 0.7);
}

/* ── Reduced motion: bypass entirely ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  .opening-overlay {
    display: none !important;
  }
}

.reduce-motion .opening-overlay {
  display: none !important;
}

/* ── Font scaling ──────────────────────────────────────── */
.font-lg .opening-brand-name { font-size: clamp(48px, 9vw, 72px); }
.font-lg .opening-brand-tagline { font-size: clamp(16px, 2.5vw, 20px); }
.font-lg .opening-skip { font-size: 15px; }

.font-xl .opening-brand-name { font-size: clamp(54px, 11vw, 84px); }
.font-xl .opening-brand-tagline { font-size: clamp(18px, 2.8vw, 23px); }
.font-xl .opening-skip { font-size: 17px; }
