/* tom-apk.com – hlavní stránka jako prezentace
   Režimy (třída na <html>, nastaví ji skript v hlavičce a prezentace.js):
   .scrub  velká obrazovka: snímky se při posunu přišpendlí a animace jedou podle posunu (--e příjezd, --p postup 0–1)
   .flow   mobil a nízké okno: běžné posouvání, prvky najíždějí při zobrazení
   .static omezené animace v systému: všechno je vidět hned, nic se nehýbe */

.pres .top { margin-bottom: -56px; }
.scene { position: relative; --e: 0; --p: 0; }
.stage { position: relative; }
.scrub .scene.pin { height: var(--delka, 230vh); }
.scrub .stage {
  position: sticky; top: 0; height: 100vh; padding-top: 56px; overflow: hidden;
  display: flex; align-items: center;
}
.scrub .stage > .wrap { width: 100%; }
.flow .stage, .static .stage { padding-top: clamp(104px, 18vw, 150px); }

/* ---------------------------------------------------------------- najíždění při zobrazení */
.scrub [data-anim], .flow [data-anim], .flow [data-flow] {
  opacity: 0; transform: translateY(32px);
  transition: opacity .9s ease, transform 1s cubic-bezier(.2, .7, .2, 1);
}
.scrub [data-anim].vidim, .flow [data-anim].vidim, .flow [data-flow].vidim { opacity: 1; transform: none; }
[data-anim][data-d="1"] { transition-delay: .12s; }
[data-anim][data-d="2"] { transition-delay: .24s; }
[data-anim][data-d="3"] { transition-delay: .36s; }
[data-anim][data-d="4"] { transition-delay: .5s; }

/* body funkcí: čára nahoře se natáhne a body najedou po jednom */
.pres .feat li { border-top: 0; position: relative; }
.pres .feat li::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-2);
  transform-origin: 0 50%;
}
.scrub .feat li, .flow .feat li {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s ease, transform .8s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--i, 0) * 90ms + .1s);
}
.scrub .feat li::before, .flow .feat li::before { transform: scaleX(0); transition: transform 1.1s cubic-bezier(.6, 0, .2, 1); transition-delay: calc(var(--i, 0) * 90ms); }
.feat.vidim li { opacity: 1 !important; transform: none !important; }
.feat.vidim li::before { transform: none !important; }
.feat li:nth-child(2) { --i: 1; }
.feat li:nth-child(3) { --i: 2; }
.feat li:nth-child(4) { --i: 3; }
.feat li:nth-child(5) { --i: 4; }
.feat li:nth-child(6) { --i: 5; }
.feats { padding-bottom: clamp(48px, 9vw, 120px); }

/* ---------------------------------------------------------------- ukazatel postupu a tečky snímků */
.progress { position: fixed; inset: 0 0 auto; height: 2px; z-index: 45; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }
.dots {
  position: fixed; right: clamp(8px, 1.4vw, 24px); top: 50%; transform: translateY(-50%); z-index: 30;
  display: none; flex-direction: column; gap: 4px;
}
.scrub .dots { display: flex; }
.dots button { position: relative; width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; padding: 0; }
.dots button::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint);
  transition: transform .3s, background-color .3s, border-color .3s;
}
.dots button:hover::before { border-color: var(--ink); }
.dots button[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); transform: scale(1.3); }
.dots button span {
  position: absolute; right: 34px; top: 50%; transform: translate(6px, -50%); white-space: nowrap;
  font: 600 12px/1 var(--display); font-stretch: 110%; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  background: var(--bg-3); border: 1px solid var(--line-2); padding: 7px 10px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.dots button:hover span, .dots button:focus-visible span { opacity: 1; transform: translate(0, -50%); }

/* ---------------------------------------------------------------- 1. úvod */
.intro { --delka: 250vh; }
.intro .copy { text-align: center; position: relative; z-index: 2; }
.logo-hex { display: block; width: 50px; height: 56px; margin: 0 auto 18px; overflow: visible; }
.logo-hex path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.intro h1 {
  margin: 12px 0 0; font: 900 clamp(5rem, 19vw, 15rem)/.86 var(--display); font-stretch: 78%; letter-spacing: -0.045em;
}
.intro h1 span { display: inline-block; }
.intro .sub { margin: 22px auto 0; max-width: 24ch; font: 600 clamp(1.5rem, 3.4vw, 2.4rem)/1.15 var(--display); letter-spacing: -0.015em; }
.intro .ctas { margin-top: 34px; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 14px 28px; }
.intro .shot { position: relative; z-index: 1; width: min(1180px, 100%); margin: clamp(48px, 9vw, 80px) auto 0; padding: 0 var(--gutter); }
.flow .intro .stage, .static .intro .stage { padding-top: clamp(72px, 14vw, 120px); }

.scrub .intro .stage { display: grid; place-items: center; perspective: 1600px; }
.scrub .intro .stage > * { grid-area: 1 / 1; }
.scrub .intro .copy {
  --t: clamp(0, var(--p) * 3, 1);
  opacity: calc(1 - var(--t));
  transform: translateY(calc(var(--t) * -7vh)) scale(calc(1 - var(--t) * .15));
}
.scrub .intro.pryc .copy { pointer-events: none; }
.scrub .intro .shot {
  margin: 0; padding: 0; width: min(1180px, 86vw, calc((100vh - 130px) * 1.778));
  --a: clamp(0, (var(--p) - .04) / .6, 1);
  --s: calc(var(--a) * var(--a) * (3 - 2 * var(--a)));
  transform-origin: 50% 100%;
  transform: translateY(calc((1 - var(--s)) * 50vh)) rotateX(calc((1 - var(--s)) * 42deg)) scale(calc(.8 + var(--s) * .2));
  will-change: transform;
}

/* ---------------------------------------------------------------- 2. slova, která se rozsvěcují */
.manifest { --delka: 230vh; }
.slova {
  margin: 0 auto; max-width: 11.5em; text-align: center;
  font: 800 clamp(2.2rem, 5.4vw, 4.9rem)/1.07 var(--display); font-stretch: 86%; letter-spacing: -0.03em;
}
.flow .manifest .stage, .static .manifest .stage { padding-bottom: clamp(24px, 6vw, 60px); }
.scrub .w { opacity: calc(.14 + .86 * clamp(0, var(--p) * 1.35 * var(--n) - var(--i), 1)); }
.flow .w { opacity: .14; transition: opacity .6s ease; transition-delay: calc(var(--i) * 55ms); }
.flow .slova.vidim .w { opacity: 1; }

/* ---------------------------------------------------------------- snímky aplikací */
.app .scene { --delka: 230vh; }
.app .app-name { font-size: clamp(3.4rem, 7.2vw, 6.6rem); }
.app .copy { position: relative; isolation: isolate; }
.scrub .app .copy {
  --c: clamp(0, (var(--e) - .4) / .55, 1);
  opacity: var(--c); transform: translateY(calc((1 - var(--c)) * 50px));
}
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(36px, 5vw, 84px); align-items: center; }
.duo.flip > .copy { order: 2; }

/* TomOS: plocha se přiblíží na panel T */
.zoom-fig { margin: 0; }
.zoom { aspect-ratio: 16 / 9; }
.zoom img, .zoom video { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 21.9% 37.5%; }
.zoom-fig figcaption { margin-top: 14px; font-size: 15px; color: var(--muted); }
.scrub #tomos .zoom-fig {
  --c: clamp(0, (var(--e) - .3) / .6, 1);
  opacity: var(--c); transform: translateX(calc((1 - var(--c)) * 80px));
}
.scrub #tomos .zoom img, .scrub #tomos .zoom video {
  --z: clamp(0, (var(--p) - .12) / .58, 1);
  --zs: calc(var(--z) * var(--z) * (3 - 2 * var(--z)));
  transform: translate(calc(var(--zs) * 28.1%), calc(var(--zs) * 12.5%)) scale(calc(1 + var(--zs) * .52));
  will-change: transform;
}
.scrub #tomos figcaption { opacity: clamp(0, (var(--p) - .6) / .15, 1); }

/* TomOS Mobil: dva telefony se rozloží jako karty */
.phones2 { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 2.4vw, 28px); }
.phones2 .phone { width: min(46%, 290px); }
.phones2 .phone:nth-child(1) { position: relative; z-index: 2; }
.scrub .phones2 {
  --c: clamp(0, (var(--e) - .3) / .6, 1);
  --f: clamp(0, (var(--p) - .04) / .56, 1);
  --fs: calc(var(--f) * var(--f) * (3 - 2 * var(--f)));
  opacity: var(--c); transform: translateY(calc((1 - var(--c)) * 12vh));
}
.scrub .phones2 .phone { width: min(44%, 300px, calc((100vh - 240px) * .486)); will-change: transform; }

/* realistické telefony (vykresluje snimky/render_telefon.py): stín, záře, vznášení a odlesk na skle */
.phones2 { position: relative; isolation: isolate; }
.phones2::before {
  content: ""; position: absolute; inset: -18% -42%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(48% 50% at 40% 44%, rgba(0, 229, 255, .46), rgba(0, 229, 255, .14) 50%, transparent 74%),
    radial-gradient(42% 44% at 64% 62%, rgba(124, 77, 255, .42), rgba(124, 77, 255, .10) 52%, transparent 74%);
  filter: blur(40px);
}
.phones2::after {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: -7%; height: 70px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(0, 229, 255, .30), rgba(0, 229, 255, .08) 55%, transparent);
  filter: blur(14px);
}
.phone.real { background: none; border: 0; padding: 0; border-radius: 0; }
.phones2 .phone.real:nth-child(2) { margin-top: clamp(40px, 7vw, 90px); }
.scrub .phones2 .phone.real:nth-child(2) { margin-top: 0; }
.ph-in { position: relative; isolation: isolate; animation: vznas 7s ease-in-out infinite; }
.phone.real:nth-child(2) .ph-in { animation-delay: -3.5s; }
.ph-in img { position: relative; z-index: 1; width: 100%; height: auto; border-radius: 0; }
/* krátké video na displeji: leží pod rámečkem (mobil-ramecek.webp má displej průhledný), rozměry z render_telefon.py */
.ph-video {
  position: absolute; z-index: 0; left: 4.6632%; top: 2.267%; width: 90.6736%; height: 95.466%;
  object-fit: cover; border-radius: 9.4286% / 4.3536%; background: #05070a;
}
/* stín pod celým telefonem (obrys z obrázku telefonu), aby nepadal na video */
.ph-in::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: #000; opacity: .78;
  -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat;
  transform: translateY(32px) scale(.96); filter: blur(26px);
}
.ph-in::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(112deg, transparent 38%, rgba(255, 255, 255, .17) 48%, rgba(180, 250, 255, .10) 52%, transparent 62%);
  background-size: 260% 100%; background-position: 140% 0;
  -webkit-mask: var(--m) center / 100% 100% no-repeat; mask: var(--m) center / 100% 100% no-repeat;
  animation: lesk 8s ease-in-out infinite;
}
.phone.real:nth-child(2) .ph-in::after { animation-delay: -4s; }
@keyframes vznas { 50% { transform: translateY(-10px); } }
@keyframes lesk { 0%, 55% { background-position: 140% 0; } 85%, 100% { background-position: -40% 0; } }
html.static .ph-in, html.static .ph-in::after { animation: none; }
/* na mobilu (a bez animací) záře nesmí přesahovat do stran, jinak by se stránka posouvala do boku */
html.flow .phones2::before, html.static .phones2::before { inset: -14% 0; }
html.flow .phones2::after, html.static .phones2::after { left: 12%; right: 12%; }
.scrub .phones2 .phone:nth-child(1) { transform: translateX(calc((1 - var(--fs)) * 54%)) rotate(calc((1 - var(--fs)) * -5deg)); }
.scrub .phones2 .phone:nth-child(2) {
  margin-top: 0;
  transform: translateX(calc((1 - var(--fs)) * -54%)) translateY(calc(var(--fs) * 64px)) rotate(calc((1 - var(--fs)) * 5deg)) scale(calc(.94 + var(--fs) * .06));
}

/* Jarvis: kruhy jako při mluvení a okno vyjede zespodu */
.jarvis-st, .lnch-st { display: flex; flex-direction: column; align-items: center; text-align: center; }
.jarvis-st .copy, .lnch-st .copy { max-width: 48rem; }
.jarvis-st .app-lead, .lnch-st .app-lead { margin-left: auto; margin-right: auto; }
.jarvis-st .app-actions { justify-content: center; }
.rings {
  position: absolute; left: 50%; top: 50%; z-index: -1; width: min(clamp(420px, 56vw, 760px), 100vw); aspect-ratio: 1;
  transform: translate(-50%, -50%); pointer-events: none; overflow: visible;
}
.rings circle { fill: none; stroke: var(--accent); stroke-width: 1.4; transform-box: fill-box; transform-origin: center; opacity: 0; }
.static .rings circle:first-child { opacity: .25; }
.jarvis-shot { margin: clamp(32px, 6vw, 56px) auto 0; width: min(1040px, 100%); }
.jarvis-shot img { width: 100%; height: auto; border-radius: 16px; }
/* video okna (snimky/natoc_okna.py): rohy mimo okno jsou černé, zaoblení je ořízne */
.jarvis-shot video { display: block; width: 100%; height: auto; aspect-ratio: 1600 / 974; border-radius: 16px; background: #04090e; }
.scrub .jarvis-shot {
  margin-top: clamp(24px, 4vh, 44px); width: min(1040px, 84vw, calc((100vh - 480px) * 1.643));
  --j: clamp(0, (var(--p) - .04) / .55, 1);
  --js: calc(var(--j) * var(--j) * (3 - 2 * var(--j)));
  opacity: calc(.1 + var(--js) * .9);
  transform-origin: 50% 0;
  transform: translateY(calc((1 - var(--js)) * 24vh)) scale(calc(.7 + var(--js) * .3));
  will-change: transform;
}

/* Media Bar: okno se natočí ze strany a vznáší se, ekvalizér hraje */
.eq { display: flex; align-items: flex-end; gap: 3px; height: 22px; margin-bottom: 16px; }
.eq i { width: 4px; height: 100%; border-radius: 2px; background: var(--accent); transform-origin: 50% 100%; transform: scaleY(.35); }
.okno { width: min(440px, 100%); margin-left: auto; perspective: 1200px; }
.okno img { width: 100%; height: auto; }
.okno video {
  display: block; width: 100%; height: auto; aspect-ratio: 840 / 870; background: #111113;
  border-radius: 4.2857% / 4.1379%; /* poloměr okna Media Baru 24 px z 560 × 580 */
  box-shadow: 0 34px 70px -28px rgba(0, 0, 0, .75);
}
.scrub .okno {
  width: min(440px, 100%, calc((100vh - 230px) * .965));
  --c: clamp(0, (var(--e) - .3) / .6, 1);
  --m: clamp(0, (var(--p) - .02) / .55, 1);
  --ms: calc(var(--m) * var(--m) * (3 - 2 * var(--m)));
  opacity: var(--c);
}
.scrub .okno .tilt {
  transform: rotateY(calc((1 - var(--ms)) * -34deg)) rotateX(calc((1 - var(--ms)) * 10deg)) translateX(calc((1 - var(--ms)) * 14%)) scale(calc(.84 + var(--ms) * .16));
  will-change: transform;
}

/* Launcher: čtyři aplikace se sletí do jednoho okna */
.lnch-vis { position: relative; margin: clamp(32px, 6vw, 56px) auto 0; width: min(980px, 100%); }
.scrub .lnch-vis { margin-top: clamp(26px, 4vh, 44px); width: min(980px, 78vw, calc((100vh - 420px) * 1.553)); }
.scrub .lnch-vis .frame {
  --k: clamp(0, (var(--p) - .28) / .4, 1);
  --ks: calc(var(--k) * var(--k) * (3 - 2 * var(--k)));
  opacity: calc(.06 + var(--ks) * .94); transform: scale(calc(.78 + var(--ks) * .22));
}
.chip {
  position: absolute; left: 50%; top: 50%; z-index: 2; display: none; align-items: center; gap: 10px;
  padding: 12px 18px 12px 14px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line-2);
  font: 700 clamp(16px, 1.5vw, 21px)/1 var(--display); letter-spacing: -0.01em; white-space: nowrap; color: var(--ink);
}
.chip svg { width: 18px; height: 20px; flex: none; }
.chip svg path { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; }
.scrub .chip {
  display: inline-flex;
  --g: clamp(0, var(--p) / .55, 1);
  --gs: calc(var(--g) * var(--g) * (3 - 2 * var(--g)));
  opacity: calc(1 - clamp(0, (var(--p) - .42) / .16, 1));
  transform: translate(-50%, -50%) translate(calc(var(--x) * (1 - var(--gs))), calc(var(--y) * (1 - var(--gs)))) scale(calc(1 - var(--gs) * .45));
  will-change: transform;
}
.chip:nth-of-type(1) { --x: -34vw; --y: -22vh; }
.chip:nth-of-type(2) { --x: 32vw; --y: -18vh; }
.chip:nth-of-type(3) { --x: -30vw; --y: 20vh; }
.chip:nth-of-type(4) { --x: 34vw; --y: 24vh; }

/* ---------------------------------------------------------------- poslední snímek: stažení */
.finale {
  position: relative; isolation: isolate; overflow: hidden; min-height: 100vh; display: grid; align-items: center;
  padding: clamp(120px, 14vw, 180px) 0 clamp(96px, 10vw, 140px); text-align: center;
}
.hexy { position: absolute; left: 50%; top: 50%; z-index: -1; width: min(1000px, 150vw); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.hexy path { fill: none; stroke: var(--accent); stroke-width: 1.2; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 2.4s cubic-bezier(.6, 0, .2, 1); }
.hexy path:nth-child(1) { opacity: .2; }
.hexy path:nth-child(2) { opacity: .14; transition-delay: .3s; }
.hexy path:nth-child(3) { opacity: .1; transition-delay: .6s; }
.hexy.vidim path, .static .hexy path { stroke-dashoffset: 0; }
.hexy g { transform-box: view-box; transform-origin: 50% 50%; }
.fin-title { margin: 14px 0 0; font: 900 clamp(3.2rem, 9vw, 8rem)/.9 var(--display); font-stretch: 80%; letter-spacing: -0.04em; }
.fin-lead { margin: 24px auto 0; max-width: 32rem; font-size: clamp(19px, 2vw, 22px); color: var(--muted); }
.fin-cta { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fin-cta .file-info { margin: 0; font-size: 14px; }
.btn-xl { padding: 21px 40px; font-size: 19px; gap: 12px; }
.btn-xl svg { width: 22px; height: 22px; transition: transform .25s; }
.btn-xl:hover svg { transform: translateY(3px); }
.kroky {
  list-style: none; counter-reset: krok; padding: 0; margin: clamp(64px, 9vw, 104px) auto 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px clamp(24px, 4vw, 48px); text-align: left;
}
.kroky li { counter-increment: krok; border-top: 1px solid var(--line-2); padding-top: 16px; color: var(--muted); font-size: 16px; }
.kroky li::before { content: counter(krok); display: block; font: 900 2.6rem/1 var(--display); font-stretch: 80%; color: var(--accent); margin-bottom: 12px; }
.kroky strong { display: block; color: var(--ink); font: 700 19px/1.25 var(--display); margin-bottom: 4px; }
/* přihlášený: první krok je hotový, místo čísla fajfka */
.kroky li.hotovo { border-top-color: var(--accent); }
.kroky li.hotovo::before {
  content: ""; width: 26px; height: 13px; margin: 10px 0 24px 4px;
  border-left: 4px solid var(--accent); border-bottom: 4px solid var(--accent); transform: rotate(-45deg);
}

/* ---------------------------------------------------------------- přepínač animací */
.anim-hint { margin: 28px auto 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; font-size: 15px; color: var(--muted); }
.foot-anim { color: var(--muted); font-weight: 400; font-size: 14px; }

/* ---------------------------------------------------------------- nekonečné animace (vypne je režim static) */
@media all {
  html:not(.static) .logo-hex path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kresli 1.5s .1s cubic-bezier(.6, 0, .2, 1) forwards; }
  html:not(.static) .intro h1 span { animation: pismeno 1.2s cubic-bezier(.2, .7, .2, 1) both; }
  .intro h1 span:nth-child(1) { animation-delay: .25s; }
  .intro h1 span:nth-child(2) { animation-delay: .33s; }
  .intro h1 span:nth-child(3) { animation-delay: .41s; }
  .intro h1 span:nth-child(4) { animation-delay: .49s; }
  .intro h1 span:nth-child(5) { animation-delay: .57s; }
  html:not(.static) .intro .nab { animation: nabeh .9s cubic-bezier(.2, .7, .2, 1) both; }
  .intro .eyebrow.nab { animation-delay: .85s; }
  .intro .sub.nab { animation-delay: 1s; }
  .intro .ctas.nab { animation-delay: 1.15s; }
  html:not(.static) .intro .shot .frame { animation: nabeh 1.4s 1s cubic-bezier(.2, .7, .2, 1) both; }
  html:not(.static) .rings circle { animation: vlna 4.5s cubic-bezier(.2, .6, .3, 1) infinite; }
  .rings circle:nth-child(2) { animation-delay: 1.5s; }
  .rings circle:nth-child(3) { animation-delay: 3s; }
  html:not(.static) .eq i { animation: eq 1.1s ease-in-out infinite alternate; }
  .eq i:nth-child(2) { animation-duration: .8s; animation-delay: -.3s; }
  .eq i:nth-child(3) { animation-duration: 1.3s; animation-delay: -.7s; }
  .eq i:nth-child(4) { animation-duration: .9s; animation-delay: -.5s; }
  .eq i:nth-child(5) { animation-duration: 1.2s; animation-delay: -.2s; }
  html:not(.static) .okno img, html:not(.static) .okno video { animation: vznaseni 6s ease-in-out infinite; }
  html:not(.static) .hexy g { animation: otacej 120s linear infinite; }
}
@keyframes kresli { to { stroke-dashoffset: 0; } }
@keyframes pismeno {
  from { opacity: 0; transform: translateY(.3em) scale(.92); filter: blur(14px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes nabeh { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes vlna { 0% { transform: scale(.42); opacity: 0; } 18% { opacity: .5; } 100% { transform: scale(1); opacity: 0; } }
@keyframes eq { from { transform: scaleY(.2); } to { transform: scaleY(1); } }
@keyframes vznaseni { 50% { transform: translateY(-12px); } }
@keyframes otacej { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- ovládání prezentace na mobilu */
.pill {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 35;
  display: none; align-items: center; gap: 2px; padding: 4px;
  border-radius: 999px; background: rgba(20, 23, 27, 0.86); border: 1px solid var(--line-2);
  backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  transform: translateX(-50%); transition: transform .35s cubic-bezier(.2, .7, .2, 1), opacity .3s;
}
html:not(.scrub) .pill { display: flex; }
.pill.skryta, .pill.uhni { transform: translate(-50%, 150%); opacity: 0; pointer-events: none; }
.pill button {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: none; color: var(--ink);
}
.pill button:hover { background: rgba(255, 255, 255, 0.08); }
.pill button:disabled { opacity: .3; cursor: default; background: none; }
.pill button svg { width: 20px; height: 20px; }
.pill-text { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-width: 9.5em; padding: 0 4px; }
.pill-cislo { font: 600 13px/1 var(--display); letter-spacing: .04em; font-variant-numeric: tabular-nums; color: var(--muted); }
.pill-nazev { font: 700 15px/1 var(--display); white-space: nowrap; color: var(--ink); }
html:not(.scrub) .toast { bottom: 86px; }
html:not(.scrub) footer { padding-bottom: 104px; }

/* ---------------------------------------------------------------- mobil: animace podle posunu
   --v nastavuje prezentace.js: 0 = prvek vjíždí zespodu obrazovky, 1 = jeho střed je uprostřed */
/* úvod: plocha TomOS se zvedne z náklonu */
html.flow .intro .shot[data-flow] {
  --a: clamp(0, (var(--v, 1) - .3) / .7, 1);
  --s: calc(var(--a) * var(--a) * (3 - 2 * var(--a)));
  opacity: 1; transition: none; transform-origin: 50% 100%;
  transform: perspective(1000px) rotateX(calc((1 - var(--s)) * 36deg)) scale(calc(.9 + var(--s) * .1));
}
/* věta se rozsvěcuje slovo po slově podle posunu */
html.flow .slova .w, html.flow .slova.vidim .w {
  transition: opacity .25s linear; transition-delay: 0s;
  opacity: calc(.14 + .86 * clamp(0, var(--v, 1) * 1.35 * var(--n) - var(--i), 1));
}
/* TomOS: přiblížení na panel T */
html.flow #tomos .zoom img, html.flow #tomos .zoom video {
  --z: clamp(0, (var(--v, 1) - .5) / .5, 1);
  --zs: calc(var(--z) * var(--z) * (3 - 2 * var(--z)));
  transform: translate(calc(var(--zs) * 28.1%), calc(var(--zs) * 12.5%)) scale(calc(1 + var(--zs) * .52));
}
/* TomOS Mobil: telefony se rozloží jako karty */
html.flow .phones2 {
  --f: clamp(0, (var(--v, 1) - .25) / .6, 1);
  --fs: calc(var(--f) * var(--f) * (3 - 2 * var(--f)));
}
html.flow .phones2 .phone:nth-child(1) { transform: translateX(calc((1 - var(--fs)) * 54%)) rotate(calc((1 - var(--fs)) * -5deg)); }
html.flow .phones2 .phone:nth-child(2) { transform: translateX(calc((1 - var(--fs)) * -54%)) rotate(calc((1 - var(--fs)) * 5deg)) scale(calc(.94 + var(--fs) * .06)); }
/* Jarvis: okno vyjede zespodu a zvětší se */
html.flow .jarvis-shot[data-flow] {
  --j: clamp(0, (var(--v, 1) - .05) / .75, 1);
  --js: calc(var(--j) * var(--j) * (3 - 2 * var(--j)));
  opacity: calc(.15 + var(--js) * .85); transition: none; transform-origin: 50% 0;
  transform: translateY(calc((1 - var(--js)) * 10vh)) scale(calc(.78 + var(--js) * .22));
}
/* Media Bar: okno se natočí ze strany */
html.flow .okno {
  --m: clamp(0, (var(--v, 1) - .15) / .7, 1);
  --ms: calc(var(--m) * var(--m) * (3 - 2 * var(--m)));
}
html.flow .okno .tilt { transform: rotateY(calc((1 - var(--ms)) * -34deg)) rotateX(calc((1 - var(--ms)) * 10deg)) translateX(calc((1 - var(--ms)) * 10%)) scale(calc(.86 + var(--ms) * .14)); }
/* Launcher: čtyři aplikace se sletí do okna */
html.flow .chip {
  display: inline-flex; padding: 10px 14px 10px 12px; font-size: 15px;
  --g: clamp(0, var(--v, 1) / .7, 1);
  --gs: calc(var(--g) * var(--g) * (3 - 2 * var(--g)));
  opacity: calc(1 - clamp(0, (var(--v, 1) - .62) / .18, 1));
  transform: translate(-50%, -50%) translate(calc(var(--x) * (1 - var(--gs))), calc(var(--y) * (1 - var(--gs)))) scale(calc(1 - var(--gs) * .4));
}
html.flow .chip:nth-of-type(1) { --x: -26vw; --y: -15vh; }
html.flow .chip:nth-of-type(2) { --x: 25vw; --y: -5vh; }
html.flow .chip:nth-of-type(3) { --x: -25vw; --y: 5vh; }
html.flow .chip:nth-of-type(4) { --x: 26vw; --y: 15vh; }
html.flow .lnch-vis .frame {
  --k: clamp(0, (var(--v, 1) - .5) / .35, 1);
  --ks: calc(var(--k) * var(--k) * (3 - 2 * var(--k)));
  opacity: calc(.06 + var(--ks) * .94); transform: scale(calc(.8 + var(--ks) * .2));
}

/* ---------------------------------------------------------------- mobil */
@media (max-width: 900px) {
  .duo, .duo.flip { grid-template-columns: 1fr; }
  .duo.flip > .copy { order: 0; }
  .okno { margin: 0 auto; }
  .kroky { grid-template-columns: 1fr; max-width: 30rem; }
}
@media (max-width: 640px) {
  .finale > .wrap { min-width: 0; }
  .fin-title { font-size: clamp(2.2rem, 12.2vw, 3.2rem); }
  .intro .ctas .btn, .btn-xl { width: 100%; }
  .fin-cta { align-items: stretch; }
}
