/* Scrub theme shell: header, overlay menu, progress hairline, footer.
   Layers over the base ulric sheet; brand tokens come from :root there. */

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body.scrub-body { background: var(--paper); }
/* the base sheet pads the body for its own 72px nav and pins its footer via a
   flex chain this layout breaks with the Barba wrapper; both are reset here */
body.scrub-body { padding-top: 0; }
body.scrub-body > [data-barba="wrapper"] { flex: 1 0 auto; display: flex; flex-direction: column; }
body.scrub-body [data-barba="container"] { flex: 1 0 auto; display: flex; flex-direction: column; }
body.scrub-body [data-barba="container"] > .sfoot { margin-top: auto; }

/* ---------- fixed header ---------- */
.shd { position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 3.4vw, 40px);
  color: var(--ink); pointer-events: none;
  transition: color .45s ease; }
.shd > * { pointer-events: auto; }
.shd-brand { display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--display); font-size: 1.28rem; text-decoration: none; color: inherit; }
.shd-mark { width: 30px; height: 18px; color: var(--accent); }
.shd-side { display: flex; align-items: center; gap: 20px; }
.shd-book { display: inline-flex; align-items: center; min-height: 44px;
  font: 600 .8rem var(--body); letter-spacing: .04em; text-decoration: none;
  background: #fff; color: var(--ink); border: 0; border-radius: 999px; padding: 10px 21px;
  box-shadow: 0 4px 18px rgba(25, 25, 23, .22);
  transition: background .2s, color .2s, transform .2s; }
@media (max-width: 520px) { .shd-book { display: none; } .shd { padding: 14px 18px; } }
.shd-book:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.shd-menu { display: inline-flex; align-items: center; gap: 10px; background: none; border: 0;
  color: inherit; font: 600 .8rem var(--body); letter-spacing: .08em; text-transform: uppercase;
  cursor: pointer; padding: 10px 2px; min-height: 44px; }
.shd-menu i { display: block; width: 26px; }
.shd-menu b { display: block; height: 2px; background: currentColor; border-radius: 2px;
  margin: 5px 0; transition: transform .3s cubic-bezier(.6,0,.2,1), width .3s; }
.shd-menu b:last-child { width: 70%; margin-left: auto; }
body.smenu-open .shd-menu b:first-child { transform: translateY(3.5px) rotate(45deg); }
body.smenu-open .shd-menu b:last-child { width: 100%; transform: translateY(-3.5px) rotate(-45deg); }
.shd.on-dark { color: var(--paper); }
body.smenu-open .shd { color: var(--paper); }

/* ---------- fullscreen menu ---------- */
.smenu { position: fixed; inset: 0; z-index: 55; background: var(--ink); color: var(--paper);
  display: flex; flex-direction: column; justify-content: center;
  padding: 96px clamp(22px, 6vw, 84px) 42px; }
/* The closed state belongs to CSS and is gated on html.js, so a reader
   without JavaScript gets the navigation as an ordinary block at the foot of
   the page instead of five unreachable pages behind an inert button. */
html.js .smenu { clip-path: inset(0 0 100% 0); visibility: hidden; }
html.js body.smenu-open .smenu { visibility: visible; }
html:not(.js) .smenu { position: static; padding: 40px clamp(22px, 6vw, 84px); }
html:not(.js) .shd-menu { display: none; }
.smenu nav { display: flex; flex-direction: column; max-width: 860px; }
.smenu-link { display: flex; align-items: baseline; gap: 18px; text-decoration: none; color: var(--paper);
  padding: clamp(4px, .9vh, 10px) 0; border-bottom: 1px solid var(--line-dark); }
.smenu-word { font-family: var(--display); font-weight: 400; letter-spacing: -.02em;
  font-size: clamp(1.9rem, 5.2vh, 3.4rem); line-height: 1.12;
  transition: color .2s, transform .3s cubic-bezier(.2,.8,.3,1); }
.smenu-note { font-family: 'Caveat', cursive; font-size: clamp(1rem, 2.2vh, 1.3rem);
  color: var(--stone-dark); opacity: .62; transform: translateX(-8px);
  transition: opacity .25s, transform .25s; }
/* revealed on hover only, these nine lines never existed for a touch reader */
@media (hover: hover) { .smenu-note { opacity: 0; } }
.smenu-link:hover .smenu-word, .smenu-link:focus-visible .smenu-word { color: var(--accent); transform: translateX(10px); }
.smenu-link:hover .smenu-note, .smenu-link:focus-visible .smenu-note { opacity: 1; transform: none; }
.smenu-foot { margin-top: clamp(18px, 4vh, 40px); font: 500 .78rem var(--body);
  letter-spacing: .12em; text-transform: uppercase; color: var(--stone-dark); }

/* ---------- scroll progress hairline ---------- */
.sprog { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 70;
  background: var(--accent); }

/* ---------- subpages: breathing room under the fixed header ---------- */
main#main > .page-head { padding-top: 124px; }

/* ---------- footer ---------- */
.sfoot { position: relative; z-index: 3; background: var(--ink); color: var(--paper); }
.sfoot-in { max-width: var(--max); margin: 0 auto; padding: 44px var(--pad);
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px 34px; }
.sfoot-brand { font-family: var(--display); font-size: 1.5rem; color: var(--paper); text-decoration: none; }
.sfoot-links { display: flex; flex-wrap: wrap; gap: 5px 22px; margin-right: auto; }
.sfoot-links a { color: var(--stone-dark); text-decoration: none; font: 500 .84rem var(--body); }
.sfoot-links a:hover { color: var(--paper); }
.sfoot-note { font: 400 .76rem var(--body); color: var(--stone-dark); }
@media (max-width: 640px) {
  .sfoot-in { flex-direction: column; align-items: flex-start; }
  .sfoot-links { margin-right: 0; }
}

/* ---------- the gate: hold the screen until the world is real ---------- */
html.gated, html.gated body { overflow: hidden; }
.gate { position: fixed; inset: 0; z-index: 200; color: #fff;
  background: #2b6cb8;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  transition: opacity .7s ease, visibility .7s; }
/* the real sky, already moving: the towering-cumulus plate eases larger the
   whole time the rail counts, so the load IS the first shot of the film */
.gate::before { content: ""; position: absolute; inset: -7%;
  background: url("sky-main.jpg") center / cover no-repeat;
  animation: gatezoom 9s cubic-bezier(.2, .6, .3, 1) forwards; }
/* a quiet ink falloff at the foot so the readout always reads */
.gate::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(12, 18, 30, .55) 0%, rgba(12, 18, 30, .12) 38%, rgba(12, 18, 30, 0) 62%); }
@keyframes gatezoom { from { transform: scale(1); } to { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .gate::before { animation: none; } }
.gate-open { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 0 28px; text-align: center; }
.gate-mark { width: 54px; height: 32px; color: var(--accent); filter: drop-shadow(0 2px 10px rgba(20,40,70,.3)); }
.gate-word { font-family: var(--display); font-size: clamp(2.4rem, 7vw, 4rem);
  letter-spacing: -.02em; line-height: 1; margin: 0; }
/* a rail that fills, not a spinner that lies: it tracks real fetches */
.gate-rail { position: relative; z-index: 1; width: min(300px, 62vw); height: 2px; background: rgba(255,255,255,.3);
  overflow: hidden; border-radius: 2px; }
.gate-rail i { display: block; width: 100%; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; }
.gate-note { display: flex; align-items: baseline; gap: 10px; margin: 0;
  font: 500 .78rem var(--body); letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.88); font-variant-numeric: tabular-nums; }
.gate-sep { opacity: .5; }
.gate-what { text-transform: none; letter-spacing: .02em; font-family: 'Caveat', cursive;
  font-size: 1.15rem; color: #ffe4c4; }
@media (prefers-reduced-motion: reduce) { .gate { display: none; } }
