/* intro.css — the first screen of the landing: the sign, one line and the bell of 64 cubes with physics (js/intro.js).
   Page tokens only (--bg --fg --mut); lime #C8F23A with a black edge, as the bins of the page.
   The block itself is put into the page by js/intro.js, right after the header of each layout. A class set in <head>
   (js-intro) holds its place from the first paint, so nothing below moves when the script runs. Without scripts
   the class is absent and the page starts as before. */

/* the height of the first screen: the window minus a strip of the next block. The header takes no row of its own:
   it sits over the first screen, centred on the big sign (Nikita, 5 Dec 2026: "хедер был на одном уровне с надписью mid").
   --in-top and --in-wm repeat the sign's top and size set below (.in-tx, .in-wm). */
:root{--intro-h:clamp(520px,calc(100vh - 92px),972px);--in-top:clamp(28px,6vh,72px);--in-wm:clamp(96px,11vw,168px)}
@supports (height:100svh){:root{--intro-h:clamp(520px,calc(100svh - 92px),972px)}}
@media (max-width:1279px){
  :root{--intro-h:clamp(440px,calc(100vh - 70px),824px);--in-top:clamp(20px,4vh,40px);--in-wm:clamp(72px,22vw,104px)}
  @supports (height:100svh){:root{--intro-h:clamp(440px,calc(100svh - 70px),824px)}}
}

/* the header over the first screen, on the level of the sign; until the block is in, its place is held above the next block */
.js-intro .pg{position:relative;display:flow-root}   /* flow-root: the held place above the next block must not carry the header down with it */
.js-intro .pg>.nv{position:absolute;left:0;right:0;top:var(--in-top);height:var(--in-wm);z-index:3;pointer-events:none}
.js-intro .pg>.nv>*{pointer-events:auto}
.js-intro .pg>.nv+.hero{margin-top:var(--intro-h)}
/* the next block starts closer, so its headline shows under the first screen */
.js-intro .pg>.hero{padding-top:40px!important}
.js-intro .pg.ph>.hero{padding-top:28px!important}

.intro{position:relative;overflow:hidden;height:var(--intro-h);--gx:max(24px,calc((100% - 1200px) / 2))}
.ph .intro{--gx:20px}
.intro .in-cv{position:absolute;inset:0;cursor:pointer}
.intro canvas{position:absolute;left:0;top:0;width:100%;height:100%;display:block}

/* the sign and the line; presses go through them to the cubes behind */
.intro .in-tx{position:absolute;left:var(--gx);right:var(--gx);top:clamp(28px,6vh,72px);z-index:2;pointer-events:none}
.ph .intro .in-tx{top:clamp(20px,4vh,40px)}
.intro .in-wm{display:block;margin-left:-0.04em;font-size:clamp(96px,11vw,168px)}
.intro .in-h{font-family:'Source Serif 4',Georgia,serif;font-weight:500;letter-spacing:-0.02em;text-wrap:balance;
  margin:clamp(12px,2vh,24px) 0 0;font-size:clamp(28px,2.6vw,40px);line-height:1.15;max-width:19ch}
.ph .intro .in-wm{font-size:clamp(72px,22vw,104px)}
.ph .intro .in-h{font-size:24px;line-height:30px;max-width:none}

/* "Push a cube" under the bell: a real button (it knocks out the top cube), drawn as a caption.
   After the first push it steps aside, and comes back for whoever reaches it from the keyboard. */
.intro .in-hint{position:absolute;z-index:2;transform:translateX(-50%);white-space:nowrap;
  margin:0;padding:0;border:0;background:none;font:inherit;font-size:12px;line-height:16px;color:var(--mut);cursor:pointer;
  transition:opacity 200ms cubic-bezier(0.4,0,1,1)}
.intro .in-hint::before{content:"";position:absolute;inset:-14px -16px}
.intro .in-hint:hover{color:var(--fg)}
.intro .in-hint:focus-visible{outline:2px solid var(--fg);outline-offset:4px;border-radius:4px}
.intro .in-hint.off{opacity:0;pointer-events:none}
.intro .in-hint.off:focus-visible{opacity:1}
.intro .in-hint[hidden]{display:none}

/* the small sign in the header steps aside while the big one is on screen */
.pg .nv .brand{transition:opacity 200ms cubic-bezier(0.2,0,0,1),visibility 0s}
.intro-top .pg .nv .brand{opacity:0;visibility:hidden;transition:opacity 200ms cubic-bezier(0.2,0,0,1),visibility 0s 200ms}

@media (prefers-reduced-motion:reduce){
  .intro .in-cv{cursor:default}
  .intro .in-hint{transition:none}
  .pg .nv .brand,.intro-top .pg .nv .brand{transition:none}
}

/* Narrow phones: "Join the beta" and "Try to trade" (Nikita, 5 Dec) do not fit beside the big sign, so the header
   becomes its own row above it and the sign and line move down by that row. The bell is laid out from the text's
   bottom (js/intro.js), so it follows. From 600 px the header stands beside the sign as before. */
@media (max-width:599px){
  .js-intro .pg.ph>.nv{top:8px;height:56px}
  .ph .intro .in-tx{top:calc(clamp(20px,4vh,40px) + 48px)}
}
