/* =========================================================
   Сленг vs Литературный русский — стили
   ========================================================= */

:root {
  --bg: #06060c;
  --text: #f4f5fb;
  --muted: #a3a7c2;
  --stroke: rgba(255, 255, 255, 0.12);
  --violet: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --green: #34d399;
  --grad: linear-gradient(115deg, #22d3ee 0%, #8b5cf6 52%, #f472b6 100%);
  --grad-alt: linear-gradient(115deg, #f472b6 0%, #8b5cf6 48%, #22d3ee 100%);
  --font: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system,
    "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-card: 0 30px 70px -35px rgba(0, 0, 0, 0.9);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}

button {
  font-family: inherit;
}

::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* =========================================================
   Фон
   ========================================================= */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 800px at 82% -12%, rgba(139, 92, 246, 0.2), transparent 62%),
    radial-gradient(950px 720px at -8% 104%, rgba(34, 211, 238, 0.14), transparent 58%),
    radial-gradient(760px 620px at 50% 55%, rgba(244, 114, 182, 0.08), transparent 62%),
    var(--bg);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  will-change: transform;
  animation: blobFloat 24s ease-in-out infinite alternate;
}

.blob-1 {
  width: 52vw;
  height: 52vw;
  min-width: 420px;
  min-height: 420px;
  left: -12vw;
  top: -16vw;
  background: radial-gradient(circle at 35% 35%, rgba(139, 92, 246, 0.5), transparent 62%);
  animation-duration: 26s;
}

.blob-2 {
  width: 46vw;
  height: 46vw;
  min-width: 360px;
  min-height: 360px;
  right: -14vw;
  top: 16vh;
  background: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.36), transparent 62%);
  animation-duration: 32s;
  animation-delay: -9s;
}

.blob-3 {
  width: 44vw;
  height: 44vw;
  min-width: 340px;
  min-height: 340px;
  left: 20vw;
  bottom: -24vw;
  background: radial-gradient(circle at 50% 50%, rgba(244, 114, 182, 0.32), transparent 62%);
  animation-duration: 30s;
  animation-delay: -15s;
}

.letters {
  position: absolute;
  inset: -8%;
  pointer-events: none;
  user-select: none;
}

.letters span {
  position: absolute;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.09);
  animation-name: letterDrift;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  will-change: transform;
}

.letters span.accent {
  color: transparent;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
}

.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 42%, rgba(0, 0, 0, 0.6) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: auto, 160px 160px;
  opacity: 0.32;
  mix-blend-mode: overlay;
}

@keyframes blobFloat {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4vw, 3vh, 0) scale(1.12);
  }
}

@keyframes letterDrift {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(26px, -70px, 0) rotate(10deg);
  }
}

/* =========================================================
   Интерфейс: прогресс, верхняя панель, навигация
   ========================================================= */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  z-index: 70;
}

.progress-fill {
  height: 100%;
  width: 20%;
  border-radius: 0 3px 3px 0;
  background: var(--grad);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.85);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 3vw, 40px) 0;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(163, 167, 194, 0.85);
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.9);
}

.counter {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: rgba(163, 167, 194, 0.65);
  font-variant-numeric: tabular-nums;
}

.counter-now {
  color: var(--text);
  font-weight: 700;
}

.counter-sep {
  margin: 0 6px;
  opacity: 0.5;
}

.navbar {
  position: fixed;
  left: 50%;
  bottom: clamp(12px, 2.6vh, 26px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
  padding: 7px 9px 7px 16px;
  border-radius: 999px;
  background: rgba(14, 14, 24, 0.62);
  border: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 22px 50px -20px rgba(0, 0, 0, 0.9);
}

.dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: width 0.35s, background 0.35s, box-shadow 0.35s;
}

.dot:hover {
  background: rgba(255, 255, 255, 0.45);
}

.dot.active {
  width: 26px;
  border-radius: 99px;
  background: var(--grad);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
}

.nav-arrows {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s, transform 0.25s, opacity 0.25s, box-shadow 0.25s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.13);
  transform: translateY(-1px);
}

.nav-btn:disabled {
  opacity: 0.28;
  cursor: default;
  transform: none;
  background: rgba(255, 255, 255, 0.04);
}

.nav-btn-primary {
  border: 0;
  color: #0a0a12;
  font-weight: 800;
  background: var(--grad);
  background-size: 200% 200%;
  box-shadow: 0 8px 24px -8px rgba(139, 92, 246, 0.9);
}

.nav-btn-primary:hover {
  background-position: 100% 50%;
}

.nav-btn-primary:disabled {
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

/* =========================================================
   Сцены и слайды
   ========================================================= */

.stage {
  position: relative;
  z-index: 1;
  height: 100vh;
  height: 100svh;
  perspective: 1800px;
  perspective-origin: 50% 45%;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  padding: clamp(76px, 10vh, 110px) clamp(16px, 4vw, 56px) clamp(100px, 14vh, 130px);
  overflow-x: hidden;
  overflow-y: auto;
  text-align: center;
  opacity: 0;
  transform: translate3d(64%, 0, -260px) rotateY(-28deg) scale(0.9);
  transform-origin: center center;
  transition:
    transform 0.85s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.55s ease;
  pointer-events: none;
  will-change: transform, opacity;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.slide::-webkit-scrollbar {
  width: 6px;
}

.slide::-webkit-scrollbar-track {
  background: transparent;
}

.slide::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
}

.slide::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.slide.prev {
  transform: translate3d(-64%, 0, -260px) rotateY(28deg) scale(0.9);
}

.slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  z-index: 2;
}

.slide-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  margin: auto;
}

/* появление элементов активного слайда */
.slide.active .reveal {
  animation: rise 0.9s cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--d, 0) * 90ms + 40ms);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Типографика и общие элементы
   ========================================================= */

.eyebrow {
  display: inline-block;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.grad-text {
  background: var(--grad);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 9s ease-in-out infinite;
}

.grad-alt {
  background-image: var(--grad-alt);
  animation-delay: -4.5s;
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.lead {
  max-width: 52ch;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(0.98rem, 1.5vw, 1.15rem);
  line-height: 1.55;
}

.slide-head {
  margin-bottom: clamp(20px, 3.6vh, 36px);
}

.slide-head h2 {
  margin: 14px 0 0;
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.sub {
  max-width: 64ch;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: clamp(0.85rem, 1.2vw, 0.98rem);
}

/* кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.7rem;
  border: 0;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, background-position 0.5s, background-color 0.25s;
}

.btn-lg {
  padding: 1.02rem 2.2rem;
  font-size: 1.05rem;
}

.btn-sm {
  padding: 0.65rem 1.2rem;
  font-size: 0.88rem;
}

.btn-primary {
  color: #0a0a12;
  background: var(--grad);
  background-size: 200% 200%;
  box-shadow:
    0 14px 44px -14px rgba(139, 92, 246, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background-position: 100% 50%;
  box-shadow:
    0 20px 54px -14px rgba(139, 92, 246, 1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn .arrow {
  transition: transform 0.25s;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

.btn-ghost:hover .arrow {
  transform: rotate(-90deg);
}

/* =========================================================
   1. Титульный слайд
   ========================================================= */

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-title {
  margin: clamp(16px, 2.6vh, 28px) 0 clamp(12px, 2vh, 20px);
  font-size: clamp(2.2rem, 7.2vw, 6rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.hero-title .line {
  display: block;
}

.vs {
  display: inline-grid;
  place-items: center;
  width: 1.7em;
  height: 1.7em;
  font-size: 0.36em;
  font-style: italic;
  font-weight: 800;
  color: #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 34px rgba(139, 92, 246, 0.28);
  transform: rotate(-6deg) translateY(-0.04em);
  vertical-align: 0.28em;
  margin-left: 0.06em;
}

.author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: clamp(14px, 2.4vh, 22px) 0 0;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  font-size: clamp(0.76rem, 1.05vw, 0.85rem);
  color: var(--muted);
}

.author::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.85);
}

.author strong {
  color: var(--text);
  font-weight: 700;
}

.cta-row {
  margin-top: clamp(16px, 2.6vh, 26px);
}

.hint-keys {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: clamp(20px, 3.2vh, 34px) 0 0;
  color: rgba(163, 167, 194, 0.75);
  font-size: 0.78rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 0.72rem;
  color: var(--muted);
}

/* =========================================================
   2. Карточки «зачем»
   ========================================================= */

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}

.card {
  position: relative;
  padding: clamp(20px, 2.4vw, 30px);
  text-align: left;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s,
    box-shadow 0.4s;
}

.card::before {
  content: "";
  position: absolute;
  inset: -45% -20% auto;
  height: 75%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 30%, transparent), transparent);
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.4s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 26px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent);
}

.card:hover::before {
  opacity: 0.9;
}

.num {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 0 26px -6px color-mix(in srgb, var(--accent) 55%, transparent);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  position: relative;
  margin: 18px 0 7px;
  font-size: clamp(1.05rem, 1.7vw, 1.28rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.card p {
  position: relative;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* =========================================================
   3. Словарь-перевёртыши
   ========================================================= */

.dict-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(8px, 1.1vw, 14px);
  margin-top: clamp(4px, 1vh, 10px);
}

.flip-card {
  position: relative;
  height: clamp(120px, 17vh, 172px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  perspective: 900px;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.3s ease;
}

.slide.active .flip-card.reveal {
  animation-delay: calc(var(--d, 0) * 55ms + 80ms);
}

.flip-card:hover {
  transform: translateY(-4px);
}

.flip-card:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.flip-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.2, 0.75, 0.25, 1);
}

.flip-card.flipped .flip-inner {
  transform: rotateY(180deg);
}

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px;
  overflow: hidden;
  text-align: center;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.front {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.flip-card:hover .front {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow:
    0 16px 44px -26px rgba(139, 92, 246, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.front .word {
  font-size: clamp(1rem, 1.45vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.front .tap {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.back {
  transform: rotateY(180deg) translateZ(1px);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.32), rgba(34, 211, 238, 0.12));
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 16px 44px -26px rgba(139, 92, 246, 0.9);
}

.back .syn {
  font-size: clamp(0.78rem, 1.05vw, 0.95rem);
  font-weight: 700;
  line-height: 1.25;
}

.back .ex {
  font-size: clamp(0.62rem, 0.82vw, 0.73rem);
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.65);
}

.flip-count {
  margin: clamp(12px, 2vh, 18px) 0 0;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(163, 167, 194, 0.7);
}

/* =========================================================
   4. Истоки сленга и богатство языка
   ========================================================= */

.origin-slide .slide-head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.75rem);
  line-height: 1.08;
}

.origin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px);
  text-align: left;
}

.origin-col {
  --accent: #22d3ee;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 2vw, 24px);
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.origin-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.origin-badge {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--accent);
  font-weight: 800;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 0 22px -6px color-mix(in srgb, var(--accent) 60%, transparent);
}

.origin-head h3 {
  margin: 0;
  font-size: clamp(0.92rem, 1.4vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.origin-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.origin-card {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}

.origin-card:hover {
  transform: translateX(4px);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: rgba(255, 255, 255, 0.07);
}

.origin-card h4 {
  margin: 0 0 4px;
  font-size: clamp(0.85rem, 1.15vw, 0.95rem);
  font-weight: 700;
  line-height: 1.25;
}

.origin-card p {
  margin: 0;
  font-size: clamp(0.72rem, 0.95vw, 0.8rem);
  line-height: 1.45;
  color: var(--muted);
}

.origin-card.phrase h4 {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(0.92rem, 1.3vw, 1.05rem);
}

/* =========================================================
   5. Переводчик диалогов
   ========================================================= */

.dialog-toolbar {
  display: flex;
  justify-content: center;
  margin-bottom: clamp(14px, 2.4vh, 24px);
}

.dialog-toolbar .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  box-shadow: 0 12px 34px -16px rgba(139, 92, 246, 0.9);
}

.swap-icon {
  font-size: 1.05em;
  line-height: 1;
}

.dialogues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.6vw, 18px);
  text-align: left;
}

.dialog-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(14px, 1.7vw, 20px);
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.dialog-scene {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialog-versions {
  display: grid;
}

.dialog-ver {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.dialog-ver p {
  margin: 0 0 9px;
  font-size: clamp(0.8rem, 1.05vw, 0.92rem);
  line-height: 1.5;
}

.dialog-ver p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.lit-ver {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

.dialogues.translated .slang-ver {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.dialogues.translated .lit-ver {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

mark {
  background: none;
  color: inherit;
}

.hot {
  color: #f9a8d4;
  font-weight: 700;
  border-bottom: 1px dashed rgba(244, 114, 182, 0.55);
}

.cool {
  color: #67e8f9;
  font-weight: 700;
  border-bottom: 1px dashed rgba(34, 211, 238, 0.5);
}

/* =========================================================
   6. Живая сценка «Спаси Артемия» и квест
   ========================================================= */

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.quest-slide .slide-head {
  margin-bottom: 12px;
}

.quest-slide .slide-head h2 {
  font-size: clamp(1.45rem, 2.9vw, 2.45rem);
  line-height: 1.03;
}

.quest-slide .slide-head .sub {
  margin-top: 6px;
  font-size: clamp(0.76rem, 1vw, 0.88rem);
}

.quest-slide .eyebrow {
  padding: 4px 10px;
  font-size: 0.6rem;
}

/* ---------- сцена-лист ---------- */

.classroom-stage {
  position: relative;
  width: min(100%, calc((100svh - 330px) / 0.5833));
  max-width: 1180px;
  margin: 0 auto;
  aspect-ratio: 1200 / 700;
  background: #f4ead7;
  border: 2px solid rgba(46, 42, 47, 0.88);
  border-radius: 10px 22px 12px 18px;
  box-shadow:
    0 34px 80px -40px rgba(0, 0, 0, 0.95),
    0 5px 0 rgba(46, 42, 47, 0.28);
  overflow: hidden;
}

.classroom-stage::before,
.classroom-stage::after {
  content: "";
  position: absolute;
  top: -11px;
  width: 86px;
  height: 23px;
  z-index: 4;
  background: rgba(232, 178, 58, 0.62);
  border-left: 1px dashed rgba(46, 42, 47, 0.25);
  border-right: 1px dashed rgba(46, 42, 47, 0.25);
  pointer-events: none;
}

.classroom-stage::before {
  left: 22px;
  transform: rotate(-3deg);
}

.classroom-stage::after {
  right: 22px;
  transform: rotate(2.5deg);
  background: rgba(217, 108, 79, 0.5);
}

.scene-frame {
  position: relative;
  width: 100%;
  height: 100%;
}

.classroom-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.classroom-stage .is-hidden {
  display: none !important;
}

/* ---------- кнопки сцены ---------- */

.stage-actions {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 7;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-btn {
  font: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 7px 10px;
  color: #2e2a2f;
  background: #fff9ea;
  border: 1.6px solid #2e2a2f;
  border-radius: 10px 14px 10px 12px;
  box-shadow: 2px 3px 0 rgba(46, 42, 47, 0.17);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}

.stage-btn:hover {
  transform: translateY(-2px);
  box-shadow: 3px 5px 0 rgba(46, 42, 47, 0.17);
}

.stage-btn:active {
  transform: translateY(1px);
  box-shadow: 1px 1px 0 rgba(46, 42, 47, 0.17);
}

.stage-btn.is-hidden {
  display: none !important;
}

.stage-btn-sound[aria-pressed="false"] {
  opacity: 0.75;
}

/* ---------- облачко учителя ---------- */

.teacher-bubble {
  position: absolute;
  right: 1%;
  left: auto;
  top: 2%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 17%;
  min-height: 70px;
  padding: 8px 10px;
  color: #2e2a2f;
  background: #fffaf0;
  border: 2px solid #2e2a2f;
  border-radius: 14px 20px 16px 12px;
  box-shadow: 3px 4px 0 rgba(46, 42, 47, 0.14);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(0.56rem, 0.82vw, 0.74rem);
  line-height: 1.32;
  text-align: center;
  pointer-events: none;
}

.teacher-bubble::after {
  content: "";
  position: absolute;
  left: -8px;
  bottom: 16px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-left: 2px solid #2e2a2f;
  border-bottom: 2px solid #2e2a2f;
  transform: rotate(45deg);
}

.teacher-bubble.pop {
  animation: bubblePop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.teacher-bubble.is-hidden {
  display: none !important;
}

/* ---------- карточка квеста ---------- */

.quest-card {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 8;
  width: min(440px, 45%);
  min-width: 330px;
  max-height: calc(100% - 26px);
  overflow: auto;
  padding: 13px 14px 14px;
  color: #2e2a2f;
  background: #fffaf0;
  border: 2px solid #2e2a2f;
  border-radius: 16px 6px 18px 8px;
  box-shadow: 5px 6px 0 rgba(46, 42, 47, 0.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.985);
  transition:
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.35s;
  scrollbar-width: thin;
  scrollbar-color: rgba(46, 42, 47, 0.25) transparent;
}

.quest-card.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.quest-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.quest-card .quest-step {
  padding: 4px 8px;
  border-radius: 99px;
  border: 1px solid rgba(46, 42, 47, 0.22);
  background: #f4e6c8;
  color: #6c6359;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.quest-card .chance {
  flex: 1 1 180px;
  min-width: 140px;
}

.quest-card .chance-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  color: #6c6359;
  font-size: 0.53rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.quest-card .chance-label b {
  color: #2e2a2f;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.quest-card .chance-track {
  height: 8px;
  border-radius: 99px;
  background: rgba(46, 42, 47, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.quest-card .chance-fill {
  width: 0%;
  height: 100%;
  border-radius: 99px;
  background: var(--grad);
  background-size: 200% 100%;
  transition: width 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.quest-situation {
  margin: 0 0 6px;
  color: #6c6359;
  font-size: 0.69rem;
  line-height: 1.4;
}

.quest-card .artemiy-say {
  margin: 0 0 9px;
  padding: 8px 10px;
  color: #2e2a2f;
  background: rgba(217, 108, 79, 0.12);
  border-left: 3px solid #d96c4f;
  border-radius: 0 12px 12px 0;
  font-size: clamp(0.74rem, 0.98vw, 0.86rem);
  line-height: 1.42;
}

.quest-card .artemiy-say .hot {
  color: #b34b33;
  border-bottom: 0;
}

.quest-card .quest-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quest-card .quest-option {
  min-height: 36px;
  padding: 8px 10px;
  color: #2e2a2f;
  background: #fffdf6;
  border: 1.5px solid rgba(46, 42, 47, 0.22);
  border-radius: 10px;
  box-shadow: 1px 2px 0 rgba(46, 42, 47, 0.07);
  font: inherit;
  font-size: clamp(0.7rem, 0.94vw, 0.8rem);
  line-height: 1.34;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.quest-card .quest-option:hover:not(:disabled) {
  transform: translateX(2px);
  background: #f6edd9;
  border-color: rgba(46, 42, 47, 0.42);
}

.quest-card .quest-option.is-best {
  color: #1f4d3a;
  background: #dcf3e4;
  border-color: #2f8f6b;
  box-shadow: none;
  animation: pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-card .quest-option.is-ok {
  color: #5c4614;
  background: #fbf0cf;
  border-color: #c08f1d;
  box-shadow: none;
  animation: pop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.quest-card .quest-option.is-bad {
  color: #6e2418;
  background: #fbe2dc;
  border-color: #c0553c;
  box-shadow: none;
  animation: shake 0.4s ease;
}

.quest-card .quest-option:disabled {
  cursor: default;
}

.quest-card .quest-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 0 0;
  text-align: center;
}

.quest-card .result-eyebrow {
  color: #6c6359;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quest-card .result-score {
  display: flex;
  align-items: baseline;
  gap: 3px;
  margin-top: 2px;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--grad);
  background-size: 220% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 9s ease-in-out infinite;
}

.quest-card .result-of {
  font-size: 0.92rem;
  letter-spacing: 0;
  color: #6c6359;
  -webkit-text-fill-color: #6c6359;
}

.quest-card .result-title {
  margin: 0;
  font-size: clamp(1.02rem, 1.8vw, 1.32rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.quest-card .result-text {
  max-width: 42ch;
  margin: 0;
  color: #6c6359;
  font-size: 0.77rem;
  line-height: 1.45;
}

.quest-card .result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.quest-card .btn-sm {
  padding: 0.55rem 0.9rem;
  font-size: 0.73rem;
}

.quest-card .btn-ghost {
  color: #2e2a2f;
  background: #f4e6c8;
  border: 1.5px solid rgba(46, 42, 47, 0.25);
}

.quest-card .btn-ghost:hover {
  background: #efdcc0;
  border-color: rgba(46, 42, 47, 0.5);
}

/* ---------- персонажи и позы ---------- */

.teacher-pose,
.art-pose {
  display: none;
}

.teacher-pose.is-active,
.art-pose.is-active {
  display: block;
}

.art-seated,
.art-walker,
.board-art {
  transform-box: view-box;
  transform-origin: 0 0;
}

/* походка: покадровые фазы ног и рук */
.art-walker {
  transform: translate(99px, 213px) scale(0.48);
  will-change: transform;
  pointer-events: none;
}

.art-walker.is-walking {
  animation: walkPath 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes walkPath {
  0% {
    transform: translate(99px, 213px) scale(0.48);
  }
  24% {
    transform: translate(-30px, 210px) scale(0.48);
  }
  62% {
    transform: translate(-30px, 34px) scale(0.55);
  }
  100% {
    transform: translate(596px, 34px) scale(0.55);
  }
}

.walker-leg .leg-swing,
.walker-arm .arm-swing {
  transform-box: fill-box;
  transform-origin: 50% 0%;
}

.walker-bob {
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.art-walker.is-walking .leg-l .leg-swing {
  animation: legSwingA 0.62s steps(2, end) infinite;
}

.art-walker.is-walking .leg-r .leg-swing {
  animation: legSwingB 0.62s steps(2, end) infinite;
}

.art-walker.is-walking .arm-l .arm-swing {
  animation: armSwingB 0.62s steps(2, end) infinite;
}

.art-walker.is-walking .arm-r .arm-swing {
  animation: armSwingA 0.62s steps(2, end) infinite;
}

.art-walker.is-walking .walker-bob {
  animation: walkBob 0.62s steps(2, end) infinite;
}

@keyframes legSwingA {
  0%,
  100% {
    transform: rotate(12deg);
  }
  50% {
    transform: rotate(-12deg);
  }
}

@keyframes legSwingB {
  0%,
  100% {
    transform: rotate(-12deg);
  }
  50% {
    transform: rotate(12deg);
  }
}

@keyframes armSwingA {
  0%,
  100% {
    transform: rotate(-10deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

@keyframes armSwingB {
  0%,
  100% {
    transform: rotate(10deg);
  }
  50% {
    transform: rotate(-10deg);
  }
}

@keyframes walkBob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* ---------- мел, места, одноклассники, вспышка ---------- */

.chalk-letter {
  opacity: 0;
  transition: opacity 0.16s ease;
}

.chalk-letter.is-on {
  opacity: 1;
}

.chalk-underline {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.chalk-underline.is-on {
  opacity: 0.75;
}

.seat-mark {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: seatStar 2.1s ease-in-out infinite alternate;
}

@keyframes seatStar {
  from {
    transform: translateY(0) rotate(-2deg);
  }
  to {
    transform: translateY(-2px) rotate(2deg);
  }
}

.pupils.cheer .pupil {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: pupilCheer 0.48s steps(2, end) infinite alternate;
}

@keyframes pupilCheer {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-7px);
  }
}

.hint-flash {
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.hint-flash.is-on {
  animation: hintFlash 1.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hintFlash {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  30% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

/* ---------- общие анимации ---------- */

@keyframes bubblePop {
  from {
    transform: scale(0.9);
    opacity: 0.35;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(3px);
  }
}

/* ---------- адаптив сцены ---------- */

@media (max-width: 1100px) {
  .classroom-stage {
    width: 100%;
  }

  .quest-card {
    width: min(430px, 47%);
  }

  .teacher-bubble {
    width: 31%;
    left: 2%;
    right: auto;
  }

  .teacher-bubble::after {
    left: auto;
    right: -8px;
    border-left: 0;
    border-right: 2px solid #2e2a2f;
    border-bottom: 2px solid #2e2a2f;
    transform: rotate(-45deg);
  }
}

@media (max-width: 760px) {
  .classroom-stage {
    width: 100%;
    aspect-ratio: auto;
    border-radius: 8px 16px 10px 14px;
  }

  .stage-actions {
    position: static;
    justify-content: flex-end;
    padding: 7px 8px 0;
  }

  .stage-btn {
    font-size: 0.62rem;
    padding: 6px 8px;
  }

  .scene-frame {
    height: auto;
  }

  .classroom-svg {
    height: auto;
  }

  .teacher-bubble {
    width: 39%;
    left: 2%;
    right: auto;
    top: 2%;
    min-height: 54px;
    padding: 7px 8px;
    font-size: 0.56rem;
  }

  .teacher-bubble::after {
    left: auto;
    right: -8px;
    border-left: 0;
    border-right: 2px solid #2e2a2f;
    border-bottom: 2px solid #2e2a2f;
    transform: rotate(-45deg);
  }

  .quest-card {
    position: relative;
    right: auto;
    bottom: auto;
    display: none;
    width: auto;
    min-width: 0;
    max-height: none;
    margin: 8px;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .quest-card.show {
    display: block;
    animation: cardIn 0.4s ease both;
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   Конфетти
   ========================================================= */

#confetti {
  position: fixed;
  inset: 0;
  z-index: 45;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* =========================================================
   Адаптив
   ========================================================= */

@media (max-width: 980px) {
  .quest-arena {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "art teach"
      "panel panel";
    align-items: start;
    column-gap: 12px;
    row-gap: 14px;
  }

  .artemiy-card {
    grid-area: art;
  }

  .teacher-card {
    grid-area: teach;
  }

  .quest-panel {
    grid-area: panel;
  }

  .hero-card {
    width: 100%;
    max-width: 168px;
    margin: 0 auto;
  }

  .hero-gif {
    border-radius: 16px;
  }

  .hero-name {
    font-size: 0.58rem;
  }

  .speech-bubble {
    min-height: 64px;
    padding: 8px;
    font-size: 0.66rem;
  }
}

@media (max-width: 920px) {
  .dict-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flip-card {
    height: clamp(104px, 12.5vh, 124px);
  }
}

@media (max-width: 760px) {
  .cards {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  .origin-grid {
    grid-template-columns: 1fr;
  }

  .dialogues {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 16px 16px 0;
  }

  .brand {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  .slide {
    padding: 78px 14px 108px;
  }

  .hero-title {
    font-size: clamp(2.05rem, 9.2vw, 2.9rem);
  }

  .dict-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flip-card {
    height: clamp(104px, 15vh, 128px);
  }

  .navbar {
    gap: 10px;
    padding: 6px 8px 6px 12px;
  }

  .nav-btn {
    width: 38px;
    height: 38px;
  }

  .btn-lg {
    padding: 0.95rem 1.9rem;
    font-size: 1rem;
  }

  .card {
    padding: 20px;
  }

  .hint-keys {
    font-size: 0.72rem;
  }

  .author {
    padding: 7px 13px;
    font-size: 0.72rem;
  }

  .hero-card {
    max-width: 128px;
  }

  .speech-bubble {
    min-height: 56px;
    padding: 7px;
    font-size: 0.6rem;
  }

  .quest-panel {
    padding: 14px;
  }

  .quest-step {
    font-size: 0.62rem;
  }

  .quest-option {
    font-size: 0.78rem;
  }

  .dialog-toolbar .btn {
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
  }
}

@media (max-height: 720px) {
  .hero-title {
    font-size: clamp(2.1rem, 6.4vw, 4.6rem);
  }

  .slide {
    padding-top: 70px;
    padding-bottom: 100px;
  }

  .flip-card {
    height: clamp(104px, 16vh, 140px);
  }
}

/* =========================================================
   Уважение к настройке «меньше движения»
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .letters,
  .blob {
    display: none;
  }
}
