/* ==========================================================================
   NEXORA DIGITAL — intro.css
   Opening sequence: a line of light traces the emblem's ring, the official
   logo surfaces out of the dark, the tagline rises, then an iris opens from
   the emblem onto the site. Shown once per visit; skippable; never shown
   with reduced motion or without JavaScript.
   The logo artwork itself is never altered — every effect sits around it.
   ========================================================================== */

.intro { display: none; }
html.is-intro { overflow: hidden; }
html.is-intro body { overflow: hidden; }

.is-intro .intro {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  background: #070708;
  color: #F4F0E8;
  --iris: 0px; --cx: 50%; --cy: 46%;
  -webkit-mask: radial-gradient(circle at var(--cx) var(--cy), transparent var(--iris), #000 calc(var(--iris) + 1px));
          mask: radial-gradient(circle at var(--cx) var(--cy), transparent var(--iris), #000 calc(var(--iris) + 1px));
  cursor: pointer;
}

/* receding gallery floor — the same room the hero opens into */
.intro__floor {
  position: absolute; left: -20%; right: -20%; bottom: -10%; height: 62%;
  perspective: 600px; pointer-events: none;
  opacity: 0; animation: introFade 1.4s cubic-bezier(.22, 1, .36, 1) .15s forwards;
}
.intro__floor::before {
  content: ""; position: absolute; inset: 0;
  transform: rotateX(72deg); transform-origin: 50% 0;
  background-image:
    linear-gradient(rgba(198, 161, 91, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(198, 161, 91, .12) 1px, transparent 1px);
  background-size: 80px 80px;
  -webkit-mask: linear-gradient(to bottom, #000, transparent 85%);
          mask: linear-gradient(to bottom, #000, transparent 85%);
  animation: introFloor 6s linear infinite;
}
.intro__glow {
  position: absolute; left: 50%; top: var(--cy); width: 120vmax; height: 120vmax;
  transform: translate(-50%, -50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(198, 161, 91, .16), rgba(198, 161, 91, .04) 45%, transparent 70%);
  opacity: 0; animation: introFade 1.6s ease .5s forwards;
}

.intro__center {
  position: relative; z-index: 2;
  display: grid; justify-items: center; gap: clamp(1.4rem, 3vh, 2.2rem);
  transition: transform 1s cubic-bezier(.65, 0, .35, 1), opacity .7s ease, filter .8s ease;
}

.intro__emblem {
  position: relative;
  width: min(300px, 62vw); aspect-ratio: 1;
}
.intro__emblem img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 50%;
  mix-blend-mode: screen; /* the logo's black backdrop melts into the dark; artwork untouched */
  clip-path: circle(0% at 50% 50%);
  opacity: 0; filter: blur(14px) brightness(1.4);
  transform: scale(1.08);
}
.intro.is-playing .intro__emblem img {
  animation: introLogo 1.5s cubic-bezier(.22, 1, .36, 1) .75s forwards;
}

/* light tracing the emblem's own ring (drawn on top, then dissolves) */
.intro__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.intro__ring circle {
  fill: none; stroke: #E9CD93; stroke-width: 1.1; stroke-linecap: round;
  stroke-dasharray: 531; stroke-dashoffset: 531;
  filter: drop-shadow(0 0 4px rgba(233, 205, 147, .9)) drop-shadow(0 0 12px rgba(198, 161, 91, .6));
}
.intro.is-playing .intro__ring circle { animation: introRing 1.35s cubic-bezier(.65, 0, .35, 1) .25s forwards, introRingOut .9s ease 1.7s forwards; }

/* sweep of light across the emblem, masked to the circle */
.intro__sweep {
  position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none;
  mix-blend-mode: screen;
}
.intro__sweep::before {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 196, .38), transparent);
  transform: translateX(0) skewX(-14deg); opacity: 0;
}
.intro.is-playing .intro__sweep::before { animation: introSweep 1.3s cubic-bezier(.65, 0, .35, 1) 1.55s forwards; }

.intro__tag {
  margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .2em .55em;
  max-width: 92vw; padding-inline: 1rem;
  font-family: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  font-weight: 300; font-size: clamp(.72rem, .6rem + .45vw, .95rem);
  letter-spacing: .38em; text-transform: uppercase; color: rgba(244, 240, 232, .82);
  text-align: center;
}
.intro__tag span { display: inline-block; overflow: hidden; }
.intro__tag span i { display: inline-block; font-style: normal; transform: translateY(110%); }
.intro.is-playing .intro__tag span i { animation: introWord .9s cubic-bezier(.22, 1, .36, 1) forwards; animation-delay: calc(1.35s + var(--w) * 90ms); }

.intro__meter { width: min(220px, 50vw); height: 1px; background: rgba(244, 240, 232, .12); overflow: hidden; opacity: 0; animation: introFade .6s ease 1.1s forwards; }
.intro__meter i { display: block; height: 100%; background: linear-gradient(90deg, #8C7041, #E3C68E); transform: scaleX(var(--p, 0)); transform-origin: left; }

.intro__count {
  position: absolute; left: clamp(1.2rem, 3vw, 2.4rem); bottom: clamp(1.2rem, 3vw, 2rem); z-index: 2;
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.4rem; color: #C6A15B;
  font-variant-numeric: tabular-nums; opacity: 0; animation: introFade .6s ease 1s forwards;
}
.intro__skip {
  position: absolute; right: clamp(1.2rem, 3vw, 2.4rem); bottom: clamp(1.2rem, 3vw, 2rem); z-index: 3;
  padding: .55rem 1rem; border: 1px solid rgba(244, 240, 232, .18); border-radius: 999px;
  background: transparent; color: rgba(244, 240, 232, .7);
  font: 500 .72rem/1 "Inter", system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; opacity: 0; animation: introFade .6s ease 1s forwards;
  transition: border-color .3s, color .3s;
}
.intro__skip:hover, .intro__skip:focus-visible { border-color: #C6A15B; color: #E3C68E; }

/* the bright edge of the opening iris */
.intro__iris {
  position: fixed; left: var(--cx); top: var(--cy); z-index: 2001; pointer-events: none;
  width: calc(var(--iris) * 2); height: calc(var(--iris) * 2);
  border-radius: 50%; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(233, 205, 147, .75), 0 0 40px 6px rgba(198, 161, 91, .35), inset 0 0 60px rgba(198, 161, 91, .18);
  opacity: 0;
}
.intro.is-opening .intro__iris { opacity: 1; }

/* exit */
.intro.is-leaving .intro__center { transform: scale(1.14); opacity: 0; filter: blur(6px); }
.intro.is-leaving .intro__count, .intro.is-leaving .intro__skip, .intro.is-leaving .intro__floor { opacity: 0 !important; transition: opacity .5s; animation: none; }

@keyframes introFade { to { opacity: 1; } }
@keyframes introFloor { from { background-position: 0 0, 0 0; } to { background-position: 0 80px, 0 0; } }
@keyframes introRing { to { stroke-dashoffset: 0; } }
@keyframes introRingOut { to { opacity: 0; } }
@keyframes introLogo {
  0% { clip-path: circle(0% at 50% 50%); opacity: 0; filter: blur(14px) brightness(1.4); transform: scale(1.08); }
  40% { opacity: 1; }
  100% { clip-path: circle(75% at 50% 50%); opacity: 1; filter: blur(0) brightness(1); transform: scale(1); }
}
@keyframes introSweep { 0% { opacity: 1; transform: translateX(0) skewX(-14deg); } 100% { opacity: 1; transform: translateX(420%) skewX(-14deg); } }
@keyframes introWord { to { transform: none; } }

@media (prefers-reduced-motion: reduce) { .intro { display: none !important; } }
