
/* ---------- intro: invitation + 3D piece ---------- */
.intro { display: none; }
.js .intro:not([hidden]) {
  position: fixed; inset: 0; z-index: 400;
  background: #08141b; color: #fff;
  display: grid; place-items: center;
  transition: opacity 0.7s cubic-bezier(0.22, 0.68, 0.28, 1);
  overscroll-behavior: contain;
}
.intro[hidden] { display: none !important; }
.intro.is-leaving { opacity: 0; pointer-events: none; }
.intro.is-leaving .intro__stage { transform: scale(1.03); }
.intro-open, .intro-open body { overflow: hidden !important; }

/* The page keeps laying out behind the curtain, so its entrance animations
   would play unseen and be over by the time the piece ends. Hold them at
   frame zero and release when the intro finishes. */
html.intro-wait .hero,
html.intro-wait .hero * { animation-play-state: paused !important; }

/* the canvas layer */
.intro__stage {
  position: absolute; inset: 0;
  transition: transform 0.7s cubic-bezier(0.22, 0.68, 0.28, 1);
}
.intro__canvas { display: block; width: 100%; height: 100%; }
.intro__vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 100% at 50% 42%, transparent 38%, rgba(4, 12, 17, 0.62) 100%),
    linear-gradient(0deg, rgba(4, 12, 17, 0.55) 0%, transparent 34%);
}

/* ---------- invitation ---------- */
.intro__invite {
  position: relative; z-index: 2;
  width: 100%; max-width: 560px; padding: 40px 32px;
  text-align: center;
}
.intro__mark { width: 34px; height: 60px; margin: 0 auto 30px; color: rgba(255,255,255,.9); }
.intro__mark svg { width: 100%; height: 100%; }
.intro__eyebrow {
  font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(255,255,255,.42); margin: 0 0 18px;
}
.intro__title {
  font-family: "Newsreader", Georgia, serif; font-weight: 300;
  font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.08;
  letter-spacing: -0.028em; margin: 0 0 16px;
}
.intro__lede {
  font-size: 0.95rem; line-height: 1.65; color: rgba(255,255,255,.55);
  margin: 0 auto 34px; max-width: 40ch;
}
.intro__choices { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.intro__btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 24px; border: 1px solid transparent; border-radius: 2px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; transition: background .25s, color .25s, border-color .25s, transform .25s;
}
.intro__btn--solid { background: #fff; color: #0b1a22; }
.intro__btn--solid:hover { background: #d9e2e6; }
.intro__btn--ghost { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.04); }
.intro__btn--ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.intro__btn:active { transform: translateY(1px); }
.intro__note {
  margin: 26px 0 0; font-size: 11.5px; line-height: 1.6;
  color: rgba(255,255,255,.3);
}
.intro__note a { color: rgba(255,255,255,.55); border-bottom: 1px solid rgba(255,255,255,.2); }

/* ---------- playing ---------- */
.intro.is-playing .intro__invite { display: none; }

.intro__beats {
  position: absolute; left: 0; right: 0; bottom: clamp(96px, 15vh, 170px);
  z-index: 2; padding: 0 clamp(24px, 6vw, 72px);
  pointer-events: none;
}
.intro__beat {
  position: absolute; left: clamp(24px, 6vw, 72px); right: clamp(24px, 6vw, 72px);
  bottom: 0; opacity: 0; will-change: opacity, transform;
}
.intro__beat--right { text-align: right; }
.intro__beat--center { text-align: center; }
.intro__beat .k {
  display: block; font-size: 10px; letter-spacing: 0.24em;
  text-transform: uppercase; color: rgba(255,255,255,.42); margin-bottom: 12px;
}
.intro__beat .t {
  display: block;
  font-family: "Newsreader", Georgia, serif; font-weight: 300;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem); line-height: 1.12;
  letter-spacing: -0.024em; color: #fff; text-wrap: balance;
}
.intro__beat .t em { font-style: italic; color: rgba(255,255,255,.78); }

/* controls */
.intro__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 0 clamp(20px, 5vw, 56px) clamp(20px, 4vh, 34px);
  display: flex; align-items: center; gap: 18px;
}
.intro__rail { flex: 1; height: 2px; background: rgba(255,255,255,.14); position: relative; overflow: hidden; }
.intro__rail i {
  position: absolute; inset: 0; transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, rgba(255,255,255,.5), #fff);
}
.intro__time {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 11px; letter-spacing: 0.08em; color: rgba(255,255,255,.5);
  font-variant-numeric: tabular-nums; min-width: 34px; text-align: right;
}
.intro__ctrl {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22); color: #fff;
  background: rgba(255,255,255,.05); cursor: pointer;
  transition: background .25s, border-color .25s;
  flex: none;
}
.intro__ctrl:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.45); }
.intro__ctrl svg { width: 15px; height: 15px; }
.intro__skip {
  padding: 10px 18px; border-radius: 40px; border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.05); color: #fff; cursor: pointer;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  transition: background .25s, border-color .25s;
  flex: none;
}
.intro__skip:hover { background: #fff; color: #0b1a22; border-color: #fff; }

.intro__sound {
  position: absolute; top: clamp(18px, 3vw, 28px); inset-inline-end: clamp(18px, 4vw, 34px);
  z-index: 3;
}

/* ---------- Arabic ---------- */
html[dir="rtl"] .intro__title,
html[dir="rtl"] .intro__beat .t { font-family: "Noto Naskh Arabic", Georgia, serif; letter-spacing: normal; line-height: 1.4; }
html[dir="rtl"] .intro__eyebrow,
html[dir="rtl"] .intro__beat .k,
html[dir="rtl"] .intro__btn,
html[dir="rtl"] .intro__skip { letter-spacing: normal; text-transform: none; }
html[dir="rtl"] .intro__lede { line-height: 1.8; }
html[dir="rtl"] .intro__rail i { transform-origin: 100% 50%; }
html[dir="rtl"] .intro__time { text-align: left; }

@media (max-width: 640px) {
  .intro__beats { bottom: 128px; }
  .intro__bar { gap: 12px; }
  .intro__skip { padding: 9px 14px; font-size: 10px; }
  .intro__choices .intro__btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .intro, .intro__stage { transition: none; }
}
