/* Five Fingers — лэндинг. Стиль игры «Чёрный оттиск» (Theme.swift): чёрный фон, кислотный #E6FF2E,
   бумага #F2EDE3, розовый #FF3D8B, голубой #19D3FF; заголовки — SF Expanded Black (на Apple — системный
   шрифт с font-stretch, иначе Archivo того же рисунка), мелкий текст — IBM Plex Mono.
   Разметку собирает _tools/fivefingers/page.py, поведение — landing.js. */

:root {
  --acid: #E6FF2E; --paper: #F2EDE3; --pink: #FF3D8B; --cyan: #19D3FF;
  --cell: #191919; --panel: #1C1C1C; --pip: #2B2B2B; --muted: #A6A6A6; --ink: #111;
  --text: #D9D9D9; --tile: #0E0E0E; --ring: #232323;
  --disp: -apple-system, BlinkMacSystemFont, "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --wrap: min(1200px, calc(100% - 48px));
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #000; -webkit-text-size-adjust: 100%; }
body { background: #000; color: #fff; font: 16px/1.55 var(--mono); -webkit-font-smoothing: antialiased; }
img, video, svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
.wrap { width: var(--wrap); margin: 0 auto; }

.disp, .h1, .h2 { font-family: var(--disp); font-weight: 900; font-stretch: 150%; letter-spacing: -0.005em; }
.h1, .h2 { text-transform: uppercase; text-wrap: balance; }
.h1 { font-size: clamp(28px, 3.6vw, 52px); line-height: 1.04; }
.h2 { font-size: clamp(25px, 2.9vw, 42px); line-height: 1.04; max-width: 22em; }
.lead { color: var(--text); font-size: 17px; line-height: 1.6; max-width: 40em; margin-top: 18px; text-wrap: pretty; }

/* ── шапка и подвал ── */
.top { position: relative; z-index: 2; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.top__brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 900 15px/1 var(--disp); font-stretch: 150%; letter-spacing: .01em; }
.top__brand img { width: 32px; height: 32px; border-radius: 8px; }
.top__nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.top__nav a { color: var(--muted); text-decoration: none; }
.top__nav a:hover { color: #fff; }
.foot { border-top: 1px solid var(--ring); margin-top: 0; }
.foot__row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 26px 0 40px; font-size: 13px; color: var(--muted); }
.foot__row a { color: var(--muted); text-decoration: none; }
.foot__row a:hover { color: #fff; }

/* ── первый экран: главный экран игры ── */
.hero { padding: 0; text-align: center; }
.menu { width: min(520px, 100%); margin: 0 auto; container-type: inline-size; }
.menu__five { width: clamp(170px, 40cqw, 210px); height: auto; margin: 0 auto; overflow: visible; }
.menu__title { font: italic 900 clamp(32px, 8.4cqw, 44px)/1 var(--disp); font-stretch: 150%; margin-top: 2px; }
.menu__say { color: var(--muted); font-size: 15px; line-height: 22px; height: 22px; margin-top: 6px; transition: opacity .2s; }
.menu__say.is-swap { opacity: 0; }

/* HUD как на экране игры: счёт слева, пять квадратиков пальцев справа, полоска времени */
.hud { display: none; text-align: left; margin-top: 14px; }
.is-playing .hud { display: block; }
.hud__row { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 6%; }
.hud__score small { display: block; color: var(--muted); font-size: 12px; line-height: 1; }
.hud__score b { display: block; font: 900 34px/1.05 var(--disp); font-stretch: 150%; margin-top: 4px; transition: color .25s, transform .25s; transform-origin: left bottom; }
.hud__score b.is-flash { color: var(--acid); transform: scale(1.25); transition: none; }
.hud__side { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; }
.hud__mute { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.hud__mute:hover { color: #fff; }
.hud__mute svg { width: 20px; height: 20px; }
.hud__mute .off { display: none; }
.hud__mute[aria-pressed="false"] .on { display: none; }
.hud__mute[aria-pressed="false"] .off { display: block; }
.pips { display: flex; gap: 5px; }
.pips i { width: 14px; height: 14px; background: var(--pip); }
.pips i.on { background: var(--acid); }
.timer { display: none; height: 10px; background: var(--pip); margin: 4px 6% 0; position: relative; overflow: hidden; }
.is-playing .timer { display: block; }
.is-playing .menu__say { text-align: left; padding: 0 6%; margin-top: 4px; }
.timer i { position: absolute; inset: 0 auto 0 0; width: 100%; background: var(--acid); }
.timer i.is-low { background: var(--pink); }

/* Поле: DemoBoardView — высота 0.56 ширины колонки, плоскость 0.88 × 1.42 высоты, наклон 0.285π,
   m34 = −1/620 точки (колонка меню 380 точек). В игре на сайте плоскость ложится ровно. */
.stage { position: relative; height: calc(100cqw * .56); perspective: calc(100cqw * 1.6316); margin-top: 2px; }
/* Поле ложится и встаёт плавно, но только после первой отрисовки: иначе на загрузке высота
   «доезжает» от нуля и поле на полсекунды наезжает на кнопку */
.is-ready .stage { transition: height .5s cubic-bezier(.3,.7,.2,1); }
.is-ready .plane { transition: transform .5s cubic-bezier(.3,.7,.2,1), top .5s cubic-bezier(.3,.7,.2,1), gap .5s; }
.plane { position: absolute; left: 6%; width: 88%; height: calc(100cqw * .7952); top: calc(100cqw * -.1176);
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr);
  transform: rotateX(51.3deg); transform-style: preserve-3d;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.is-playing .stage { height: calc(100cqw * .7952); }
.is-playing .plane { transform: none; top: 0; gap: 3px; touch-action: none; }

/* Клетка (GameCellView): пустая, задание «HOLD», палец с номером, палец, который надо поднять */
.c { position: relative; background: #000; box-shadow: inset 0 0 0 1.5px #4A4A4A; container-type: size; }
.is-playing .c { background: var(--cell); box-shadow: none; }
.c svg.fp { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--ink); }
.c .fp, .c .lbl, .c .n, .c .up, .c .k { display: none; }
.c .lbl { position: absolute; inset: 0; place-items: center; font: 900 clamp(11px, 17cqw, 20px)/1 var(--disp); font-stretch: 150%; color: #000; }
.c .n { position: absolute; left: 0; top: 0; width: clamp(18px, 26cqw, 30px); height: clamp(18px, 26cqw, 30px); background: #000; color: #fff;
  place-items: center; font: 900 clamp(10px, 14cqw, 16px)/1 var(--disp); font-stretch: 150%; }
.c .up { position: absolute; right: 6%; top: 6%; width: clamp(20px, 31cqw, 36px); height: clamp(20px, 31cqw, 36px); background: var(--pink); place-items: center; }
.c .up svg { width: 56%; height: 56%; }
.c .k { position: absolute; right: 7%; bottom: 5%; font: 700 clamp(10px, 11cqw, 13px)/1 var(--mono); color: #6b6b6b; }
.has-keys .is-playing .c .k { display: block; }
.c.is-task { background: var(--acid); box-shadow: none; }
.c.is-task .fp { display: block; color: rgba(0, 0, 0, .2); }
.c.is-task .lbl { display: grid; }
.c.is-task .k { color: rgba(0, 0, 0, .55); }
.c.is-held { background: var(--paper); box-shadow: none; }
.c.is-held .fp, .c.is-lift .n, .c.is-held .n { display: block; }
.c.is-held .n, .c.is-lift .n { display: grid; }
.c.is-held .k, .c.is-lift .k { color: #8b877e; }
.c.is-lift { z-index: 2; background: var(--paper); box-shadow: 0 0 22px 4px rgba(255, 61, 139, .9); }
/* Штриховка FingerprintRenderer.hatch: полосы 9 точек через 18 под 45° в клетке шириной 104 точки;
   кайма 7 точек — поверх штриховки, номер и стрелка — поверх каймы */
.c.is-lift::before, .c.is-lift::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.c.is-lift::before { background: repeating-linear-gradient(45deg, #000 0 8.65cqw, var(--paper) 8.65cqw 17.3cqw); }
.c.is-lift::after { box-shadow: inset 0 0 0 var(--edge, 7px) var(--glow, var(--pink)); }
.c .n, .c .up, .c .k { z-index: 1; }
.c.is-lift .up { display: grid; }
@media (prefers-reduced-motion: no-preference) {
  .c.is-task, .c.is-restore { animation: ff-pulse .45s ease-in-out infinite alternate; }
  .c.is-restore { animation-name: ff-restore; }
  .c.is-lift { animation: ff-glow .35s ease-in-out infinite alternate; }
}
@keyframes ff-pulse { to { opacity: .8; } }
@keyframes ff-restore { to { opacity: .4; } }
@keyframes ff-glow {
  from { box-shadow: 0 0 12px 2px rgba(255, 61, 139, .6); }
  to { box-shadow: 0 0 34px 6px rgba(255, 61, 139, 1); }
}

/* Кончик пальца в сценке меню: белый круг с кислотной каймой */
.tip { position: absolute; width: 62cqw; height: 62cqw; left: 19cqw; top: calc(50cqh - 31cqw); z-index: 3;
  border-radius: 50%; background: rgba(255, 255, 255, .92); box-shadow: 0 0 0 3px var(--acid); pointer-events: none;
  opacity: 0; transform: scale(1.8); }
.tip.is-down { animation: ff-down .5s forwards; }
.tip.is-up { animation: ff-up .28s ease-out forwards; }
@keyframes ff-down { 0% { opacity: 0; transform: scale(1.8); } 40% { opacity: 1; transform: scale(1); } 60% { opacity: 1; transform: scale(1); } 100% { opacity: .72; transform: scale(.72); } }
@keyframes ff-up { from { opacity: .72; transform: scale(.72); } to { opacity: 0; transform: scale(2); } }

/* Отсчёт 3-2-1 и карточка конца — поверх поля */
.ready { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font: 900 clamp(70px, 24cqw, 120px)/1 var(--disp); font-stretch: 150%; color: var(--acid); }
.over { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .8); z-index: 3; }
.over[hidden], .ready[hidden] { display: none; }
.over__card { width: min(420px, 86%); background: var(--acid); color: #000; padding: 22px 20px 20px; text-align: center; }
.over__card h3 { font: 900 22px/1.1 var(--disp); font-stretch: 150%; }
.over__card p { font: 700 13px/1.4 var(--mono); margin-top: 10px; }
.over__card b { display: block; font: 900 40px/1 var(--disp); font-stretch: 150%; margin-top: 12px; }
.over__card .btn { margin-top: 10px; height: 50px; width: 100%; font: 900 15px/1 var(--disp); font-stretch: 150%; }
.over__card .btn--again { background: #fff; color: #000; margin-top: 16px; }
.over__card .btn--menu { background: #000; color: #fff; }

/* Кнопки меню (Theme.styleMenuButton): высота 56, скругление 10 */
.menu__go { margin: 34px auto 0; width: min(380px, 100%); height: 56px; border-radius: 10px; background: var(--acid); color: #000;
  display: flex; align-items: center; justify-content: center; gap: 14px; font: 900 19px/1 var(--disp); font-stretch: 150%; }
.menu__go svg { width: 18px; height: 18px; }
.menu__go:hover { filter: brightness(1.06); }
.is-playing .menu__go { background: var(--panel); color: #fff; }
.is-playing .menu__go svg { display: none; }
.menu__how { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 12px; min-height: 20px; }
.menu__how .for-touch { display: none; }
.is-touch .menu__how .for-touch { display: inline; }
.is-touch .menu__how .for-keys { display: none; }

.hero__text { margin-top: clamp(40px, 4.4vw, 56px); }
.hero__text .h1 { max-width: 22em; margin: 0 auto; }
.hero__text .lead { margin: 18px auto 0; max-width: 37em; }
.badges { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 26px; }
.badges .soon { color: var(--muted); font-size: 14px; }
.hero .meta { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ── разделы ── */
.sec { padding-top: clamp(96px, 11vw, 150px); }
.sec__head .lead { margin-top: 20px; }
.bento { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; margin-top: 44px; }
.tile { background: var(--tile); box-shadow: inset 0 0 0 1px var(--ring); border-radius: 24px; padding: 32px; min-width: 0;
  display: flex; flex-direction: column; justify-content: center; }
.tile figcaption, .tile .cap { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 18px; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-3 { grid-column: span 3; }
.span-12 { grid-column: span 12; }

/* Рамки устройств: iPhone 17 Pro Max (экран 1320 × 2868) и iPad Pro 13″ (2064 × 2752) */
.phone { position: relative; width: min(100%, 290px); margin: 0 auto; aspect-ratio: 1320 / 2868; padding: 2.6%;
  background: #050505; border-radius: 15.5% / 7.1%; box-shadow: inset 0 0 0 1.5px #3a3a3a, 0 0 0 1px #000; }
.phone__screen { position: relative; width: 100%; height: 100%; border-radius: 13% / 6%; overflow: hidden; background: #000; }
.phone__screen img, .phone__screen video { width: 100%; height: 100%; object-fit: cover; }
.pad { position: relative; width: min(100%, 480px); margin: 0 auto; aspect-ratio: 2064 / 2752; padding: 2.4%;
  background: #050505; border-radius: 5.4% / 4.1%; box-shadow: inset 0 0 0 1.5px #3a3a3a; }
.pad .phone__screen { border-radius: 3.2% / 2.4%; }

/* Разбор экрана: рамка фокуса по рамкам, которые записала сама игра */
.screen { display: grid; grid-template-columns: minmax(0, 290px) minmax(0, 1fr); gap: 40px; align-items: center; }
.focus { position: absolute; border: 2.5px solid var(--acid); border-radius: 6px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); transition: left .35s, top .35s, width .35s, height .35s; }
.parts { list-style: none; counter-reset: part; }
.parts li + li { margin-top: 2px; }
.parts button { width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 6px 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--text); font-size: 14px; line-height: 1.45; }
.parts button b { font: 900 13px/1.5 var(--disp); font-stretch: 150%; color: #fff; text-transform: uppercase; letter-spacing: .02em; }
.parts button::before { counter-increment: part; content: counter(part); grid-row: span 2; width: 24px; height: 24px; display: grid; place-items: center;
  background: var(--pip); color: #fff; font: 900 12px/1 var(--disp); font-stretch: 150%; margin-top: 1px; }
.parts button span { grid-column: 2; color: var(--muted); }
.parts button:hover { background: #151515; }
.parts button[aria-pressed="true"] { background: #171717; }
.parts button[aria-pressed="true"]::before { background: var(--acid); color: #000; }

/* Три клетки, нарисованные по правилам игры */
.cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 520px; }
.cells .c { aspect-ratio: 104 / 176; box-shadow: none; }
.cells p { color: var(--muted); font-size: 13px; line-height: 1.45; margin-top: 12px; }
.cells p b { color: #fff; font: 900 13px/1.4 var(--disp); font-stretch: 150%; display: block; text-transform: uppercase; }
.cells .c.is-lift { animation: none; }
.cells .c.is-lift.is-duo { --glow: var(--acid); box-shadow: 0 0 22px 4px rgba(230, 255, 46, .7); }
.cells .c.is-lift.is-duo .up { background: var(--acid); }

/* Темп: секунды на ход по номеру хода, квадратиками, как пальцы в HUD */
.pace__cols { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; align-items: end; }
.pace__col { display: flex; flex-direction: column-reverse; gap: 3px; position: relative; padding-bottom: 26px; }
.pace__col i { display: block; aspect-ratio: 1; background: var(--acid); }
.pace__col i.calm { background: none; box-shadow: inset 0 0 0 1.5px #5a5a5a; }
.pace__col span { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 11px; line-height: 20px; }
.pace__col.is-ten span { color: var(--acid); }
.pace__col.is-ten::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: 22px; height: 2px; background: var(--acid); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.legend i { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; background: var(--acid); }
.legend i.calm { background: none; box-shadow: inset 0 0 0 1.5px #5a5a5a; }
.legend__ten { color: var(--acid); }

/* Звуки игры */
.sounds { list-style: none; display: grid; gap: 14px; }
.sounds li { display: grid; grid-template-columns: 96px 1fr; gap: 14px; color: var(--text); font-size: 14px; line-height: 1.45; }
.sounds b { color: var(--acid); font: 900 12px/1.5 var(--disp); font-stretch: 150%; text-transform: uppercase; letter-spacing: .03em; }

/* Поддержка */
.qa { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.qa h3 { font: 900 15px/1.3 var(--disp); font-stretch: 150%; text-transform: uppercase; }
.qa p { color: var(--text); font-size: 14px; line-height: 1.55; margin-top: 8px; }
.mail { display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px; border-radius: 10px; background: var(--acid); color: #000;
  font: 900 17px/1 var(--disp); font-stretch: 150%; text-decoration: none; }
.mail:hover { filter: brightness(1.06); }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 26px; }
.contact a.more { color: var(--muted); font-size: 14px; }
.contact a.more:hover { color: #fff; }

/* Конец */
.cta { display: grid; grid-template-columns: 120px 1fr; gap: 32px; align-items: start; }
.cta__icon { width: 120px; height: 120px; border-radius: 27px; box-shadow: 0 0 0 1px #2a2a2a; }
.facts { list-style: none; display: grid; gap: 12px; color: var(--text); font-size: 15px; line-height: 1.55; max-width: 44em; }
.facts li { padding-left: 22px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 0; top: .6em; width: 10px; height: 10px; background: var(--acid); }
.links { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; font-size: 14px; }
.links a { color: var(--muted); }
.links a:hover { color: #fff; }
.sec--end .badges { justify-content: flex-start; margin-top: 28px; }
.sec--end { padding-bottom: 72px; }
.made { color: #fff; }

/* ── ширины ── */
@media (max-width: 1000px) {
  .span-4 { grid-column: span 5; } .span-8 { grid-column: span 7; }
  .span-6 { grid-column: span 12; } .span-3 { grid-column: span 6; }
  .screen { grid-template-columns: 1fr; gap: 24px; }
  .screen .phone { width: min(100%, 250px); }
}
@media (max-width: 700px) {
  :root { --wrap: calc(100% - 40px); }
  .c { --edge: 5px; }
  .tile { padding: 24px 20px; border-radius: 20px; }
  .bento { gap: 14px; margin-top: 32px; }
  .span-3, .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .screen { grid-template-columns: 1fr; }
  .screen .phone { width: min(100%, 260px); }
  .qa { grid-template-columns: 1fr; }
  .cta { grid-template-columns: 1fr; gap: 22px; }
  .cta__icon { width: 96px; height: 96px; border-radius: 22px; }
  .top__nav { gap: 16px; font-size: 13px; }
  .top__brand span { display: none; }
  .lead { font-size: 15px; }
  .pace__cols { gap: 2px; } .pace__col { gap: 2px; }
  .sounds li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-ready .stage, .is-ready .plane, .focus, .menu__say { transition: none; }
}
