/* TimberPack motion layer — preloader, particle stream, cursor and the states the springs in motion.js drive.
   Loaded after style.css; without JS (crawlers) or under reduced motion the page stays fully static and visible. */

@font-face{font-family:"Fragment Mono";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/fragment-mono-latin-ext.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Fragment Mono";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/fragment-mono-latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root {
  --mono: "Fragment Mono", Consolas, monospace;
  --stream-main: #3b8dff;
  --stream-alt: #ff8a2b;
  --stream-core: #d6ebff;
  --stream-deep: #0f2f66;
  --stream-spark: #ff7a1b;
}

/* the page sits on the dark scene so the stream can read through every dark block */
html, body { background: var(--void); }
html { scroll-behavior: auto; }
body { overflow-x: clip; } /* `hidden` makes body a scroll container and breaks position: sticky */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Stacking: the stream runs under the paper sections and through the dark ones ---------- */
.stream {
  position: fixed; top: 0; left: 0; z-index: 1;
  width: 100%; height: 100lvh;
  pointer-events: none; mix-blend-mode: screen;
}
main > section:not(.scene-dark) { position: relative; z-index: 2; }
.scene-dark > :not(.hero-media):not(.case-image):not(.contact-bg) { position: relative; z-index: 2; }
.hero-media, .case-image, .contact-bg { z-index: 0; }
footer { position: relative; }
footer > * { position: relative; z-index: 2; }
/* Nothing above the animated stream carries a backdrop blur: the compositor re-blurs the backdrop of every such
   element on every frame (one offscreen pass each, measured as a third of the hero's frame budget on an
   integrated GPU). The plates are flat and a touch more opaque instead. */
.case-map article { background: #0c1927d9; }
.motion .signal-core, .motion .signal-label, .motion .contact-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
.motion .signal-core { background: #07101ad9; }
.motion .signal-label { background: #050c14e0; }
.motion .contact-card { background: #0c1927cc; }
.ema-facts article { position: relative; }

/* ---------- Fixed navigation with a plate that fades in once the page scrolls ---------- */
.site-header { position: fixed; z-index: 40; }
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: #050d17d9;
  opacity: var(--plate, 1);
}

/* ---------- Gate set by the inline head script ---------- */
html.motion:not(.motion-ready) main { opacity: 0; }
html[data-preload] { overflow: hidden; }
html[data-preload] main { transform: translateY(200vh); }
html[data-preload] .site-header { opacity: 0; }

/* ---------- Preloader: edge ring = load progress → lime flood → fold into the logo tile ---------- */
.preloader { display: none; position: fixed; inset: 0; z-index: 60; pointer-events: none; }
html[data-preload] .preloader, html[data-preload-closing] .preloader { display: block; }
.pl-stage { position: absolute; inset: 0; background: #03090f; }
.pl-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pl-ring rect { fill: none; stroke: var(--acid); stroke-linecap: round; stroke-dasharray: 100 100; stroke-dashoffset: 100; }
.pl-flood { position: absolute; inset: 0; opacity: 0; }
.pl-plate { position: absolute; inset: 0; display: none; background: var(--acid); }
.pl-tile { position: absolute; top: calc(50% - 38px); left: calc(50% - 38px); width: 76px; height: 76px; }
.pl-mark, .logo-tile { position: absolute; inset: 0; border-radius: 31.58%; display: grid; place-items: center; overflow: clip; background: linear-gradient(135deg, #152e4a, #050d17 71.429%); border: 1px solid #ff7a1b45; }
.pl-mark { box-shadow: 0 0 60px #ff7a1b30; }
.pl-mark svg, .logo-tile svg { width: 54%; height: 60%; }
.logo img { height: 32px; width: auto; }
footer .logo img { height: 28px; }

/* ---------- Cursor ring (fine pointers only, set up by JS) ---------- */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 50; display: none; pointer-events: none;
  width: 28px; height: 28px; border: 1px solid var(--acid); border-radius: 50%;
  transition: border-color .2s;
}
.cursor i { position: absolute; inset: 0; border-radius: inherit; background: var(--acid); opacity: 0; transition: background .2s; }
.cursor.on-light { border-color: var(--forest); }
.cursor.on-light i { background: var(--forest); }

/* ---------- Hairlines that draw themselves from the left (--draw 0 → 1) ---------- */
.motion .hero-foot, .motion .problem-grid, .motion .process-grid, .motion .ema-facts, .motion .faq-list { border-top-color: transparent; position: relative; }
.motion .hero-foot::before, .motion .problem-grid::before, .motion .process-grid::before, .motion .ema-facts::before, .motion .faq-list::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px;
  transform: scaleX(var(--draw, 1)); transform-origin: left;
}
.motion .hero-foot::before { background: #ffffff29; }
.motion .problem-grid::before { background: #c1c9d3; }
.motion .process-grid::before { background: #a5b1bf; }
.motion .ema-facts::before { background: #ffffff25; }
.motion .faq-list::before { background: #b7bfc9; }
.motion .pv1::after { transform: scaleX(var(--draw, 1)); transform-origin: left; }

/* ---------- Counter roll for the numbered indexes ---------- */
.roll { display: inline-block; height: 1.2em; line-height: 1.2em; overflow: hidden; vertical-align: top; margin-right: .12em; }
.roll-strip { display: block; }
.roll-strip i { display: block; height: 1.2em; font-style: normal; }

/* ---------- Hero: wires and packets flowing into the single system ---------- */
.signal-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.signal-wires path { fill: none; stroke: #ff7a1b52; stroke-width: 1; }
.signal-packet {
  position: absolute; left: 0; top: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  background: radial-gradient(circle, var(--acid) 0 2.5px, #ff7a1b47 2.6px 5.6px, transparent 6px);
  opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.hero-signal.wired .signal-label::after { display: none; }
.signal-label { transition: border-color .3s, box-shadow .3s; }
.signal-label.lit { border-color: #ff7a1bb3; box-shadow: 0 0 22px #ff7a1b26; }
.core-ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--acid); opacity: 0; pointer-events: none; }

/* ---------- Manifesto rail: a packet relays along the four words ---------- */
.manifesto-rail { position: relative; }
.manifesto-rail span { padding: 3px 7px; margin: -3px -7px; transition: background .25s, color .25s; }
.manifesto-rail span.lit { background: var(--void); color: var(--acid); }
.rail-packet { position: absolute; left: 0; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--void); opacity: 0; pointer-events: none; }

/* ---------- Flow demo packets ---------- */
.flow-packet {
  position: absolute; left: 0; top: 0; z-index: 3; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--forest); box-shadow: 0 0 0 3px var(--acid), 0 0 18px #ff7a1b;
  opacity: 0; pointer-events: none;
}
.node-pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--orange); opacity: var(--ping, 0); transform: scale(calc(1 + (1 - var(--ping, 0)) * 2.2)); }

/* ---------- EMA window ---------- */
.gantt i { transform-origin: left center; }

/* big elements that move or fade every frame live on their own compositor layer, so their blurred
   shadows and backdrop filters are rasterised once instead of on every frame */
.motion .product-window, .motion .phone-mockup, .motion .contact-bg,
.motion .hero-signal, .motion .signal-wires, .motion .signal-core, .motion .signal-label,
.motion .flow-source, .motion .flow-node, .motion .flow-result, .motion .flow-packet,
.motion .rail-packet, .motion .gantt i, .motion .avatar-stack > * { will-change: transform; }
.motion .logo-open .case-close { will-change: clip-path; }
/* no will-change on the hero image: it carries a CSS filter, and a filtered layer is re-filtered by the
   compositor on every frame (a full-size offscreen pass), whereas a painted image is filtered once */

/* ---------- FAQ smooth toggle ---------- */
.faq-list details { overflow: clip; }

/* ---------- LogoOpen: the lime plate opens out of the TimberPack tile (EMA case page) ---------- */
/* the pin reserve must be content height, not padding: a sticky element only travels inside its parent's content box */
.logo-open-wrap { position: relative; padding: 70px 0 0; height: calc(var(--ph, 560px) + 310px); }
.logo-open { position: sticky; top: max(90px, calc(50lvh - var(--ph, 560px) / 2)); z-index: 2; }
.logo-open .case-close { width: min(1400px, calc(100% - 96px)); margin-inline: auto; border-radius: 32px; overflow: clip; position: relative; }
.motion .logo-open .case-close { clip-path: inset(50%); }
.close-mark { position: relative; display: block; width: 76px; height: 76px; margin: 0 auto 34px; }
.logo-open-mark {
  position: absolute; z-index: 3; pointer-events: none;
  left: calc(var(--mx, 0px) - var(--msize, 76px) / 2);
  top: calc(var(--my, 0px) - var(--msize, 76px) / 2);
  width: var(--msize, 76px); height: var(--msize, 76px);
  opacity: calc(min(var(--pop, 0), clamp(0, calc(1 - (var(--grow, 0) - .06) / .12), 1)));
  transform: scale(calc(.6 + var(--pop, 0) * .4));
}
.motion-reduced .logo-open-mark, html:not(.motion):not(.motion-reduced) .logo-open-mark { display: none; }
.case-close h2 .w { display: inline-block; }

@media (max-width: 600px) {
  .logo-open .case-close { width: calc(100% - 34px); border-radius: 24px; }
  .logo-open-wrap { height: calc(var(--ph, 560px) + 250px); }
}
@media (max-width: 850px) {
  .motion .process-grid::before { display: none; }
}

/* ---------- Navrh: proud jemne prosvita i pod svetlymi sekcemi ----------
   Svetle sekce uz nejsou nad platnem; jejich pozadi zustava pod nim (screen blend ho jen lehce rozsviti)
   a jejich obsah se zvedne nad platno, aby text zustal netknuty. */
main > section:not(.scene-dark) { z-index: auto; }
main > section:not(.scene-dark) > * { position: relative; z-index: 2; }
