/* ============================================================
   CINEMATIC OPENING — SCENE 1 → 4
   Approximate total: 7.5 seconds. Skippable.
   ============================================================ */

.intro {
  position: fixed; inset: 0;
  z-index: 200;
  background: radial-gradient(ellipse at center, #0F2747 0%, #081A32 55%, #050B1C 100%);
  color: var(--arch-white);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity 900ms var(--ease-in-out);
}
.intro.is-hidden {
  opacity: 0;
  pointer-events: none;
}
.intro.is-hidden .intro__stage { visibility: hidden; }

/* Scene stack */
.intro__stage { position: relative; width: 100%; height: 100%; }
.intro__scene {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  pointer-events: none;
}
.intro__scene.is-active { opacity: 1; }

/* ---- SCENE 1 : LOGO ARRIVAL ---- */
.scene-logo {
  transition: opacity 700ms var(--ease-out);
}
.scene-logo .logo-wrap {
  position: relative;
  width: min(560px, 72vw);
  transform: scale(0.94) translateY(6px);
  opacity: 0;
  filter: blur(6px);
  transition: transform 1200ms var(--ease-out), opacity 900ms var(--ease-out), filter 900ms var(--ease-out);
}
.scene-logo.is-active .logo-wrap {
  transform: none;
  opacity: 1;
  filter: none;
}
/* Light sweep across the logo */
.scene-logo .logo-wrap::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(220, 238, 255, 0.55) 45%, transparent 60%);
  mix-blend-mode: screen;
  transform: translateX(-120%);
  pointer-events: none;
}
.scene-logo.is-active .logo-wrap::after {
  animation: sweep 1500ms var(--ease-out) 350ms 1 both;
}
@keyframes sweep {
  from { transform: translateX(-120%); }
  to   { transform: translateX(120%); }
}
/* Extending silver hairlines under the logo */
.scene-logo .side-line {
  position: absolute; top: 50%; height: 1px; background: rgba(220,238,255,0.55);
  width: 0;
  transition: width 900ms var(--ease-out) 800ms;
}
.scene-logo .side-line--left  { right: calc(50% + 300px); }
.scene-logo .side-line--right { left:  calc(50% + 300px); }
.scene-logo.is-active .side-line { width: min(28vw, 240px); }

/* ---- SCENE 2 : BLUEPRINT ACTIVATION ---- */
.scene-blueprint svg { width: min(720px, 85vw); height: auto; overflow: visible; }
.scene-blueprint .bp-line,
.scene-blueprint .bp-fill,
.scene-blueprint .bp-dot {
  opacity: 0;
}
.scene-blueprint.is-active .bp-line {
  animation: draw 1000ms var(--ease-out) forwards;
}
.scene-blueprint.is-active .bp-line:nth-child(2) { animation-delay: 120ms; }
.scene-blueprint.is-active .bp-line:nth-child(3) { animation-delay: 240ms; }
.scene-blueprint.is-active .bp-line:nth-child(4) { animation-delay: 360ms; }
.scene-blueprint.is-active .bp-line:nth-child(5) { animation-delay: 480ms; }
.scene-blueprint.is-active .bp-line:nth-child(6) { animation-delay: 600ms; }
.scene-blueprint.is-active .bp-line:nth-child(7) { animation-delay: 720ms; }
.scene-blueprint.is-active .bp-fill { animation: fadeIn 500ms var(--ease-out) 900ms forwards; }
.scene-blueprint.is-active .bp-dot  { animation: dotPop 500ms var(--ease-out) 700ms forwards; }

@keyframes draw { from { stroke-dashoffset: var(--dash, 400); opacity: 0; } 30% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 0.28; } }
@keyframes dotPop { from { opacity: 0; transform: scale(0.4); } to { opacity: 1; transform: scale(1); } }

.scene-blueprint .bp-caption {
  position: absolute; bottom: 12%; left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--ice-blue);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms 900ms, transform 700ms 900ms;
}
.scene-blueprint.is-active .bp-caption { opacity: 0.85; transform: none; }

/* ---- SCENE 3 : ASSEMBLY (real cinematic construction video) ---- */
.scene-assembly { padding: 0; }
.scene-assembly .assembly-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 700ms var(--ease-out);
}
.scene-assembly.is-active .assembly-video { opacity: 1; }
.scene-assembly::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(5,11,28,0.55) 100%),
    linear-gradient(180deg, rgba(5,11,28,0.35) 0%, transparent 30%, transparent 65%, rgba(5,11,28,0.75) 100%);
  pointer-events: none;
}
.assembly-caption {
  position: absolute;
  bottom: 10%;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--font-mono);
  color: var(--ice-blue);
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 700ms 400ms var(--ease-out), transform 700ms 400ms var(--ease-out);
  z-index: 3;
}
.scene-assembly.is-active .assembly-caption { opacity: 0.9; transform: none; }

/* ---- SCENE 4 : COMPLETED REVEAL (background + tagline + logo close-out) ---- */
.scene-reveal {
  transition: opacity 900ms var(--ease-out);
}
.scene-reveal .reveal-bg {
  position: absolute; inset: 0;
  /* Close on the completed villa from Scene 3 for narrative continuity */
  background-image: url("../public/assets/intro/villa-completed.jpg");
  background-size: cover; background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1400ms var(--ease-out), transform 4000ms var(--ease-out);
}
.scene-reveal.is-active .reveal-bg {
  opacity: 0.5;
  transform: scale(1);
}

/* Logo card that fades in after the tagline for the final brand close-out */
.scene-reveal .reveal-logo {
  display: block;
  width: min(360px, 60vw);
  margin: 2rem auto 0;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 900ms 1200ms var(--ease-out), transform 900ms 1200ms var(--ease-out);
}
.scene-reveal.is-active .reveal-logo { opacity: 1; transform: none; }
.scene-reveal .reveal-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,39,71,0.4) 0%, rgba(8,26,50,0.75) 65%, rgba(5,11,28,0.95) 100%);
}
.scene-reveal .reveal-content {
  position: relative; z-index: 2;
  text-align: center;
  padding-inline: var(--gutter);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 900ms 300ms var(--ease-out), transform 900ms 300ms var(--ease-out);
}
.scene-reveal.is-active .reveal-content { opacity: 1; transform: none; }
.reveal-content .eyebrow { display: block; margin-bottom: 1.5rem; }
.reveal-content .tagline {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 1.2rem + 2.5vw, 3.2rem);
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--arch-white);
  margin: 0 0 2rem;
}
.reveal-content .tagline em {
  font-style: italic;
  color: var(--ice-blue);
}

/* ---- Controls (skip + sound) ---- */
.intro__controls {
  position: absolute; top: 1.5rem; right: 1.5rem;
  z-index: 3;
  display: flex; gap: 0.6rem;
}
.intro__btn {
  height: 36px;
  padding: 0 0.95rem;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid rgba(220, 238, 255, 0.28);
  background: rgba(15, 39, 71, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--arch-white);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.intro__btn:hover { background: rgba(220, 238, 255, 0.15); border-color: var(--ice-blue); }
.intro__btn svg { width: 14px; height: 14px; }

/* Reduced motion: skip straight to reveal */
@media (prefers-reduced-motion: reduce) {
  .intro__scene { transition: none; }
  .scene-logo .logo-wrap { transform: none; filter: none; opacity: 1; }
  .intro { transition: none; }
}

/* =========================================================================
   SPLASH GATE — unlocks browser audio policy so the intro plays with sound
   ========================================================================= */
.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 1000; /* above .intro */
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0A0F1D;
  overflow: hidden;
  opacity: 1;
  transition: opacity 700ms ease;
}
.intro-gate.is-hiding { opacity: 0; pointer-events: none; }

.intro-gate__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 50% 20%, rgba(220, 238, 255, 0.08), transparent 60%),
    radial-gradient(900px 500px at 80% 90%, rgba(180, 210, 255, 0.05), transparent 60%),
    linear-gradient(180deg, #0A0F1D 0%, #060A16 100%);
}

.intro-gate__inner {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 640px;
  animation: gate-in 900ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes gate-in {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.intro-gate__logo {
  display: block;
  margin: 0 auto 2rem;
  opacity: 0.95;
  height: auto;
  width: min(220px, 45vw);
}

.intro-gate__eyebrow {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(220, 238, 255, 0.55);
  margin: 0 0 1.25rem;
}

.intro-gate__title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 300;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  line-height: 1.2;
  color: #F4F8FF;
  margin: 0 0 1rem;
  letter-spacing: -0.01em;
}

.intro-gate__body {
  color: rgba(220, 238, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 44ch;
  margin: 0 auto 2rem;
}

.intro-gate__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.intro-gate__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 200ms ease, background 200ms ease, border-color 200ms ease, color 200ms ease;
  font-family: inherit;
}
.intro-gate__btn svg { width: 16px; height: 16px; }
.intro-gate__btn:hover { transform: translateY(-1px); }
.intro-gate__btn:focus-visible {
  outline: 2px solid rgba(220, 238, 255, 0.6);
  outline-offset: 3px;
}

.intro-gate__btn--primary {
  background: #F4F8FF;
  color: #0A0F1D;
  border: 1px solid #F4F8FF;
}
.intro-gate__btn--primary:hover {
  background: #FFFFFF;
  border-color: #FFFFFF;
}

.intro-gate__btn--ghost {
  background: transparent;
  color: rgba(220, 238, 255, 0.85);
  border: 1px solid rgba(220, 238, 255, 0.3);
}
.intro-gate__btn--ghost:hover {
  border-color: rgba(220, 238, 255, 0.7);
  color: #F4F8FF;
}

.intro-gate__hint {
  color: rgba(220, 238, 255, 0.4);
  font-size: 0.78rem;
  margin: 0;
}

@media (max-width: 480px) {
  .intro-gate__actions { flex-direction: column; align-items: stretch; }
  .intro-gate__btn { justify-content: center; }
}
