/* ============================================================================
   PHILTECH · «Силы Земли» — дизайн-система курса (литосфера, 5 класс)
   ----------------------------------------------------------------------------
   Единые токены, типографика и компоненты для всех экранов урока:
   старт, HUD, док инструментов, карточки испытаний, тест, финал.
   Стиль проекта: светлый «редакционный» нео-брутализм — толстый контур,
   жёсткая тень, крупная антиква-гротеск, моноширинные подписи.
   ========================================================================== */

:root {
  /* палитра */
  --bg:        #ECF1F7;
  --surface:   #FFFFFF;
  --surface-2: #F4F8FC;
  --surface-3: #E4EDF7;
  --ink:       #0A1224;
  --ink-soft:  #36445C;
  --ink-mute:  #7C8AA0;

  --teal:      #43B5A0;
  --teal-dark: #2E9484;
  --purple:    #491D88;
  --pink:      #FA448C;
  --cyan:      #5CE1E6;
  --amber:     #F59E0B;
  --green:     #2FB56B;
  --red:       #E8483F;

  /* форма */
  --border-w: 3px;
  --border: var(--border-w) solid var(--ink);
  --border-thin: 2px solid var(--ink);
  --shadow: 8px 8px 0 var(--ink);
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-lg: 12px 12px 0 var(--ink);

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;

  /* шрифты */
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  --disp: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --sans: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --tr: 160ms cubic-bezier(.2, .8, .2, 1);
  --glass: rgba(255, 255, 255, .86);
}

/* ---------------------------------------------------------------- базовое */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body.lesson { height: 100dvh; }

img, svg, canvas, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--cyan); color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

.is-hidden { display: none !important; }
[hidden] { display: none !important; }

.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;
}

/* скроллбары в оверлеях */
.overlay, .sheet { scrollbar-width: thin; scrollbar-color: var(--ink-mute) transparent; }
.overlay::-webkit-scrollbar, .sheet::-webkit-scrollbar { width: 10px; }
.overlay::-webkit-scrollbar-thumb, .sheet::-webkit-scrollbar-thumb {
  background: var(--ink-mute); border-radius: 999px; border: 2px solid var(--surface);
}

/* ------------------------------------------------------------- типографика */
.mono {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  margin-bottom: 18px;
  background: var(--ink);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  border-radius: 3px;
  transform: rotate(-1deg);
}
.sticker--pink  { background: var(--pink);  color: #fff; }
.sticker--amber { background: var(--amber); color: var(--ink); }
.sticker--teal  { background: var(--teal);  color: #fff; }

.boxed {
  display: inline-block;
  padding: 0 .08em;
  background: var(--cyan);
  border: var(--border);
  box-shadow: var(--shadow-sm);
  transform: rotate(-2deg);
}

.outline {
  color: transparent;
  -webkit-text-stroke: 3px var(--ink);
}

/* ---------------------------------------------------------------- кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 20px;
  background: var(--teal);
  color: #fff;
  border: var(--border-thin);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr);
  user-select: none;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.btn:active { transform: translate(4px, 4px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .42; cursor: not-allowed; transform: none; box-shadow: none;
  filter: grayscale(.35);
}

.btn--lg { padding: 16px 26px; font-size: 13px; border-width: 3px; }
.btn--sm { padding: 8px 14px; font-size: 10px; }
.btn--block { width: 100%; }

.btn--teal  { background: var(--teal); color: #fff; }
.btn--pink  { background: var(--pink); color: #fff; }
.btn--amber { background: var(--amber); color: var(--ink); }
.btn--ink   { background: var(--ink); color: var(--cyan); }
.btn--ghost { background: var(--surface); color: var(--ink); }

.btn--quiz {
  width: 100%;
  margin-top: 14px;
  background: var(--amber);
  color: var(--ink);
  font-size: 11px;
  padding: 12px 14px;
}
.btn--quiz:not(:disabled) { animation: quizPulse 2.4s ease-in-out infinite; }
.btn--quiz.is-passed { background: var(--teal); color: #fff; animation: none; }

@keyframes quizPulse {
  0%, 100% { box-shadow: 4px 4px 0 var(--ink); }
  50%      { box-shadow: 4px 4px 0 var(--ink), 0 0 0 5px rgba(245, 158, 11, .35); }
}

/* ------------------------------------------------------------------- сцена */
#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: linear-gradient(180deg, #9fd0f5 0%, #dcecf9 62%, #eef5fb 100%);
}

/* мягкая виньетка поверх 3D, но под интерфейсом */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 52%, rgba(10, 18, 36, .16) 100%);
}

/* загрузчик */
.boot {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  gap: 20px;
  background: var(--bg);
  transition: opacity .5s ease, visibility .5s ease;
}
.boot.is-off { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.boot__globe {
  width: 76px; height: 76px; border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, var(--cyan) 0 26%, transparent 27%),
    radial-gradient(circle at 62% 66%, var(--teal) 0 20%, transparent 21%),
    radial-gradient(circle at 42% 48%, var(--teal) 0 48%, var(--purple) 49% 100%);
  border: var(--border);
  box-shadow: var(--shadow);
  animation: bootSpin 3.6s linear infinite;
}
.boot__text {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.boot__text b { color: var(--pink); }

@keyframes bootSpin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.06); }
  100% { transform: rotate(360deg) scale(1); }
}

/* --------------------------------------------------------------- верхняя */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 66px;
  padding: 9px 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand__logo {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 21px;
  background: var(--cyan);
  border: var(--border-thin);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__text b {
  font-family: var(--disp);
  font-size: 15px;
  letter-spacing: -.01em;
  text-transform: uppercase;
}
.brand__text small {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.course-nav { display: flex; align-items: center; gap: 9px; margin-inline: auto; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--r-pill);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--tr);
}
.nav-btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.nav-btn--next { background: var(--cyan); }
.nav-btn.is-locked {
  background: var(--surface-2);
  color: var(--ink-mute);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}
.nav-btn.is-locked:hover { transform: none; }
.nav-btn__lock { font-size: 9px; }
.nav-btn:not(.is-locked) .nav-btn__lock { display: none; }

.progress-chip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 216px;
  padding: 6px 16px 9px;
  background: var(--ink);
  color: #fff;
  border: var(--border-thin);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.progress-chip__label {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.progress-chip__topic {
  font-family: var(--disp);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.progress-chip::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 4px;
  width: var(--p, 88.9%);
  background: var(--pink);
}

.topbar__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.seg {
  display: flex;
  padding: 3px;
  background: var(--surface-2);
  border: var(--border-thin);
  border-radius: var(--r-pill);
}
.seg__btn {
  padding: 6px 10px;
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: var(--tr);
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--ink); color: var(--cyan); }

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--r-pill);
  box-shadow: 3px 3px 0 var(--ink);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--tr);
}
.action-btn:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.action-btn span { font-size: 12px; line-height: 1; }
.action-btn.is-on { background: var(--pink); color: #fff; }

/* ------------------------------------------------------------- камера рук */
.pip {
  position: fixed;
  top: 86px;
  left: 18px;
  z-index: 40;
  width: 252px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pip__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  background: var(--surface-2);
  border-bottom: 2px solid var(--ink);
}
.pip__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-mute);
  box-shadow: 0 0 0 2px rgba(10, 18, 36, .12);
  flex: 0 0 auto;
}
.pip__dot.is-live { background: var(--teal); animation: dotBlink 1.6s ease-in-out infinite; }
.pip__dot.is-error { background: var(--red); }
.pip__title {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.pip__fps {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-mute);
}

@keyframes dotBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.pip__view {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 50% 42%, rgba(92, 225, 230, .14), transparent 62%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 15px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 15px),
    var(--ink);
  overflow: hidden;
}
#webcam {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: .32;
  filter: saturate(.55) contrast(1.12) brightness(.9);
  transform: scaleX(-1);
}
#skeleton { position: absolute; inset: 0; width: 100%; height: 100%; }

.pip__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 12px;
  text-align: center;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--cyan);
  background: rgba(10, 18, 36, .82);
}
.pip__placeholder.is-off { display: none; }

.mini-btn {
  padding: 6px 12px;
  background: transparent;
  color: var(--cyan);
  border: 2px solid var(--cyan);
  border-radius: var(--r-pill);
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: var(--tr);
}
.mini-btn:hover { background: var(--cyan); color: var(--ink); }

.pip__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  border-top: 2px solid var(--ink);
}
.pip__gesture {
  font-family: var(--disp);
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
  color: var(--purple);
  transition: color var(--tr);
}
.pip__gesture[data-g="pinch"] { color: var(--pink); }
.pip__gesture[data-g="fist"]  { color: var(--amber); }
.pip__gesture[data-g="palm"]  { color: var(--teal); }
.pip__gesture[data-g="two"]   { color: var(--cyan); }
.pip__hint {
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.25;
  text-align: right;
  color: var(--ink-mute);
  max-width: 118px;
}

/* ------------------------------------------------------------- испытания */
.missions {
  position: fixed;
  top: 86px;
  right: 18px;
  z-index: 40;
  width: 302px;
  padding: 14px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.missions__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
}
.missions__title {
  font-family: var(--disp);
  font-size: 12px;
  line-height: 1.1;
  text-transform: uppercase;
}
.missions__count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-mute);
  white-space: nowrap;
  flex: 0 0 auto;
}

.goal { margin-bottom: 12px; }
.goal:last-of-type { margin-bottom: 4px; }
.goal__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.goal__name {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: color var(--tr);
}
.goal__val {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-mute);
  white-space: nowrap;
  transition: color var(--tr);
}
.goal__bar {
  position: relative;
  height: 12px;
  background: var(--surface-3);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.goal__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .28) 0 5px, transparent 5px 10px),
    var(--amber);
  border-radius: var(--r-pill);
  transition: width .22s linear, background-color var(--tr);
}
.goal.is-done .goal__name { color: var(--ink); }
.goal.is-done .goal__name::after { content: " ✓"; color: var(--teal); }
.goal.is-done .goal__val { color: var(--teal-dark); }
.goal.is-done .goal__bar i {
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .25) 0 5px, transparent 5px 10px),
    var(--teal);
}

/* -------------------------------------------------------------- инструменты */
.dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 45;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.dock__group { display: flex; flex-direction: column; gap: 7px; }
.dock__caption {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-mute);
}
.dock__tools { display: flex; gap: 7px; }
.dock__sep { width: 2px; align-self: stretch; background: rgba(10, 18, 36, .12); border-radius: 2px; margin: 4px 0; }

.tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
  padding: 8px 4px 7px;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform var(--tr), box-shadow var(--tr), background var(--tr);
  user-select: none;
}
.tool:hover { background: var(--surface-2); transform: translateY(-2px); }
.tool.is-active {
  background: var(--cyan);
  box-shadow: var(--shadow-sm);
  transform: translate(-2px, -2px);
}
.tool__icon { font-size: 20px; line-height: 1; }
.tool__name {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.tool__sub {
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  text-align: center;
  line-height: 1.2;
}
.tool.is-active .tool__sub { color: var(--ink-soft); }
.tool__key {
  position: absolute;
  top: 3px;
  right: 5px;
  font-family: var(--mono);
  font-size: 7.5px;
  color: var(--ink-mute);
}
.tool--reset {
  width: 104px;
  justify-content: center;
  background: var(--surface-2);
  border-style: dashed;
}
.tool--reset:hover { background: #FFE9E7; border-style: solid; }
.tool--reset .tool__icon { font-size: 18px; }

/* --------------------------------------------------------------- подсказки */
.hint-chip {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 35;
  max-width: 300px;
  padding: 9px 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: var(--border-thin);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.6;
  letter-spacing: .03em;
  color: var(--ink-soft);
}
.hint-chip b { color: var(--ink); }
.hint-chip kbd {
  display: inline-block;
  min-width: 15px;
  padding: 0 3px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  text-align: center;
}

.toast {
  position: fixed;
  top: 82px;
  left: 50%;
  z-index: 260;
  max-width: min(78vw, 560px);
  padding: 11px 18px;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: .02em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -14px);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast.is-warn { background: var(--pink); border-color: var(--ink); }
.toast.is-good { background: var(--teal); color: #fff; }

/* ------------------------------------------------------------- оверлеи */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 26px;
  background: rgba(10, 18, 36, .44);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .28s ease, visibility .28s ease;
  overflow-y: auto;
}
.overlay.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.sheet {
  position: relative;
  width: min(620px, 100%);
  padding: 32px;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.985);
  transition: transform .32s cubic-bezier(.2, .9, .25, 1.05);
}
.overlay.is-open .sheet { transform: translateY(0) scale(1); }

.sheet--intro { width: min(780px, 100%); padding: 36px 40px 30px; }
.sheet--help { width: min(760px, 100%); }
.sheet--quiz { width: min(640px, 100%); }
.sheet--finale { width: min(760px, 100%); }
.sheet--pause { width: min(420px, 100%); text-align: center; }

.sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  transition: var(--tr);
}
.sheet__close:hover { background: var(--pink); color: #fff; }

.sheet__title {
  font-family: var(--disp);
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: .98;
  letter-spacing: -.02em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.sheet__sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

/* intro */
.intro__title {
  font-family: var(--disp);
  font-size: clamp(40px, 6.4vw, 68px);
  line-height: .88;
  letter-spacing: -.035em;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.intro__lead {
  max-width: 58ch;
  margin-bottom: 22px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.intro__lead b { color: var(--ink); }
.intro__lead .hl-teal { background: rgba(67, 181, 160, .22); padding: 0 3px; border-radius: 3px; }

.gesture-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 24px;
}
.gesture-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 10px;
  background: var(--surface-2);
  border: var(--border-thin);
  border-radius: var(--r-sm);
}
.gesture-card__icon { font-size: 21px; line-height: 1.1; }
.gesture-card b { font-size: 12px; line-height: 1.15; }
.gesture-card small {
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.35;
  letter-spacing: .02em;
  color: var(--ink-mute);
}

.intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.intro__note {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--ink-mute);
}

/* help */
.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.help-card {
  display: flex;
  gap: 11px;
  padding: 12px;
  background: var(--surface-2);
  border: var(--border-thin);
  border-radius: var(--r-sm);
}
.help-card__icon { font-size: 24px; line-height: 1; flex: 0 0 auto; }
.help-card b { display: block; font-size: 12.5px; line-height: 1.2; margin-bottom: 2px; }
.help-card small {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-soft);
}
.help-card em {
  display: block;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px dashed rgba(10, 18, 36, .18);
  font-family: var(--mono);
  font-style: normal;
  font-size: 8px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* quiz */
.quiz__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.quiz__bar {
  height: 10px;
  margin-bottom: 20px;
  background: var(--surface-3);
  border: 2px solid var(--ink);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.quiz__bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--pink);
  border-radius: var(--r-pill);
  transition: width .35s cubic-bezier(.2, .8, .2, 1);
}
.quiz__q {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 16px;
}
.quiz__opts { display: grid; gap: 9px; }

.quiz__opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--r-sm);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--tr);
}
.quiz__opt::before {
  content: attr(data-idx);
  display: grid;
  place-items: center;
  width: 24px; height: 24px;
  flex: 0 0 auto;
  background: var(--surface-3);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}
.quiz__opt:hover:not(:disabled) {
  background: var(--surface-2);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--ink);
}
.quiz__opt.is-correct {
  background: rgba(47, 181, 107, .16);
  border-color: var(--green);
}
.quiz__opt.is-correct::before { background: var(--green); color: #fff; border-color: var(--green); }
.quiz__opt.is-wrong {
  background: rgba(232, 72, 63, .12);
  border-color: var(--red);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}
.quiz__opt.is-wrong::before { background: var(--red); color: #fff; border-color: var(--red); }
.quiz__opt:disabled { cursor: default; }

.quiz__result { text-align: center; padding: 6px 0 4px; }
.quiz__emoji { font-size: 52px; line-height: 1; margin-bottom: 10px; }
.quiz__result h3 {
  font-family: var(--disp);
  font-size: 26px;
  line-height: 1;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.quiz__score {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.quiz__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* finale */
.finale__title {
  font-family: var(--disp);
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: .92;
  letter-spacing: -.03em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.finale__lead { max-width: 54ch; color: var(--ink-soft); font-size: 14.5px; margin-bottom: 20px; }
.finale__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-bottom: 24px;
}
.stat {
  padding: 12px 10px;
  background: var(--surface-2);
  border: var(--border-thin);
  border-radius: var(--r-sm);
}
.stat b {
  display: block;
  font-family: var(--disp);
  font-size: 21px;
  line-height: 1.05;
}
.stat span {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* пауза */
.pause__icon { font-size: 44px; line-height: 1; margin-bottom: 12px; }
.pause__title {
  font-family: var(--disp);
  font-size: 30px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.pause__sub {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink-mute);
  margin-bottom: 20px;
}

/* ------------------------------------------------------------- курсор руки */
.hand-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 400;
  width: 64px;
  height: 64px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  display: none;
  will-change: transform;
}
.hand-cursor.is-live { display: block; }

.hand-cursor__ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}
.hand-cursor__track {
  fill: rgba(255, 255, 255, .14);
  stroke: rgba(10, 18, 36, .3);
  stroke-width: 3;
}
.hand-cursor__fill {
  fill: none;
  stroke: var(--teal);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 213.6;
  stroke-dashoffset: 213.6;
  transition: stroke .15s;
}
.hand-cursor__dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 2px #fff;
  transform: translate(-50%, -50%);
  transition: width .12s, height .12s, background .12s;
}
.hand-cursor.is-target .hand-cursor__fill { stroke: var(--pink); }
.hand-cursor.is-target .hand-cursor__dot { background: var(--pink); }
.hand-cursor.is-pinch .hand-cursor__dot {
  width: 16px; height: 16px;
  background: var(--pink);
  box-shadow: 0 0 0 3px rgba(250, 68, 140, .35);
}
.hand-cursor.is-pinch .hand-cursor__fill { stroke: var(--pink); stroke-dashoffset: 0; }

/* элемент интерфейса, на который наведена рука */
.is-hand-hover {
  outline: 3px solid var(--pink) !important;
  outline-offset: 3px;
}

/* ------------------------------------------------------- адаптив и motion */
@media (max-width: 1280px) {
  .brand__text small { display: none; }
  .progress-chip { min-width: 178px; }
  .seg__btn { padding: 6px 8px; }
  .action-btn { padding: 8px 10px; }
  .tool { width: 76px; }
  .tool--reset { width: 94px; }
}

@media (max-width: 1120px) {
  .hint-chip { display: none; }
  .missions { width: 272px; }
  .pip { width: 224px; }
  .action-btn { font-size: 0; gap: 0; padding: 8px 10px; }
  .action-btn span { font-size: 14px; }
}

@media (max-width: 940px) {
  .topbar { flex-wrap: wrap; min-height: 0; padding: 8px 12px; gap: 8px; }
  .course-nav { order: 3; width: 100%; justify-content: space-between; margin: 0; }
  .pip { top: 118px; width: 196px; }
  .missions { top: 118px; width: 246px; padding: 12px; }
  .dock { padding: 8px; gap: 8px; border-radius: var(--r-md); }
  .tool { width: 66px; }
  .tool__name { font-size: 10px; }
  .tool__sub { display: none; }
  .dock__caption { display: none; }
  .tool--reset { width: 80px; }
}

@media (max-width: 760px) {
  .pip { display: none; }
  .missions {
    top: auto;
    bottom: 132px;
    right: 10px;
    width: 232px;
  }
  .btn--quiz { font-size: 9.5px; padding: 10px; }
  .dock {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    overflow-x: auto;
    justify-content: flex-start;
  }
  .tool { flex: 0 0 auto; }
  .sheet { padding: 22px; }
  .gesture-grid { grid-template-columns: repeat(2, 1fr); }
  .help-grid { grid-template-columns: 1fr; }
  .finale__stats { grid-template-columns: repeat(2, 1fr); }
  .overlay { padding: 12px; }
}

@media (max-height: 680px) {
  .pip { width: 190px; }
  .pip__view { aspect-ratio: 16 / 10; }
  .missions { top: 78px; padding: 11px; }
  .goal { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Совместимость: слайдовые страницы курса (используют .slider / .slide).
   Стили ограничены внутри .slide, чтобы не влиять на 3D-урок.
   -------------------------------------------------------------------------- */
.slider {
  display: flex;
  width: 100vw;
  height: 100vh;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.slide {
  position: relative;
  min-width: 100vw;
  height: 100vh;
  padding: 8vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
}
.slide .content { max-width: 800px; z-index: 2; }
.slide h1 {
  font-family: var(--disp);
  font-size: clamp(50px, 10vw, 120px);
  line-height: .85;
  letter-spacing: -.04em;
  text-transform: uppercase;
  margin-bottom: 30px;
  white-space: nowrap;
}
.slide p {
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.4;
  max-width: 55ch;
  margin-bottom: 40px;
  color: rgba(10, 18, 36, .85);
}
.decoration {
  position: absolute;
  right: -5vw;
  bottom: -10vw;
  font-family: var(--disp);
  font-size: 40vw;
  line-height: 1;
  color: rgba(10, 18, 36, .04);
  pointer-events: none;
  z-index: 1;
}
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 25%;
  height: 8px;
  background: var(--pink);
  z-index: 100;
  transition: width .4s ease;
}
.hud {
  position: fixed;
  left: 30px;
  right: 30px;
  bottom: 30px;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}
.status {
  padding: 12px 20px;
  background: var(--ink);
  color: var(--cyan);
  border: var(--border);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.hint {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: rgba(10, 18, 36, .5);
}

