/* igra — «геймдизайн-документ»: бумага в точку, стикеры, карандашные схемы, маркер.
   Шрифты: Geologica (текст) + Caveat (пометки от руки). Не пиксели (это games). */
:root {
  --paper: #fbf8f0;
  --paper-2: #f4efe2;
  --dot: #cfc5b0;
  --ink: #1d2433;
  --muted: #5d6474;
  --pencil: #4a4f5c;
  --pen: #2747c9;          /* синяя ручка: акцент, белый текст на нём допустим */
  --pen-d: #1d36a0;
  --marker: #ffe25a;       /* маркер: только под тёмным текстом */
  --sticky-y: #fff1a8;
  --sticky-p: #ffd3df;
  --sticky-m: #cdf0de;
  --sticky-b: #d8e6fb;
  --line: #e2dac8;
  --hand: "Caveat", "Segoe Print", cursive;
  --sans: "Geologica", "Segoe UI", system-ui, sans-serif;

  --lf-fg: var(--ink);
  --lf-muted: var(--muted);
  --lf-field: #fff;
  --lf-field-fg: var(--ink);
  --lf-border: #cfc6b2;
  --lf-accent: var(--pen);
  --lf-accent-fg: #fff;
  --lf-chip: #fff;
  --lf-radius: 10px;
  --cta-glow: var(--pen);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0; font: 400 17px/1.55 var(--sans); color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(circle, var(--dot) 1.15px, transparent 1.5px);
  background-size: 24px 24px;
  background-position: 12px 12px;
  overflow-x: hidden;
}
a { color: var(--pen); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.02em; }
.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 32px; }
.hand { font-family: var(--hand); font-weight: 700; }
.mk { background: linear-gradient(transparent 52%, var(--marker) 52%, var(--marker) 92%, transparent 92%); padding: 0 .08em; border-radius: 2px; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 1.5px dashed var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 18px; line-height: 1.05; }
.logo svg { width: 34px; height: 34px; }
.logo small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.role { margin-left: auto; display: flex; padding: 3px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; }
.role button { font: 600 14px var(--sans); color: var(--ink); background: none; border: 0; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.role button.is-active { background: var(--ink); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 26px; font: 700 17px var(--sans); color: #fff; background: var(--pen); border: 2px solid var(--ink); border-radius: 12px; text-decoration: none; box-shadow: 3px 3px 0 var(--ink); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 15px; box-shadow: 2px 2px 0 var(--ink); }
.micro { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* ── первый экран ── */
.hero { padding: 20px 0 28px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; position: relative; z-index: 1; }
.page-no { margin: 0 0 6px; font-size: 24px; color: var(--pen); transform: rotate(-1.5deg); transform-origin: left; }
.hero h1 { font-size: clamp(36px, 3.6vw, 64px); line-height: 1.04; max-width: 15ch; }
.hero-sub { margin: 18px 0 0; font-size: clamp(18px, 1.35vw, 23px); font-weight: 500; line-height: 1.35; max-width: 30ch; }
.qn { font-weight: 800; }
html:not(.igra-ready) .qn { visibility: hidden; }

.sketch { position: relative; margin: 26px 0 0; max-width: 720px; }
.level { display: block; width: 100%; height: auto; overflow: visible; }
.level .pen { fill: none; stroke: var(--pencil); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.level .pen.fill, .level .fill { fill: var(--pencil); stroke: none; }
.level .hatch path { fill: none; stroke: #9a9484; stroke-width: 1.3; stroke-linecap: round; }
.level .dash { fill: none; stroke: var(--pen); stroke-width: 2; stroke-dasharray: 6 7; stroke-linecap: round; }
.level .ink { fill: none; stroke: var(--pen); stroke-width: 2; stroke-linecap: round; }
.level .coin circle { fill: var(--marker); stroke: var(--ink); stroke-width: 2; }
.level .flag { fill: #ff8fab; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.level .enemy path { fill: #ffd3df; }
.level .hero-fig rect, .level .hero-fig circle { fill: #d8e6fb; }
.level text { font: 700 25px var(--hand); fill: var(--pen); }
.sticky { position: absolute; margin: 0; padding: 12px 16px 14px; font: 600 21px/1.15 var(--hand); color: var(--ink); box-shadow: 0 6px 14px rgba(40, 32, 10, .14); }
.sticky b { display: block; font: 700 14px var(--sans); letter-spacing: .02em; text-transform: none; margin-bottom: 2px; }
.sticky-y { background: var(--sticky-y); }
.sticky-p { background: var(--sticky-p); }
.sticky-m { background: var(--sticky-m); }
.sticky-b { background: var(--sticky-b); }
.sketch .sticky-y { left: 170px; top: -6px; width: 196px; transform: rotate(2.5deg); }
.sketch .sticky-p { left: 0; top: 34px; font-size: 22px; transform: rotate(-4deg); padding: 6px 12px; }

/* анимация «рисуем карандашом» */
.motion .level .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.1s ease forwards; }
.motion .level .draw-fade { opacity: 0; animation: fade .5s ease forwards; }
.motion .level .draw:nth-of-type(2) { animation-delay: .25s; }
.motion .level .draw:nth-of-type(3) { animation-delay: .5s; }
.motion .level .draw:nth-of-type(4) { animation-delay: .7s; }
.motion .level .draw:nth-of-type(5) { animation-delay: .9s; }
.motion .level .draw:nth-of-type(6), .motion .level .draw:nth-of-type(7) { animation-delay: 1.2s; animation-duration: .8s; }
.motion .level .draw:nth-of-type(8) { animation-delay: 1.6s; }
.motion .level .draw-fade { animation-delay: 1.3s; }
.motion .level .note-txt { animation-delay: 1.9s; }
.motion .level .coin circle { animation: bob 2.4s ease-in-out 2.4s infinite; transform-box: fill-box; transform-origin: center; }
.motion .level .enemy { animation: fade .5s ease 1.3s forwards, patrol 3.2s ease-in-out 2s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes patrol { 0%, 100% { transform: translateX(-26px); } 50% { transform: translateX(26px); } }
/* дуга прыжка: пунктир «бежит» */
.motion .level .dash { animation: fade .5s ease 1.2s forwards, dash-run 1.2s linear 1.7s infinite; }
@keyframes dash-run { to { stroke-dashoffset: -13; } }

/* лист с квизом */
.hero-quiz { position: relative; }
.sheet { position: relative; background: #fff; border: 1.5px solid var(--ink); border-radius: 6px 6px 6px 22px; padding: 26px 28px 26px; box-shadow: 6px 7px 0 rgba(29, 36, 51, .9); transform: rotate(-.5deg); }
.tape { position: absolute; top: -14px; left: 50%; width: 132px; height: 30px; margin-left: -66px; background: repeating-linear-gradient(-45deg, rgba(143, 220, 188, .78) 0 9px, rgba(205, 240, 222, .78) 9px 18px); transform: rotate(-3deg); box-shadow: 0 1px 2px rgba(0,0,0,.08); z-index: 2; }
.hero-quiz .micro { text-align: center; margin-top: 16px; }

/* квиз: вид */
.qz {
  --qz-bg: #fff; --qz-fg: var(--ink); --qz-muted: var(--muted); --qz-border: #cfc6b2;
  --qz-accent: var(--pen); --qz-accent-fg: #fff; --qz-opt-on-bg: #fff6c4; --qz-radius: 10px;
  --qz-q-size: clamp(22px, 1.7vw, 30px);
  font-family: var(--sans);
}
.qz-count { font: 700 20px var(--hand); color: var(--pen); }
.qz-progress { height: 8px; background: repeating-linear-gradient(90deg, #ece6d6 0 10px, #f6f2e8 10px 14px); }
.qz-q { letter-spacing: -.015em; }
.qz-opt { border-color: #cfc6b2; box-shadow: 2px 2px 0 #e6dfcd; }
.qz-opt:hover { border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.qz-opt.is-on { border-color: var(--ink); background: var(--qz-opt-on-bg); box-shadow: 3px 3px 0 var(--ink); }
.qz-opt .qz-ico { color: var(--pen); width: 30px; height: 30px; }
.qz-opts--many .qz-opt { min-height: 96px; }
.qz-opts--many .qz-opt:not(:has(.qz-ico)) { min-height: 58px; align-items: center; text-align: center; }
.qz-next { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.qz-next:disabled { box-shadow: none; }
.qz-submit { border: 2px solid var(--ink) !important; box-shadow: 3px 3px 0 var(--ink); }
.qz .lf-day.is-active, .qz .lf-time.is-active { border-color: var(--ink); }
.qz-done-ico { border: 2px solid var(--ink); }

/* итог квиза */
.ig-kicker { margin: 0; font: 700 22px var(--hand); color: var(--pen); }
.ig-title { font-size: clamp(24px, 1.9vw, 32px); }
.ig-path { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; }
.ig-path li { position: relative; display: flex; gap: 8px; padding: 10px 10px 12px; border: 1.5px dashed #b9b09d; border-radius: 10px; background: #fffdf6; min-width: 0; }
.ig-path li.is-goal { border: 1.5px solid var(--ink); background: #fff6c4; box-shadow: 3px 3px 0 var(--ink); }
.ig-n { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 50%; font: 700 18px/1 var(--hand); background: #fff; }
.ig-path b { display: block; font-size: 15.5px; line-height: 1.2; }
.ig-path div > span { display: block; font-size: 13px; line-height: 1.3; color: var(--ink); margin-top: 2px; }
.ig-path small { display: block; font-size: 11.5px; line-height: 1.3; color: var(--muted); margin-top: 4px; }
.ig-next { margin: 10px 0 0; font: 700 19px/1.2 var(--hand); color: var(--pen); }
.ig-notes { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ig-notes li { position: relative; padding-left: 18px; font-size: 14px; line-height: 1.4; }
.ig-notes li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--pen); }
.ig-trial { margin: 10px 0 0; padding: 8px 12px; font-size: 14.5px; font-weight: 600; background: var(--sticky-m); border-radius: 8px; }
.qz .qz-gift-line { margin-top: 10px; }
.qz .qz-next--main { margin-top: 12px; }

/* ── секции ── */
.sec { padding: 96px 0; position: relative; }
.sec-alt { background: color-mix(in srgb, var(--paper-2) 70%, transparent); border-top: 1.5px dashed var(--line); border-bottom: 1.5px dashed var(--line); }
.sec-k { margin: 0 0 8px; font-size: 26px; color: var(--pen); transform: rotate(-1deg); transform-origin: left; }
.sec h2 { font-size: clamp(30px, 3vw, 48px); line-height: 1.08; max-width: 22ch; }
.sec-lead { margin: 14px 0 0; max-width: 62ch; color: var(--muted); font-size: 18px; }

.spread { display: grid; grid-template-columns: minmax(0, 660px) minmax(0, 1fr); gap: 48px; margin-top: 40px; align-items: start; }
.shot { margin: 0; position: relative; }
.shot-main { background: #fff; border: 1.5px solid var(--ink); padding: 10px; border-radius: 6px; box-shadow: 6px 7px 0 var(--ink); }
.shot-main video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; background: #10131c; border-radius: 3px; }
.shot-main figcaption { margin: 10px 4px 2px; font-size: 14px; color: var(--muted); }
.tape-l { left: 30px; margin-left: 0; transform: rotate(-6deg); background: repeating-linear-gradient(-45deg, rgba(255, 211, 223, .85) 0 9px, rgba(255, 236, 242, .85) 9px 18px); }
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }
.notes li { display: flex; gap: 16px; }
.notes b { display: block; font-size: 20px; margin-bottom: 4px; }
.notes p { margin: 0; color: var(--muted); }
.num-hand { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; font: 700 30px/1 var(--hand); color: var(--pen); border: 2px solid var(--pen); border-radius: 50% 46% 52% 44%; transform: rotate(-6deg); }
.polaroids { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 56px; }
.polaroid { margin: 0; background: #fff; padding: 12px 12px 8px; border: 1.5px solid var(--line); box-shadow: 0 10px 24px rgba(40, 32, 10, .13); }
.polaroid:nth-child(1) { transform: rotate(-1.2deg); }
.polaroid:nth-child(2) { transform: rotate(1deg); }
.polaroid img { display: block; width: 100%; height: auto; }
.polaroid figcaption { margin-top: 6px; font-size: 24px; color: var(--pencil); text-align: center; }

/* карта уровней */
.levels { list-style: none; margin: 44px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 34px 26px; counter-reset: lv; }
.levels li { position: relative; padding: 16px 16px 16px; background: #fff; border: 1.5px solid var(--ink); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }
.levels li:not(:nth-child(5n))::after { content: ""; position: absolute; top: 50%; right: -28px; width: 28px; border-top: 2px dashed var(--pen); }
.levels .lv { position: absolute; top: -15px; left: 14px; width: 30px; height: 30px; display: grid; place-items: center; font: 700 20px/1 var(--hand); background: var(--marker); border: 1.5px solid var(--ink); border-radius: 50%; }
.levels b { display: block; margin-top: 6px; font-size: 18px; }
.levels li > span:last-child { display: block; font-size: 14px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.levels .lv-boss { background: #fff6c4; }
.worlds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin-top: 40px; }
.world { padding: 18px 18px 20px; background: var(--paper); border: 1.5px dashed var(--pencil); border-radius: 12px; }
.world .hand { font-size: 22px; color: var(--pen); }
.world b { display: block; font-size: 18px; line-height: 1.2; margin: 2px 0 6px; }
.world p { margin: 0; font-size: 15px; color: var(--muted); }
.note-wide { position: relative; margin: 36px 0 0; max-width: 760px; font: 500 16px/1.5 var(--sans); transform: rotate(-.6deg); padding: 16px 20px; }
.note-wide b { display: inline; font-size: 16px; }

/* пробное */
.trial { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.checks { list-style: none; margin: 34px 0 0; padding: 0; display: grid; gap: 18px; }
.checks li { display: flex; gap: 16px; align-items: flex-start; }
.checks i { flex: 0 0 auto; width: 30px; height: 30px; margin-top: 2px; border: 2px solid var(--ink); border-radius: 5px 7px 6px 4px; position: relative; background: #fff; }
.checks i::after { content: ""; position: absolute; left: 7px; top: 1px; width: 9px; height: 17px; border: solid var(--pen); border-width: 0 4px 4px 0; transform: rotate(42deg); border-radius: 2px; }
.checks b { display: block; font-size: 19px; }
.checks span { color: var(--muted); }
.trial-side { position: relative; display: grid; gap: 26px; padding-top: 60px; }
.trial-side .sticky { position: relative; font: 500 16px/1.45 var(--sans); padding: 18px 20px; }
.trial-side .sticky b { font-size: 17px; margin-bottom: 4px; }
.trial-side .sticky-y { transform: rotate(1.5deg); }
.trial-side .sticky-m { transform: rotate(-1.5deg); margin-left: 28px; }
.facts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 18px; margin-top: 64px; }
.facts div { padding: 14px 16px; border-top: 2px solid var(--ink); }
.facts b { display: block; font-size: 34px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.facts span { color: var(--muted); font-size: 15px; }

/* подарок */
.gift { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 64px; align-items: center; }
.gift-cover { position: relative; max-width: 420px; justify-self: center; }
.gift-cover img { display: block; width: 100%; height: auto; border: 1.5px solid var(--ink); box-shadow: 8px 9px 0 var(--ink); transform: rotate(-2deg); background: #fff; }
.gift-cover .tape { top: -12px; }
.gift-text p { color: var(--muted); max-width: 58ch; margin: 16px 0 0; }
.toc { margin: 22px 0 28px; padding: 0 0 0 4px; list-style: none; columns: 2; column-gap: 32px; counter-reset: t; }
.toc li { counter-increment: t; break-inside: avoid; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 16px; }
.toc li::before { content: counter(t, decimal-leading-zero); font: 700 20px var(--hand); color: var(--pen); margin-right: 10px; }

/* FAQ */
.faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: 56px; }
.faq-side { color: var(--muted); margin-top: 14px; }
.faq details { border-bottom: 1.5px dashed var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 40px 14px 0; position: relative; font-weight: 700; font-size: 18px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 8px; font: 700 32px/1 var(--hand); color: var(--pen); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* финал */
.sec-end { padding: 80px 0 96px; }
.end { text-align: center; display: flex; flex-direction: column; align-items: center; }
.end .sec-k { transform: rotate(-1deg); transform-origin: center; }
.end h2 { margin: 0 auto 28px; }

.foot { padding: 34px 0 40px; border-top: 1.5px dashed var(--line); font-size: 14px; color: var(--muted); }
.foot-in { display: grid; gap: 8px; }
.foot a { color: inherit; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }

/* ── экраны поменьше ── */
@media (max-width: 1500px) and (min-width: 1101px) {
  .sketch { max-width: 600px; }
}
@media (max-height: 900px) and (min-width: 1101px) {
  .hero { padding: 10px 0 18px; }
  .sketch { max-width: 560px; margin-top: 18px; }
  .sheet { padding: 22px 24px; }
}
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-text { display: contents; }
  .page-no { order: 0; } .hero h1, .hero .role-swap { order: 1; }
  .hero-quiz { order: 3; }
  .sketch { order: 4; max-width: 640px; }
  .hero h1 { max-width: 20ch; }
  .spread, .trial, .gift, .faq-wrap { grid-template-columns: 1fr; gap: 32px; }
  .levels { grid-template-columns: repeat(2, 1fr); }
  .levels li::after { display: none; }
  .worlds { grid-template-columns: 1fr 1fr; }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .trial-side { padding-top: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .top-in { height: 56px; gap: 10px; }
  .logo span { display: none; }
  .role button { padding: 6px 9px; font-size: 13px; }
  .role { padding: 2px; }
  .btn-sm { padding: 0 11px; font-size: 14px; min-height: 36px; box-shadow: 2px 2px 0 var(--ink); }
  .logo svg { width: 30px; height: 30px; }
  .hero { padding: 14px 0 24px; }
  .hero-grid { gap: 16px; }
  .page-no { font-size: 21px; margin: 0; }
  .hero h1 { font-size: 31px; }
  .hero-sub { margin-top: 6px; font-size: 17px; }
  .sheet { padding: 22px 16px 18px; transform: none; box-shadow: 4px 5px 0 rgba(29, 36, 51, .9); }
  .qz-opts--many { grid-template-columns: 1fr 1fr !important; }
  .qz-opts--many .qz-opt { min-height: 74px; }
  .ig-path { grid-template-columns: 1fr; gap: 8px; }
  .sketch .sticky-y { width: 150px; font-size: 18px; top: -10px; left: 0; }
  .sketch .sticky-p { display: none; }
  .level text { font-size: 30px; }
  .sec { padding: 64px 0; }
  .sec-k { font-size: 23px; }
  .polaroids { grid-template-columns: 1fr; gap: 24px; margin-top: 36px; }
  .levels { grid-template-columns: 1fr; gap: 22px; }
  .worlds { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 40px; }
  .facts b { font-size: 28px; }
  .toc { columns: 1; }
  .trial-side .sticky-m { margin-left: 0; }
  .btn { width: 100%; padding: 0 16px; text-align: center; }
  .btn-sm { width: auto; }
  .faq summary { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .level .draw, .level .draw-fade { opacity: 1 !important; stroke-dashoffset: 0 !important; }
}
