/* ==========================================================================
   VibeTech — элитный стиль для школы программирования
   ========================================================================== */

:root {
  /* ---- Palette A (previous coral) — restore by swapping with active block below
  --bg: #11151e;
  --bg-soft: #161b26;
  --panel: #1a2030;
  --panel-2: #202738;
  --accent: #e85d4c;
  --accent-hover: #f06a58;
  --accent-rgb: 232, 93, 76;
  --accent-soft: rgba(232, 93, 76, 0.14);
  --gold-bright: #f08a7c;
  --gold-deep: #c94a3c;
  --gradient-gold: linear-gradient(135deg, #f06a58 0%, #e85d4c 100%);
  --body-grad: linear-gradient(160deg, #11151e 0%, #171d2a 55%, #131820 100%);
  --aura-1: rgba(232, 93, 76, 0.1);
  --aura-2: rgba(90, 120, 190, 0.08);
  ---- */

  /* ---- Palette B (previous): deep ocean — keep for rollback
  --bg: #05090e;
  --bg-soft: #0a1018;
  --panel: #0e1620;
  --panel-2: #131d28;
  --border: rgba(140, 180, 210, 0.07);
  --border-strong: rgba(140, 180, 210, 0.13);
  --text: #dfe7f0;
  --text-dim: #7f91a6;
  --text-dimmer: #566779;
  --accent: #1f8a7e;
  --accent-hover: #27998c;
  --accent-rgb: 31, 138, 126;
  --accent-soft: rgba(31, 138, 126, 0.12);
  --btn: #156960;
  --btn-hover: #1b7a70;
  --btn-rgb: 21, 105, 96;
  --gold-bright: #4db5a8;
  --gold-deep: #114e47;
  --gradient-gold: linear-gradient(135deg, #1f8a7e 0%, #1a6f8a 55%, #156960 100%);
  --body-grad: linear-gradient(165deg, #04070b 0%, #08121c 42%, #05090e 100%);
  --aura-1: rgba(31, 138, 126, 0.07);
  --aura-2: rgba(20, 60, 110, 0.1);
  ---- */

  /* ---- Palette C (previous): desert — keep for rollback
  --bg: #0b0806;
  --bg-soft: #120e0b;
  --panel: #1a1410;
  --panel-2: #231c16;
  --accent: #e08a3c;
  --accent-rgb: 224, 138, 60;
  --btn: #b35f24;
  --btn-rgb: 179, 95, 36;
  ---- */

  /* ---- Palette D (active): deep ocean ---- */
  --bg: #060912;
  --bg-soft: #0b1220;
  --panel: #101a2a;
  --panel-2: #162235;
  --border: rgba(140, 190, 230, 0.1);
  --border-strong: rgba(140, 190, 230, 0.18);
  --text: #e8f0fa;
  --text-dim: #8fa3bc;
  --text-dimmer: #5f738c;
  --accent: #3ec4c8;
  --accent-hover: #55d4d6;
  --accent-rgb: 62, 196, 200;
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --btn: #156970;
  --btn-hover: #187a82;
  --btn-rgb: 21, 105, 112;
  --gold: var(--accent);
  --gold-bright: #7ee0e2;
  --gold-deep: #1a6f78;
  --gradient-gold: linear-gradient(135deg, #55d4d6 0%, #3ec4c8 50%, #2a9aa0 100%);
  --body-grad: linear-gradient(180deg, #070b14 0%, #060912 100%);
  --aura-1: rgba(62, 196, 200, 0.05);
  --aura-2: rgba(30, 80, 120, 0.06);
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Manrope", "Segoe UI", sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 16px;
  --radius-sm: 10px;
  --container: 1240px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  overflow-x: hidden;
  width: 100%;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--body-grad);
  background-attachment: scroll;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: -0.011em;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-optical-sizing: auto;
}

/* Soft atmosphere — overridden by editorial daylight system */
body::before {
  content: none;
  display: none;
}

body::after {
  content: none;
  display: none;
}

main,
footer,
.auth-page,
.admin-page {
  position: relative;
  z-index: 1;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* Soft page enter only — leave is instant (no click delay) */
@keyframes page-enter {
  from { opacity: 0.92; }
  to { opacity: 1; }
}

html.page-boot body {
  animation: page-enter 0.16s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  html.page-boot body {
    animation: none;
  }
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

.gold {
  color: var(--gold-bright);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

/* ---------- Texture overlay ---------- */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.02;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- IT decor: soft glass keys ---------- */
.keys-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.keycap {
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: var(--size, 48px);
  height: var(--size, 48px);
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(140, 200, 230, 0.14);
  background:
    linear-gradient(145deg, rgba(120, 200, 220, 0.08), rgba(40, 70, 120, 0.12));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(180, 230, 255, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0.28;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg));
  animation: key-float 14s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.keycap__face {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(12px, calc(var(--size) * 0.3), 15px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1;
  color: rgba(170, 210, 230, 0.72);
  white-space: nowrap;
  user-select: none;
}

.keycap--accent {
  border-color: rgba(var(--accent-rgb), 0.22);
  background:
    linear-gradient(145deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.03));
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.16),
    0 0 24px rgba(var(--accent-rgb), 0.06),
    inset 0 1px 0 rgba(var(--accent-rgb), 0.16);
  opacity: 0.48;
}

.keycap--accent .keycap__face {
  color: rgba(var(--accent-rgb), 0.85);
}

@keyframes key-float {
  0%, 100% {
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) translateY(0);
  }
  50% {
    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) translateY(-6px);
  }
}

@media (max-width: 900px) {
  .keycap:nth-of-type(n + 4) { display: none; }
}

@media (max-width: 600px) {
  .keycap { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .keycap { animation: none; }
  .advantage-card:hover,
  .lang-chip:hover { transform: none; }
  .quiz-option:hover { padding-left: 20px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

.btn--gold {
  background: linear-gradient(165deg, #1a828a 0%, var(--btn) 55%, #126068 100%);
  color: #eef9fa;
  box-shadow: 0 8px 20px -14px rgba(var(--btn-rgb), 0.45);
}
.btn--gold:hover {
  background: linear-gradient(165deg, #1f8f96 0%, var(--btn-hover) 55%, #157078 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(var(--btn-rgb), 0.5);
}

.btn--outline {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: transparent;
}
.btn--outline:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--gold-bright);
  background: var(--accent-soft);
}

.btn--ghost {
  color: var(--text-dim);
  padding: 10px 20px;
  font-weight: 600;
  border: 1px solid transparent;
}
.btn--ghost:hover { color: var(--gold-bright); }

.auth-slot {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-slot .btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.auth-slot .btn--ghost:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
  color: var(--gold-bright);
  background: var(--accent-soft);
}
.auth-slot .btn--gold {
  min-height: 40px;
}

/* Profile chip in header */
.profile-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 200px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(59, 48, 39, 0.12);
  background: #fffdf8;
  box-shadow: 0 1px 2px rgba(59, 48, 39, 0.04);
  color: #3b3027;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.profile-chip:hover {
  border-color: rgba(182, 147, 99, 0.45);
  background: #f6efe3;
  box-shadow: 0 2px 8px rgba(59, 48, 39, 0.06);
}
.profile-chip__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #5a4737;
  color: #fffdf8;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
}
.profile-chip__meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding-right: 2px;
}
.profile-chip__name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: #3b3027;
  line-height: 1.15;
}
.profile-chip__hint {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9a8b7a;
  line-height: 1.1;
}
.profile-chip__out {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(59, 48, 39, 0.12);
  background: transparent;
  color: #5a4737;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}
.profile-chip__out:hover {
  background: #f6efe3;
  border-color: rgba(182, 147, 99, 0.4);
  color: #3b3027;
}

.mobile-auth {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 8px;
  padding-bottom: 12px;
  border-top: 1px solid var(--border);
}
.mobile-auth__chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 4px 14px;
  text-decoration: none;
  color: inherit;
}
.mobile-auth__chip .profile-chip__avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}
.mobile-auth__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mobile-auth__name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: #3b3027;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mobile-auth__hint {
  font-size: 12px;
  font-weight: 600;
  color: #9a8b7a;
}
.mobile-auth .btn {
  width: 100%;
  min-height: 48px;
  padding: 14px 22px;
  justify-content: center;
  font-family: var(--font-sans, inherit);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 999px;
  border-bottom: none;
  -webkit-tap-highlight-color: transparent;
}
.mobile-auth .btn:hover {
  padding-left: 22px;
}
.mobile-auth .btn--outline {
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}
.mobile-auth .btn--gold {
  color: #eef9fa;
}

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 20px 60px;
  position: relative;
}
.auth-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 28px 32px;
  box-shadow: 0 24px 48px -28px rgba(0, 0, 0, 0.55);
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px;
  margin-bottom: 28px;
}
.auth-tab {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: all 0.25s ease;
}
.auth-tab.active {
  background: linear-gradient(135deg, #187a82, var(--btn));
  color: #f2fbfc;
}
.auth-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  font-optical-sizing: auto;
}
.auth-subtitle {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 24px;
  line-height: 1.55;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: #0a0c12;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color 0.25s ease;
}
.field input:focus { border-color: var(--gold); }
.auth-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}
.auth-remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent, #b69363);
  flex-shrink: 0;
}
.auth-forgot,
.auth-back {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent, var(--gold));
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.auth-forgot {
  display: block;
  margin: -4px 0 16px auto;
}
.auth-back {
  margin: 0 0 18px;
}
.auth-forgot:hover,
.auth-back:hover { text-decoration: underline; }
.auth-success {
  margin: 0 0 16px;
  padding: 11px 12px;
  border: 1px solid rgba(61, 139, 90, 0.32);
  border-radius: 10px;
  background: rgba(61, 139, 90, 0.1);
  color: #2f7a4a;
  font-size: 13px;
  line-height: 1.45;
}
.auth-success a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
}
.auth-code-input {
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.28em;
  text-align: center;
}
.auth-error {
  color: #ff8f8f;
  font-size: 13.5px;
  margin: 4px 0 12px;
}
.auth-submit {
  width: 100%;
  margin-top: 8px;
}
.auth-form[hidden] { display: none !important; }


.btn--sm { padding: 10px 20px; font-size: 13px; }

/* ==========================================================================
   Header
   ========================================================================== */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: all 0.4s ease;
  background: transparent;
}
.header.scrolled {
  padding: 14px 0;
  background: rgba(6, 9, 18, 0.86);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

/* Backend offline banner */
.backend-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: 10px 16px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: rgba(120, 40, 40, 0.95);
  border-bottom: 1px solid rgba(255, 120, 120, 0.35);
  color: #ffe8e8;
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1.45;
}

.backend-banner code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
}

body.backend-down .header {
  top: var(--backend-banner-h, 52px);
}

body.backend-down main:not(.support-app):not(.arena-main),
body.backend-down .auth-page,
body.backend-down .admin-page {
  padding-top: var(--backend-banner-h, 52px);
}

.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  justify-self: start;
  color: #3b3027;
  line-height: 1;
  text-decoration: none;
}

.nav {
  justify-self: center;
  grid-column: 2;
}
.logo__word {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #3b3027;
}
.logo__word span {
  font-weight: 600;
  color: #5a4737;
}
.logo__icon {
  display: none !important;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 18, 36, 0.45);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  border-radius: 999px;
  transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
.nav__link:hover { color: var(--text); }
.nav__link.active {
  color: #f2fbfc;
  background: linear-gradient(135deg, #187a82, #327090);
  box-shadow: 0 6px 16px -8px rgba(var(--btn-rgb), 0.48);
}

.header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-shrink: 0;
  justify-self: end;
  grid-column: 3;
}

.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
}
.burger span {
  width: 18px;
  height: 1.5px;
  background: var(--text);
  margin: 0 auto;
  transition: all 0.3s ease;
}
.burger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  top: 0; right: 0;
  width: min(360px, 100%);
  height: 100vh;
  height: 100dvh;
  background: var(--panel);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border);
  z-index: 99;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  padding: 110px 40px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu > ul { display: flex; flex-direction: column; gap: 8px; }
.mobile-menu > ul a {
  display: block;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  transition: color 0.3s ease, padding-left 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.mobile-menu > ul a:hover { color: var(--gold-bright); padding-left: 8px; }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero, .page-hero {
  position: relative;
  padding: 200px 0 120px;
  overflow: hidden;
}
.page-hero { padding: 180px 0 90px; text-align: center; }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(140, 190, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 190, 230, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 40%, black, transparent 78%);
  opacity: 0.7;
}

/* Legacy glow/aurora nodes kept in markup for safety — hidden */
.hero__glow,
.hero__aurora {
  display: none !important;
}

.hero__fade {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

.hero__inner { text-align: center; max-width: 860px; margin: 0 auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ">";
  color: var(--gold);
  font-weight: 700;
}
.eyebrow::after {
  content: "";
  width: 8px; height: 1px;
  background: var(--gold);
  animation: caret-blink 1.1s steps(1) infinite;
}
@keyframes caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 6.2vw, 70px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  margin-bottom: 22px;
  text-wrap: balance;
}

.hero__text {
  font-size: 17.5px;
  font-weight: 500;
  color: var(--text-dim);
  max-width: 34em;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.hero__cta {
  margin-bottom: 64px;
}

.hero__actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.hero__offer {
  margin: 0 auto;
  max-width: 36em;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--text-dimmer);
  text-wrap: balance;
}

.cta__offer {
  margin: 18px 0 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-dimmer);
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 72px);
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 36px;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.stat__num {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 500;
  color: transparent;
  background: linear-gradient(135deg, #7ee0e2, #6a8fe0);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: -0.02em;
  font-optical-sizing: auto;
}
.stat__num--text { font-size: 32px; }
.stat__label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-dimmer);
  max-width: 160px;
  text-align: center;
}

.page-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5.8vw, 62px);
  font-weight: 500;
  margin-bottom: 18px;
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.page-hero__text {
  color: var(--text-dim);
  max-width: 36em;
  margin: 0 auto;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.7;
}

/* ==========================================================================
   Marquee
   ========================================================================== */

.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
  overflow: hidden;
  background: transparent;
}
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee-scroll 28s linear infinite;
}
.marquee__group {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-right: 22px;
  flex: 0 0 auto;
  white-space: nowrap;
}
.marquee__group span {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dimmer);
  letter-spacing: 0.22em;
}
.marquee__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(var(--accent-rgb), 0.55);
  opacity: 0.85;
  flex: 0 0 auto;
}
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: 110px 0; }
.section--dark,
.section--soft {
  background: var(--bg-soft);
}

.section-head {
  max-width: 680px;
  margin-bottom: 52px;
}
.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 16px;
}
.section__eyebrow::before {
  content: "//";
  color: var(--text-dimmer);
  font-weight: 500;
  letter-spacing: 0;
}
.section__title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.2vw, 44px);
  font-weight: 500;
  max-width: 16em;
  margin-bottom: 0;
  letter-spacing: -0.022em;
  line-height: 1.2;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.section__lead {
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.7;
  max-width: 42ch;
}
/* ---------- Career quiz ---------- */
.quiz {
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.quiz__intro {
  padding: 36px 32px;
  border-right: 1px solid var(--border);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
}
.quiz__progress-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.quiz__progress-top [data-quiz-step] {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}
.quiz__progress-top [data-quiz-label] {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.quiz__track {
  height: 1px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}
.quiz__track > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.quiz__dots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quiz-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.3s ease, transform 0.3s ease;
}
.quiz-dot.is-done { background: var(--gold-deep); }
.quiz-dot.is-current {
  background: var(--gold-bright);
  transform: scale(1.3);
}
.quiz__back {
  margin-top: auto;
  padding-top: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dimmer);
  transition: color 0.25s ease;
  align-self: flex-start;
}
.quiz__back:hover { color: var(--gold-bright); }

.quiz__stage {
  padding: 36px 40px;
  min-height: 400px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.quiz__stage.is-leaving {
  opacity: 0;
  transform: translateY(8px);
}
.quiz__stage.is-entering {
  animation: quiz-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes quiz-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz__question {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.8vw, 30px);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 22px;
  letter-spacing: -0.02em;
  max-width: 22ch;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.quiz__options {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.quiz-option {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  transition: background 0.3s ease, padding-left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.quiz-option:hover {
  background: var(--panel-2);
  padding-left: 24px;
}
.quiz-option.is-selected {
  background: linear-gradient(90deg, var(--accent-soft), var(--panel-2));
}
.quiz-option__num {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.55;
}
.quiz-option__text { padding-top: 1px; }

.quiz__result[hidden],
.quiz__panel[hidden],
.quiz__back[hidden] { display: none !important; }

.quiz-result__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 14px;
}
.quiz-result__eyebrow::before {
  content: "//";
  color: var(--text-dimmer);
  font-weight: 500;
  letter-spacing: 0;
}
.quiz-result__title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.8vw, 42px);
  font-weight: 500;
  line-height: 1.12;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.quiz-result__short {
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 15px;
}
.quiz-result__text {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 44ch;
  margin-bottom: 28px;
}
.quiz-result__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 18px;
  max-width: 400px;
}
.quiz-result__lang,
.quiz-result__fit {
  background: var(--panel);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quiz-result__lang span,
.quiz-result__fit span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dimmer);
}
.quiz-result__lang strong,
.quiz-result__fit strong {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
}
.quiz-result__lang strong { color: var(--gold-bright); }
.quiz-result__alt {
  color: var(--text-dimmer);
  font-size: 14px;
  margin-bottom: 28px;
}
.quiz-result__alt strong { color: var(--text-dim); font-weight: 600; }
.quiz-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- How it works ---------- */
.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  counter-reset: none;
  position: relative;
}

.how-step {
  position: relative;
  padding: 8px 28px 8px 0;
  min-width: 0;
}

.how-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: linear-gradient(145deg, rgba(62, 196, 200, 0.12), rgba(70, 100, 180, 0.08));
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  position: relative;
  z-index: 1;
}

.how-step__title {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  line-height: 1.25;
  max-width: 12em;
}

.how-step__text {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.65;
  max-width: 28ch;
}

.how-cta {
  margin-top: 40px;
  display: flex;
  justify-content: flex-start;
}

/* ---------- Advantages ---------- */
.advantages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.advantage-card {
  position: relative;
  background: linear-gradient(160deg, rgba(22, 36, 58, 0.92), rgba(12, 20, 36, 0.88));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  overflow: hidden;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.advantage-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3ec4c8, #2a9aa0);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.35s ease;
}
.advantage-card:hover {
  background: linear-gradient(160deg, rgba(28, 46, 72, 0.95), rgba(16, 28, 48, 0.92));
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-4px);
  box-shadow:
    0 18px 36px -24px rgba(0, 0, 0, 0.55);
}
.advantage-card:hover::before { transform: scaleX(1); }
.advantage-card__num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 26px;
  letter-spacing: 0.02em;
  display: inline-block;
}
.advantage-card__num::before { content: "0x"; color: var(--text-dimmer); }
.advantage-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.015em;
}
.advantage-card:hover h3 { color: var(--text); }
.advantage-card p {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.65;
}

/* ---------- Language grid ---------- */
.lang-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.lang-chip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 22px;
  background: linear-gradient(160deg, rgba(22, 36, 58, 0.9), rgba(12, 20, 36, 0.86));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 124px;
  overflow: hidden;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.lang-chip::after {
  content: "→";
  position: absolute;
  right: 20px;
  bottom: 20px;
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.lang-chip:hover {
  background: linear-gradient(160deg, rgba(28, 46, 72, 0.96), rgba(16, 28, 48, 0.92));
  border-color: rgba(var(--accent-rgb), 0.3);
  transform: translateY(-4px);
  box-shadow: 0 18px 36px -24px rgba(0, 0, 0, 0.55);
}
.lang-chip:hover::after {
  opacity: 1;
  transform: translateX(0);
}
.lang-chip__mark {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  padding-top: 2px;
}
.lang-chip__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.lang-chip__body strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lang-chip__body span {
  font-size: 13px;
  color: var(--text-dimmer);
  font-weight: 500;
}
.lang-chip:hover .lang-chip__body span { color: var(--text-dim); }
.lang-chip--more {
  background: var(--panel-2);
  border-color: var(--border-strong);
  align-items: center;
}
.lang-chip--more::after { display: none; }
.lang-chip--more:hover {
  background: var(--panel);
  border-color: rgba(var(--accent-rgb), 0.35);
}
.lang-chip--more .lang-chip__body strong { color: var(--gold-bright); }
.lang-chip--more .lang-chip__body span { color: var(--accent); }
.lang-chip--more:hover .lang-chip__body span { color: var(--gold-bright); }

/* ---------- CTA ---------- */
.cta {
  padding: 120px 0;
  text-align: center;
  position: relative;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(ellipse 60% 50% at 70% 20%, rgba(80, 100, 200, 0.12), transparent 60%),
    radial-gradient(ellipse 55% 45% at 30% 90%, rgba(40, 160, 170, 0.12), transparent 60%),
    var(--bg-soft);
}
.cta::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 720px; height: 280px;
  background: radial-gradient(ellipse, rgba(var(--accent-rgb), 0.12), transparent 70%);
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}
.cta__inner { position: relative; z-index: 1; }
.cta__inner .section__eyebrow {
  margin-bottom: 18px;
}
.cta__inner h2 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4.4vw, 48px);
  font-weight: 500;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.cta__inner p {
  color: var(--text-dim);
  max-width: 460px;
  margin: 0 auto 32px;
  line-height: 1.6;
}
.cta__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Catalog page
   ========================================================================== */

.catalog-section { padding-top: 40px; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}
.filter-btn {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
}
.filter-btn:hover { border-color: var(--border-strong); color: var(--text); }
.filter-btn.active {
  background: linear-gradient(135deg, #187a82, #327090);
  border-color: transparent;
  color: #f2fbfc;
  box-shadow: 0 6px 16px -10px rgba(var(--btn-rgb), 0.48);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.course-card {
  position: relative;
  background: linear-gradient(165deg, rgba(22, 36, 58, 0.94), rgba(12, 20, 36, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.course-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #3ec4c8, #2a9aa0);
}
.course-card::after {
  content: "";
  position: absolute;
  top: -60%; right: -30%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0.08;
  border-radius: 50%;
  transition: opacity 0.3s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(165deg, rgba(28, 46, 72, 0.96), rgba(16, 28, 48, 0.92));
  box-shadow: 0 22px 40px -28px rgba(0,0,0,0.55);
}
.course-card:hover::after { opacity: 0.1; }
.course-card.is-hidden { display: none; }

.course-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.course-card__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: var(--accent);
  flex-shrink: 0;
  overflow: hidden;
}
.course-card__icon.lang-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: inherit;
  padding: 9px;
}
.course-card__icon.lang-icon img,
.course-card__icon.lang-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.lang-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}
.lang-icon img,
.lang-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.lang-chip__mark.lang-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 7px;
  font-size: 0;
  color: inherit;
}

.profile-course__icon.lang-icon {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 8px;
  color: inherit;
}
.course-card__level {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}
.course-card__badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
}
.course-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 12px;
  z-index: 1;
  letter-spacing: -0.02em;
  line-height: 1.25;
  font-optical-sizing: auto;
}
.course-card p {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 22px;
  z-index: 1;
  flex-grow: 1;
  line-height: 1.65;
}
.course-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
  z-index: 1;
}
.course-card__meta li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
}
.course-card__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  border-top: 1px solid var(--border);
  padding-top: 22px;
  z-index: 1;
}
.course-card__bottom .price {
  white-space: nowrap;
  margin-right: auto;
}
.course-card__bottom .btn {
  flex-shrink: 0;
}
.course-card--free .course-card__bottom {
  justify-content: stretch;
}
.course-card--free .course-card__bottom .btn {
  width: 100%;
  text-align: center;
}
.price {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--gold-bright);
  letter-spacing: -0.015em;
}
.price--free {
  color: var(--gold-bright);
  letter-spacing: 0.02em;
}

/* ---------- Profile ---------- */
.profile-page .keys-bg { opacity: 0.9; }

.profile-main {
  padding: 120px 0 72px;
  min-height: calc(100vh - 120px);
}

.profile-layout {
  max-width: 820px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.profile-welcome {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px 28px;
  padding: 28px 32px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  animation: profile-in 0.55s ease both;
}
.profile-welcome::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--accent);
}

.profile-welcome__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #5a4737;
  color: #fffdf8;
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
}

.profile-welcome__body { position: relative; z-index: 1; min-width: 0; }
.profile-welcome__hello {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.profile-welcome__name {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.18;
  margin-bottom: 6px;
  font-optical-sizing: auto;
}
.profile-welcome__email {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-welcome__meta {
  font-size: 13.5px;
  color: var(--text-dimmer);
}

.profile-welcome__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.profile-courses {
  animation: profile-in 0.55s ease 0.08s both;
}

.profile-next {
  padding: 26px 28px 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  animation: profile-in 0.55s ease 0.03s both;
}

.profile-next__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 10px;
}

.profile-next__title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3.5vw, 30px);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.2;
}

.profile-next__lead {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.55;
  max-width: 42ch;
}

.profile-next__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-next__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  min-height: 64px;
}

.profile-next__item:hover {
  border-color: rgba(59, 48, 39, 0.22);
  background: #f6efe3;
}

.profile-next__item.is-primary {
  border-color: rgba(182, 147, 99, 0.45);
  background: #f3ebe0;
  box-shadow: none;
}

.profile-next__item.is-primary:hover {
  background: #efe4d4;
  transform: translateY(-1px);
  box-shadow: none;
}

.profile-next__item-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-next__item-label {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.profile-next__item-meta {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  line-height: 1.4;
}

.profile-next__item-cta {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}

.profile-next__item.is-primary .profile-next__item-cta {
  color: #5a4737;
}

.profile-arena {
  position: relative;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 22, 32, 0.72);
  animation: profile-in 0.55s ease 0.05s both;
}

.profile-arena__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.profile-arena__eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.profile-arena__head h2 {
  margin: 0;
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  color: #f2f4f8;
}

.profile-arena__mmr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: rgba(242, 244, 248, 0.55);
  white-space: nowrap;
}

.profile-arena__track {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.profile-arena__track span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold-bright));
}

.profile-arena__hint,
.profile-arena__record {
  margin: 0.45rem 0 0;
  font-size: 0.82rem;
  color: rgba(242, 244, 248, 0.45);
}

.profile-courses__head {
  margin-bottom: 18px;
}
.profile-courses__head h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  font-optical-sizing: auto;
}
.profile-courses__head p {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.profile-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-course {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition:
    background 0.28s ease,
    border-color 0.28s ease,
    transform 0.28s ease,
    box-shadow 0.28s ease;
}
.profile-course:hover {
  background: var(--panel-2);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -26px rgba(0, 0, 0, 0.55);
}
.profile-course:hover .profile-course__cta {
  background: var(--accent-hover);
}

.profile-course__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  background: var(--accent);
  flex-shrink: 0;
}

.profile-course__main { min-width: 0; }
.profile-course__top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.profile-course__title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.profile-course__tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dimmer);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
}
.profile-course__sub {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.profile-course__track {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.profile-course__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.45s ease;
}

.profile-course__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.25s ease;
}

.profile-empty {
  text-align: center;
  padding: 56px 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.profile-empty h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.profile-empty p {
  color: var(--text-dim);
  margin-bottom: 24px;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}

.footer--compact {
  padding: 28px 0;
}
.footer--compact .footer__inner {
  justify-content: space-between;
}

@keyframes profile-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .profile-main { padding: 110px 0 56px; }
  .profile-welcome {
    grid-template-columns: auto 1fr;
    padding: 22px 20px;
    gap: 16px;
  }
  .profile-welcome__actions {
    grid-column: 1 / -1;
    flex-direction: column;
    align-items: stretch;
  }
  .profile-welcome__actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .profile-welcome__avatar {
    width: 64px;
    height: 64px;
    font-size: 20px;
  }
  .profile-course {
    grid-template-columns: auto 1fr;
    gap: 14px;
    padding: 16px;
  }
  .profile-course__cta {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
  .profile-next {
    padding: 22px 18px 20px;
  }
  .profile-next__item {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    padding: 14px 16px;
  }
  .profile-next__item-cta {
    align-self: flex-start;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-welcome,
  .profile-next,
  .profile-arena,
  .profile-courses,
  .profile-course { animation: none; transition: none; }
  .profile-course:hover,
  .profile-next__item.is-primary:hover { transform: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */

.footer {
  border-top: 1px solid var(--border);
  padding: 44px 0;
  background: var(--bg-soft);
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__nav { display: flex; gap: 28px; }
.footer__nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.3s ease;
}
.footer__nav a:hover { color: var(--gold-bright); }
.footer__copy {
  font-size: 13px;
  color: var(--text-dimmer);
}

/* ==========================================================================
   Reveal animation
   ========================================================================== */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
  .nav__link { padding: 9px 14px; font-size: 13.5px; }
  .nav__list { gap: 4px; padding: 5px; }
}

@media (max-width: 1080px) {
  .advantages { grid-template-columns: repeat(2, 1fr); }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .how-steps { gap: 28px 24px; }
  .how-step { padding-right: 12px; }
  .quiz { grid-template-columns: 1fr; }
  .quiz__intro {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .quiz__back { align-self: flex-start; }
  .nav__link { padding: 8px 12px; font-size: 13px; }
}

@media (max-width: 980px) {
  .header__inner {
    display: flex;
    justify-content: space-between;
  }
  .nav { display: none; }
  .burger { display: flex; }
  .auth-slot { display: none; }
  .header__actions {
    grid-column: auto;
  }
}

@media (max-width: 860px) {
  .hero { padding: 160px 0 88px; }
  .hero__stats { gap: 28px; }
  .cta__actions { flex-direction: column; align-items: stretch; }
  .cta__actions .btn { width: 100%; min-height: 48px; }

  /* Full-bleed drawer so logo doesn't collide with a partial panel */
  .mobile-menu {
    width: 100%;
    border-left: none;
    padding-left: max(24px, env(safe-area-inset-left, 0px));
    padding-right: max(24px, env(safe-area-inset-right, 0px));
  }
  .header__inner {
    gap: 12px;
  }
  .logo {
    min-width: 0;
    max-width: calc(100% - 56px);
  }
  .logo__word {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .how-steps {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .how-step {
    padding: 0;
    position: relative;
  }
  .how-step__num {
    position: static;
    margin-bottom: 16px;
  }
  .how-step__title {
    margin-top: 0;
    max-width: none;
  }
  .how-step__text { max-width: none; }
  .how-cta {
    margin-top: 32px;
    justify-content: stretch;
  }
  .how-cta .btn {
    width: 100%;
    max-width: 360px;
    min-height: 48px;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .advantages { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: 1fr; }
  .course-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 36px; }
  .section { padding: 80px 0; }
  .footer__inner { flex-direction: column; text-align: center; }
  .quiz__intro { padding: 28px 22px; }
  .quiz__stage { padding: 28px 22px; min-height: 0; }
  .quiz-result__meta { grid-template-columns: 1fr; max-width: none; }
  .quiz-result__actions { flex-direction: column; align-items: stretch; }
  .quiz-result__actions .btn { width: 100%; }
}

/* ==========================================================================
   Mobile / tablet polish + performance
   ========================================================================== */

/* Safe areas for notched phones */
.header {
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}
.header.scrolled {
  padding-top: max(14px, env(safe-area-inset-top));
}
.mobile-menu {
  height: 100dvh;
  padding-top: calc(120px + env(safe-area-inset-top, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-right: max(40px, env(safe-area-inset-right));
}
.footer {
  padding-bottom: max(44px, calc(44px + env(safe-area-inset-bottom, 0px)));
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .burger,
  .nav__link,
  .filter-btn,
  .auth-tab,
  .lesson-nav button {
    min-height: 44px;
  }
  .burger {
    width: 44px;
    height: 44px;
  }
}

/* Prevent iOS zoom on focus */
@media (max-width: 860px) {
  .field input,
  .field textarea,
  .auth-tab,
  .chat-composer input {
    font-size: 16px;
  }
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 98;
  background: rgba(59, 48, 39, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}
body.menu-open {
  overflow: hidden;
}
body.menu-open .header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.menu-open .logo {
  position: relative;
  z-index: 101;
  pointer-events: auto;
}
body.menu-open .burger {
  position: relative;
  z-index: 101;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 85;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}
body.sidebar-open {
  overflow: hidden;
}

/* Tablet */
@media (max-width: 1024px) {
  .hero, .page-hero { padding: 170px 0 96px; }
  .page-hero { padding: 150px 0 72px; }
  .section { padding: 96px 0; }
  .section-head { margin-bottom: 40px; }
}

@media (max-width: 860px) {
  .hero__grid { opacity: 0.55; }
  .keycap { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .header.scrolled,
  .mobile-menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .marquee__track { animation-duration: 40s; }

  .header { padding-top: max(18px, env(safe-area-inset-top, 0px)); }
  .header.scrolled { padding-top: max(12px, env(safe-area-inset-top, 0px)); }
  .hero { padding: 140px 0 72px; }
  .page-hero { padding: 130px 0 64px; }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero__actions .btn { width: 100%; }
  .hero__cta { margin-bottom: 48px; }
  .hero__offer {
    font-size: 13.5px;
    max-width: 22em;
    padding: 0 8px;
  }
  .cta__offer {
    text-align: center;
    padding: 0 12px;
  }
  .hero__stats {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding-top: 28px;
  }
  .stat__label { max-width: none; }
  .mobile-menu > ul a { font-size: 26px; padding: 12px 0; }
  .auth-page { padding: 100px 16px 40px; }
  .auth-card { padding: 22px 20px 26px; }
  .auth-title { font-size: 28px; }
  .filters {
    gap: 8px;
    margin-bottom: 36px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn {
    padding: 10px 16px;
    font-size: 13px;
    flex: 0 0 auto;
    min-height: 44px;
  }
  .footer__nav { flex-wrap: wrap; justify-content: center; gap: 16px 24px; }
  .page-hero__title { font-size: clamp(32px, 8vw, 48px); }
}

@media (max-width: 640px) {
  .hero, .page-hero { padding: 120px 0 64px; }
  .page-hero { padding: 110px 0 56px; }
  .marquee { display: none; }
  .logo { font-size: 22px; }
  .logo__word { font-size: 19px; }
  .cta { padding: 80px 0; }
  .course-card { padding: 24px; }
  .course-card__bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .course-card__bottom .price {
    margin-right: 0;
  }
  .course-card__bottom .btn {
    width: 100%;
    text-align: center;
  }
  .advantage-card { padding: 24px 20px; }
  .lang-chip { min-height: 0; padding: 20px 18px; }
  .quiz__option { padding: 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee__track { animation: none; }
}

/* Off-screen sections: faster initial paint on long pages */
@media (max-width: 860px) {
  .section:not(.hero):not(.page-hero) {
    content-visibility: auto;
    contain-intrinsic-size: auto 520px;
  }
}

/* ==========================================================================
   About
   ========================================================================== */

.about-page {
  --about-line: rgba(126, 224, 226, 0.08);
  overflow-x: clip;
}

.about-page .keys-bg {
  opacity: 0.7;
}

.about-hero {
  min-height: min(92vh, 860px);
  display: flex;
  align-items: center;
  padding: clamp(132px, 18vh, 180px) 0 clamp(72px, 10vh, 112px);
  overflow: hidden;
}

.about-hero__bg {
  background:
    radial-gradient(ellipse 80% 55% at 50% 18%, rgba(62, 196, 200, 0.14), transparent 58%),
    radial-gradient(ellipse 48% 38% at 88% 72%, rgba(40, 90, 140, 0.2), transparent 55%),
    radial-gradient(ellipse 42% 34% at 8% 68%, rgba(30, 70, 110, 0.18), transparent 60%),
    linear-gradient(180deg, #07101c 0%, var(--bg) 100%);
}

.about-hero__bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--about-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--about-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 75% 60% at 50% 35%, black, transparent 78%);
  opacity: 0.55;
}

.about-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent 0 18px,
      rgba(126, 224, 226, 0.025) 18px 19px
    );
  mask-image: linear-gradient(180deg, black 10%, transparent 70%);
  opacity: 0.7;
}

.about-hero__beam {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(70vw, 720px);
  height: 100%;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(126, 224, 226, 0.07) 0%,
    transparent 42%,
    transparent 100%
  );
  mask-image: linear-gradient(90deg, transparent, black 35%, black 65%, transparent);
  pointer-events: none;
}

.about-hero__code {
  position: absolute;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 1.2vw, 14px);
  line-height: 1.7;
  color: rgba(126, 224, 226, 0.2);
  white-space: pre;
  pointer-events: none;
  user-select: none;
  max-width: 42vw;
  overflow: hidden;
}

.about-hero__code--right {
  top: 14%;
  right: max(2%, calc((100% - var(--container)) / 2 - 40px));
  width: min(38vw, 420px);
  mask-image: linear-gradient(135deg, black 18%, transparent 88%);
  animation: about-code-drift 18s ease-in-out infinite alternate;
}

.about-hero__code--left {
  bottom: 16%;
  left: max(2%, calc((100% - var(--container)) / 2 - 20px));
  width: min(32vw, 340px);
  color: rgba(140, 180, 210, 0.15);
  mask-image: linear-gradient(225deg, black 15%, transparent 90%);
  animation: about-code-drift 22s ease-in-out infinite alternate-reverse;
}

.about-hero__glyph {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 600;
  color: rgba(126, 224, 226, 0.16);
  pointer-events: none;
  user-select: none;
  animation: about-glyph-float 14s ease-in-out infinite;
}

.about-hero__glyph--1 {
  top: 28%;
  left: 10%;
  font-size: clamp(24px, 3.2vw, 44px);
  --glyph-rot: -8deg;
}

.about-hero__glyph--2 {
  top: 64%;
  right: 12%;
  font-size: clamp(20px, 2.6vw, 34px);
  color: rgba(126, 224, 226, 0.2);
  --glyph-rot: 6deg;
  animation-delay: -4s;
}

.about-hero__glyph--3 {
  top: 22%;
  right: 26%;
  font-size: clamp(16px, 2vw, 26px);
  --glyph-rot: -3deg;
  animation-delay: -7s;
}

.about-hero__inner {
  position: relative;
  z-index: 1;
  max-width: min(820px, 100%);
  padding-inline: 4px;
}

.about-hero__brand {
  font-family: var(--font-serif);
  font-size: clamp(40px, 6.5vw, 72px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
  margin: 0 0 clamp(18px, 2.5vw, 28px);
  color: #3b3027;
  text-wrap: balance;
}

.about-hero__brand span {
  color: inherit;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.about-hero__title {
  font-size: clamp(26px, 3.8vw, 40px);
  font-weight: 500;
  line-height: 1.28;
  margin-bottom: clamp(14px, 2vw, 20px);
  max-width: 18em;
  margin-left: auto;
  margin-right: auto;
  text-wrap: balance;
}

.about-hero .hero__text {
  margin-bottom: 0;
  max-width: 36em;
  font-size: clamp(15.5px, 1.35vw, 17.5px);
  padding-inline: 2px;
}

.about-mission,
.about-audience,
.about-features {
  position: relative;
  overflow: hidden;
  padding-block: clamp(72px, 10vw, 110px);
}

.about-mission::before,
.about-audience::before,
.about-features::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 50% at 0% 40%, rgba(62, 196, 200, 0.06), transparent 70%),
    radial-gradient(ellipse 50% 45% at 100% 70%, rgba(40, 90, 140, 0.08), transparent 68%);
}

.about-mission {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}

.about-mission__inner,
.about-block-head,
.about-list {
  position: relative;
  z-index: 1;
}

.about-mission__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-mission .section__title {
  max-width: 14em;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(28px, 4vw, 42px);
}

.about-mission__text {
  margin-top: clamp(16px, 2vw, 22px);
  color: var(--text-dim);
  font-size: clamp(15.5px, 1.4vw, 17.5px);
  font-weight: 500;
  line-height: 1.75;
  text-wrap: pretty;
}

.about-block-head {
  max-width: 640px;
  margin: 0 auto clamp(32px, 5vw, 48px);
  text-align: center;
}

.about-block-head .section__title {
  max-width: 14em;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(28px, 4vw, 42px);
}

.about-list {
  list-style: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  border-top: 1px solid var(--border);
}

.about-list li {
  display: grid;
  gap: 8px;
  padding: clamp(22px, 3vw, 30px) 0;
  border-bottom: 1px solid var(--border);
}

.about-list strong {
  font-family: var(--font-serif);
  font-size: clamp(21px, 2.5vw, 28px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}

.about-list span {
  color: var(--text-dim);
  font-size: clamp(15px, 1.3vw, 16.5px);
  font-weight: 500;
  line-height: 1.7;
  max-width: 46em;
  text-wrap: pretty;
}

.about-list--features strong {
  color: var(--gold-bright);
}

.about-audience {
  padding-top: clamp(72px, 10vw, 110px);
}

.about-features {
  border-top: 1px solid var(--border);
}

.about-page .cta {
  padding-block: clamp(72px, 10vw, 110px);
  padding-bottom: max(clamp(72px, 10vw, 110px), env(safe-area-inset-bottom, 0px));
}

.about-page .cta__actions {
  gap: 12px;
}

.about-page .footer {
  padding-bottom: max(40px, env(safe-area-inset-bottom, 0px));
}

@keyframes about-code-drift {
  from { transform: translate3d(0, 0, 0); opacity: 0.85; }
  to { transform: translate3d(-10px, 14px, 0); opacity: 1; }
}

@keyframes about-glyph-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(var(--glyph-rot, 0deg)); opacity: 0.7; }
  50% { transform: translate3d(0, -8px, 0) rotate(calc(var(--glyph-rot, 0deg) + 4deg)); opacity: 1; }
}

/* Desktop wide: keep decor clear of text */
@media (min-width: 1280px) {
  .about-hero__code--right { right: 6%; opacity: 0.95; }
  .about-hero__code--left { left: 5%; }
  .about-hero__glyph--1 { left: 14%; }
  .about-hero__glyph--2 { right: 16%; }
}

/* Tablet */
@media (max-width: 1100px) {
  .about-hero {
    min-height: 0;
    padding: 150px 0 88px;
  }
  .about-hero__code--left,
  .about-hero__glyph--3 {
    display: none;
  }
  .about-hero__code--right {
    right: 2%;
    width: min(34vw, 300px);
    opacity: 0.55;
  }
  .about-hero__glyph {
    opacity: 0.55;
  }
}

@media (max-width: 860px) {
  .about-page .keys-bg {
    display: none;
  }

  .about-hero {
    padding: 128px 0 64px;
    min-height: 0;
  }

  .about-hero__bg::after,
  .about-hero__code,
  .about-hero__glyph,
  .about-hero__beam {
    display: none;
  }

  .about-hero__bg::before {
    background-size: 40px 40px;
    opacity: 0.4;
  }

  .about-hero__inner {
    text-align: center;
  }

  .about-mission,
  .about-audience,
  .about-features {
    padding-block: 64px;
  }

  .about-list li {
    gap: 6px;
    padding: 22px 0;
  }

  .about-page .cta__inner p {
    max-width: 34em;
  }
}

@media (max-width: 640px) {
  .about-hero {
    padding: 112px 0 56px;
  }

  .about-hero__brand {
    font-size: clamp(40px, 12vw, 56px);
    margin-bottom: 16px;
  }

  .about-hero__title {
    font-size: clamp(24px, 6.8vw, 30px);
    margin-bottom: 14px;
    max-width: none;
  }

  .about-hero .hero__text {
    font-size: 15.5px;
    line-height: 1.65;
  }

  .about-mission,
  .about-audience,
  .about-features {
    padding-block: 56px;
  }

  .about-block-head {
    margin-bottom: 28px;
  }

  .about-mission__text,
  .about-list span {
    font-size: 15.5px;
  }

  .about-list strong {
    font-size: clamp(20px, 5.6vw, 24px);
  }

  .about-page .cta__actions .btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }

  .about-page .footer__inner {
    gap: 18px;
  }

  .about-page .footer__nav {
    gap: 12px 18px;
  }
}

@media (max-width: 400px) {
  .about-hero__brand {
    font-size: 36px;
  }

  .about-hero__title {
    font-size: 22px;
  }

  .about-mission__text,
  .about-list span,
  .about-hero .hero__text {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-hero__code,
  .about-hero__glyph {
    animation: none;
  }
}

/* ==========================================================================
   Editorial daylight system — original VibeTech redesign
   ========================================================================== */
:root {
  --bg: #f7f3eb;
  --bg-soft: #eee6d8;
  --panel: #fffdf8;
  --panel-2: #f4ecde;
  --border: rgba(67, 53, 42, .15);
  --border-strong: rgba(67, 53, 42, .28);
  --text: #3b3027;
  --text-dim: #74685b;
  --text-dimmer: #9e9488;
  --accent: #5a4737;
  --accent-hover: #3b3027;
  --accent-rgb: 90, 71, 55;
  --accent-soft: rgba(90, 71, 55, .09);
  --btn: #5a4737;
  --btn-hover: #3b3027;
  --btn-rgb: 90, 71, 55;
  --gold: #b69363;
  --gold-bright: #9f7e52;
  --gold-deep: #765633;
  --gradient-gold: linear-gradient(135deg, #5a4737, #3b3027);
  --body-grad: #f7f3eb;
  --aura-1: rgba(90, 71, 55, .07);
  --aura-2: rgba(182, 147, 99, .13);
  --font-serif: "Newsreader", Georgia, serif;
  --radius: 12px;
  --radius-sm: 8px;
  --container: 1180px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-weight: 450;
  letter-spacing: 0;
}
body::before,
body::after {
  content: none !important;
  display: none !important;
  background: none !important;
  border: 0 !important;
}
/* Clean cream surface — only soft keycaps as IT accents.
   Hide keys: add class "no-it-decor" on <html>. */
.noise-overlay { display: none !important; }
.hero__bg, .hero__grid, .hero__fade { display: none !important; }

html:not(.no-it-decor) .keys-bg {
  display: block !important;
  z-index: 0;
  opacity: 1;
}
html:not(.no-it-decor) .keycap {
  border: 1px solid rgba(59, 48, 39, 0.1);
  background:
    linear-gradient(155deg, rgba(255, 253, 248, 0.94), rgba(240, 228, 207, 0.82));
  box-shadow:
    0 8px 22px rgba(59, 48, 39, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0.5;
}
html:not(.no-it-decor) .keycap__face {
  color: rgba(90, 71, 55, 0.52);
  font-weight: 550;
}
html:not(.no-it-decor) .keycap--accent {
  border-color: rgba(182, 147, 99, 0.35);
  background:
    linear-gradient(155deg, rgba(255, 250, 240, 0.96), rgba(232, 214, 184, 0.85));
  box-shadow:
    0 10px 24px rgba(90, 71, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  opacity: 0.68;
}
html:not(.no-it-decor) .keycap--accent .keycap__face {
  color: rgba(159, 126, 82, 0.88);
}

@media (max-width: 900px) {
  html:not(.no-it-decor) .keycap:nth-of-type(n + 4) { display: none; }
}
@media (max-width: 700px) {
  html:not(.no-it-decor) .keys-bg { display: none !important; }
}

html.no-it-decor .keys-bg { display: none !important; }

a { color: inherit; }
.container { max-width: var(--container); }
.header,
.header.scrolled {
  background: var(--bg);
  border-bottom: 1px solid rgba(59, 48, 39, 0.08);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.header__inner { min-height: 76px; }
.logo {
  align-items: center;
}
.logo__word {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #3b3027;
  line-height: 1;
}
.logo__word span {
  font-weight: 600;
  color: #5a4737;
}
.logo__icon {
  display: none !important;
}

/* Menu — soft light pill, clear links */
.nav__list {
  gap: 4px !important;
  padding: 5px !important;
  background: #fffdf8 !important;
  border: 1px solid rgba(59, 48, 39, 0.1) !important;
  border-radius: 999px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: 0 1px 3px rgba(59, 48, 39, 0.04) !important;
}
.nav__link {
  color: #5a4737 !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  padding: 9px 16px !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
}
.nav__link::after { display: none !important; }
.nav__link:hover {
  color: #3b3027 !important;
  background: rgba(182, 147, 99, 0.14) !important;
}
.nav__link.active {
  color: #3b3027 !important;
  background: rgba(182, 147, 99, 0.22) !important;
  position: relative;
}
.nav__link.active::after {
  content: none !important;
  display: none !important;
}
.mobile-menu { background: var(--panel); border-bottom: 1px solid var(--border); }
.mobile-menu a { color: var(--text); }
.burger span { background: var(--text) !important; }

/* Open mobile menu: keep cream header (override old dark ocean rule) */
body.menu-open .header,
body.menu-open .header.scrolled {
  background: #f7f3eb !important;
  border-bottom: 1px solid rgba(59, 48, 39, 0.1) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.menu-backdrop {
  background: rgba(59, 48, 39, 0.28) !important;
}
.mobile-menu {
  background: #fffdf8 !important;
  border-left: 1px solid rgba(59, 48, 39, 0.1) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.mobile-menu > ul a {
  color: #5a4737 !important;
  border-bottom-color: rgba(59, 48, 39, 0.1) !important;
}
.mobile-menu > ul a:hover {
  color: #3b3027 !important;
}

.btn {
  border-radius: 8px;
  min-height: 44px;
  padding: 0 20px;
  font-size: 14px;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 650;
  box-shadow: none;
}
.btn--gold { background: var(--accent); color: #fffdf8; }
.btn--gold:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn--outline, .btn--ghost {
  border-color: var(--border-strong);
  color: var(--accent);
  background: transparent;
}
.btn--outline:hover, .btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.auth-slot .btn { min-height: 36px; padding: 0 14px; }

.hero, .page-hero, .about-hero {
  background: transparent;
  min-height: auto;
  padding: 170px 0 90px;
  border-bottom: 1px solid var(--border);
}
.hero__bg, .hero__grid, .hero__fade,
.about-hero__bg, .about-hero__beam, .about-hero__bg::before, .about-hero__bg::after {
  display: none !important;
}
.hero__inner { max-width: 920px; margin: 0 auto; text-align: center; }
.eyebrow, .section__eyebrow {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero__title, .page-hero__title, .section__title, .about-hero__title {
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
}
.hero__title { max-width: 850px; margin: 18px auto; font-size: clamp(48px, 7vw, 88px); }
.page-hero__title, .about-hero__title { font-size: clamp(44px, 6vw, 72px); }
.gold { color: var(--accent); }
.hero__text, .page-hero__text { color: var(--text-dim); max-width: 650px; font-size: 18px; margin-inline: auto; }
.hero__actions { justify-content: center; }
.hero__offer { color: var(--text-dimmer); font-size: 13px; }
.hero__stats {
  margin-top: 58px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  background: transparent;
}
.stat { border-right-color: var(--border); }
.stat__num { color: var(--accent); font-family: var(--font-serif); font-size: 35px; }
.stat__label { color: var(--text-dim); }
.marquee { border-color: var(--border); color: var(--accent); background: var(--panel-2); }

.section { padding: 96px 0; }
.section--soft { background: var(--bg-soft); border-block: 1px solid var(--border); }
.section-head { max-width: 740px; margin-bottom: 44px; }
.section__title { font-size: clamp(36px, 4vw, 58px); margin-top: 12px; }
.section__lead { color: var(--text-dim); font-size: 17px; }

/* Cards — light surfaces, warm hover (no dark ocean leftovers) */
.advantage-card, .how-step, .lang-card, .course-card, .profile-course,
.auth-card, .paywall__card, .quiz, .about-card, .profile-welcome, .profile-stats,
.catalog-empty, .lang-chip {
  background: #fffdf8 !important;
  border: 1px solid rgba(59, 48, 39, 0.1) !important;
  box-shadow: 0 1px 2px rgba(59, 48, 39, 0.04);
  border-radius: 12px;
  color: var(--text);
}
.advantage-card::before,
.course-card::before {
  background: linear-gradient(90deg, #b69363, #5a4737) !important;
}
.course-card::after {
  opacity: 0 !important;
  display: none !important;
}
.advantage-card:hover,
.lang-card:hover,
.course-card:hover,
.lang-chip:hover,
.lang-chip--more:hover {
  background: #f6efe3 !important;
  border-color: rgba(182, 147, 99, 0.55) !important;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(90, 71, 55, 0.1) !important;
}
.advantage-card:hover h3,
.course-card:hover h3,
.lang-chip:hover .lang-chip__body strong {
  color: #3b3027 !important;
}
.advantage-card__num, .how-step__num { color: var(--accent); font-family: var(--font-serif); }
.how-step { background: transparent !important; border: 0 !important; border-top: 1px solid var(--border) !important; border-radius: 0; box-shadow: none; }
.how-step__title, .advantage-card h3 { font-family: var(--font-serif); color: var(--text); }
.lang-chip, .filter-btn {
  background: #fffdf8;
  border-color: rgba(59, 48, 39, 0.1);
  color: var(--text);
  border-radius: 12px;
}
.lang-chip:hover, .filter-btn:hover, .filter-btn.active {
  border-color: rgba(182, 147, 99, 0.55);
  color: #3b3027;
  background: #f6efe3 !important;
}
.lang-chip__body span { color: var(--text-dim) !important; }
.lang-chip:hover .lang-chip__body span { color: #74685b !important; }
.course-card__price, .lang-card__price { color: var(--accent); }
.quiz-option:hover {
  background: #f6efe3 !important;
  border-color: rgba(182, 147, 99, 0.45) !important;
}

.field input, .field textarea, input:not(.sandbox__editor), textarea:not(.sandbox__editor), select {
  background: #fffef9;
  color: var(--text);
  border-color: var(--border-strong);
  border-radius: 8px;
}
.field input:focus, .field textarea:focus, input:not(.sandbox__editor):focus, textarea:not(.sandbox__editor):focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-page { background: transparent; }
.auth-bg {
  opacity: 0 !important;
  background: none !important;
}
.auth-card {
  border-radius: 16px !important;
  box-shadow: 0 20px 50px rgba(90,71,55,.10);
  background: #fffdf8 !important;
}
.auth-tabs {
  background: #f3ebe0 !important;
  border: 1px solid rgba(59, 48, 39, 0.1) !important;
  border-radius: 12px !important;
  padding: 4px !important;
}
.auth-tab {
  color: #74685b !important;
  background: transparent !important;
  border-radius: 10px !important;
  border: none !important;
  font-weight: 650 !important;
}
.auth-tab.active {
  color: #3b3027 !important;
  background: #fffdf8 !important;
  border: 1px solid rgba(182, 147, 99, 0.45) !important;
  box-shadow: 0 2px 8px rgba(90, 71, 55, 0.08);
}

/* Profile arena block — light after login */
.profile-arena {
  background: #fffdf8 !important;
  border: 1px solid rgba(59, 48, 39, 0.12) !important;
  box-shadow: 0 8px 24px rgba(59, 48, 39, 0.06);
  border-radius: 16px !important;
}
.profile-arena__head h2,
.profile-arena__mmr {
  color: #3b3027 !important;
}
.profile-arena__eyebrow {
  color: #9f7e52 !important;
}
.profile-arena__hint,
.profile-arena__record {
  color: #74685b !important;
}
.profile-arena__track {
  background: rgba(59, 48, 39, 0.08) !important;
}
.profile-arena__track span {
  background: linear-gradient(90deg, #b69363, #5a4737) !important;
}

.profile-next__item {
  background: #fffdf8 !important;
  border: 1px solid rgba(59, 48, 39, 0.1) !important;
  box-shadow: none !important;
}
.profile-next__item.is-primary {
  background: #f3ebe0 !important;
  border-color: rgba(182, 147, 99, 0.45) !important;
  box-shadow: none !important;
}
.profile-next__item:hover,
.profile-next__item.is-primary:hover {
  background: #efe4d4 !important;
  border-color: rgba(182, 147, 99, 0.55) !important;
  box-shadow: none !important;
}
.profile-next__item-cta,
.profile-next__item.is-primary .profile-next__item-cta {
  color: #5a4737 !important;
}
.profile-next__item-label { color: #3b3027 !important; }
.profile-next__item-meta { color: #74685b !important; }
.profile-welcome__avatar {
  background: #5a4737 !important;
  box-shadow: none !important;
  color: #fffdf8 !important;
}
.profile-course__cta,
.profile-course:hover .profile-course__cta {
  background: #5a4737 !important;
  box-shadow: none !important;
}
.profile-course__bar {
  background: #5a4737 !important;
  box-shadow: none !important;
}
.auth-slot .btn--ghost {
  background: transparent !important;
  border-color: rgba(59, 48, 39, 0.18) !important;
  color: #5a4737 !important;
}
.mobile-auth {
  border-top-color: rgba(59, 48, 39, 0.12) !important;
}
.mobile-auth .btn--outline {
  border-color: rgba(59, 48, 39, 0.18) !important;
  color: #5a4737 !important;
  background: #fffdf8 !important;
}

.footer { background: #3b3027; border: 0; color: rgba(255,255,255,.75); }
.footer .logo__word { color: #fffdf8; }
.footer .logo__word span { color: rgba(255, 253, 248, 0.78); }
.footer__copy { color: rgba(255,255,255,.55); }

@media (max-width: 720px) {
  .header__inner { min-height: 64px; }
  .hero, .page-hero, .about-hero { padding: 125px 0 62px; }
  .hero__title { font-size: 48px; }
  .section { padding: 66px 0; }
  .hero__stats { display: grid; grid-template-columns: 1fr; gap: 14px; }
  .stat { border: 0; }
}

/* ==========================================================================
   Responsive final pass — shared shell and marketing pages
   ========================================================================== */

html,
body {
  max-width: 100%;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

button,
input,
textarea,
select {
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid #b69363;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .header,
  .header.scrolled {
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }

  .header__inner {
    min-height: 64px;
    gap: 12px;
  }

  .burger {
    width: 44px;
    height: 44px;
  }

  .mobile-menu {
    overscroll-behavior: contain;
    padding-top: calc(120px + env(safe-area-inset-top, 0px));
    padding-bottom: max(28px, env(safe-area-inset-bottom, 0px));
  }

  .mobile-menu > ul a {
    min-height: 52px;
    display: flex;
    align-items: center;
  }

  .mobile-menu > ul > li:first-child a {
    padding-top: 18px;
  }

  .page-hero,
  .about-hero {
    padding-top: 142px;
  }

  .profile-welcome {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .profile-welcome__actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .profile-welcome__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 860px) {
  body.menu-open {
    overscroll-behavior: none;
  }

  .mobile-menu {
    width: 100%;
    max-width: none;
    padding-top: calc(124px + env(safe-area-inset-top, 0px));
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }

  .mobile-menu > ul {
    gap: 4px;
  }

  .mobile-menu > ul a {
    font-size: clamp(22px, 6vw, 28px);
    padding: 14px 0;
  }

  .filters {
    width: calc(100% + 40px);
    margin-left: -20px;
    padding-left: 20px;
    padding-right: 20px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .footer__nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 20px;
  }

  .profile-next__item,
  .profile-course {
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }

  .hero,
  .page-hero,
  .about-hero {
    padding-top: 112px;
    padding-bottom: 54px;
  }

  .hero__title {
    font-size: clamp(40px, 12vw, 48px) !important;
    line-height: 1.02;
  }

  .page-hero__title,
  .about-hero__title {
    font-size: clamp(36px, 10vw, 46px);
  }

  .hero__text,
  .page-hero__text,
  .section__lead {
    font-size: 16px;
  }

  .hero__actions,
  .quiz-result__actions,
  .cta__actions {
    width: 100%;
  }

  .hero__actions .btn,
  .quiz-result__actions .btn,
  .cta__actions .btn {
    min-height: 48px;
  }

  .auth-page {
    align-items: flex-start;
    padding: 100px 16px 32px;
  }

  .auth-card {
    padding: 22px 18px 24px;
    border-radius: 14px !important;
  }

  .auth-tabs {
    margin-bottom: 22px;
  }

  .profile-welcome {
    grid-template-columns: 1fr;
  }

  .profile-welcome__avatar {
    width: 58px;
    height: 58px;
    font-size: 18px;
  }

  .profile-welcome__actions {
    grid-template-columns: 1fr;
  }

  .footer {
    padding-top: 34px;
  }

  .footer__nav {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header,
  .header.scrolled {
    padding-left: 14px;
    padding-right: 14px;
  }

  .logo__word {
    font-size: 19px;
  }

  .hero__title {
    font-size: 40px !important;
  }

  .auth-tab {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   Theme toggle + night editorial
   ========================================================================== */
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

.theme-toggle {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(182, 147, 99, 0.38);
  background:
    radial-gradient(circle at 35% 30%, #fff6d8 0%, #ffd27a 42%, #f0b24a 100%);
  box-shadow:
    0 6px 16px rgba(176, 122, 42, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  overflow: hidden;
  cursor: pointer;
  transition:
    background 0.45s ease,
    box-shadow 0.45s ease,
    border-color 0.45s ease,
    transform 0.2s ease;
}
.theme-toggle:hover {
  transform: translateY(-1px) scale(1.05);
}
.theme-toggle:active {
  transform: scale(0.96);
}
.theme-toggle__sky {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
}
.theme-toggle__icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}
.theme-toggle__icon--sun {
  color: #7a4a12;
  opacity: 1;
  transform: rotate(0deg) scale(1);
}
.theme-toggle__icon--moon {
  color: #f4ead4;
  opacity: 0;
  transform: rotate(-70deg) scale(0.35) translate(8px, -6px);
}
.theme-toggle__stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.theme-toggle__stars i {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff8e8;
  opacity: 0;
  box-shadow: 0 0 6px rgba(255, 248, 232, 0.8);
  transition: opacity 0.4s ease;
}
.theme-toggle__stars i:nth-child(1) { top: 9px; left: 11px; }
.theme-toggle__stars i:nth-child(2) { top: 14px; right: 10px; width: 1.5px; height: 1.5px; }
.theme-toggle__stars i:nth-child(3) { bottom: 11px; left: 14px; width: 1.5px; height: 1.5px; }

html[data-theme="dark"] .theme-toggle {
  border-color: rgba(143, 201, 176, 0.32);
  background:
    radial-gradient(circle at 70% 28%, #3d524a 0%, #1c2824 42%, #101614 100%);
  box-shadow:
    0 8px 20px rgba(6, 12, 10, 0.45),
    inset 0 0 12px rgba(143, 201, 176, 0.16);
}
html[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(80deg) scale(0.3) translate(-10px, 8px);
}
html[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1) translate(0, 0);
  color: #dceee6;
}
html[data-theme="dark"] .theme-toggle__stars i {
  opacity: 0.95;
  background: #e6f4ee;
}

html[data-theme="dark"] {
  --bg: #121413;
  --bg-soft: #191c1b;
  --panel: #1f2322;
  --panel-2: #272c2a;
  --border: rgba(190, 220, 208, 0.12);
  --border-strong: rgba(190, 220, 208, 0.2);
  --text: #eef2f0;
  --text-dim: #9aa8a2;
  --text-dimmer: #6c7873;
  --accent: #8fc9b0;
  --accent-hover: #a8d9c4;
  --accent-rgb: 143, 201, 176;
  --accent-soft: rgba(143, 201, 176, 0.16);
  --btn: #6eae96;
  --btn-hover: #7fbea6;
  --btn-rgb: 110, 174, 150;
  --gold: #8fc9b0;
  --gold-bright: #c5e6d6;
  --gold-deep: #4a8a74;
  --gradient-gold: linear-gradient(135deg, #a8d9c4, #6eae96);
  --body-grad: #121413;
  --aura-1: rgba(143, 201, 176, 0.08);
  --aura-2: rgba(60, 100, 85, 0.1);
}

html[data-theme="dark"] body {
  background: radial-gradient(1000px 480px at 8% -12%, rgba(143, 201, 176, 0.07), transparent 48%),
              radial-gradient(820px 420px at 100% 0%, rgba(60, 100, 85, 0.1), transparent 44%),
              var(--bg);
}

html[data-theme="dark"] .header,
html[data-theme="dark"] .header.scrolled,
html[data-theme="dark"] body.menu-open .header,
html[data-theme="dark"] body.menu-open .header.scrolled {
  background: rgba(18, 20, 19, 0.92) !important;
  border-bottom-color: var(--border) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .logo__word { color: #eef2f0 !important; }
html[data-theme="dark"] .logo__word span { color: #8fc9b0 !important; }

html[data-theme="dark"] .nav__list {
  background: rgba(31, 35, 34, 0.94) !important;
  border-color: var(--border) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}
html[data-theme="dark"] .nav__link { color: #aeb8b3 !important; }
html[data-theme="dark"] .nav__link:hover {
  color: #eef2f0 !important;
  background: rgba(143, 201, 176, 0.12) !important;
}
html[data-theme="dark"] .nav__link.active {
  color: #121413 !important;
  background: linear-gradient(135deg, #a8d9c4, #6eae96) !important;
}

html[data-theme="dark"] .mobile-menu {
  background: #191c1b !important;
  border-left-color: var(--border) !important;
}
html[data-theme="dark"] .mobile-menu > ul a {
  color: #aeb8b3 !important;
  border-bottom-color: var(--border) !important;
}
html[data-theme="dark"] .mobile-menu > ul a:hover { color: #eef2f0 !important; }
html[data-theme="dark"] .menu-backdrop { background: rgba(8, 8, 8, 0.58) !important; }

html[data-theme="dark"] .btn--gold { color: #121413; }
html[data-theme="dark"] .auth-slot .btn--ghost {
  border-color: var(--border-strong) !important;
  color: #8fc9b0 !important;
}
html[data-theme="dark"] .mobile-auth .btn--outline {
  border-color: var(--border-strong) !important;
  color: #8fc9b0 !important;
  background: var(--panel) !important;
}

html[data-theme="dark"] .advantage-card,
html[data-theme="dark"] .how-step,
html[data-theme="dark"] .lang-card,
html[data-theme="dark"] .course-card,
html[data-theme="dark"] .profile-course,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .paywall__card,
html[data-theme="dark"] .quiz,
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .profile-welcome,
html[data-theme="dark"] .profile-stats,
html[data-theme="dark"] .catalog-empty,
html[data-theme="dark"] .lang-chip,
html[data-theme="dark"] .profile-arena,
html[data-theme="dark"] .profile-next__item {
  background: var(--panel) !important;
  border-color: var(--border) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24) !important;
  color: var(--text);
}
html[data-theme="dark"] .advantage-card::before,
html[data-theme="dark"] .course-card::before {
  background: linear-gradient(90deg, #a8d9c4, #6eae96) !important;
}
html[data-theme="dark"] .advantage-card:hover,
html[data-theme="dark"] .lang-card:hover,
html[data-theme="dark"] .course-card:hover,
html[data-theme="dark"] .lang-chip:hover,
html[data-theme="dark"] .lang-chip--more:hover,
html[data-theme="dark"] .filter-btn:hover,
html[data-theme="dark"] .filter-btn.active,
html[data-theme="dark"] .quiz-option:hover,
html[data-theme="dark"] .profile-next__item:hover,
html[data-theme="dark"] .profile-next__item.is-primary:hover {
  background: #272c2a !important;
  border-color: rgba(143, 201, 176, 0.38) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3) !important;
}
html[data-theme="dark"] .advantage-card:hover h3,
html[data-theme="dark"] .course-card:hover h3,
html[data-theme="dark"] .lang-chip:hover .lang-chip__body strong {
  color: #eef2f0 !important;
}
html[data-theme="dark"] .lang-chip,
html[data-theme="dark"] .filter-btn {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
}
html[data-theme="dark"] .lang-chip__body span { color: var(--text-dim) !important; }
html[data-theme="dark"] .lang-chip:hover .lang-chip__body span { color: #c4d2cb !important; }

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] input:not(.sandbox__editor),
html[data-theme="dark"] textarea:not(.sandbox__editor),
html[data-theme="dark"] select {
  background: #171b19;
  color: var(--text);
  border-color: var(--border-strong);
}
html[data-theme="dark"] .auth-tabs {
  background: #171b19 !important;
  border-color: var(--border) !important;
}
html[data-theme="dark"] .auth-tab { color: var(--text-dim) !important; }
html[data-theme="dark"] .auth-tab.active {
  color: #eef2f0 !important;
  background: #1f2322 !important;
  border-color: rgba(143, 201, 176, 0.35) !important;
}

html[data-theme="dark"] .profile-arena__head h2,
html[data-theme="dark"] .profile-arena__mmr,
html[data-theme="dark"] .profile-next__item-label {
  color: #eef2f0 !important;
}
html[data-theme="dark"] .profile-arena__eyebrow { color: #8fc9b0 !important; }
html[data-theme="dark"] .profile-arena__hint,
html[data-theme="dark"] .profile-arena__record,
html[data-theme="dark"] .profile-next__item-meta {
  color: var(--text-dim) !important;
}
html[data-theme="dark"] .profile-arena__track { background: rgba(238, 242, 240, 0.08) !important; }
html[data-theme="dark"] .profile-arena__track span,
html[data-theme="dark"] .profile-course__bar,
html[data-theme="dark"] .profile-welcome__avatar,
html[data-theme="dark"] .profile-course__cta,
html[data-theme="dark"] .profile-course:hover .profile-course__cta {
  background: linear-gradient(90deg, #a8d9c4, #6eae96) !important;
  color: #121413 !important;
}
html[data-theme="dark"] .profile-next__item.is-primary {
  background: #272c2a !important;
  border-color: rgba(143, 201, 176, 0.35) !important;
}
html[data-theme="dark"] .profile-next__item-cta,
html[data-theme="dark"] .profile-next__item.is-primary .profile-next__item-cta {
  color: #8fc9b0 !important;
}

html[data-theme="dark"] .footer {
  background: #0e1210;
  color: rgba(238, 242, 240, 0.62);
}
html[data-theme="dark"] .footer .logo__word { color: #eef2f0; }
html[data-theme="dark"] .footer .logo__word span { color: #8fc9b0; }

html[data-theme="dark"]:not(.no-it-decor) .keycap {
  border-color: rgba(208, 228, 218, 0.1);
  background: linear-gradient(155deg, rgba(42, 50, 46, 0.86), rgba(20, 28, 24, 0.8));
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0.4;
}
html[data-theme="dark"]:not(.no-it-decor) .keycap__face { color: rgba(214, 232, 224, 0.5); }
html[data-theme="dark"]:not(.no-it-decor) .keycap--accent {
  border-color: rgba(143, 201, 176, 0.32);
  background: linear-gradient(155deg, rgba(42, 62, 54, 0.9), rgba(20, 32, 26, 0.82));
  opacity: 0.58;
}
html[data-theme="dark"]:not(.no-it-decor) .keycap--accent .keycap__face {
  color: rgba(197, 230, 214, 0.88);
}

html[data-theme="dark"] .profile-chip {
  background: var(--panel);
  border-color: var(--border);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
html[data-theme="dark"] .profile-chip:hover {
  background: var(--panel-2);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}
html[data-theme="dark"] .profile-chip__avatar {
  background: var(--btn);
  color: #121413;
}
html[data-theme="dark"] .profile-chip__name {
  color: var(--text);
}
html[data-theme="dark"] .profile-chip__hint {
  color: var(--text-dimmer);
}
html[data-theme="dark"] .profile-chip__out {
  border-color: var(--border);
  color: var(--accent);
}
html[data-theme="dark"] .profile-chip__out:hover {
  background: var(--accent-soft);
  border-color: rgba(var(--accent-rgb), 0.4);
  color: var(--gold-bright);
}

