/* 1Day landing — one stylesheet, three layouts.
   html.mode-desk  : desktop / landscape tablet ≥ 1024 px wide — left panel + horizontal panorama driven by wheel/keys
   html.mode-touch : touch layouts — native horizontal scroll-snap. Adds .is-phone below 744 px.
   html.no-js      : plain document (all chapters expanded, panorama scrolls) — also what crawlers see. */

:root {
  --bg: #0b0a18;
  --fg: #f2f3f4;
  --muted: rgba(242, 243, 244, .62);
  --faint: rgba(242, 243, 244, .42);
  --line: rgba(255, 255, 255, .08);
  --acc: #c2acff;
  --panel: calc(100vh * 375 / 812);   /* left column = exactly one app screen wide */
  --pad: calc(var(--panel) * .077);
  --head: Manrope, Inter, -apple-system, system-ui, sans-serif;
  --ease: cubic-bezier(.65, .05, .36, 1);
  --dur: 1.4s;
  --pop: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.55 Inter, -apple-system, system-ui, sans-serif; background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
button { font: inherit; color: inherit; }
img { display: block; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--bg); }
.skip:focus { top: 16px; }

@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- shared pieces ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 40px; }
.logo { position: relative; display: block; width: 85px; height: 36px; color: var(--fg); }
.logo svg { position: absolute; left: 0; top: 5px; }
.logo img { position: absolute; left: 73px; top: 0; width: 12px; height: 12px; border-radius: 50%; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.sound-btn { height: 36px; padding: 0 11px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: transparent;
  font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 7px; cursor: pointer; }
.sound-btn { color: #fff; transition: color .3s ease, border-color .3s ease; }
.sound-btn[aria-pressed="true"] { color: #8ff0c8; border-color: rgba(143, 240, 200, .5); }
.sound-btn .i-on { display: none; }
.sound-btn[aria-pressed="true"] .i-on { display: block; }
.sound-btn[aria-pressed="true"] .i-off { display: none; }
.store img { height: 36px; width: auto; }
.store-lg img { height: 56px; }

.chapters { list-style: none; margin: 0; padding: 0; }
.ch { border-top: 1px solid var(--line); }
.ch-tab { width: 100%; height: 30px; border: 0; padding: 0; background: none; cursor: pointer; display: flex; align-items: center; gap: 16px;
  font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; text-align: left; color: rgba(242, 243, 244, .38); transition: color .6s ease; }
.ch-num { width: 20px; flex: none; }
.ch.is-past .ch-tab { color: rgba(242, 243, 244, .7); }
.ch.is-active .ch-tab { color: var(--acc); }
.ch-body { padding: 6px 0 20px 32px; }
.ch-body h2 { white-space: pre-line; margin: 0 0 12px; font: 500 32px/1.08 var(--head); letter-spacing: -.03em; color: #fff; }
html[lang="ru"] .ch-body h2 { font-size: 30px; }
.ch-body p { margin: 0; color: var(--muted); }
.made-label { margin-top: 32px !important; font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; color: rgba(242, 243, 244, .5) !important; }
.uses { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.uses li { height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); font-size: 12px; display: flex; align-items: center; }
.ch.is-open .uses li { animation: popIn .5s ease var(--d, 0ms) both; }

.bottom .scene { margin: 0; font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; color: rgba(242, 243, 244, .5); min-height: 16px; }
.bottom .free { margin: 0; font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; color: rgba(242, 243, 244, .7); }
.legal { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; line-height: 16px; color: var(--faint); }
.legal span, .legal a { white-space: nowrap; }
.legal-links { display: flex; gap: 12px; margin-left: auto; }

.stage { position: relative; background: var(--bg); }
.pano { height: 100%; width: auto; max-width: none; }
.mosaic { overflow: hidden; }
.mosaic .col { position: absolute; top: 0; height: 100%; }
.mosaic .strip { position: absolute; left: 0; right: 0; will-change: transform; }
.mosaic .card { position: relative; overflow: hidden; background: #1a1830; }
.mosaic .card img { width: 100%; height: 100%; object-fit: cover; }
.mosaic .card.gap { background: none; }
.mosaic.on .card { animation: popIn .65s var(--pop) var(--d, 0ms) both; }
.mosaic:not(.on) .card { opacity: 0; }
/* each column drifts slowly up or down, forever; the strip holds its cards twice so the loop is seamless */
.mosaic.on .strip.up { animation: driftUp var(--dur, 80s) linear infinite; }
.mosaic.on .strip.down { animation: driftDown var(--dur, 80s) linear infinite; }
@keyframes driftUp { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, calc(-1 * var(--dist)), 0); } }
@keyframes driftDown { from { transform: translate3d(0, calc(-1 * var(--dist)), 0); } to { transform: translate3d(0, 0, 0); } }
@media (prefers-reduced-motion: reduce) { .mosaic.on .strip { animation: none !important; } }

/* ---------- no-JS / crawler baseline ---------- */
html.no-js body { max-width: 760px; margin: 0 auto; padding: 32px 24px; }
html.no-js .chapters { margin: 32px 0; }
html.no-js .ch-tab { pointer-events: none; }
html.no-js .stage { overflow-x: auto; height: 60vh; }
html.no-js .track { height: 100%; }
html.no-js .focus, html.no-js .dim, html.no-js .mosaic, html.no-js .swipe-hint, html.no-js .scene, html.no-js .store-lg { display: none; }
html.no-js .bottom { margin-top: 32px; display: grid; gap: 12px; }

/* ---------- desktop ---------- */
html.mode-desk, html.mode-desk body { height: 100%; overflow: hidden; overscroll-behavior: none; }
html.mode-desk .top { position: fixed; z-index: 3; left: 0; top: 36px; width: var(--panel); padding: 0 var(--pad); }
html.mode-desk .story { position: fixed; z-index: 2; left: 0; top: 108px; width: var(--panel); padding: 0 var(--pad); }
html.mode-desk .ch-body { display: none; }
html.mode-desk .ch.is-open .ch-body { display: block; animation: fadeIn .5s ease both; }
html.mode-desk .bottom { position: fixed; z-index: 2; left: 0; bottom: 32px; width: var(--panel); padding: 0 var(--pad); }
html.mode-desk .bottom .store-lg, html.mode-desk .bottom .free { display: none; }
html.mode-desk .legal { margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); }
html.mode-desk .stage { position: fixed; left: var(--panel); top: 0; right: 0; bottom: 0; overflow: hidden; }
html.mode-desk .track { position: absolute; left: 0; top: 0; height: 100%; transition: transform var(--dur) var(--ease); will-change: transform; }
html.mode-desk .pano { position: absolute; left: 0; top: 0; }
html.mode-desk .mosaic { position: absolute; top: 0; height: 100%; }
html.mode-desk .dim { position: absolute; top: 0; bottom: 0; background: rgba(8, 6, 28, .42); transition: width var(--dur) var(--ease), left var(--dur) var(--ease); }
html.mode-desk .dim-l { left: 0; }
html.mode-desk .dim-r { right: 0; }
html.mode-desk .focus { position: absolute; top: 0; bottom: 0; transition: left var(--dur) var(--ease); }
html.mode-desk .swipe-hint { display: none; }
html.mode-desk.is-final .focus { display: none; }
@media (max-height: 780px) {
  html.mode-desk .top { top: 24px; }
  html.mode-desk .story { top: 88px; }
  html.mode-desk .bottom { bottom: 24px; }
  html.mode-desk .ch-body h2 { font-size: 26px; }
  html.mode-desk .ch-body { padding-bottom: 14px; }
  html.mode-desk .ch-tab { height: 27px; }
}
html.mode-desk .ch-body h2 { font-size: clamp(22px, calc(var(--panel) * .065), 36px); }
html.mode-desk .ch-body { padding-left: 0; }
html.mode-desk .ch-num { width: 22px; }
html.mode-desk .ch-tab { gap: 10px; }

/* app UI drawn on the focused screen — designed at 416 × 900, scaled by --k */
.ui { position: absolute; left: 0; top: 0; width: 416px; height: 900px; transform: scale(var(--k, 1)); transform-origin: 0 0; color: #fff; }
.u-sw { position: absolute; right: 22px; top: 59px; }
.ov { display: none; }
.focus[data-ov="0"] .ov-0, .focus[data-ov="1"] .ov-1, .focus[data-ov="2"] .ov-2, .focus[data-ov="3"] .ov-3,
.focus[data-ov="5"] .ov-5, .focus[data-ov="6"] .ov-6, .focus[data-ov="7"] .ov-7, .focus[data-ov="8"] .ov-8 { display: flex; animation: popIn .45s var(--pop) both; }
.focus[data-ov="0"] .play, .focus[data-ov="1"] .play { animation: none; }
.bed { position: absolute; inset: 0; background: rgba(4, 3, 14, .38); animation-duration: .9s !important; }
.play { position: absolute; left: 208px; top: 330px; width: 0; height: 0; }
.play i { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .15); }
.play i:nth-child(1) { left: -160px; top: -160px; width: 320px; height: 320px; }
.play i:nth-child(2) { left: -104px; top: -104px; width: 208px; height: 208px; }
.play i:nth-child(3) { left: -63px; top: -63px; width: 126px; height: 126px; }
.play-btn { position: absolute; left: -33px; top: -33px; width: 66px; height: 66px; border: 0; padding: 0; background: none; cursor: pointer; }
.play-btn svg { display: block; }
.play-btn .i-pause, .playing .play-btn .i-play { display: none; }
.playing .play-btn .i-pause { display: block; }
html.playing .play i { animation: breathe 4s ease-in-out infinite; }
html.playing .play i:nth-child(2) { animation-delay: .4s; }
html.playing .play i:nth-child(3) { animation-delay: .8s; }
@keyframes breathe { 50% { transform: scale(1.06); } }
.tap { position: absolute; left: 0; right: 0; top: 510px; justify-content: center; font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.pill { position: absolute; left: 50%; top: 300px; transform: translateX(-50%); white-space: nowrap; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 13px;
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); color: #292929; font-size: 15px; }
.focus[data-ov] .pill { animation-name: pillIn; }
@keyframes pillIn { from { opacity: 0; transform: translate(-50%, 12px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
.timer { position: absolute; left: 123px; top: 100px; width: 240px; padding: 13px; border-radius: 13px; flex-direction: column; gap: 11px;
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); }
.timer-q { font-size: 15px; color: #292929; }
.timer button { height: 44px; border: 0; border-radius: 9px; padding: 0 13px; text-align: left; font-size: 15px; color: #292929; background: #fff; cursor: pointer; }
.timer button[aria-pressed="true"] { background: #b6ff8a; }
.np { position: absolute; left: 18px; right: 18px; top: 280px; padding: 14px; border-radius: 13px; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); color: #292929; }
.np-art { width: 50px; height: 50px; border-radius: 9px; background: #f738a0; flex: none; }
.np-txt { flex: 1; display: flex; flex-direction: column; }
.np-txt b { font-size: 15px; font-weight: 500; }
.np-txt small { font-size: 13px; opacity: .7; }
.countdown { position: absolute; right: 18px; top: 100px; padding: 12px 16px; border-radius: 13px; background: rgba(255, 255, 255, .6);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); color: #292929; font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- touch (tablet portrait, phones) ---------- */
html.mode-touch, html.mode-touch body { height: 100%; overflow: hidden; }
html.mode-touch body { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; height: 100dvh;
  padding: max(20px, env(safe-area-inset-top)) 0 max(20px, env(safe-area-inset-bottom)); }
html.mode-touch .top { padding: 0 40px; margin-bottom: 20px; }
html.mode-touch main { display: contents; }
html.mode-touch .stage { grid-row: 2; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
html.mode-touch .stage::-webkit-scrollbar { display: none; }
html.mode-touch .track { position: relative; height: 100%; display: flex; }
html.mode-touch .pano { position: absolute; left: 0; top: 0; }
html.mode-touch .snap { flex: none; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; }
html.mode-touch .snap:last-child { scroll-snap-align: end; }
html.mode-touch .mosaic { position: absolute; top: 0; height: 100%; }
html.mode-touch .focus, html.mode-touch .dim { display: none; }
html.mode-touch .story { grid-row: 3; padding: 28px 40px 0; min-height: 220px; }
html.mode-touch .ch { display: none; border: 0; }
html.mode-touch .ch.is-open { display: block; animation: fadeIn .4s ease both; }
html.mode-touch .ch-tab { pointer-events: none; height: auto; color: var(--acc) !important; }
html.mode-touch .ch-num { display: none; }
html.mode-touch .ch-body { padding: 10px 0 0; }
html.mode-touch .ch-body h2 { font-size: 34px; max-width: 600px; }
html.mode-touch .ch-body p { font-size: 15px; max-width: 600px; }
html.mode-touch .bottom { grid-row: 4; padding: 20px 40px 0; }
html.mode-touch .bottom .scene, html.mode-touch .bottom .store-lg, html.mode-touch .bottom .free { display: none; }
html.mode-touch .legal { padding-top: 14px; border-top: 1px solid var(--line); }
html.mode-touch .swipe-hint { position: absolute; display: none; }

/* phones: full-bleed panorama, copy on top, big App Store badge at the bottom */
html.is-phone body { display: block; padding: 0; }
html.is-phone .stage { position: fixed; inset: 0; }
html.is-phone .top { position: fixed; z-index: 3; left: 0; right: 0; top: 0; padding: max(16px, env(safe-area-inset-top)) 24px 0; margin: 0; }
html.is-phone .store-sm { display: none; }
html.is-phone .story { position: fixed; z-index: 2; left: 0; right: 0; top: calc(max(16px, env(safe-area-inset-top)) + 56px); padding: 0 24px; min-height: 0; pointer-events: none; }
html.is-phone .ch-body h2 { font-size: 30px; line-height: 1.1; }
html.is-phone .ch-body p { color: rgba(255, 255, 255, .88); }
html.is-phone .ch-tab { text-shadow: 0 1px 8px rgba(11, 10, 24, .5); }
html.is-phone .story .uses { pointer-events: auto; }
html.is-phone body::before, html.is-phone body::after { content: ''; position: fixed; z-index: 1; left: 0; right: 0; pointer-events: none; }
html.is-phone body::before { top: 0; height: 400px; background: linear-gradient(rgba(11, 10, 24, .7), rgba(11, 10, 24, 0)); }
html.is-phone body::after { bottom: 0; height: 260px; background: linear-gradient(rgba(11, 10, 24, 0), rgba(11, 10, 24, .85)); }
html.is-phone .bottom { position: fixed; z-index: 2; left: 0; right: 0; bottom: 0; padding: 0 24px max(24px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 12px; }
html.is-phone .bottom .store-lg, html.is-phone .bottom .free { display: block; }
html.is-phone .legal { border: 0; padding: 0; justify-content: center; color: rgba(242, 243, 244, .5); }
html.is-phone .legal-links { margin-left: 0; }
html.is-phone .swipe-hint { display: block; position: fixed; z-index: 2; left: 24px; bottom: 170px; font: 500 13px/1.3 var(--head); letter-spacing: 0; font-variant-numeric: tabular-nums; opacity: .8; transition: opacity .4s; }
html.is-phone.is-final .mosaic { filter: brightness(.32) saturate(.8); transition: filter .6s ease; }
html.is-phone.moved .swipe-hint { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
html.mode-desk .snap { display: none; }
