/* ---------- 0. Lenis, povinné štýly ---------- */

/* Bez nich Lenis nefunguje a prejav je nenápadný a mätúci: stránka sa po
   koliesku pohne o pár pixelov a potom skočí na koniec. Lenis si polohu
   posunu dopočítava sám a natívne plynulé rolovanie mu pod rukami prepisuje
   cieľ.

   Pravidlo viaž na triedu `lenis`, nie len na `lenis-smooth`. Lenis 1.1.14
   pridáva na <html> iba `lenis`, takže selektor viazaný výlučne na
   `lenis-smooth` sa nikdy neuplatní a chyba vyzerá ako neopravená.

   V projekte navyše zmaž `html { scroll-behavior: smooth }`. Toto pravidlo
   je len poistka, zdroj konfliktu treba odstrániť. */
html.lenis, html.lenis body { height: auto; }
html.lenis, .lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* motion.css - základná pohybová vrstva
   Tokeny prepíš podľa tonality (references/kompozicia.md). Pohyby nechaj tak. */

:root {
  /* fyzika, nemeniť */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io:  cubic-bezier(.76, 0, .24, 1);
  --ease-snap: cubic-bezier(0, 0, 0, 1);
  --t-hover: .24s;
  --t-reveal: 1.05s;
  --t-curtain: 1.2s;
  --travel: 28px;

  /* paleta, prepísať podľa tonality */
  --bg: #ffffff;
  --surface: #f1f1f1;
  --ink: #161718;
  --mute: #5f6468;
  --accent: #78faae;
  --line: rgba(22, 23, 24, .12);
  --line-strong: rgba(22, 23, 24, .22);

  /* rozmery */
  --r: 16px;
  --gutter: clamp(16px, 4vw, 64px);
  --container: 1440px;
  --section-y: clamp(72px, 8.5vw, 136px);
  --header-h: 76px;

  /* typografická škála */
  --fs-display: clamp(2.6rem, 7.2vw, 7.4rem);
  --fs-h1: clamp(2.4rem, 5.6vw, 5.6rem);
  --fs-h2: clamp(2rem, 4.2vw, 4.1rem);
  --fs-h3: clamp(1.2rem, 1.6vw, 1.5rem);
  --fs-lead: clamp(1.05rem, 1.25vw, 1.25rem);
  --fs-xs: .75rem;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.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;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- typografia ---------- */

.display { font-size: var(--fs-display); line-height: .98; letter-spacing: -.035em; margin: 0; }
.h1 { font-size: var(--fs-h1); line-height: 1.02; letter-spacing: -.03em; margin: 0; }
.h2 { font-size: var(--fs-h2); line-height: 1.05; letter-spacing: -.025em; margin: 0; }
.lead { font-size: var(--fs-lead); color: var(--mute); max-width: 60ch; }
.eyebrow {
  font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .12em;
  color: var(--mute); margin: 0 0 .75em;
}
.num { font-variant-numeric: tabular-nums; }

/* ---------- 1. opona ---------- */

.curtain {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background: var(--bg);
  clip-path: inset(0% 0% 0% 0%);
}
.curtain__logo { opacity: 0; }

/* ---------- 2. javisko, prílet subjektu ---------- */

.stage { position: relative; min-height: 100svh; overflow: clip; }
.stage__subject { position: relative; will-change: transform; }
.stage__shadow {
  position: absolute; left: 8%; right: 8%; bottom: 3%; height: 9%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), transparent 70%);
  filter: blur(18px); pointer-events: none;
}
/* údaje okolo subjektu: v CSS viditeľné, JS si ich schová sám */
.stage__callout { opacity: 1; }
.js-anim .stage__callout { opacity: 0; }

/* ---------- 3. maska ---------- */

.mask { overflow: hidden; }
.mask > img { will-change: transform; }

/* ---------- 4. riadkový nástup textu ---------- */

.split .line { display: block; clip-path: inset(-.35em -.12em 0 -.12em); }
.split .line > span { display: block; }
.js-anim .split .line > span { transform: translateY(110%); }

/* ---------- 5. reveal ---------- */

[data-reveal] { opacity: 1; }
.js-anim [data-reveal] { opacity: 0; }

/* ---------- 6. ťahací rail ---------- */

.rail {
  display: flex; gap: clamp(12px, 1.6vw, 24px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none; cursor: grab;
  padding-bottom: 4px;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 clamp(260px, 26vw, 380px); }
.rail.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.rail.is-dragging a { pointer-events: none; }
.rail__bar { height: 2px; background: var(--line); position: relative; margin-top: 20px; }
.rail__bar i { position: absolute; inset-block: 0; background: var(--ink); transition: left .2s linear, width .2s linear; }

/* ---------- 7. ticker ---------- */

.ticker { overflow: hidden; white-space: nowrap; user-select: none; }
.ticker__track { display: inline-flex; will-change: transform; }
.ticker__group { display: inline-flex; gap: 2.5rem; padding-right: 2.5rem; align-items: center; }

/* ---------- 9. dýchanie ---------- */

@keyframes mw-breathe {
  0%, 100% { transform: translateY(1.3%); }
  50% { transform: translateY(-1.3%); }
}
.breathe { animation: mw-breathe 6s ease-in-out infinite; }

/* ---------- 10. hlavička ---------- */

.header {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  background: var(--bg); border-bottom: 1px solid var(--line);
  transition: transform .45s var(--ease-out), background .3s, border-color .3s;
}
.header.is-hidden { transform: translateY(-100%); }
.header.is-over { background: transparent; border-color: transparent; }
.header__logo--light { opacity: 0; transition: opacity .3s; }
.header.is-over .header__logo--light { opacity: 1; }
.header.is-over .header__logo--dark { opacity: 0; }
.header__logo--dark { transition: opacity .3s; }

.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
}

/* ---------- 11. paralaxa hero ---------- */

.hero { position: relative; min-height: 92svh; overflow: clip; display: grid; }
.hero__media { position: absolute; inset: -9% 0; will-change: transform; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__content { position: relative; z-index: 2; align-self: end; }

/* ---------- 12. obrysové slovo ---------- */

.outline-word {
  position: absolute; top: 50%; left: 0; translate: 0 -50%;
  font-size: clamp(8rem, 22vw, 20rem); font-weight: 800; letter-spacing: -.04em;
  -webkit-text-stroke: 1px var(--line-strong); color: transparent;
  white-space: nowrap; user-select: none; pointer-events: none; margin: 0;
}

/* ---------- hover na karte ---------- */

.card {
  position: relative; overflow: hidden; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .5s var(--ease-out), border-color .3s;
}
.card:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.card__media { overflow: hidden; }
.card__media img { transition: transform 1.2s var(--ease-out); }
.card:hover .card__media img { transform: scale(1.06); }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .js-anim [data-reveal], .js-anim .stage__callout { opacity: 1; }
  .js-anim .split .line > span { transform: none; }
}

/* ---------- 2b. javisko ako sekvencia uhlov ---------- */

/* Bez JS a pri obmedzenom pohybe sú kroky pod sebou ako zoznam.
   Prekryv do jednej bunky zapína až JS triedou is-seq, inak by sa štyri autá
   na seba navrstvili a stránka by bez JS nedávala zmysel. */
.stage__cars { display: grid; gap: clamp(28px, 5vw, 64px); }
.stage__cars.is-seq { gap: 0; }
.stage__cars.is-seq .stage__item { grid-area: 1 / 1; }
.stage__item { display: grid; align-content: center; gap: clamp(10px, 1.6vw, 20px); }
.stage__car { width: 100%; height: auto; object-fit: contain; }
.stage__cars.is-seq .stage__car { will-change: transform; }

/* ---------- 3c. video riadené scrollom ---------- */

.vscrub { position: relative; overflow: hidden; }
.vscrub > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vscrub > video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  opacity: 0; transition: opacity .6s var(--ease-out);
}
/* plagát drží sekciu až kým video nie je pripravené, potom sa prelne */
.vscrub.is-live > video { opacity: 1; }

/* ---------- 5c. vlastný kurzor ---------- */

.cursor {
  position: fixed; left: 0; top: 0; z-index: 95;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: var(--ink);
  /* difference prevráti farbu pod sebou, takže kurzor je vidieť na svetlom aj tmavom */
  mix-blend-mode: difference;
  pointer-events: none; opacity: 0;
  display: grid; place-items: center;
  transition: width .3s var(--ease-out), height .3s var(--ease-out),
              margin .3s var(--ease-out), background .3s, opacity .25s;
}
.cursor.is-on { opacity: 1; }
.cursor span {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--bg); opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.cursor.is-link { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
.cursor.is-view {
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  mix-blend-mode: normal; background: var(--accent);
}
.cursor.is-view span { opacity: 1; }
@media (hover: none), (pointer: coarse) { .cursor { display: none; } }

/* ---------- fotka vnútri písmen ---------- */

.in-letters {
  background-size: cover; background-position: 50% 50%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ---------- 2c. vodorovná jazda ---------- */

.hs__viewport { overflow: hidden; }
.hs__track { display: flex; will-change: transform; }
.hs__track > * { flex: 0 0 auto; }
.hs__media { will-change: transform; }
/* bez pinu (úzka obrazovka, obmedzený pohyb) sa z pásu stane listovanie prstom */
[data-hscroll]:not(.is-pinned) .hs__viewport {
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
[data-hscroll]:not(.is-pinned) .hs__viewport::-webkit-scrollbar { display: none; }
[data-hscroll]:not(.is-pinned) .hs__track > * { scroll-snap-align: center; }
[data-hscroll]:not(.is-pinned) .hs__track { transform: none !important; }
.hs__bar { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.hs__bar i { position: absolute; inset: 0; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- 2d. produktový orbit ---------- */

/* Bez JS a na úzkej obrazovke sú produkty pod sebou ako zoznam. */
.orbit__stage { display: grid; gap: clamp(28px, 5vw, 56px); justify-items: center; }
/* width:max-content a max-width:none sú nutné: v absolútnom pozicovaní sa šírka
   rodiča počíta z dieťaťa a max-width:100 % z rodiča, čo sa zacyklí na nulu */
.orbit__item { display: grid; justify-items: center; gap: 1rem; width: max-content; }
.orbit__item img { width: auto; max-width: none; display: block; }
.orbit__cap { text-align: center; }
[data-orbit].is-orbit .orbit__stage { display: block; position: relative; height: 100%; }
[data-orbit].is-orbit .orbit__item {
  position: absolute; left: 50%; bottom: 0; transform-origin: 50% 90%; will-change: transform;
}
[data-orbit].is-orbit .orbit__item .orbit__cap { display: none; }
[data-orbit].is-orbit .orbit__cap--fixed { display: block; }
.orbit__cap--fixed { display: none; opacity: 0; transition: opacity .3s var(--ease-out); }
.orbit__cap--fixed.is-on { opacity: 1; }
.orbit__ring { position: absolute; pointer-events: none; will-change: transform; }
.orbit__dot { opacity: .3; transition: opacity .3s; }
.orbit__dot.is-on { opacity: 1; }
