/* Library entrance. Landing, then the film, then the archive.
   Scoped so the archive stylesheet can load beside it. */
/* The landing sits in normal flow so the fixed corridor layer behind it
   stays visible and can move on scroll. The film still covers the viewport. */
#gate{position:relative;z-index:2;min-height:100vh;min-height:100dvh;background:transparent;color:#f3ead6}
#gate[hidden]{display:none}
#gate-landing{position:relative;min-height:100vh;min-height:100dvh;overflow:hidden;background:transparent}
#gate-film{position:fixed;inset:0;z-index:90;overflow:hidden;background:#07040a}
#gate-landing[hidden],#gate-film[hidden]{display:none}
#gate-landing .gate-photo{display:none}
#gate-film video{
  position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:cover;object-position:center center
}
.gate-shade{
  position:absolute;left:0;right:0;bottom:0;height:42%;
  background:linear-gradient(180deg,rgba(7,4,10,0) 0%,rgba(7,4,10,.55) 55%,rgba(7,4,10,.82) 100%);
  pointer-events:none
}
.gate-copy{
  position:absolute;left:0;right:0;bottom:0;z-index:2;display:flex;flex-direction:column;align-items:center;
  text-align:center;padding:24px 18px calc(28px + env(safe-area-inset-bottom));gap:12px
}
.gate-crest{width:72px;height:auto;max-width:22vw;filter:drop-shadow(0 8px 18px rgba(0,0,0,.65))}
#gate h1{
  margin:0;max-width:18ch;font-family:"Cinzel Decorative","Cinzel",Georgia,serif;font-weight:700;
  font-size:clamp(1.85rem,7.4vw,4.4rem);line-height:1.05;letter-spacing:.02em;
  background:linear-gradient(180deg,#fff1c2 0%,#f0cd78 40%,#b8873a 70%,#f6dc94 100%);
  -webkit-background-clip:text;background-clip:text;color:transparent
}
.gate-byline{
  margin:0;font-family:"Cinzel",Georgia,serif;letter-spacing:.18em;
  font-size:clamp(.95rem,2.6vw,1.15rem);color:#f6dc94
}
.gate-btn{
  appearance:none;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  margin-top:8px;min-height:52px;min-width:min(92vw,220px);padding:0 32px;border:0;border-radius:999px;
  cursor:pointer;font-family:"Cinzel",Georgia,serif;font-weight:700;font-size:1.05rem;letter-spacing:.28em;
  color:#1a1206;background:linear-gradient(180deg,#fff1c2,#e6c46e 45%,#b8873a);
  box-shadow:0 10px 30px rgba(0,0,0,.45);text-decoration:none
}
.gate-btn:focus-visible{outline:2px solid #fff1c2;outline-offset:3px}
.gate-courses{color:#f6dc94;font-family:"Cinzel",Georgia,serif;letter-spacing:.16em;font-size:.85rem;text-decoration:underline;text-underline-offset:4px;min-height:44px;display:inline-flex;align-items:center}
#library-skip,#library-sound{
  min-width:0;
  width:auto;
  max-width:calc(50vw - 24px);
  padding:0 16px;
  font-size:.95rem;
  letter-spacing:.1em
}
#library-skip{position:absolute;right:max(16px,3vw);bottom:calc(max(16px,4vh) + env(safe-area-inset-bottom));z-index:3}
#library-sound{position:absolute;left:max(16px,3vw);bottom:calc(max(16px,4vh) + env(safe-area-inset-bottom));z-index:4}
#library-hub:target{display:block}
body:has(#library-hub:target) #gate{display:none}
.intro-veil{position:absolute;inset:0;pointer-events:none;opacity:0}
#gate-film.leaving video{animation:introZoomFade 1.85s ease forwards}
#gate-film.leaving .intro-veil{animation:goldVeil 1.85s ease forwards}
@keyframes introZoomFade{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.08)}}
@keyframes goldVeil{
  0%{opacity:0;background:radial-gradient(ellipse at center,rgba(230,196,110,0),rgba(7,4,10,0))}
  40%{opacity:1;background:radial-gradient(ellipse at center,rgba(230,196,110,.22),rgba(20,12,4,.55))}
  100%{opacity:0;background:radial-gradient(ellipse at center,transparent,rgba(7,4,10,0))}
}
#library-hub.reveal-in{animation:heroFromGold 1.85s ease both}
@keyframes heroFromGold{from{filter:brightness(.35) saturate(1.15)}to{filter:none}}
body.gate-lock{overflow:auto;height:auto}
body.gate-film-open{overflow:hidden;height:100%}
@media (prefers-reduced-motion:reduce){
  #gate-film.leaving video,#gate-film.leaving .intro-veil,#library-hub.reveal-in{animation:none}
}
/* After ENTER, gate.js focuses the archive h1 (tabindex=-1) so assistive tech
   hears the new page. Hide the browser's default focus ring on that heading
   only. Keep accessible :focus-visible rings on .gate-btn and other controls. */
#library-hub h1:focus,
#library-hub h1:focus-visible{
  outline:none;
  box-shadow:none;
}
