/* =====================================================================
   SayNihao — стили. Тема: рисовая бумага, тушь, киноварная печать.
   ===================================================================== */
:root {
  --paper: #f3ede2;
  --paper-2: #e9e0d0;
  --card: #fbf7ef;
  --ink: #16130f;
  --muted: #6a6257;
  --line: rgba(22, 19, 15, .14);
  --red: #d4351c;
  --red-deep: #a92410;
  --on-red: #fff6ea;
  --jade: #1f6f5c;
  --gold: #b98a2c;
  --outline: #d8cdb9;
  --tg: #2aa1da;
  --wa: #1fa855;
  --shadow: 0 30px 60px -30px rgba(60, 35, 10, .35);
  --r: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sans: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --hz: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --brush: 'Ma Shan Zheng', 'Noto Serif SC', serif;
}
:root[data-theme='dark'] {
  --paper: #12100d;
  --paper-2: #1a1713;
  --card: #1f1b16;
  --ink: #f2ebde;
  --muted: #a69c8d;
  --line: rgba(242, 235, 222, .14);
  --red: #f0492c;
  --red-deep: #c2331a;
  --jade: #4fb89d;
  --gold: #dbb25a;
  --outline: #3b342b;
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
  overflow-x: hidden; transition: background .5s var(--ease), color .5s var(--ease);
}
/* зерно бумаги */
body::before {
  content: ''; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .05; mix-blend-mode: multiply;
  background-image: 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='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme='dark'] body::before { mix-blend-mode: screen; opacity: .06; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.03em; line-height: 1.02; text-wrap: balance; }
h2 { font-size: clamp(34px, 5.2vw, 68px); }
h3 { font-size: clamp(21px, 2vw, 26px); letter-spacing: -.02em; line-height: 1.15; }
em { font-family: var(--serif); font-style: italic; font-weight: 500; letter-spacing: -.01em; color: var(--red); font-size: 1.12em; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--red); color: var(--on-red); }

.container { width: min(1240px, 100%); margin-inline: auto; padding-inline: clamp(16px, 4vw, 40px); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; }
.skip:focus { left: 8px; }
.note { font-size: 13px; color: var(--muted); margin-top: 14px; }

.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 90; }
.progress span { display: block; height: 100%; width: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; }

/* ---------- Кнопки ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 17px 26px; border-radius: 999px; background: var(--bg); color: var(--fg);
  font-weight: 600; font-size: 16px; line-height: 1; white-space: nowrap; overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), color .35s;
}
.btn::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(255, 255, 255, .16);
  transform: translateY(101%); transition: transform .45s var(--ease);
}
.btn:hover::before { transform: none; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--sm { padding: 12px 18px; font-size: 14.5px; }
.btn--red { --bg: var(--red); --fg: var(--on-red); box-shadow: 0 14px 30px -14px var(--red); }
.btn--ghost { --bg: transparent; --fg: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost::before { background: var(--ink); opacity: .07; }
.btn--paper { --bg: #f3ede2; --fg: #16130f; }
.btn--paper::before { background: rgba(0, 0, 0, .08); }
.btn--tg { --bg: var(--tg); --fg: #fff; }
.btn--wa { --bg: var(--wa); --fg: #fff; }
.btn--tg svg, .btn--wa svg { fill: currentColor; stroke: none; }
.btn--tg:hover svg, .btn--wa:hover svg { transform: scale(1.12) rotate(-6deg); }
.send { display: flex; flex-wrap: wrap; gap: 10px; }
.send .btn { flex: 1 1 220px; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--line); transition: transform .5s var(--ease), background .3s; }
.icon-btn:hover { transform: rotate(40deg); background: var(--paper-2); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-moon, :root[data-theme='dark'] .i-sun { display: none; }
:root[data-theme='dark'] .i-moon { display: block; }

/* ---------- Шапка ---------- */
.header { position: fixed; inset: 0 0 auto 0; z-index: 80; transition: transform .5s var(--ease), background .4s, box-shadow .4s; }
.header.is-scrolled { background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 1px 0 var(--line); }
.header.is-hidden { transform: translateY(-100%); }
.header__row { display: flex; align-items: center; gap: 24px; height: 72px; }
.header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -.03em; font-weight: 500; }
.logo b { font-weight: 700; }
.seal {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--red); color: var(--on-red);
  font: 400 23px/1 var(--brush); transform: rotate(-5deg); transition: transform .5s var(--ease);
}
.logo:hover .seal { transform: rotate(6deg) scale(1.08); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { position: relative; padding: 9px 13px; border-radius: 999px; font-size: 15px; font-weight: 500; color: var(--muted); transition: color .3s, background .3s; }
.nav a:hover, .nav a.is-active { color: var(--ink); background: color-mix(in srgb, var(--ink) 7%, transparent); }
.nav + .header__actions { margin-left: 8px; }
.burger { display: none; width: 42px; height: 42px; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1.5px var(--line); }
.burger span { position: absolute; left: 12px; right: 12px; height: 2px; background: currentColor; border-radius: 2px; transition: transform .4s var(--ease), top .4s var(--ease); }
.burger span:first-child { top: 16px; } .burger span:last-child { top: 24px; }
.burger[aria-expanded='true'] span:first-child { top: 20px; transform: rotate(45deg); }
.burger[aria-expanded='true'] span:last-child { top: 20px; transform: rotate(-45deg); }

/* ---------- Первый экран ---------- */
.hero { position: relative; padding: clamp(120px, 15vw, 190px) 0 clamp(56px, 8vw, 110px); overflow: hidden; }
.hero__glyph {
  position: absolute; right: -4vw; top: -6vw; font: 900 clamp(360px, 62vw, 900px)/1 var(--hz); color: var(--ink); opacity: .035;
  pointer-events: none; user-select: none; will-change: transform;
}
.hero__grid { position: relative; display: grid; grid-template-columns: 1.08fr .92fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 var(--red); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.hero__title { font-size: clamp(46px, 8.2vw, 118px); line-height: .94; letter-spacing: -.045em; margin: 22px 0 26px; }
.hero__title em { font-size: 1.16em; line-height: .8; }
.line { display: block; overflow: hidden; padding-bottom: .12em; margin-bottom: -.12em; }
.line > span { display: inline-block; }
.js .line > span { transform: translateY(110%) rotate(4deg); transform-origin: left bottom; animation: rise 1.1s var(--ease) forwards; }
.js .line:nth-child(2) > span { animation-delay: .1s; }
.js .line:nth-child(3) > span { animation-delay: .2s; }
@keyframes rise { to { transform: none; } }
.js .hero__in { opacity: 0; transform: translateY(26px); animation: fadeUp 1s var(--ease) var(--d, 0s) forwards; }
@keyframes fadeUp { to { opacity: 1; transform: none; } }
.hero__lead { max-width: 520px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: clamp(40px, 5vw, 64px); padding-top: 26px; border-top: 1px solid var(--line); max-width: 600px; }
.facts dt { font-size: clamp(30px, 3.6vw, 46px); font-weight: 600; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.facts dd { font-size: 13.5px; color: var(--muted); margin-top: 8px; line-height: 1.35; }

.hero__art { position: relative; display: grid; place-items: center; min-height: 440px; }
.sun { position: absolute; width: min(132%, 640px); max-width: none; overflow: visible; fill: var(--red); opacity: .92; animation: breathe 14s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.06) rotate(8deg); } }
.scroll-card {
  position: relative; width: min(100%, 400px); padding: 22px 22px 26px; background: var(--card); border-radius: 26px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line); transform: rotate(-3deg); transition: transform .8s var(--ease);
  will-change: transform;
}
.scroll-card__top { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.scroll-card__top span:first-child { font-family: var(--hz); letter-spacing: .3em; }
.tian-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tian {
  --g: color-mix(in srgb, var(--red) 34%, transparent);
  position: relative; aspect-ratio: 1; border: 1.5px solid color-mix(in srgb, var(--red) 55%, transparent); border-radius: 10px; display: grid; place-items: center;
  font: 500 clamp(70px, 11vw, 120px)/1 var(--hz);
  background:
    repeating-linear-gradient(90deg, var(--g) 0 5px, transparent 5px 10px) 0 50% / 100% 1px no-repeat,
    repeating-linear-gradient(0deg, var(--g) 0 5px, transparent 5px 10px) 50% 0 / 1px 100% no-repeat,
    linear-gradient(45deg, transparent calc(50% - .5px), color-mix(in srgb, var(--red) 16%, transparent) 50%, transparent calc(50% + .5px)),
    linear-gradient(-45deg, transparent calc(50% - .5px), color-mix(in srgb, var(--red) 16%, transparent) 50%, transparent calc(50% + .5px));
}
.tian svg { position: absolute; inset: 0; }
.scroll-card__word { display: flex; align-items: baseline; gap: 12px; margin-top: 18px; padding-right: 54px; }
.scroll-card__word strong { font-size: 30px; font-weight: 600; letter-spacing: -.02em; }
.scroll-card__word span { color: var(--muted); }
.say { position: absolute; right: 20px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; transition: transform .3s var(--ease); }
.say:hover { transform: scale(1.1); }
.say svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stamp {
  position: absolute; top: -22px; right: -18px; width: 74px; height: 74px; display: grid; place-items: center; text-align: center;
  background: var(--red); color: var(--on-red); border-radius: 14px; font: 400 21px/1.05 var(--brush); transform: rotate(12deg);
  box-shadow: 0 10px 24px -10px var(--red-deep); animation: stampIn .7s var(--ease) 1.2s backwards;
}
@keyframes stampIn { from { transform: rotate(-20deg) scale(2.4); opacity: 0; } }
.float { position: absolute; font-family: var(--hz); font-weight: 900; color: var(--ink); will-change: transform; transition: transform .6s var(--ease); pointer-events: none; }
.f1 { left: 0; top: 4%; font-size: 64px; opacity: .9; }
.f2 { left: -14%; bottom: -9%; font-size: 92px; color: var(--paper); -webkit-text-stroke: 1.5px var(--ink); }
.f3 { right: 12%; bottom: -8px; font: italic 500 46px/1 var(--serif); color: var(--jade); }

/* ---------- Бегущая строка ---------- */
.marquee { overflow: hidden; border-block: 1px solid var(--line); padding: 20px 0; background: var(--paper-2); transform: rotate(-1.2deg) scale(1.02); margin-block: 10px; }
.marquee__track { display: flex; gap: 56px; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee span { display: inline-flex; align-items: baseline; gap: 14px; font: 500 clamp(26px, 3.4vw, 42px)/1 var(--hz); white-space: nowrap; }
.marquee span::after { content: '·'; color: var(--red); margin-left: 42px; }
.marquee i { font: italic 500 .62em var(--serif); color: var(--muted); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Секции ---------- */
.section { position: relative; padding-block: clamp(76px, 10vw, 150px); }
.section--alt { background: var(--paper-2); }
.section--ink { background: #14110e; color: #f2ebde; --ink: #f2ebde; --paper: #14110e; --paper-2: #1d1915; --card: #1f1b16; --muted: #a69c8d; --line: rgba(242, 235, 222, .14); --outline: #3b342b; }
.section--red { background: var(--red); color: var(--on-red); --ink: #fff6ea; --muted: rgba(255, 246, 234, .78); --line: rgba(255, 246, 234, .28); overflow: hidden; }
.section--red em { color: #16130f; }
.head { display: grid; grid-template-columns: auto 1fr auto; align-items: end; gap: 22px 26px; margin-bottom: clamp(34px, 5vw, 64px); }
.head--stack { grid-template-columns: auto 1fr; align-items: start; }
.head h2 { margin-top: 12px; max-width: 16ch; }
.head--stack h2 { max-width: none; font-size: clamp(32px, 4.2vw, 56px); }
.quiz__res .send .btn { flex: 1 1 150px; }
.quiz__res .send .btn--red { flex-basis: 100%; }
.head__lead { margin-top: 18px; color: var(--muted); max-width: 46ch; }
.num {
  align-self: start; width: 58px; height: 58px; display: grid; place-items: center; font: 500 30px/1 var(--hz); color: var(--red);
  border: 1.5px solid color-mix(in srgb, var(--red) 55%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--red) 7%, transparent);
}

.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity .9s var(--ease) var(--d, 0s), transform .9s var(--ease) var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Курсы ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 460px; }
.chip, .chips button, .chips--check span {
  padding: 10px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background .3s, color .3s, box-shadow .3s, transform .3s var(--ease); cursor: pointer; display: inline-block; user-select: none;
}
.chip:hover, .chips button:hover, .chips--check span:hover { transform: translateY(-2px); }
.chip[aria-selected='true'], .chips button[aria-pressed='true'], .chips--check input:checked + span { background: var(--ink); color: var(--paper); box-shadow: none; }
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; perspective: 1200px; }
.card {
  --mx: 50%; --my: 0%;
  position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 340px; padding: 24px; border-radius: var(--r);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s var(--ease), box-shadow .4s, opacity .45s, scale .45s var(--ease);
}
.card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(340px circle at var(--mx) var(--my), color-mix(in srgb, var(--red) 20%, transparent), transparent 62%); opacity: 0; transition: opacity .4s; pointer-events: none; }
.card:hover::before { opacity: 1; }
.card:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 50%, transparent), var(--shadow); }
.js .cards:not(.in) .card { opacity: 0; }
.cards.in .card { animation: cardIn .8s var(--ease) calc(var(--i, 0) * 70ms) backwards; }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) rotateX(-12deg); } }
.card[hidden] { display: none; }
.card__hz { font: 500 72px/1 var(--hz); transition: transform .6s var(--ease), color .4s; transform-origin: left bottom; }
.card:hover .card__hz { transform: scale(1.14) rotate(-4deg); color: var(--red); }
.card__py { position: absolute; top: 26px; right: 24px; font: italic 500 20px var(--serif); color: var(--muted); }
.card__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; margin-top: 4px; }
.card__meta span { padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.card__meta span:first-child { background: color-mix(in srgb, var(--jade) 16%, transparent); color: var(--jade); }
.card p { color: var(--muted); font-size: 15px; flex: 1; }
.card__go { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; padding: 4px 0; border-bottom: 1.5px solid var(--red); position: relative; }
.card__go::after { content: '→'; transition: transform .35s var(--ease); }
.card__go:hover::after { transform: translateX(6px); }

/* ---------- HSK ---------- */
.hsk__tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.hsk__tabs button { white-space: nowrap; padding: 16px 8px; border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; font-size: 15px; transition: background .4s var(--ease), color .4s, transform .4s var(--ease), box-shadow .4s; }
.hsk__tabs button small { display: block; font: 500 22px/1.2 var(--hz); opacity: .6; }
.hsk__tabs button:hover { transform: translateY(-3px); }
.hsk__tabs button[aria-selected='true'] { background: var(--red); color: var(--on-red); box-shadow: 0 16px 30px -16px var(--red); }
.hsk__panel { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(20px, 4vw, 60px); align-items: center; margin-top: 16px; padding: clamp(24px, 4vw, 54px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.hsk__big { font: 900 clamp(96px, 14vw, 210px)/1 var(--hz); color: var(--red); text-align: center; letter-spacing: 0; overflow: hidden; white-space: nowrap; }
.hsk__big span { display: inline-block; }
.hsk__big span.swap { animation: swap .6s var(--ease); }
@keyframes swap { from { transform: translateY(40%) scale(.9); opacity: 0; filter: blur(8px); } }
.hsk__label { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.hsk__words { font-size: clamp(40px, 6vw, 84px); font-weight: 600; letter-spacing: -.045em; line-height: 1; margin: 10px 0 18px; font-variant-numeric: tabular-nums; }
.hsk__bar { height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.hsk__bar span { display: block; height: 100%; width: 10%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--red)); transition: width 1s var(--ease); }
.hsk__text { margin: 20px 0 26px; font-size: 18px; color: var(--muted); max-width: 44ch; min-height: 3.1em; }

/* ---------- Тренажёр ---------- */
.lab { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { padding: clamp(22px, 3vw, 38px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.panel__lead { color: var(--muted); margin: 10px 0 24px; font-size: 16px; }
.tone { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; align-items: center; padding: 18px; border-radius: 18px; background: var(--paper); margin-bottom: 16px; }
.tone__chart { width: 100%; }
.tone__grid path { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 5; fill: none; }
#tonePath { fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
#tonePath.go { animation: toneDraw .9s var(--ease); }
@keyframes toneDraw { from { stroke-dashoffset: 1; } }
.tone__word { display: grid; justify-items: center; gap: 4px; text-align: center; }
.tone__hz { font: 500 76px/1 var(--hz); }
.tone__word b { display: block; font-size: 26px; font-weight: 600; }
.tone__word i { font: italic 500 20px var(--serif); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--hz button { width: 46px; height: 46px; padding: 0; font: 500 22px/1 var(--hz); border-radius: 12px; }
.chips--check input { position: absolute; opacity: 0; pointer-events: none; }
.chips--check input:focus-visible + span { outline: 2px solid currentColor; outline-offset: 3px; }
.game { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.game b { display: block; }
.game > div:first-child span { font-size: 14.5px; color: var(--muted); }
.game__opts { display: flex; gap: 8px; }
.game__opts button { width: 46px; height: 46px; border-radius: 12px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 600; transition: background .3s, transform .3s var(--ease); }
.game__opts button:hover:not(:disabled) { transform: translateY(-3px); }
.game__opts button:disabled { opacity: .45; cursor: default; }
.game__opts button.ok { background: var(--wa); color: #fff; box-shadow: none; opacity: 1; }
.game__opts button.no { background: var(--red); color: #fff; box-shadow: none; opacity: 1; animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.game__score { justify-self: end; font-size: 14.5px; color: var(--muted); }
.write { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 24px; align-items: start; }
.tian--big { background-color: var(--paper); border-radius: 16px; touch-action: none; }
.write__word { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.write__word b { font-size: 30px; font-weight: 600; }
.write__word i { font: italic 500 22px var(--serif); color: var(--muted); }
.write__btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.write__msg { margin-top: 14px; font-size: 15px; color: var(--gold); min-height: 1.5em; }

/* ---------- Тест ---------- */
.quiz { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.quiz .head { margin: 0; position: sticky; top: 110px; }
.quiz__card { padding: clamp(22px, 3.4vw, 44px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); min-height: 440px; display: flex; flex-direction: column; }
.quiz__top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.quiz__bar { height: 4px; border-radius: 9px; background: color-mix(in srgb, var(--ink) 9%, transparent); margin: 14px 0 28px; overflow: hidden; }
.quiz__bar span { display: block; height: 100%; background: var(--red); border-radius: inherit; transition: width .6s var(--ease); }
.quiz__q { font-size: clamp(22px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 24px; }
.quiz__q span { font-family: var(--hz); font-weight: 500; }
.quiz__body { animation: fadeUp .5s var(--ease); }
.quiz__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz__opts button { text-align: left; padding: 16px 18px; border-radius: 16px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 17px; font-weight: 500; transition: background .3s, color .3s, transform .3s var(--ease), box-shadow .3s; }
.quiz__opts button:hover:not(:disabled) { transform: translateY(-3px); box-shadow: inset 0 0 0 1.5px var(--ink); }
.quiz__opts button.ok { background: var(--wa); color: #fff; box-shadow: none; }
.quiz__opts button.no { background: var(--red); color: #fff; box-shadow: none; }
.quiz__skip { margin-top: 18px; align-self: flex-start; font-size: 15px; color: var(--muted); border-bottom: 1px dashed currentColor; }
.quiz__start, .quiz__res { margin: auto 0; animation: fadeUp .6s var(--ease); }
.quiz__start h3, .quiz__res h3 { font-size: clamp(26px, 3.2vw, 42px); margin-bottom: 14px; }
.quiz__start p, .quiz__res p { color: var(--muted); margin-bottom: 26px; max-width: 46ch; }
.quiz__ring { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; }
.quiz__ring svg { width: 116px; height: 116px; transform: rotate(-90deg); flex: none; }
.quiz__ring circle { fill: none; stroke-width: 9; stroke: color-mix(in srgb, var(--ink) 9%, transparent); }
.quiz__ring circle + circle { stroke: var(--red); stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.quiz__ring b { font-size: 44px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.quiz__ring small { display: block; font-size: 14px; color: var(--muted); font-weight: 400; margin-top: 6px; }
.quiz__again { margin-top: 16px; font-size: 15px; color: var(--muted); border-bottom: 1px dashed currentColor; }

/* ---------- Калькулятор ---------- */
.calc { display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px; }
.calc__form, .calc__out { padding: clamp(22px, 3.4vw, 44px); border-radius: var(--r); }
.calc__form { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); display: grid; gap: 30px; align-content: center; }
.calc__out { background: #16130f; color: #f2ebde; display: flex; flex-direction: column; }
.field { display: grid; gap: 12px; }
.field__label { font-size: 14px; font-weight: 600; color: var(--muted); }
.field__label b { color: var(--ink); font-size: 17px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.seg button { padding: 13px 8px; border-radius: 12px; font-weight: 600; font-size: 15px; transition: background .35s var(--ease), color .35s, box-shadow .35s; }
.seg button small { display: block; font-weight: 500; font-size: 12px; opacity: .65; margin-top: 2px; }
.seg button[aria-checked='true'] { background: var(--ink); color: var(--paper); box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .5); }
.seg--paper { background: rgba(0, 0, 0, .14); }
.seg--paper button[aria-checked='true'] { background: #fff6ea; color: #16130f; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 9px; background: linear-gradient(90deg, var(--red) var(--p, 25%), color-mix(in srgb, var(--ink) 10%, transparent) var(--p, 25%)); outline-offset: 8px; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); border: 3px solid var(--red); box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .4); cursor: grab; transition: transform .2s; }
.range::-webkit-slider-thumb:active { transform: scale(1.2); cursor: grabbing; }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--card); border: 3px solid var(--red); cursor: grab; }
.calc__cap { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: #a69c8d; font-weight: 600; }
.calc__sum { font-size: clamp(46px, 6.4vw, 86px); font-weight: 600; letter-spacing: -.05em; line-height: 1; margin: 8px 0 24px; font-variant-numeric: tabular-nums; }
.calc__list { display: grid; margin-bottom: 26px; }
.calc__list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid rgba(242, 235, 222, .14); font-size: 15.5px; color: #a69c8d; }
.calc__list b { color: #f2ebde; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc__out .send { margin-top: auto; }

/* ---------- FAQ ---------- */
.faq { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.faq .head { margin: 0; position: sticky; top: 110px; }
.faq__list { border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0; cursor: pointer; font-size: clamp(18px, 1.8vw, 22px); font-weight: 600; letter-spacing: -.02em; transition: color .3s; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 400; font-size: 22px; transition: transform .5s var(--ease), background .3s, color .3s; }
summary:hover { color: var(--red); }
details[open] summary::after { transform: rotate(135deg); background: var(--red); color: var(--on-red); box-shadow: none; }
details > div { padding-bottom: 26px; color: var(--muted); max-width: 58ch; }
details[open] > div { animation: fadeUp .5s var(--ease); }

/* ---------- Запись ---------- */
.enroll { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(24px, 5vw, 80px); align-items: start; }
.enroll__glyph { position: absolute; left: -3vw; bottom: -10vw; font: 900 clamp(300px, 46vw, 680px)/1 var(--hz); color: #16130f; opacity: .09; pointer-events: none; }
.enroll__copy h2 { margin: 14px 0 20px; }
.enroll__copy > p:not(.eyebrow) { max-width: 44ch; color: var(--muted); }
.steps { display: grid; gap: 12px; margin-top: 30px; }
.steps li { display: flex; align-items: center; gap: 14px; font-weight: 500; }
.steps b { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #16130f; color: #fff6ea; font-size: 14px; }
.attached { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px; }
.attached span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border-radius: 999px; background: rgba(0, 0, 0, .18); font-size: 14px; animation: fadeUp .5s var(--ease); }
.attached button { width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .2); line-height: 1; }
.form { display: grid; gap: 18px; padding: clamp(20px, 3vw, 38px); border-radius: 28px; background: #16130f; color: #f2ebde; --ink: #f2ebde; --paper: #16130f; --muted: #a69c8d; --line: rgba(242, 235, 222, .16); box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .7); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input { display: grid; gap: 8px; }
.input > span { font-size: 14px; font-weight: 600; color: var(--muted); }
.input input, .input select, .input textarea { width: 100%; padding: 15px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: rgba(255, 255, 255, .04); outline: 0; transition: border-color .3s, background .3s; resize: vertical; }
.input select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a69c8d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; padding-right: 42px; }
.input select option { color: #16130f; }
.input ::placeholder { color: #7a7166; }
.input input:focus, .input select:focus, .input textarea:focus { border-color: var(--red); background: rgba(255, 255, 255, .07); }
.err { display: none; font: 500 13px var(--sans); color: #ff8f78; letter-spacing: 0; }
.input.is-bad input { border-color: #ff8f78; animation: shake .4s; }
.input.is-bad .err { display: block; }
.form__hint { font-size: 13px; color: var(--muted); }

/* ---------- Подвал ---------- */
.footer { background: #100e0b; color: #f2ebde; }
.footer__row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.footer__nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-inline: auto; font-size: 15px; color: #a69c8d; }
.footer__nav a:hover, .footer__msg a:hover { color: #fff; }
.footer__msg { display: flex; gap: 18px; font-weight: 600; }
.footer__msg a { border-bottom: 1.5px solid var(--red); padding-bottom: 2px; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 34px; padding-top: 22px; border-top: 1px solid rgba(242, 235, 222, .12); font-size: 13.5px; color: #8b8275; }

/* ---------- Плавающая кнопка и уведомление ---------- */
.fab { position: fixed; right: clamp(16px, 2.4vw, 30px); bottom: clamp(16px, 2.4vw, 30px); z-index: 70; display: grid; justify-items: end; gap: 10px; }
.fab__btn { width: 60px; height: 60px; border-radius: 50%; background: var(--red); color: var(--on-red); display: grid; place-items: center; box-shadow: 0 16px 34px -12px var(--red-deep); transition: transform .4s var(--ease); position: relative; }
.fab__btn::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--red); animation: ring 2.6s infinite; }
@keyframes ring { to { transform: scale(1.7); opacity: 0; } }
.fab__btn:hover { transform: scale(1.08) rotate(-8deg); }
.fab__btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.fab__menu { display: grid; gap: 8px; justify-items: end; }
.fab__item { padding: 12px 18px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .5); opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; transition: opacity .35s, transform .45s var(--ease); }
.fab__item--tg { background: var(--tg); transition-delay: .06s; }
.fab__item--wa { background: var(--wa); }
.fab.is-open .fab__item { opacity: 1; transform: none; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 95; max-width: min(520px, calc(100vw - 32px)); padding: 15px 22px; border-radius: 16px; background: #16130f; color: #f2ebde; font-size: 15px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(242, 235, 222, .14); transform: translate(-50%, calc(100% + 60px)); opacity: 0; visibility: hidden; transition: transform .6s var(--ease), opacity .4s, visibility 0s .6s; }
.toast.is-on { transform: translate(-50%, 0); opacity: 1; visibility: visible; transition-delay: 0s; }

/* ---------- Адаптив ---------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .nav a { padding-inline: 9px; }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .header__cta { display: none; }
  .nav + .header__actions { margin-left: auto; }
  .nav {
    position: fixed; inset: 0; z-index: -1; flex-direction: column; justify-content: center; gap: 4px; padding: 90px 24px 40px; margin: 0;
    background: var(--paper); clip-path: circle(0 at calc(100% - 44px) 36px); transition: clip-path .7s var(--ease); height: 100dvh;
  }
  .nav.is-open { clip-path: circle(150% at calc(100% - 44px) 36px); }
  .nav a { font-size: clamp(30px, 8vw, 44px); font-weight: 600; letter-spacing: -.03em; color: var(--ink); padding: 8px 4px; border-radius: 0; background: none !important; }
  .hero__grid, .quiz, .faq, .enroll, .calc, .lab, .hsk__panel { grid-template-columns: 1fr; }
  .hero__art { min-height: 0; padding: 40px 14px 20px; }
  .quiz .head, .faq .head { position: static; }
  .head { grid-template-columns: auto 1fr; }
  .filters { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
  .hsk__big { text-align: left; font-size: clamp(88px, 22vw, 150px); }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .cards, .form__row, .quiz__opts, .write, .tone { grid-template-columns: 1fr; }
  .seg button { font-size: 13px; padding: 12px 2px; }
  .hsk__tabs { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .hsk__tabs button { padding: 12px 2px; font-size: 13px; }
  .hsk__tabs button small { font-size: 19px; }
  .facts { gap: 12px; }
  .num { width: 46px; height: 46px; font-size: 24px; }
  .head { gap: 16px; }
  .tian--big { max-width: 260px; }
  .game { grid-template-columns: 1fr; }
  .game__score { justify-self: start; }
  .card { min-height: 0; }
  .stamp { right: -8px; }
  .f1, .f2, .f3 { display: none; }
}
/* Спокойный режим: класс .calm ставится в <head>, если анимации отключены в системе
   или посетитель выключил их сам (кнопка в подвале). */
html.calm { scroll-behavior: auto; }
.calm *, .calm *::before, .calm *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
.calm.js [data-reveal], .calm.js .hero__in, .calm.js .line > span { opacity: 1; transform: none; }
.motion-ask { display: none; }
.ask-motion .motion-ask {
  position: fixed; left: clamp(16px, 2.4vw, 30px); bottom: clamp(16px, 2.4vw, 30px); z-index: 75; display: grid; gap: 12px; justify-items: start;
  width: min(330px, calc(100vw - 110px)); padding: 18px; border-radius: 20px; background: #16130f; color: #f2ebde; font-size: 14.5px; line-height: 1.4;
  box-shadow: 0 24px 50px -22px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(242, 235, 222, .14);
}
.motion-ask__no { font-size: 13.5px; color: #a69c8d; border-bottom: 1px dashed currentColor; }
.footer__motion { color: inherit; border-bottom: 1px dashed currentColor; }
.footer__motion:hover { color: #fff; }

/* =====================================================================
   Версия 2: заставка, тушь на WebGL, сцены на прокрутке, курсор
   ===================================================================== */
:root { --R: clamp(28px, 4vw, 56px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }
body { overflow-x: clip; }

/* ---------- Заставка ---------- */
.loader { display: none; }
.js .loader {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: var(--red); color: var(--on-red);
  transition: transform 1.15s cubic-bezier(.76, 0, .18, 1); animation: loaderSafe .01s 7s forwards;
}
.loader::after { content: ''; position: absolute; left: -10%; right: -10%; top: calc(100% - 1px); height: 16vh; background: var(--red); border-radius: 0 0 50% 50% / 0 0 100% 100%; }
.js.is-ready .loader { transform: translateY(-120%); pointer-events: none; }
@keyframes loaderSafe { to { visibility: hidden; pointer-events: none; } }
.loader__top { position: absolute; top: clamp(16px, 4vw, 40px); left: clamp(16px, 4vw, 40px); font: 500 15px/1 var(--hz); letter-spacing: .5em; opacity: .8; }
.loader__hz { width: min(46vw, 260px); aspect-ratio: 1; display: grid; place-items: center; font: 400 150px/1 var(--brush); }
.loader__row { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; align-items: flex-end; padding: clamp(16px, 4vw, 40px); font-weight: 600; letter-spacing: -.02em; }
.loader__row span:first-child { font-size: 18px; }
.loader__row span:last-child { font-size: clamp(72px, 13vw, 170px); line-height: .78; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }

/* ---------- Первый экран: появление после заставки ---------- */
.js .line > span, .js .hero__in, .js .stamp { animation-name: none; }
.js .stamp { opacity: 0; }
.js.is-ready .line > span { animation-name: rise; animation-duration: 1.25s; }
.js.is-ready .line:nth-child(1) > span { animation-delay: .35s; }
.js.is-ready .line:nth-child(2) > span { animation-delay: .46s; }
.js.is-ready .line:nth-child(3) > span { animation-delay: .57s; }
.js.is-ready .hero__in { animation-name: fadeUp; animation-delay: calc(var(--d, 0s) + .45s); }
.js.is-ready .stamp { opacity: 1; animation-name: stampIn; animation-delay: 1.9s; }

.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.hero__gl { position: absolute; inset: 0; width: 100%; height: 100%; opacity: calc(1 - var(--hp, 0) * .55); }
.has-gl .sun { display: none; }
.hero__copy { transform: translate3d(0, calc(var(--hp, 0) * -90px), 0); opacity: calc(1 - var(--hp, 0) * 1.5); }
.hero__art { transform: translate3d(0, calc(var(--hp, 0) * 60px), 0); }
.card-wrap { position: relative; width: min(100%, 400px); perspective: 1100px; }
.scroll-card { width: 100%; transition: transform .55s var(--ease); }
.scroll-card__glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at 30% 0%, rgba(255, 255, 255, .26), transparent 58%); }
.hero__vert { position: absolute; right: clamp(8px, 1.6vw, 26px); top: 50%; transform: translateY(-50%); writing-mode: vertical-rl; display: flex; gap: 1.6em; font: 500 15px/1 var(--hz); letter-spacing: .55em; color: var(--muted); }
.hero__vert span + span { color: var(--ink); }
.hero__scroll { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); opacity: calc(1 - var(--hp, 0) * 6); }
.hero__scroll span { width: 1.5px; height: 42px; background: var(--ink); transform-origin: top; animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: translateY(42px) scaleY(0); } }

/* ---------- Бегущие строки ---------- */
.marquee__track + .marquee__track { margin-top: 14px; }
.marquee__track--rev { animation-direction: reverse; }
.marquee__track--rev span { color: transparent; -webkit-text-stroke: 1px var(--ink); }
.marquee__track--rev i { -webkit-text-stroke: 0; color: var(--muted); }
.marquee--js .marquee__track { animation: none; will-change: transform; }

/* ---------- Манифест ---------- */
.manifest { padding-block: clamp(90px, 13vw, 190px) clamp(40px, 6vw, 90px); }
.manifest__text { margin-top: 28px; font-size: clamp(30px, 5.6vw, 86px); font-weight: 600; letter-spacing: -.04em; line-height: 1.07; }
.manifest__text b { font: italic 500 1.12em var(--serif); letter-spacing: -.01em; color: var(--red); }
.hzchip { display: inline-grid; place-items: center; width: 1.08em; height: 1.08em; vertical-align: -.14em; border-radius: .22em; background: var(--red); color: var(--on-red); font: 400 .8em/1 var(--brush); transform: rotate(-6deg); }
.manifest__text .mw { opacity: .13; transition: opacity .5s var(--ease); }
.manifest__text .mw.on { opacity: 1; }
.manifest__text .hzchip.mw { transform: rotate(-30deg) scale(.3); transition: opacity .4s, transform .7s cubic-bezier(.3, 1.7, .5, 1); }
.manifest__text .hzchip.mw.on { transform: rotate(-6deg) scale(1); }

/* ---------- Заголовки: слова выезжают из-под маски, курсив подчёркнут мазком ---------- */
h2 .w { position: relative; display: inline-block; overflow: hidden; vertical-align: bottom; padding: .06em .08em .16em; margin: -.06em -.08em -.16em; }
h2 .w > span { display: inline-block; transform: translateY(120%) rotate(7deg); transform-origin: left bottom; transition: transform 1.1s var(--ease) calc(var(--i, 0) * 70ms + .1s); }
.in h2 .w > span { transform: none; }
h2 em .w::after {
  content: ''; position: absolute; left: .08em; right: .08em; bottom: .07em; height: .085em; background: currentColor; opacity: .85;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8C40 3 90 1 198 4c-52 2-120 3-196 7z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8C40 3 90 1 198 4c-52 2-120 3-196 7z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease) .75s;
}
.in h2 em .w::after { transform: scaleX(1); }

/* ---------- Подход: стопка карточек ---------- */
.stack { display: grid; gap: 22px; }
.stack__card { position: sticky; top: calc(92px + var(--i) * 16px); }
.stack__inner {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 64px); align-items: center; overflow: hidden;
  min-height: min(62vh, 500px); padding: clamp(24px, 4vw, 60px); border-radius: clamp(24px, 3vw, 40px);
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 -24px 50px -34px rgba(40, 20, 5, .4);
  transform-origin: 50% 0; transform: scale(var(--s, 1)); filter: brightness(var(--b, 1)); will-change: transform;
}
.stack__copy { position: relative; z-index: 1; display: grid; gap: 16px; align-content: center; }
.stack__n { font: italic 500 24px/1 var(--serif); color: var(--red); }
.stack__n i { color: var(--muted); }
.stack__copy h3 { font-size: clamp(28px, 3.7vw, 52px); letter-spacing: -.035em; line-height: 1; }
.stack__copy p { color: var(--muted); max-width: 42ch; }
.stack__links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.stack__viz { position: relative; z-index: 1; display: grid; place-items: center; }
.stack__hz { position: absolute; right: -.03em; bottom: -.2em; font: 900 clamp(140px, 22vw, 330px)/1 var(--hz); white-space: nowrap; opacity: .055; pointer-events: none; }
.stack__card--red .stack__inner { background: var(--red); color: var(--on-red); --muted: rgba(255, 246, 234, .84); --line: rgba(255, 246, 234, .3); box-shadow: 0 -24px 50px -34px rgba(40, 20, 5, .5); }
.stack__card--red .stack__n { color: #16130f; }
.stack__card--red .stack__hz { opacity: .13; }
.stack__card--ink .stack__inner { background: #16130f; color: #f2ebde; --muted: #a69c8d; --line: rgba(242, 235, 222, .16); --red: #f0492c; box-shadow: 0 -24px 50px -34px rgba(0, 0, 0, .7); }
.stack__card--jade .stack__inner { background: #1b5e4f; color: #f2ebde; --muted: rgba(242, 235, 222, .82); --line: rgba(242, 235, 222, .24); box-shadow: 0 -24px 50px -34px rgba(0, 0, 0, .6); }
.stack__card--jade .stack__n { color: #f3c96a; }
.stack__card--ink .stack__hz, .stack__card--jade .stack__hz { opacity: .09; }

.viz-tones { width: 100%; max-width: 480px; overflow: visible; }
.viz-tones__grid { fill: none; stroke: var(--line); stroke-dasharray: 3 6; }
.viz-tones__line { fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.js .viz-tones__line { stroke-dashoffset: 1; }
.stack__card.in .viz-tones__line { animation: draw 2.8s var(--ease) .3s forwards; }
.viz-tones__py text { font: italic 500 22px var(--serif); fill: var(--muted); text-anchor: middle; }

.eq { display: flex; align-items: flex-start; justify-content: center; gap: clamp(8px, 1.6vw, 22px); }
.eq span { display: grid; justify-items: center; gap: 10px; }
.eq b { font: 500 clamp(64px, 8.6vw, 130px)/1 var(--hz); }
.eq i { font: italic 500 18px var(--serif); opacity: .9; }
.eq em { align-self: center; margin-bottom: 30px; font: 400 clamp(30px, 4vw, 56px)/1 var(--sans); color: inherit; opacity: .6; }
.eq__res b { color: #16130f; }
.js .eq > * { opacity: 0; transform: translateY(26px) scale(.86); }
.js .stack__card.in .eq > * { opacity: 1; transform: none; transition: opacity .7s var(--ease), transform .8s cubic-bezier(.3, 1.6, .5, 1); }
.js .stack__card.in .eq em { opacity: .6; }
.stack__card.in .eq > :nth-child(1) { transition-delay: .2s; }
.stack__card.in .eq > :nth-child(2) { transition-delay: .4s; }
.stack__card.in .eq > :nth-child(3) { transition-delay: .55s; }
.stack__card.in .eq > :nth-child(4) { transition-delay: .75s; }
.stack__card.in .eq > :nth-child(5) { transition-delay: .95s; }

.chat { display: grid; gap: 10px; width: min(100%, 410px); }
.chat__b { display: grid; gap: 3px; width: fit-content; max-width: 90%; padding: 14px 18px; border-radius: 20px 20px 20px 6px; background: rgba(242, 235, 222, .1); box-shadow: inset 0 0 0 1px var(--line); }
.chat__b b { font: 500 24px/1.2 var(--hz); }
.chat__b b.ru { font: 600 17px/1.3 var(--sans); }
.chat__b i { font-style: normal; font-size: 13.5px; color: var(--muted); }
.chat__b--me { justify-self: end; border-radius: 20px 20px 6px 20px; background: var(--red); color: var(--on-red); box-shadow: none; --muted: rgba(255, 246, 234, .82); }
.stack__card--jade .chat__b--me { background: #f2ebde; color: #16130f; --muted: #5d564c; }
.js .chat__b { opacity: 0; transform: translateY(18px) scale(.94); transform-origin: left bottom; }
.js .chat__b--me { transform-origin: right bottom; }
.js .stack__card.in .chat__b { opacity: 1; transform: none; transition: opacity .6s var(--ease) .3s, transform .7s cubic-bezier(.3, 1.5, .5, 1) .3s; }
.js .stack__card.in .chat__b:nth-child(2) { transition-delay: .85s; }
.js .stack__card.in .chat__b:nth-child(3) { transition-delay: 1.4s; }

/* ---------- Курсы: иероглиф пишется по чертам при наведении ---------- */
.card__hz { display: block; width: 76px; height: 76px; font: 500 72px/76px var(--hz); }
.card__hz svg { display: block; }

/* ---------- Первый экран: визитка преподавателя ---------- */
.card-wrap { width: min(100%, 372px); }
.vcard { padding: 12px 12px 14px; }
.vcard__photo { position: relative; display: block; aspect-ratio: 1 / 1.1; border-radius: 18px; overflow: hidden; background: #e8dccb; }
.vcard__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; transition: transform .9s var(--ease); }
.vcard__photo:hover img { transform: scale(1.04); }
.vcard__plate { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px 11px 15px; border-radius: 14px; background: color-mix(in srgb, var(--card) 93%, transparent); box-shadow: 0 12px 26px -16px rgba(0, 0, 0, .5); }
.vcard__plate b { display: block; font-size: 19px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.vcard__plate i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hero__art .f1 { left: -13%; top: -3%; }
.hero__art .f2 { left: -27%; bottom: 6%; }
.hero__art .f3 { right: -2%; bottom: -46px; }
.vcard__plate em { font-family: var(--sans); font-style: normal; font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-radius: 999px; background: var(--red); color: var(--on-red); white-space: nowrap; transition: transform .35s var(--ease); }
.vcard__photo:hover .vcard__plate em { transform: translateX(3px); }
.vcard__word { position: relative; display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 0 56px 0 4px; }
.vcard .tian-row { flex: none; grid-template-columns: 52px 52px; gap: 6px; }
.vcard .tian { font-size: 34px; border-radius: 8px; }
.vcard .scroll-card__word { display: grid; gap: 0; margin: 0; padding: 0; min-width: 0; }
.vcard .scroll-card__word small { font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.vcard .scroll-card__word strong { font-size: 21px; line-height: 1.2; }
.vcard .scroll-card__word span { font-size: 13.5px; line-height: 1.2; }
.vcard .say { right: 2px; top: 50%; bottom: auto; margin-top: -22px; }

.facts dt small { font-size: .42em; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.facts dd a { color: var(--ink); border-bottom: 1.5px solid var(--red); white-space: nowrap; }

/* ---------- Курсы: когда их один-два, карточки шире ---------- */
.cards--few { grid-template-columns: repeat(2, 1fr); }
.cards--few .card { min-height: 280px; }
#calcSign { font-size: .46em; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.calc__sum { white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 901px) { .quick--nocourse .quick__row { grid-template-columns: 1fr 1.2fr auto auto; } }
/* форматов пять — в переключателях калькулятора и формы они идут сеткой, а не в одну строку */
#calcFormat, #formFormat { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* ---------- Карточка преподавателя: цифры, абзацы, цитата ---------- */
.teacher__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 22px 0 6px; }
.teacher__stats div { padding: 16px 16px 14px; border-radius: 18px; background: color-mix(in srgb, var(--red) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 22%, transparent); }
.teacher__stats dt { font-size: clamp(22px, 2.5vw, 34px); font-weight: 600; letter-spacing: -.04em; line-height: 1; color: var(--red); white-space: nowrap; }
.teacher__stats dd { margin: 8px 0 0; font-size: 13.5px; line-height: 1.3; color: var(--muted); }
.teacher__text + .teacher__text { margin-top: 10px; }
.teachers--solo .teacher__text { font-size: 17px; line-height: 1.55; max-width: 60ch; }
.teacher__quote { margin: 22px 0 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--red); }
.teacher__quote p { margin: 0; font: italic 500 clamp(19px, 1.8vw, 23px)/1.4 var(--serif); color: var(--ink); }
.teacher__quote cite { display: block; margin-top: 8px; font-style: normal; font-size: 13.5px; color: var(--muted); }
.teachers--solo .teacher__photo { max-height: none; }
.teachers--solo .teacher__photo { position: relative; }
.teachers--solo .teacher__photo img { object-position: 50% 20%; }
@media (min-width: 761px) { .teachers--solo .teacher__photo img { position: absolute; inset: 0; } }
@media (max-width: 520px) { .teacher__stats { grid-template-columns: 1fr; } }

/* ---------- Интерактивы: три крупные карточки с живыми мини-сценами ---------- */
.tools { position: relative; padding-block: clamp(30px, 5vw, 70px) clamp(60px, 8vw, 110px); }
.tools__head { text-align: center; margin-bottom: clamp(30px, 4vw, 54px); }
.tools__head .eyebrow { justify-content: center; }
.tools__head h2 { font-size: clamp(40px, 7vw, 96px); font-weight: 600; letter-spacing: -.045em; line-height: 1; margin: 14px 0 0; }
.tools__lead { max-width: 560px; margin: 18px auto 0; color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); }
.tools__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool { position: relative; display: flex; flex-direction: column; padding: 14px 14px 28px; border-radius: 30px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -36px rgba(0, 0, 0, .6); overflow: hidden; transition: transform .6s var(--ease), box-shadow .5s; }
.tool:hover { transform: translateY(-8px); box-shadow: inset 0 0 0 2px var(--red), 0 44px 70px -34px color-mix(in srgb, var(--red) 55%, transparent); }
.tool__viz { position: relative; display: grid; place-items: center; height: 220px; border-radius: 20px; overflow: hidden; }
.tool--ai .tool__viz { background: linear-gradient(135deg, #f0492c, #a81f0c); color: #fff6ea; }
.tool--slides .tool__viz { background: linear-gradient(135deg, #1f6f5b, #0f3d33); }
.tool--cards .tool__viz { background: linear-gradient(135deg, #c99a2e, #8a5a10); }
.tool__tag { align-self: flex-start; margin: 20px 12px 0; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.tool h3 { margin: 12px 12px 0; font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.tool p { margin: 12px 12px 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
/* ИИ-собеседник: аватар, «голос» из полосок, микрофон */
.tool--ai .tool__viz { grid-template-columns: auto 1fr auto; gap: 14px; padding: 0 22px; }
.tool__ava, .tool__mic { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; }
.tool__ava { background: #fff6ea; color: #a81f0c; font: 900 30px/1 var(--hz); }
.tool__mic { background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); animation: micPulse 2.2s ease-out infinite; }
.tool__mic svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes micPulse { to { box-shadow: 0 0 0 22px rgba(255, 255, 255, 0); } }
.tool__wave { display: flex; align-items: center; justify-content: center; gap: 6px; height: 90px; }
.tool__wave i { width: 6px; height: 100%; border-radius: 6px; background: #fff6ea; transform: scaleY(.2); animation: wave 1.2s ease-in-out infinite; }
.tool__wave i:nth-child(2n) { animation-delay: -.25s; } .tool__wave i:nth-child(3n) { animation-delay: -.55s; } .tool__wave i:nth-child(5n) { animation-delay: -.85s; }
@keyframes wave { 50% { transform: scaleY(1); } }
/* Презентация: слайд с вопросом и вариантами */
.tool__slide { display: grid; justify-items: center; gap: 4px; width: 82%; padding: 18px 14px 14px; border-radius: 16px; background: #fff6ea; color: #16130f; box-shadow: 0 20px 34px -18px rgba(0, 0, 0, .6); transform: rotate(-2deg); }
.tool__slide b { font: 900 34px/1.1 var(--hz); }
.tool__slide small { font: italic 500 15px var(--serif); opacity: .7; }
.tool__opts { display: flex; gap: 6px; margin-top: 10px; }
.tool__opts i { padding: 6px 10px; border-radius: 9px; background: rgba(22, 19, 15, .08); font: 500 15px/1 var(--hz); font-style: normal; }
.tool__opts i.ok { animation: pick 3s var(--ease) infinite; }
@keyframes pick { 0%, 35% { background: rgba(22, 19, 15, .08); color: inherit; transform: none; } 45%, 90% { background: #1f6f5b; color: #fff; transform: scale(1.08); } }
.tool__dots { display: flex; gap: 5px; margin-top: 12px; }
.tool__dots i { width: 18px; height: 4px; border-radius: 4px; background: rgba(22, 19, 15, .15); }
.tool__dots i:first-child, .tool__dots i:nth-child(2) { background: #1f6f5b; }
/* Карточки: колода, верхняя переворачивается */
.tool__deck { position: relative; width: 170px; height: 130px; perspective: 800px; }
.tool__deck > span { position: absolute; inset: 0; border-radius: 16px; background: #fff6ea; box-shadow: 0 18px 30px -16px rgba(0, 0, 0, .55); }
.tool__deck > span:nth-child(1) { transform: rotate(-9deg) translate(-12px, 6px); opacity: .55; }
.tool__deck > span:nth-child(2) { transform: rotate(6deg) translate(10px, 4px); opacity: .8; }
.tool__flip { transform-style: preserve-3d; animation: flip 5s var(--ease) infinite; }
.tool__flip b { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px; border-radius: 16px; background: #fff6ea; color: #16130f; backface-visibility: hidden; font: 900 40px/1 var(--hz); }
.tool__flip b small { font: italic 500 16px var(--serif); opacity: .7; }
.tool__flip .back { transform: rotateY(180deg); background: #16130f; color: #fff6ea; font: 600 26px/1 var(--sans); }
@keyframes flip { 0%, 40% { transform: rotateY(0); } 50%, 90% { transform: rotateY(180deg); } 100% { transform: rotateY(360deg); } }
@media (max-width: 900px) { .tools__grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }

/* ---------- Тарифы крупно ---------- */
.filters[hidden] { display: none; }
.cards.plans { grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.plan { min-height: 0; padding: clamp(24px, 2.6vw, 36px); gap: 0; }
.plan h3 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.03em; margin-top: 14px; }
.plan .card__meta { margin-top: 12px; }
.plan__price { margin: 26px 0 0; font-size: 22px; font-weight: 600; color: var(--ink); flex: none; line-height: 1; white-space: nowrap; }
.plan__price b { font-size: clamp(46px, 5vw, 72px); font-weight: 600; letter-spacing: -.05em; }
.plan__price small { display: inline-block; margin-left: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
.card p.plan__alt { flex: none; margin-top: 10px; font-size: 15.5px; font-weight: 600; color: var(--ink); opacity: .8; }
.card p.plan__text { flex: none; margin-top: 20px; font-size: 16px; line-height: 1.5; }
.plan__list { flex: 1; margin: 18px 0 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--line); display: grid; gap: 10px; align-content: start; font-size: 15px; }
.plan__list li { position: relative; padding-left: 26px; }
.plan__list li::before { content: ''; position: absolute; left: 2px; top: .42em; width: 12px; height: 7px; border-left: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(-45deg); }
.plan__go { margin-top: 26px; justify-content: center; }
/* оценки тарифа: пять делений */
.plan__rate { display: grid; gap: 9px; margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.plan__rate div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan__rate dt { font-size: 14.5px; color: var(--muted); }
.plan__rate dd { display: flex; gap: 4px; margin: 0; flex: none; }
.plan__rate i { width: 20px; height: 7px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.plan__rate i.on { background: var(--red); }
/* пакеты по месяцам */
.plan__packs { display: grid; gap: 6px; margin-top: 20px; padding: 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.card .plan__packs p { flex: none; margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.plan__packs div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 15px; }
.plan__packs b { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan__packs em { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--jade) 18%, transparent); color: var(--jade); font: 600 12px var(--sans); }
.plan .plan__list { flex: 1; }
.plan--top { box-shadow: inset 0 0 0 2px var(--red), var(--shadow); }
.plan__tag { align-self: flex-start; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 12.5px; font-weight: 600; }
@media (max-width: 1000px) { .cards.plans { grid-template-columns: 1fr; max-width: 560px; } }

/* ---------- Просмотр отзыва или сертификата поверх страницы ---------- */
.zoom { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: clamp(14px, 4vw, 48px); background: rgba(12, 10, 8, .88); cursor: zoom-out; animation: zoomIn .3s var(--ease); }
.zoom[hidden] { display: none; }
.zoom img { max-width: 100%; max-height: calc(100vh - 2 * clamp(14px, 4vw, 48px)); border-radius: 14px; box-shadow: 0 40px 90px -30px #000; }
.zoom button { position: absolute; top: 14px; right: 16px; width: 46px; height: 46px; border-radius: 50%; background: #f2ebde; color: #16130f; font-size: 26px; line-height: 1; }
@keyframes zoomIn { from { opacity: 0; } }
.review__shot { cursor: zoom-in; }
.review__shot:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.cert { cursor: zoom-in; }
/* ---------- Цены: условия под калькулятором ---------- */
.pay { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; }
.pay li { padding: 22px 24px; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-size: 15px; line-height: 1.45; }
.pay b { display: block; margin-bottom: 6px; color: var(--ink); font-size: 17px; font-weight: 600; }
@media (max-width: 760px) { .cards--few, .pay { grid-template-columns: 1fr; } }

/* ---------- Быстрая запись под первым экраном ---------- */
.quick-wrap { position: relative; z-index: 3; margin-top: -46px; padding-bottom: 40px; }
.quick { --q: #17130f; display: grid; justify-items: center; color: #f2ebde; }
.quick__title { margin: 0 0 -1px; padding: 16px clamp(22px, 3.4vw, 44px) 10px; border-radius: 28px 28px 0 0; background: var(--q); font-size: clamp(26px, 3.8vw, 50px); font-weight: 600; letter-spacing: -.035em; line-height: 1.05; text-align: center; }
.quick__title em { color: var(--red); }
.quick__bar { width: 100%; padding: 20px clamp(16px, 2.6vw, 34px) 16px; border-radius: 30px; background: var(--q); box-shadow: 0 34px 60px -34px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(242, 235, 222, .1); }
.quick__lead { margin: 0 0 14px; text-align: center; font-weight: 600; font-size: 16px; }
.quick__row { display: grid; grid-template-columns: 1fr 1.15fr 1.3fr auto auto; gap: 10px; }
.quick input, .quick select { width: 100%; min-width: 0; height: 52px; padding: 0 16px; border: 0; border-radius: 13px; background: #f2ebde; color: #16130f; font: inherit; font-size: 15.5px; transition: box-shadow .25s; }
.quick input::placeholder { color: #8b8275; }
.quick input:focus-visible, .quick select:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 65%, transparent); }
.quick .is-bad { box-shadow: 0 0 0 3px var(--red); }
.quick .btn { height: 52px; padding: 0 22px; border-radius: 13px; justify-content: center; }
.quick__hint { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: #a69c8d; }
@media (max-width: 900px) {
  .quick-wrap { margin-top: 26px; }
  .quick__row { grid-template-columns: 1fr 1fr; }
  .quick__row select { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .quick__row input { grid-column: 1 / -1; }
}

/* ---------- Преподаватели ---------- */
.teachers { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.teacher { display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.teacher__photo { aspect-ratio: 4 / 4.4; background: #e8dccb; display: grid; place-items: center; overflow: hidden; }
.teacher__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; transition: transform 1.1s var(--ease); }
.teacher:hover .teacher__photo img { transform: scale(1.035); }
.teacher__photo span { font: 900 110px/1 var(--sans); color: var(--red); }
.teacher__body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.teacher__role { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.teacher h3 { font-size: clamp(26px, 2.6vw, 34px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 8px 0 0; }
.teacher__text { color: var(--muted); margin-top: 14px; max-width: 52ch; }
.teacher__note { font-size: 13px; color: var(--muted); margin-top: 22px; }
.teacher__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.teacher__tags li { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.teacher__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: auto; padding-top: 28px; }
.teacher__more { font-weight: 600; font-size: 15px; border-bottom: 1.5px solid var(--red); padding: 4px 0; }
/* один преподаватель — широкая карточка: фото слева, текст справа */
.teachers--solo { grid-template-columns: 1fr; }
.teachers--solo .teacher { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); }
.teachers--solo .teacher__photo { aspect-ratio: auto; min-height: 420px; max-height: 560px; }
.teachers--solo .teacher__body { justify-content: center; padding: clamp(24px, 4.4vw, 60px); }
.teachers--solo .teacher h3 { font-size: clamp(34px, 4.6vw, 62px); }
.teachers--solo .teacher__cta { margin-top: 0; padding-top: 34px; }

/* ---------- Отзывы ---------- */
.reviews { columns: 2; column-gap: 16px; }
.review { position: relative; break-inside: avoid; margin: 0 0 16px; padding: clamp(22px, 2.6vw, 32px); border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.review::before { content: '评'; position: absolute; right: 22px; top: 16px; font: 900 46px/1 var(--hz); color: color-mix(in srgb, var(--red) 18%, transparent); pointer-events: none; }
.review blockquote { margin: 0; padding-right: 34px; }
.review p { margin: 0 0 12px; font-size: 16.5px; line-height: 1.55; }
/* отзыв-скриншот: тёмная подложка в цвет мессенджера, картинка не растягивается больше своего размера */
.review--shot { padding: 14px 14px 0; }
.review--shot::before { display: none; }
.review__shot { display: grid; place-items: center; padding: 16px; border-radius: 16px; background: #10161d; }
.review__shot img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.review.review--shot figcaption { margin-top: 0; padding: 14px 6px; border-top: 0; }
.review figcaption { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.review__ava { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: var(--on-red); font-weight: 700; }
.review figcaption b { display: block; font-weight: 600; }
.review figcaption i { display: block; font-style: normal; font-size: 13px; color: var(--muted); }
/* раскладка «вразброс»: карточки чуть повёрнуты и сдвинуты, лежат как снимки на столе;
   при наведении карточка выравнивается и приподнимается. Новые отзывы подхватывают это сами. */
.reviews { column-gap: 26px; padding: 14px 6px 0; }
.review { margin-bottom: 30px; transform: rotate(var(--rot, 0deg)) translate(var(--dx, 0), var(--dy, 0)); box-shadow: inset 0 0 0 1px var(--line), 0 26px 46px -28px rgba(0, 0, 0, .55); transition: transform .6s var(--ease), box-shadow .5s; }
.review:nth-child(4n + 1) { --rot: -1.8deg; --dx: -4px; }
.review:nth-child(4n + 2) { --rot: 1.4deg; --dx: 10px; --dy: 6px; }
.review:nth-child(4n + 3) { --rot: 2.2deg; --dx: -8px; --dy: 10px; }
.review:nth-child(4n + 4) { --rot: -1.2deg; --dx: 12px; }
.review:nth-child(3n) { margin-bottom: 44px; }
.review:hover { transform: rotate(0deg) translateY(-6px) scale(1.015); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent), 0 40px 60px -30px rgba(0, 0, 0, .7); z-index: 2; }
@media (min-width: 1180px) { .reviews { columns: 3; } }

/* ---------- Сертификаты учеников ---------- */
.certs { margin-top: clamp(40px, 6vw, 80px); }
.certs__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 28px; margin-bottom: 26px; }
.certs__head h3 { font-size: clamp(26px, 3.2vw, 42px); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; margin: 0; }
.certs__head p { margin: 0; color: var(--muted); font-size: 15px; max-width: 44ch; }
.certs__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cert { display: block; padding: 12px 12px 0; border-radius: var(--r); background: var(--card); box-shadow: inset 0 0 0 1px var(--line), 0 26px 46px -28px rgba(0, 0, 0, .55); transition: transform .6s var(--ease), box-shadow .5s; }
.cert:nth-child(3n + 1) { transform: rotate(-1.4deg); }
.cert:nth-child(3n + 2) { transform: translateY(14px) rotate(.8deg); }
.cert:nth-child(3n) { transform: rotate(1.8deg); }
.cert:hover { transform: translateY(-6px) rotate(0deg) scale(1.02); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 45%, transparent), 0 40px 60px -30px rgba(0, 0, 0, .7); z-index: 2; }
.cert__img { display: block; border-radius: 12px; overflow: hidden; background: #e6f2ea; }
.cert__img img { display: block; width: 100%; height: auto; }
.cert__cap { display: block; padding: 14px 6px 16px; }
.cert__cap b { display: block; font-weight: 600; }
.cert__cap i { display: block; font-style: normal; font-size: 13.5px; color: var(--muted); }
@media (max-width: 760px) {
  .certs__grid { grid-template-columns: 1fr; max-width: 420px; }
  .cert:nth-child(n) { transform: none; }
}
@media (max-width: 760px) {
  .review:nth-child(n) { --dx: 0px; --dy: 0px; }
  .reviews { columns: 1; }
  .teachers--solo .teacher { grid-template-columns: 1fr; }
  .teachers--solo .teacher__photo { min-height: 0; max-height: none; aspect-ratio: 4 / 4.2; }
}

/* ---------- Уровни HSK: закреплённый экран ---------- */
.hsk-sec { padding-bottom: calc(clamp(76px, 10vw, 150px) + var(--R)); }
.hsk__rail { display: none; height: 3px; margin: 12px 4px 0; border-radius: 3px; background: color-mix(in srgb, var(--ink) 9%, transparent); overflow: hidden; }
.hsk__rail span { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--p, 0)); }
@media (min-width: 901px) and (min-height: 680px) {
  :root:not(.calm) .hsk-sec { padding-block: 0; }
  :root:not(.calm) .hsk-pin { height: 480vh; }
  :root:not(.calm) .hsk-sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; padding-bottom: calc(var(--R) * .5); }
  :root:not(.calm) .hsk-sticky .head { margin-bottom: 26px; }
  :root:not(.calm) .hsk-sticky .head h2 { max-width: none; font-size: clamp(30px, 3.8vw, 52px); }
  :root:not(.calm) .hsk__rail { display: block; }
  :root:not(.calm) .hsk-sticky .hsk__panel { padding: clamp(18px, 3.4vh, 46px) clamp(24px, 4vw, 54px); }
  :root:not(.calm) .hsk-sticky .hsk__big { font-size: clamp(90px, min(23vh, 13.5vw), 210px); }
  :root:not(.calm) .hsk-sticky .hsk__text { margin: 14px 0 18px; }
}
.hsk__big span.swap { animation: swap .7s var(--ease); }
@keyframes swap { from { transform: translateY(60%) rotateX(-70deg) scale(.8); opacity: 0; filter: blur(10px); } }
.hsk__big { perspective: 800px; }

/* ---------- Секции наезжают друг на друга ---------- */
.section--ink, .section--red, .footer { border-radius: var(--R) var(--R) 0 0; margin-top: calc(var(--R) * -1); z-index: 2; }
#faq, .section--red { padding-bottom: calc(clamp(76px, 10vw, 150px) + var(--R)); }
.section--ink::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(560px circle at 72% 8%, rgba(240, 73, 44, .2), transparent 66%); }
/* пятно света за курсором: отдельный слой, двигается только transform (вставляет js/fx.js) */
.lab-glow { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .6s; }
.lab-glow.is-on { opacity: 1; }
.lab-glow i { position: absolute; left: -340px; top: -340px; width: 680px; height: 680px; border-radius: 50%; background: radial-gradient(circle, rgba(240, 73, 44, .13), transparent 66%); will-change: transform; }

/* ---------- Запись: вращающаяся печать ---------- */
.badge { position: relative; width: 150px; height: 150px; margin-top: 36px; display: grid; place-items: center; }
.badge svg { position: absolute; inset: 0; animation: spin 20s linear infinite; }
.badge text { font: 600 13px var(--sans); letter-spacing: .08em; fill: currentColor; }
.badge b { font: 400 56px/1 var(--brush); color: #16130f; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Подвал ---------- */
.footer { position: relative; padding: calc(var(--R) + 40px) 0 0; overflow: hidden; }
.footer__mark { display: flex; justify-content: center; margin-top: 26px; font-size: clamp(60px, 20.5vw, 330px); font-weight: 700; letter-spacing: -.07em; line-height: .86; white-space: nowrap; user-select: none; color: transparent; -webkit-text-stroke: 1.5px rgba(242, 235, 222, .32); }
.footer__mark span { display: inline-block; transition: transform 1.1s var(--ease) calc(var(--i) * 60ms), color .35s, -webkit-text-stroke-color .35s; }
.js .footer__mark span { transform: translateY(100%); }
.js .footer__mark.in span { transform: translateY(12%); }
.footer__mark span:hover { color: var(--red); -webkit-text-stroke-color: var(--red); transform: translateY(4%) !important; transition-delay: 0s; }

/* ---------- Смена темы: новая тема раскрывается кругом от кнопки ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: themeReveal .85s cubic-bezier(.6, 0, .2, 1); }
@keyframes themeReveal { from { clip-path: circle(0 at var(--vx, 50%) var(--vy, 0)); } to { clip-path: circle(150vmax at var(--vx, 50%) var(--vy, 0)); } }

/* ---------- Курсор ---------- */
.cursor { display: none; }
/* Лёгкое кольцо: без режима наложения, размер меняется через scale, а не через width/height —
   браузеру не нужно пересчитывать вёрстку и перерисовывать страницу под курсором. */
.has-cursor .cursor { position: fixed; left: 0; top: 0; z-index: 250; display: block; width: 0; height: 0; pointer-events: none; opacity: 0; will-change: transform; transition: opacity .3s; }
.cursor::before {
  content: ''; position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; border-radius: 50%;
  box-shadow: inset 0 0 0 5px var(--red), 0 0 0 3px rgba(255, 255, 255, .45);
  transform: scale(.3); transition: transform .35s var(--ease), background-color .3s, box-shadow .3s; will-change: transform;
}
.cursor.is-on { opacity: .9; }
.cursor.is-hover::before { transform: scale(.48); background-color: color-mix(in srgb, var(--red) 14%, transparent); box-shadow: inset 0 0 0 3px var(--red), 0 0 0 2px rgba(255, 255, 255, .45); }
.cursor.is-down::before { transform: scale(.22); }
.cursor.is-label::before { transform: scale(1); background-color: var(--red); box-shadow: none; }
.cursor.is-hide { opacity: 0; }
.cursor span { position: absolute; left: -48px; top: -48px; width: 96px; height: 96px; display: grid; place-items: center; padding: 8px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; line-height: 1.25; text-align: center; color: #fff; opacity: 0; transition: opacity .3s; }
.cursor.is-label span { opacity: 1; }

@media (max-width: 900px) {
  .hero { min-height: 0; }
  .hero__vert, .hero__scroll { display: none; }
  .hero__copy, .hero__art { transform: none; opacity: 1; }
  .stack__card { position: relative; top: auto; }
  .stack__inner { grid-template-columns: 1fr; min-height: 0; }
  .stack__viz { padding-block: 10px 20px; }
}
@media (max-width: 620px) {
  .eq i { font-size: 15px; }
  .chat__b b { font-size: 21px; }
  .badge { width: 124px; height: 124px; }
  .badge b { font-size: 46px; }
}

/* =====================================================================
   Цвета: выравнивание светлой и тёмной темы.
   Тёмная: карточки чуть светлее фона и с более заметной рамкой, чтобы блоки
   не сливались со страницей; приглушённый текст ярче. Светлая: цена в тарифах
   чёрным, а не серым.
   ===================================================================== */
:root[data-theme='dark'] {
  --paper-2: #1b1814;
  --card: #26211b;
  --muted: #b5ab9b;
  --line: rgba(242, 235, 222, .17);
  --outline: #4a4136;
}
.card p.plan__price { color: var(--ink); }
.card p.plan__alt { opacity: 1; color: var(--muted); }

/* панель быстрой записи: в тёмной теме она не должна растворяться в фоне */
:root[data-theme='dark'] .quick { --q: #2b241d; }
:root[data-theme='dark'] .quick__bar { box-shadow: 0 34px 70px -34px color-mix(in srgb, var(--red) 55%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--red) 38%, transparent); }
:root[data-theme='dark'] .quick__title { box-shadow: inset 0 1px 0 0 color-mix(in srgb, var(--red) 38%, transparent), inset 1px 0 0 0 color-mix(in srgb, var(--red) 38%, transparent), inset -1px 0 0 0 color-mix(in srgb, var(--red) 38%, transparent); }
:root[data-theme='dark'] .quick__hint { color: #b5ab9b; }

/* отзывы: скриншот чата тёмный сам по себе — тонкая светлая кромка отделяет его от карточки */
.review__shot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09); }
:root[data-theme='dark'] .review, :root[data-theme='dark'] .cert, :root[data-theme='dark'] .tool, :root[data-theme='dark'] .teacher { box-shadow: inset 0 0 0 1px var(--line), 0 30px 60px -34px rgba(0, 0, 0, .85); }
:root[data-theme='dark'] .plan--top { box-shadow: inset 0 0 0 2px var(--red), 0 30px 60px -34px rgba(0, 0, 0, .85); }

/* светлые сканы сертификатов в тёмной теме слегка приглушаем, чтобы не слепили */
:root[data-theme='dark'] .cert__img img { filter: brightness(.9) contrast(1.03); }
:root[data-theme='dark'] .cert:hover .cert__img img { filter: none; }

/* плашки с цифрами у преподавателя и ярлыки инструментов: в тёмной теме подложка плотнее */
:root[data-theme='dark'] .teacher__stats div { background: color-mix(in srgb, var(--red) 15%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--red) 34%, transparent); }
:root[data-theme='dark'] .tool__tag { background: color-mix(in srgb, var(--red) 24%, transparent); color: #ff8a70; }
:root[data-theme='dark'] .plan__rate i { background: color-mix(in srgb, var(--ink) 16%, transparent); }
:root[data-theme='dark'] .plan__rate i.on { background: var(--red); }
:root[data-theme='dark'] .plan__packs { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* светлая тема: мягче тень у панели записи и чуть теплее фон карточек-инструментов */
:root[data-theme='light'] .quick__bar { box-shadow: 0 30px 50px -30px rgba(60, 35, 10, .55); }
:root[data-theme='light'] .teacher__stats dt, :root[data-theme='light'] .tool__tag { color: var(--red-deep); }
