/* NĪMAH intro — the logo frame draws itself over the city lights, the
   macron of the Ī catches fire, then the frame opens onto the hero plate.
   Once per visit; skipped with reduced motion. Built by assets/intro.js. */
html.intro-lock{overflow:hidden;scrollbar-gutter:stable;}

.intro{
  --ease:cubic-bezier(.76,0,.24,1);
  position:fixed;inset:0;z-index:200;
  overflow:hidden;cursor:default;
  transition:opacity .4s ease;
}
.intro.is-done{opacity:0;pointer-events:none;}

/* The window: its shadow is the black curtain, its inside opens onto the page. */
.intro-window{
  position:absolute;
  box-shadow:0 0 0 200vmax var(--bg);
}
.intro.is-leaving .intro-window{
  transition:top 1.05s var(--ease),left 1.05s var(--ease),width 1.05s var(--ease),height 1.05s var(--ease),border-radius 1.05s var(--ease);
}
.intro-cover{position:absolute;inset:0;background:var(--bg);border-radius:inherit;}
.intro.is-leaving .intro-cover{opacity:0;transition:opacity .75s ease .3s;}

/* Frame edges, drawn clockwise like a pen around the wordmark. */
.intro-edge{position:absolute;background:var(--ink);--t:max(2px,calc(var(--w) * .015));}
.intro-edge:nth-of-type(1){top:0;left:0;width:100%;height:var(--t);transform-origin:0 50%;transform:scaleX(0);}
.intro-edge:nth-of-type(2){top:0;right:0;width:var(--t);height:100%;transform-origin:50% 0;transform:scaleY(0);}
.intro-edge:nth-of-type(3){bottom:0;right:0;width:100%;height:var(--t);transform-origin:100% 50%;transform:scaleX(0);}
.intro-edge:nth-of-type(4){bottom:0;left:0;width:var(--t);height:100%;transform-origin:50% 100%;transform:scaleY(0);}
.intro.is-drawn .intro-edge{transform:none;transition:transform .34s cubic-bezier(.65,0,.35,1);}
.intro.is-drawn .intro-edge:nth-of-type(2){transition-delay:.3s;}
.intro.is-drawn .intro-edge:nth-of-type(3){transition-delay:.6s;}
.intro.is-drawn .intro-edge:nth-of-type(4){transition-delay:.9s;}
.intro.is-leaving .intro-edge{opacity:0;transition:opacity .45s ease;}

/* Wordmark: same cut as the logo, letter by letter. */
.intro-word{
  position:absolute;inset:0;margin:0;
  display:flex;align-items:center;justify-content:center;
  padding-left:.09em;padding-top:.04em;
  font:300 calc(var(--w) * .215)/1 var(--display);
  letter-spacing:.09em;color:var(--ink);
  white-space:nowrap;
}
.intro-word span{
  position:relative;display:inline-block;
  opacity:0;transform:translateY(.32em);filter:blur(6px);
}
.intro.is-word .intro-word span{
  opacity:1;transform:none;filter:none;
  transition:opacity .7s ease,transform .8s cubic-bezier(.2,.8,.2,1),filter .7s ease;
  transition-delay:calc(var(--i) * 85ms);
}
/* The macron is the flame: it lights in ember last. */
.intro-i::before{
  content:"";position:absolute;
  left:calc(50% - .045em);top:-.11em;width:.34em;height:.06em;
  transform:translateX(-50%) scaleX(0);
  background:var(--accent);
  box-shadow:0 0 .12em rgba(255,140,70,.9),0 0 .4em rgba(196,92,38,.65),0 0 .9em rgba(196,92,38,.35);
}
.intro.is-lit .intro-i::before{
  transform:translateX(-50%) scaleX(1);
  transition:transform .55s cubic-bezier(.2,.8,.2,1);
  animation:intro-flicker 1.6s ease-in-out .55s infinite;
}
@keyframes intro-flicker{
  0%,100%{filter:brightness(1);}
  35%{filter:brightness(1.35);}
  60%{filter:brightness(.9);}
}
.intro.is-leaving .intro-word{opacity:0;transform:translateY(-.18em);filter:blur(8px);transition:opacity .45s ease,transform .6s ease,filter .5s ease;}

.intro-line{
  position:absolute;left:50%;top:calc(100% + clamp(22px,3.4vh,34px));margin:0;
  transform:translate(-50%,8px);opacity:0;
  font:400 10px/1 var(--body);letter-spacing:.34em;text-transform:uppercase;
  color:var(--ink-dim);white-space:nowrap;padding-left:.34em;
}
.intro.is-lit .intro-line{opacity:1;transform:translate(-50%,0);transition:opacity .7s ease .2s,transform .8s ease .2s;}
.intro.is-leaving .intro-line{opacity:0;transition:opacity .35s ease;}

/* The city below: warm points that come on one by one. */
.intro-lights{
  position:fixed;left:0;right:0;bottom:0;height:34vh;pointer-events:none;
  -webkit-mask-image:linear-gradient(to top,#000 0%,#000 55%,transparent 100%);
  mask-image:linear-gradient(to top,#000 0%,#000 55%,transparent 100%);
}
.intro-lights::before{
  content:"";position:absolute;left:-10%;right:-10%;bottom:-30%;height:90%;
  background:radial-gradient(ellipse at 50% 100%,rgba(196,92,38,.2) 0%,rgba(196,92,38,.07) 40%,transparent 70%);
  opacity:0;transition:opacity 1.6s ease;
}
.intro.is-drawn .intro-lights::before{opacity:1;}
.intro-lights span{
  position:absolute;border-radius:50%;
  background:var(--c);box-shadow:0 0 6px var(--c);
  opacity:0;
}
.intro.is-drawn .intro-lights span{
  animation:intro-light-on .9s ease var(--d) forwards,intro-twinkle var(--tw) ease-in-out calc(var(--d) + .9s) infinite;
}
@keyframes intro-light-on{from{opacity:0;}to{opacity:var(--o);}}
@keyframes intro-twinkle{0%,100%{opacity:var(--o);}50%{opacity:calc(var(--o) * .35);}}
.intro.is-leaving .intro-lights{transform:translateY(14vh);opacity:0;transition:transform 1.1s var(--ease),opacity .8s ease;}

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