:root {
  --bg: #ffffff; --bg-alt: #f4f6fb; --text: #15171c; --muted: #636b78; --line: #e3e7ef;
  --accent: #2688eb; --accent-2: #7a5af8; --accent-soft: #e9f2fe; --error: #d93025;
  --radius: 14px;
}
/* the theme: the system's, or the one chosen with the switch (data-theme, shared with the app) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #121418; --bg-alt: #191c22; --text: #eceff3; --muted: #9aa3af; --line: #2a2f37; --accent-soft: #1b2a3d; }
}
:root[data-theme="dark"] { --bg: #121418; --bg-alt: #191c22; --text: #eceff3; --muted: #9aa3af; --line: #2a2f37; --accent-soft: #1b2a3d; }
.theme { background: none; border: 1px solid var(--line); border-radius: 10px; width: 36px; height: 34px; cursor: pointer; font-size: 16px; color: var(--text); }
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 48px); letter-spacing: -.02em; }
h2 { font-size: clamp(24px, 3.5vw, 34px); text-align: center; margin-bottom: 1.1em; }
h3 { font-size: 18px; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; color: var(--muted); }
.error { color: var(--error); }

.btn { display: inline-block; padding: 10px 18px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; text-decoration: none; font-weight: 600; border: 0; cursor: pointer; font-size: 15px; }
.btn:hover { filter: brightness(1.06); }
.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-lg { padding: 14px 26px; font-size: 17px; }
.btn-ghost { background: var(--accent-soft); color: var(--accent); }
.btn-vk { background: #0077ff; }
.btn-ya { background: #fc3f1d; }

.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 18px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--text); }
.top-in .btn { white-space: nowrap; flex: none; }
.top-in .narrow { display: none; }
@media (max-width: 640px) { .nav { display: none; } .theme { margin-left: auto; } .top-in .wide { display: none; } .top-in .narrow { display: inline; } }

.hero { padding: 56px 0 40px; background: radial-gradient(1200px 400px at 20% 0%, var(--accent-soft), transparent); }
.hero-in { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
/* the hero carousel: the exercise types (scroll-snap; arrows, dots and autoplay in site.js) */
.carousel { position: relative; min-width: 0; }
.hero { overflow-x: clip; }
/* a project's waving flag behind the carousel: it shows up on the left and fades out to the right */
.hero-flag { position: absolute; z-index: 0; left: -24%; top: 46%; width: 165%; max-width: none; height: auto; transform: translateY(-50%) rotate(-5deg);
  opacity: .55; pointer-events: none; user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent 8%, #000 30%, #000 42%, transparent 92%); mask-image: linear-gradient(to right, transparent 8%, #000 30%, #000 42%, transparent 92%); }
.carousel .car-track, .carousel .car-dots { position: relative; z-index: 1; }
.carousel .car-btn { z-index: 2; }
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
  border-radius: var(--radius); box-shadow: 0 20px 50px rgba(20, 40, 90, .18); border: 1px solid var(--line); background: var(--bg); }
.car-track::-webkit-scrollbar { display: none; }
.car-track:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.car-slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; }
.car-slide img { display: block; width: 100%; height: auto; }
.car-slide figcaption { padding: 10px 14px 12px; font-size: 14px; font-weight: 600; text-align: center; border-top: 1px solid var(--line); }
.car-btn { position: absolute; top: calc(50% - 40px); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 22px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.car-prev { left: -14px; }
.car-next { right: -14px; }
.car-btn:hover { color: var(--accent); }
.car-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.car-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.car-dots button[aria-selected="true"] { background: var(--accent); width: 22px; border-radius: 5px; }
@media (max-width: 640px) { .car-btn { display: none; } }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 4px 12px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 14px; margin-bottom: 14px; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 10px; }

.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.steps, .grid { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .steps, .grid { grid-template-columns: 1fr; } }
.step, .card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.step p, .card p { color: var(--muted); margin: 0; }
.step-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); margin-bottom: 12px; }
.ico { font-size: 28px; margin-bottom: 8px; }

.shots { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 860px) { .shots { grid-template-columns: 1fr; } }
.shots figure { margin: 0; }
.shots img { border-radius: var(--radius); border: 1px solid var(--line); }
.shots figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; text-align: center; }

.prices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0; }
@media (max-width: 760px) { .prices { grid-template-columns: 1fr; } }
.price { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-align: center; }
.price-v { font-size: 32px; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.packs { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 6px 0 18px; }
.pack { display: flex; flex-direction: column; align-items: center; padding: 10px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 110px; }

details { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; background: var(--bg); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 10px 0 0; color: var(--muted); }

.final { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.final h2 { color: #fff; }
.final .btn { background: #fff; color: var(--accent); }
.test-link { display: inline-block; margin: 0 0 12px; font-weight: 600; color: var(--accent); text-decoration: none; }
.test-link:hover { text-decoration: underline; }
.final .test-link { display: block; width: fit-content; margin: 16px auto 0; color: #fff; }

.login { max-width: 460px; text-align: center; }
.login img { border-radius: 16px; }
.login-btns { display: flex; flex-direction: column; gap: 12px; margin: 22px 0; }

.doc { font-size: 15px; }
.doc h1 { font-size: 28px; }
.doc h2 { font-size: 20px; text-align: left; margin: 1.6em 0 .6em; }

.foot { border-top: 1px solid var(--line); padding: 36px 0 24px; background: var(--bg-alt); font-size: 14px; }
.foot-in { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr 1.2fr; gap: 22px; }
@media (max-width: 860px) { .foot-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-in { grid-template-columns: 1fr; } }
.foot-brand { font-weight: 700; font-size: 16px; }
.foot-col { display: flex; flex-direction: column; gap: 4px; }
.foot-col a { color: var(--text); }
.foot-h { font-weight: 600; margin-bottom: 4px; }
.foot-note { margin-top: 22px; }

/* the cookie notice: a slim bar at the very bottom; the page makes room for it (body.cookie-on), so it
   never covers a button — on a short phone screen (the VK app's browser) it used to hide «Начать тест» */
.cookie { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
.cookie[hidden] { display: none; }
.cookie-in { max-width: 1100px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.cookie-in .btn { flex: none; padding: 6px 16px; }
body.cookie-on { padding-bottom: 52px; }

/* the free level test (/free-lesson/, free.js) */
.free { padding: 32px 0 56px; }
.free-in { max-width: 620px; }
.free-card { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px; }
.free-card h1 { margin: 0 0 12px; }
.free-card[hidden] { display: none; }
.ft-q { font-size: 22px; margin: 6px 0 10px; line-height: 1.35; text-align: left; }
.ft-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.ft-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.ft-hint { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 14px; }
.ft-ru { margin: 6px 0 0; }
.ft-options { display: grid; gap: 10px; margin-top: 16px; }
.ft-option { text-align: left; width: 100%; font-weight: 500; }
.free-card textarea { width: 100%; box-sizing: border-box; margin: 12px 0; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.ft-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ft-actions .btn:disabled { opacity: .5; cursor: default; }
#ft-level { background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ft-levels { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 22px; }
.ft-cta { display: block; text-align: center; margin-bottom: 10px; }
.ft-spin { width: 36px; height: 36px; margin: 8px auto 12px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: ft-spin 1s linear infinite; }
@keyframes ft-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .free-card { padding: 22px 16px; } .ft-q { font-size: 19px; } .ft-actions .btn { width: 100%; text-align: center; } }
.free-intro { margin-bottom: 16px; }
.free-intro[hidden] { display: none; }
.free-intro h1 { margin: 0 0 6px; }
.free-intro p { margin: 0; }
@media (max-width: 640px) { .free { padding-top: 16px; } .free-intro h1 { font-size: 24px; line-height: 1.2; } .free-intro .pill { margin-bottom: 8px; } }
.ft-notsure { background: none; border: 1px dashed var(--line); color: var(--muted); border-radius: 10px; padding: 10px 18px; font: inherit; cursor: pointer; }
.ft-notsure:hover { color: var(--text); }
.ft-zero { display: block; margin: 14px auto 0; background: none; border: 0; color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ft-level-note { margin: -8px 0 20px; padding: 12px 14px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; line-height: 1.45; }
.ft-level-note[hidden] { display: none; }
.ft-level-note-h { font-weight: 600; margin-bottom: 4px; }
