/* =========================================================
   DevSpeak — English for ISIP students (Unit 18: Web Design)
   Pure CSS. No external fonts, frameworks or CDNs.
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "SFMono-Regular", Menlo, monospace;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --container: 1200px;
  --header-h: 64px;

  color-scheme: light;
  --bg: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f0f2f9;
  --surface-3: #e5e8f3;
  --text: #11152e;
  --text-2: #454b6b;
  --muted: #6f7598;
  --border: #e1e4f0;
  --border-2: #cdd2e5;
  --primary: #4f46e5;
  --primary-strong: #4f46e5;
  --primary-soft: #ecebfd;
  --grid-dot: rgba(17, 21, 46, .11);
  --glass: rgba(255, 255, 255, .78);

  --indigo: #4f46e5;  --indigo-soft: #ecebfd;
  --cyan: #0e7490;    --cyan-soft: #dcf4f9;
  --pink: #be185d;    --pink-soft: #fce8f2;
  --orange: #b45309;  --orange-soft: #fdf0dc;
  --violet: #7c3aed;  --violet-soft: #f1eafe;
  --rose: #e11d48;    --rose-soft: #fde8ec;
  --green: #047857;   --green-soft: #dcf4ea;
  --danger: #dc2626;  --danger-soft: #fde7e7;
  --success: #059669; --success-soft: #daf5ea;

  --shadow-sm: 0 1px 2px rgba(17, 21, 46, .06);
  --shadow: 0 1px 2px rgba(17, 21, 46, .05), 0 8px 24px -8px rgba(17, 21, 46, .14);
  --shadow-lg: 0 2px 6px rgba(17, 21, 46, .05), 0 28px 60px -18px rgba(17, 21, 46, .28);

  --hero-glow-1: rgba(99, 102, 241, .20);
  --hero-glow-2: rgba(6, 182, 212, .16);
  --hero-glow-3: rgba(236, 72, 153, .12);
  --brand-grad: linear-gradient(90deg, #4f46e5, #db2777);

  /* code surfaces are always dark */
  --code-bg: #0e1124;
  --code-bar: #161a33;
  --code-text: #e2e6f5;
  --code-muted: #6c7396;
  --tk-tag: #7dd3fc;
  --tk-attr: #c4b5fd;
  --tk-str: #86efac;
  --tk-com: #6c7396;
  --tk-kw: #f9a8d4;
  --tk-var: #fcd34d;
  --tk-num: #fdba74;
  --tk-prop: #67e8f9;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090c1a;
    --surface: #11152a;
    --surface-2: #171c35;
    --surface-3: #212747;
    --text: #eceefb;
    --text-2: #b3b9d8;
    --muted: #8087ab;
    --border: #232948;
    --border-2: #333a63;
    --primary: #a5a0ff;
    --primary-strong: #5b52f0;
    --primary-soft: rgba(129, 120, 255, .16);
    --grid-dot: rgba(255, 255, 255, .07);
    --glass: rgba(9, 12, 26, .78);
    --indigo: #a5a0ff;  --indigo-soft: rgba(129, 120, 255, .16);
    --cyan: #5ee0f5;    --cyan-soft: rgba(34, 211, 238, .13);
    --pink: #f78cc4;    --pink-soft: rgba(244, 114, 182, .14);
    --orange: #fbbf5c;  --orange-soft: rgba(251, 191, 36, .13);
    --violet: #c4a8ff;  --violet-soft: rgba(167, 139, 250, .15);
    --rose: #fb7f96;    --rose-soft: rgba(251, 113, 133, .14);
    --green: #4ade9c;   --green-soft: rgba(52, 211, 153, .13);
    --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .15);
    --success: #34d399; --success-soft: rgba(52, 211, 153, .15);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .75);
    --hero-glow-1: rgba(99, 102, 241, .30);
    --hero-glow-2: rgba(6, 182, 212, .16);
    --hero-glow-3: rgba(236, 72, 153, .15);
    --brand-grad: linear-gradient(90deg, #a5a0ff, #f78cc4);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090c1a;
  --surface: #11152a;
  --surface-2: #171c35;
  --surface-3: #212747;
  --text: #eceefb;
  --text-2: #b3b9d8;
  --muted: #8087ab;
  --border: #232948;
  --border-2: #333a63;
  --primary: #a5a0ff;
  --primary-strong: #5b52f0;
  --primary-soft: rgba(129, 120, 255, .16);
  --grid-dot: rgba(255, 255, 255, .07);
  --glass: rgba(9, 12, 26, .78);
  --indigo: #a5a0ff;  --indigo-soft: rgba(129, 120, 255, .16);
  --cyan: #5ee0f5;    --cyan-soft: rgba(34, 211, 238, .13);
  --pink: #f78cc4;    --pink-soft: rgba(244, 114, 182, .14);
  --orange: #fbbf5c;  --orange-soft: rgba(251, 191, 36, .13);
  --violet: #c4a8ff;  --violet-soft: rgba(167, 139, 250, .15);
  --rose: #fb7f96;    --rose-soft: rgba(251, 113, 133, .14);
  --green: #4ade9c;   --green-soft: rgba(52, 211, 153, .13);
  --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .15);
  --success: #34d399; --success-soft: rgba(52, 211, 153, .15);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, .75);
  --hero-glow-1: rgba(99, 102, 241, .30);
  --hero-glow-2: rgba(6, 182, 212, .16);
  --hero-glow-3: rgba(236, 72, 153, .15);
  --brand-grad: linear-gradient(90deg, #a5a0ff, #f78cc4);
}

/* Module accents */
.ac-indigo { --accent: var(--indigo); --accent-soft: var(--indigo-soft); --accent-grad: linear-gradient(135deg, #6366f1, #8b5cf6); --accent-shadow: rgba(99, 102, 241, .55); }
.ac-cyan   { --accent: var(--cyan);   --accent-soft: var(--cyan-soft);   --accent-grad: linear-gradient(135deg, #06b6d4, #3b82f6); --accent-shadow: rgba(6, 182, 212, .5); }
.ac-pink   { --accent: var(--pink);   --accent-soft: var(--pink-soft);   --accent-grad: linear-gradient(135deg, #ec4899, #f43f5e); --accent-shadow: rgba(236, 72, 153, .5); }
.ac-orange { --accent: var(--orange); --accent-soft: var(--orange-soft); --accent-grad: linear-gradient(135deg, #f59e0b, #f97316); --accent-shadow: rgba(245, 158, 11, .5); }
.ac-violet { --accent: var(--violet); --accent-soft: var(--violet-soft); --accent-grad: linear-gradient(135deg, #8b5cf6, #d946ef); --accent-shadow: rgba(139, 92, 246, .5); }
.ac-rose   { --accent: var(--rose);   --accent-soft: var(--rose-soft);   --accent-grad: linear-gradient(135deg, #f43f5e, #fb923c); --accent-shadow: rgba(244, 63, 94, .5); }
.ac-green  { --accent: var(--green);  --accent-soft: var(--green-soft);  --accent-grad: linear-gradient(135deg, #10b981, #06b6d4); --accent-shadow: rgba(16, 185, 129, .5); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; color: var(--text); }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 750; }
h3 { font-size: 1.18rem; font-weight: 700; }
p { margin: 0 0 1em; }
::selection { background: rgba(99, 102, 241, .25); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .container { padding: 0 16px; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.mono, .cw-body, .sc-codewin pre, code, pre { font-variant-ligatures: none; font-feature-settings: "calt" 0, "liga" 0; }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.center { text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: saturate(170%) blur(14px);
  -webkit-backdrop-filter: saturate(170%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.16rem; letter-spacing: -0.02em; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff;
  font-family: var(--mono); font-size: .78rem; font-weight: 700;
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .8);
}
.brand-name b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { flex: 1; display: flex; align-items: center; justify-content: center; gap: 2px; }
.nav a {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-radius: 10px;
  font-size: .92rem; font-weight: 600; color: var(--text-2); white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav a .i { display: none; width: 20px; height: 20px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.is-active { color: var(--primary); background: var(--primary-soft); }
.header-actions { position: relative; display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 11px;
  border: 1px solid transparent; background: transparent; color: var(--text-2); transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .i { width: 20px; height: 20px; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 9px; }
.icon-btn.sm .i { width: 17px; height: 17px; }
.menu-btn { display: none; }
.xp-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; margin-right: 6px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  font-size: .8rem; font-weight: 650; white-space: nowrap;
}
.xp-lvl { padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-size: .74rem; }
.xp-num { font-family: var(--mono); color: var(--text-2); }
@media (max-width: 1080px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    padding: 10px 16px 18px; background: var(--surface);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .site-header.nav-open .nav { display: flex; }
  .nav a { padding: 12px 14px; font-size: 1rem; }
  .nav a .i { display: block; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 480px) {
  .xp-num { display: none; }
  .xp-chip { padding-right: 4px; margin-right: 0; }
  .brand-name { display: none; }
}

/* Popover (voice settings) */
.popover {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 60;
  width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 16px;
}
.pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.pop-head strong { font-size: 1rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: .88rem; color: var(--text-2); font-weight: 600; }
.pop-note { font-size: .82rem; color: var(--text-2); margin: 12px 0 0; line-height: 1.5; }
.pop-note.warn { padding: 10px 12px; border-radius: 10px; background: var(--orange-soft); color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--primary-strong); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 40px 0 28px; }
.footer-inner p { color: var(--text-2); font-size: .92rem; }
.footer-inner h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; font-family: var(--mono); }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .93rem; color: var(--text-2); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding: 16px 0; font-size: .82rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-credit { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px 0 28px; border-top: 1px solid var(--border); font-size: .95rem; color: var(--text-2); text-align: center; }
.footer-credit b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.credit-mark { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #06b6d4); color: #fff; font-family: var(--mono); font-size: .68rem; font-weight: 700; }
.no-vpn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 650; font-size: .8rem; }
@media (max-width: 800px) { .footer-inner { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- Buttons ---------- */
.btn {
  --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--border-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; border: 1px solid var(--b-bd);
  background: var(--b-bg); color: var(--b-fg);
  font-weight: 650; font-size: .95rem; line-height: 1.2; white-space: nowrap; user-select: none;
  transition: transform .12s ease, box-shadow .15s, background .15s, border-color .15s, filter .15s;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn .i { width: 18px; height: 18px; }
.btn-primary { --b-bg: var(--primary-strong); --b-fg: #fff; --b-bd: transparent; box-shadow: 0 10px 22px -10px rgba(79, 70, 229, .75); }
.btn-primary:hover { filter: brightness(1.1); border-color: transparent; }
.btn-grad { --b-fg: #fff; --b-bd: transparent; background: var(--accent-grad, linear-gradient(135deg, #6366f1, #8b5cf6)); box-shadow: 0 10px 22px -10px var(--accent-shadow, rgba(99, 102, 241, .6)); }
.btn-grad:hover { filter: brightness(1.08); border-color: transparent; }
.btn-soft { --b-bg: var(--accent-soft, var(--primary-soft)); --b-fg: var(--accent, var(--primary)); --b-bd: transparent; }
.btn-soft:hover { border-color: transparent; filter: brightness(.97); }
.btn-ghost { --b-bg: transparent; }
.btn-ok { --b-bg: var(--success-soft); --b-fg: var(--success); --b-bd: transparent; }
.btn-bad { --b-bg: var(--danger-soft); --b-fg: var(--danger); --b-bd: transparent; }
.btn-ok:hover, .btn-bad:hover { border-color: transparent; filter: brightness(.97); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-sm .i { width: 16px; height: 16px; }
.btn-lg { padding: 14px 24px; font-size: 1.04rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }

.say-btn {
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--accent, var(--primary)); transition: .15s;
}
.say-btn:hover { background: var(--accent-soft, var(--primary-soft)); border-color: transparent; }
.say-btn .i { width: 18px; height: 18px; }
.say-btn.sm { width: 30px; height: 30px; }
.say-btn.sm .i { width: 15px; height: 15px; }
.is-speaking { animation: speak-pulse 1.1s ease-in-out infinite; background: var(--accent-soft, var(--primary-soft)) !important; }
@keyframes speak-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, .45); }
  50% { box-shadow: 0 0 0 7px rgba(99, 102, 241, 0); }
}

/* ---------- Form controls ---------- */
.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.5; }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search .input { padding-left: 42px; }

/* ---------- Cards, chips, tabs, bars ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.card-lg { border-radius: var(--radius-lg); padding: 28px; }
@media (max-width: 600px) { .card, .card-lg { padding: 18px; } }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font-size: .86rem; font-weight: 600; transition: .15s; white-space: nowrap;
}
button.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.is-active { background: var(--accent-soft, var(--primary-soft)); color: var(--accent, var(--primary)); border-color: transparent; }
.chip .i { width: 15px; height: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: .74rem; font-weight: 650; font-family: var(--mono); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--accent-soft, var(--primary-soft)); color: var(--accent, var(--primary)); }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge .i { width: 14px; height: 14px; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-2); font-weight: 650; font-size: .93rem; transition: .15s;
}
.tab .i { width: 18px; height: 18px; }
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--accent, var(--primary)); box-shadow: var(--shadow); }
@media (max-width: 600px) { .tabs { display: flex; } .tab { flex: 1 1 auto; justify-content: center; padding: 9px 10px; font-size: .86rem; } }

.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: var(--accent-grad, linear-gradient(90deg, #6366f1, #06b6d4)); transition: width .4s ease; }

.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; font-family: var(--mono); font-size: .78rem; color: var(--text-2); background: var(--surface); }

.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--orange-soft); color: var(--text); font-size: .92rem; margin-bottom: 20px; }
.notice .i { color: var(--orange); margin-top: 2px; }
.notice b { display: block; margin-bottom: 2px; }
.notice.info { background: var(--primary-soft); }
.notice.info .i { color: var(--primary); }

/* ---------- Section / page hero ---------- */
.section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--text-2); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--mono); font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent, var(--primary));
}
.page-hero { position: relative; isolation: isolate; padding: 44px 0 28px; }
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 240px at 12% 20%, var(--accent-soft, var(--primary-soft)), transparent 72%),
    radial-gradient(480px 220px at 88% 0%, var(--hero-glow-2), transparent 70%);
}
.page-hero-inner { display: flex; align-items: center; gap: 20px; }
.page-icon {
  width: 64px; height: 64px; border-radius: 18px; flex: none; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; box-shadow: 0 14px 30px -12px var(--accent-shadow);
}
.page-icon .i { width: 30px; height: 30px; }
.page-hero h1 { margin: 0 0 6px; }
.page-hero .lead { color: var(--text-2); font-size: 1.06rem; max-width: 70ch; margin: 0; }
@media (max-width: 600px) { .page-hero-inner { align-items: flex-start; } .page-icon { width: 52px; height: 52px; border-radius: 15px; } .page-icon .i { width: 24px; height: 24px; } }

/* ---------- Home: hero ---------- */
.hero { position: relative; isolation: isolate; padding: 64px 0 40px; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(700px 420px at 8% 10%, var(--hero-glow-1), transparent 70%),
    radial-gradient(620px 420px at 92% 18%, var(--hero-glow-2), transparent 70%),
    radial-gradient(520px 320px at 60% 105%, var(--hero-glow-3), transparent 70%);
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 40%, #000 30%, transparent 80%);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); line-height: 1.05; letter-spacing: -0.035em; margin-bottom: 20px; }
.grad-text { background: linear-gradient(92deg, #6366f1 0%, #06b6d4 50%, #ec4899 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.14rem; color: var(--text-2); max-width: 54ch; margin-bottom: 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; margin-bottom: 22px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: .85rem; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-sm);
}
.hero-badge b { background: var(--primary-strong); color: #fff; padding: 2px 9px; border-radius: 999px; font-family: var(--mono); font-size: .74rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 30px; color: var(--text-2); font-size: .92rem; }
.hero-facts span { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts b { font-family: var(--font-display); font-size: 1.3rem; color: var(--text); }
.hero-grid > * { min-width: 0; }
.hero-visual { position: relative; padding: 20px 10px; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .hero { padding-top: 40px; }
}

/* Code window */
.code-window { position: relative; background: var(--code-bg); border-radius: 18px; color: var(--code-text); overflow: hidden; box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, .06); }
.cw-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; background: var(--code-bar); border-bottom: 1px solid rgba(255, 255, 255, .06); }
.cw-dot { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.cw-dot:nth-child(2) { background: #febc2e; }
.cw-dot:nth-child(3) { background: #28c840; }
.cw-tabs { display: flex; gap: 4px; margin-left: 10px; font-family: var(--mono); font-size: .76rem; overflow: hidden; }
.cw-tab { padding: 4px 10px; border-radius: 7px; color: var(--code-muted); white-space: nowrap; transition: .2s; }
.cw-tab.is-active { background: rgba(255, 255, 255, .08); color: var(--code-text); }
.cw-body { font-family: var(--mono); font-size: .88rem; line-height: 1.8; padding: 18px 0 22px; min-height: 262px; counter-reset: ln; overflow: hidden; }
.cw-line { display: block; white-space: pre; padding-right: 16px; }
.cw-line::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 44px; padding-right: 16px; text-align: right; color: #3b4266; }
.caret { display: inline-block; width: 8px; height: 1.15em; vertical-align: -3px; background: #a5b4fc; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.tk-tag { color: var(--tk-tag); }
.tk-attr { color: var(--tk-attr); }
.tk-str { color: var(--tk-str); }
.tk-com { color: var(--tk-com); font-style: italic; }
.tk-kw { color: var(--tk-kw); }
.tk-var { color: var(--tk-var); }
.tk-num { color: var(--tk-num); }
.tk-prop { color: var(--tk-prop); }
.float-badge {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px;
  border-radius: 13px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow-lg); font-size: .85rem; font-weight: 650; animation: float 6s ease-in-out infinite;
}
.float-badge .i { width: 18px; height: 18px; }
.float-badge .ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: #fff; }
.fb-1 { top: -4px; right: 0; }
.fb-1 .ico { background: linear-gradient(135deg, #10b981, #06b6d4); }
.fb-2 { bottom: 64px; left: -18px; animation-delay: -2s; }
.fb-2 .ico { background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.fb-3 { bottom: -2px; right: 28px; animation-delay: -4s; }
.fb-3 .ico { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.fb-2 .mono { color: var(--muted); font-weight: 500; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 600px) { .fb-2 { left: 0; } .cw-body { font-size: .78rem; min-height: 230px; } .cw-line::before { width: 34px; padding-right: 12px; } }

/* ---------- Home: progress ---------- */
.progress-panel { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.level-card {
  position: relative; overflow: hidden; padding: 26px; border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(145deg, #4338ca, #7c3aed 55%, #db2777);
  box-shadow: 0 24px 50px -24px rgba(124, 58, 237, .7);
}
.level-card::after { content: "</>"; position: absolute; right: -6px; bottom: -34px; font-family: var(--mono); font-size: 7rem; font-weight: 800; opacity: .12; }
.level-card .lc-label { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; opacity: .8; }
.level-card .lc-name { font-family: var(--font-display); font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 2px; }
.level-card .lc-ru { opacity: .85; font-size: .92rem; margin-bottom: 18px; }
.level-card .bar { background: rgba(255, 255, 255, .22); height: 10px; }
.level-card .bar > span { background: #fff; }
.level-card .lc-next { display: flex; justify-content: space-between; font-size: .84rem; opacity: .9; margin-top: 8px; font-family: var(--mono); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { padding: 18px 18px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.stat-card .sc-top { display: flex; align-items: center; justify-content: space-between; color: var(--accent); }
.stat-card .sc-top .i { width: 20px; height: 20px; }
.stat-card .v { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat-card .v small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat-card .l { color: var(--muted); font-size: .84rem; }
.stat-card .bar { margin-top: 8px; height: 6px; }
@media (max-width: 960px) { .progress-panel { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Home: modules ---------- */
.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(262px, 100%), 1fr)); gap: 16px; }
.module-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 22px;
  border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s, border-color .2s;
}
.module-card::after {
  content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -70px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%); pointer-events: none; transition: transform .3s;
}
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent); }
.module-card:hover::after { transform: scale(1.3); }
.mc-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; box-shadow: 0 10px 22px -10px var(--accent-shadow); }
.mc-icon .i { width: 24px; height: 24px; }
.mc-title { font-size: 1.15rem; font-weight: 750; margin: 6px 0 0; }
.mc-desc { color: var(--text-2); font-size: .93rem; margin: 0; flex: 1; }
.mc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); font-family: var(--mono); padding-top: 6px; }
.mc-arrow { transition: transform .2s, color .2s; }
.module-card:hover .mc-arrow { transform: translateX(4px); color: var(--accent); }
.module-card .bar { height: 5px; }

/* Home: word of the day + path */
.home-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .home-duo { grid-template-columns: 1fr; } }
.wotd { position: relative; overflow: hidden; }
.wotd .w-word { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.wotd .w-ipa { font-family: var(--mono); color: var(--muted); }
.wotd .w-ru { font-size: 1.1rem; font-weight: 650; margin: 10px 0 12px; }
.wotd .w-ex { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: .95rem; margin: 0; }
.wotd .w-ex i { display: block; font-style: normal; color: var(--muted); font-size: .86rem; margin-top: 4px; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: step; }
.path li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 8px; border-radius: 12px; }
.path li::before {
  counter-increment: step; content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: .85rem;
  background: var(--primary-soft); color: var(--primary);
}
.path b { display: block; }
.path span { color: var(--text-2); font-size: .9rem; }
.path a { color: var(--primary); font-weight: 650; }

.map-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.map-table th, .map-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.map-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-family: var(--mono); font-weight: 600; }
.map-table tr:last-child td { border-bottom: 0; }
.map-table td:first-child { font-weight: 650; white-space: nowrap; }
.map-table a { color: var(--primary); font-weight: 650; }
.table-wrap { overflow-x: auto; }
@media (max-width: 600px) {
  .map-table thead { display: none; }
  .map-table, .map-table tbody, .map-table tr, .map-table td { display: block; width: 100%; }
  .map-table tr { padding: 12px 8px; border-bottom: 1px solid var(--border); }
  .map-table tr:last-child { border-bottom: 0; }
  .map-table td { padding: 0; border: 0; }
  .map-table td:first-child { white-space: normal; margin-bottom: 4px; }
  .map-table td:last-child { color: var(--text-2); font-size: .9rem; }
}

.feature-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px; }
.feature { display: flex; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.feature .i { color: var(--success); width: 22px; height: 22px; margin-top: 1px; }
.feature b { display: block; font-size: .95rem; }
.feature span { color: var(--text-2); font-size: .88rem; }

/* ---------- Glossary term + tooltip ---------- */
.term {
  display: inline; padding: 0 1px; margin: 0; border: 0; background: none; font: inherit; color: inherit; cursor: help;
  border-bottom: 2px dotted var(--accent, var(--primary)); border-radius: 2px; text-align: inherit;
  transition: background .15s;
}
.term:hover, .term:focus-visible, .term.is-open { background: var(--accent-soft, var(--primary-soft)); }
.gloss-tip {
  position: fixed; z-index: 90; max-width: 300px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.gloss-tip.is-on { opacity: 1; transform: none; pointer-events: auto; }
.gt-head { display: flex; align-items: center; gap: 8px; }
.gt-head strong { font-size: 1.02rem; }
.gt-ipa { font-family: var(--mono); color: var(--muted); font-size: .82rem; flex: 1; }
.gt-ru { margin-top: 4px; font-weight: 600; color: var(--text-2); font-size: .93rem; }
.gt-def { margin-top: 6px; color: var(--muted); font-size: .84rem; line-height: 1.45; }

/* ---------- Toasts / confetti ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 13px;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem;
  animation: toast-in .25s ease; max-width: min(380px, calc(100vw - 40px));
}
.toast .i { width: 18px; height: 18px; }
.toast-xp .i { color: #fbbf24; }
.toast-ok .i { color: #34d399; }
.toast-level { background: linear-gradient(135deg, #4f46e5, #db2777); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@media (max-width: 600px) { .toasts { right: 12px; left: 12px; bottom: 12px; align-items: stretch; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -20px; left: var(--x); border-radius: 2px; animation: confetti-fall var(--t) cubic-bezier(.2, .6, .4, 1) var(--dl) forwards; }
@keyframes confetti-fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

/* ---------- Quiz (shared) ---------- */
.quiz-q { margin-bottom: 22px; }
.quiz-q:last-child { margin-bottom: 0; }
.quiz-q > p { font-weight: 650; margin-bottom: 10px; }
.quiz-q > p .n { font-family: var(--mono); color: var(--accent, var(--primary)); margin-right: 6px; }
.opts { display: grid; gap: 8px; }
.opts.two { grid-template-columns: 1fr 1fr; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; text-align: left;
  border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-weight: 550; transition: .15s;
}
.opt:hover:not(:disabled) { border-color: var(--accent, var(--primary)); background: var(--accent-soft, var(--primary-soft)); }
.opt .letter { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--text-2); }
.opt:disabled { cursor: default; }
.opt.is-selected { border-color: var(--accent, var(--primary)); background: var(--accent-soft, var(--primary-soft)); }
.opt.is-correct { border-color: var(--success); background: var(--success-soft); }
.opt.is-correct .letter { background: var(--success); color: #fff; }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt.is-wrong .letter { background: var(--danger); color: #fff; }
.opt.is-dim { opacity: .55; }
.explain { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: .9rem; }
.explain.ok { background: var(--success-soft); color: var(--text); }
.explain.bad { background: var(--danger-soft); color: var(--text); }
@media (max-width: 600px) { .opts.two { grid-template-columns: 1fr; } }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.pop { animation: pop .35s ease; }
@keyframes pop { 50% { transform: scale(1.06); } }

/* ---------- Lessons ---------- */
.lesson-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 32px; align-items: start; }
.lesson-nav { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.lesson-nav h4 { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 8px 10px 8px; }
.ln-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; border: 0; background: transparent; text-align: left; width: 100%; transition: background .15s; }
.ln-item:hover { background: var(--surface-2); }
.ln-item.is-active { background: var(--accent-soft); }
.ln-num { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-family: var(--mono); font-size: .82rem; font-weight: 700; color: var(--text-2); }
.ln-item.is-active .ln-num { background: var(--accent-grad); color: #fff; }
.ln-item.is-done .ln-num { background: var(--success); color: #fff; }
.ln-text { display: flex; flex-direction: column; min-width: 0; }
.ln-text b { font-size: .92rem; font-weight: 650; line-height: 1.3; }
.ln-text span { font-size: .8rem; color: var(--muted); }
.lesson-progress { margin: 10px; font-size: .8rem; color: var(--muted); }
.lesson-progress .bar { margin-top: 6px; height: 6px; }
@media (max-width: 960px) {
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-nav { position: static; flex-direction: row; overflow-x: auto; padding: 6px; scrollbar-width: none; }
  .lesson-nav::-webkit-scrollbar { display: none; }
  .lesson-nav h4, .lesson-progress { display: none; }
  .ln-item { flex: none; width: auto; padding: 8px 12px 8px 8px; }
  .ln-text span { display: none; }
  .ln-text b { white-space: nowrap; }
}
.reader { max-width: 800px; }
.reader-head { margin-bottom: 22px; }
.reader-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin-bottom: 4px; }
.reader-head .ru-title { color: var(--text-2); font-size: 1.08rem; margin: 0 0 14px; }
.reader-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.para { position: relative; padding: 14px 16px; margin: 0 -16px 6px; border-radius: 14px; transition: background .2s; }
.para.is-reading { background: var(--accent-soft); }
.para-en { font-size: 1.08rem; line-height: 1.8; margin: 0; }
.para-en .lead-word { font-weight: 750; }
.para-ru { margin: 10px 0 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; color: var(--text-2); font-size: .97rem; line-height: 1.65; }
.para-tools { display: flex; gap: 6px; margin-top: 8px; opacity: .75; transition: opacity .15s; }
.para:hover .para-tools, .para:focus-within .para-tools { opacity: 1; }
.mini-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: .8rem; font-weight: 600; transition: .15s; }
.mini-btn:hover { color: var(--accent); border-color: var(--accent); }
.mini-btn .i { width: 14px; height: 14px; }
.mini-btn.is-active { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--cyan-soft); margin: 22px 0; }
.callout .i { color: var(--cyan); width: 22px; height: 22px; margin-top: 2px; }
.callout b { display: block; margin-bottom: 4px; }
.callout p { margin: 0; color: var(--text-2); font-size: .95rem; }
.block-title { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; margin: 34px 0 14px; }
.block-title .i { color: var(--accent); }
.term-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.term-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .9rem; }
.term-chip b { font-weight: 700; }
.term-chip span { color: var(--muted); }
.qa { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.qa summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 650; display: flex; gap: 12px; align-items: center; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary .i { transition: transform .2s; color: var(--muted); margin-left: auto; }
.qa[open] summary .i { transform: rotate(180deg); }
.qa .qa-body { padding: 0 16px 16px; color: var(--text-2); }
.qa .qa-body p { margin: 0; }
.qa .qa-hint { display: inline-block; font-size: .78rem; font-family: var(--mono); color: var(--accent); margin-bottom: 6px; }
.lesson-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- Vocabulary ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .search { flex: 1 1 260px; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.word-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color .2s, box-shadow .2s; }
.word-card:hover { box-shadow: var(--shadow); }
.word-card.is-known { border-color: var(--success); }
.wc-head { display: flex; align-items: center; gap: 10px; }
.wc-head h3 { margin: 0; font-size: 1.2rem; }
.wc-ipa { font-family: var(--mono); font-size: .84rem; color: var(--muted); }
.wc-ru { font-weight: 650; color: var(--text); }
.wc-def { font-size: .88rem; color: var(--text-2); margin: 0; }
.wc-ex { font-size: .9rem; color: var(--text-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); margin: 0; }
.wc-ex i { display: block; font-style: normal; color: var(--muted); font-size: .84rem; margin-top: 3px; }
.wc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.known-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-2); background: transparent; font-size: .82rem; font-weight: 650; color: var(--text-2); transition: .15s; }
.known-btn .i { width: 15px; height: 15px; }
.known-btn:hover { border-color: var(--success); color: var(--success); }
.known-btn.is-on { background: var(--success); border-color: var(--success); color: #fff; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.flash-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.flash-opts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.flash-count { font-family: var(--mono); color: var(--muted); font-size: .9rem; }
.flashcard { width: min(600px, 100%); height: 340px; perspective: 1400px; cursor: pointer; border: 0; padding: 0; background: none; }
.flash-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.3, .7, .3, 1); }
.flashcard.is-flipped .flash-inner { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 28px; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
.flash-face.front { background: linear-gradient(160deg, var(--surface), var(--surface-2)); }
.flash-face.back { transform: rotateY(180deg); background: linear-gradient(160deg, #0891b2, #4f46e5); color: #fff; border: 0; }
.flash-face .ff-word { font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.flash-face .ff-ipa { font-family: var(--mono); color: var(--muted); }
.flash-face .ff-hint { position: absolute; bottom: 16px; font-size: .8rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.flash-face.back .ff-word { font-size: clamp(1.4rem, 4vw, 2rem); }
.flash-face.back .ff-ex { font-size: .95rem; opacity: .9; max-width: 44ch; }
.flash-face.back .ff-ex i { display: block; font-style: normal; opacity: .75; font-size: .86rem; margin-top: 4px; }
.flash-face .ff-cat { position: absolute; top: 16px; left: 18px; }
.flash-face.back .ff-cat .tag-pill { background: rgba(255, 255, 255, .18); color: #fff; }
.flash-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.flash-done { text-align: center; padding: 30px; }
.abbr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.abbr-card { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.abbr-card .ab { display: flex; align-items: center; justify-content: space-between; }
.abbr-card .ab b { font-family: var(--mono); font-size: 1.5rem; font-weight: 800; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.abbr-card .full { font-weight: 650; }
.abbr-card .full u { text-decoration: none; color: var(--accent); font-weight: 800; }
.abbr-card .ru { color: var(--text-2); font-size: .9rem; }

/* ---------- Games ---------- */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.game-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gc-art { position: relative; height: 150px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; overflow: hidden; }
.gc-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .25) 1px, transparent 1px); background-size: 16px 16px; opacity: .6; }
.gc-art .i { width: 64px; height: 64px; stroke-width: 1.6; position: relative; filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .25)); transition: transform .3s; }
.game-card:hover .gc-art .i { transform: scale(1.1) rotate(-6deg); }
.gc-art .gc-tag { position: absolute; top: 12px; left: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .22); font-size: .74rem; font-family: var(--mono); font-weight: 600; }
.gc-art .gc-deco { position: absolute; right: 14px; bottom: 10px; font-family: var(--mono); font-size: .8rem; opacity: .7; }
.gc-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.gc-body h3 { margin: 0; }
.gc-body p { margin: 0; color: var(--text-2); font-size: .93rem; flex: 1; }
.gc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.gc-best { font-size: .82rem; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-family: var(--mono); }
.gc-best .i { width: 16px; height: 16px; color: #f59e0b; }

.game-shell { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.gs-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.gs-head h2 { font-size: 1.15rem; margin: 0; }
.gs-stats { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.gs-stat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); font-family: var(--mono); font-size: .85rem; font-weight: 650; }
.gs-stat .i { width: 16px; height: 16px; color: var(--accent); }
.gs-body { padding: 28px; min-height: 420px; }
@media (max-width: 600px) { .gs-body { padding: 18px 14px; } }
.game-center { max-width: 640px; margin: 0 auto; text-align: center; }
.big-prompt { font-family: var(--font-display); font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 10px 0; }
.prompt-sub { color: var(--muted); margin-bottom: 20px; }
.timer-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin: 0 0 22px; }
.timer-bar > span { display: block; height: 100%; width: 100%; background: var(--accent-grad); transform-origin: left; }
.result { text-align: center; max-width: 520px; margin: 0 auto; padding: 10px 0; }
.result-trophy { width: 88px; height: 88px; border-radius: 26px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--accent-grad); color: #fff; box-shadow: 0 18px 40px -16px var(--accent-shadow); }
.result-trophy .i { width: 44px; height: 44px; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0 10px; }
.stars .i { width: 34px; height: 34px; color: var(--border-2); fill: currentColor; stroke: none; }
.stars .i.on { color: #f59e0b; animation: pop .4s ease backwards; }
.stars .i.on:nth-child(2) { animation-delay: .12s; }
.stars .i.on:nth-child(3) { animation-delay: .24s; }
.result-score { font-family: var(--font-display); font-size: 3rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.result-meta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 22px; }
.result-list { text-align: left; margin: 0 auto 22px; display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.result-list div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.result-list b { color: var(--danger); }

/* memory */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 720px; margin: 0 auto; }
.mem-card { aspect-ratio: 4 / 3; perspective: 900px; border: 0; padding: 0; background: none; }
.mem-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, .7, .3, 1); }
.mem-card.is-open .mem-inner, .mem-card.is-matched .mem-inner { transform: rotateY(180deg); }
.mem-face { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; padding: 8px; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-weight: 700; font-size: .95rem; line-height: 1.2; text-align: center; word-break: break-word; }
.mem-front { background: var(--accent-grad); color: rgba(255, 255, 255, .9); box-shadow: var(--shadow); }
.mem-front .i { width: 30px; height: 30px; opacity: .8; }
.mem-back { transform: rotateY(180deg); background: var(--surface); border: 2px solid var(--border-2); }
.mem-back.en { font-family: var(--mono); color: var(--accent); }
.mem-card.is-matched .mem-back { border-color: var(--success); background: var(--success-soft); color: var(--success); }
.mem-card.is-miss .mem-back { border-color: var(--danger); background: var(--danger-soft); }
@media (max-width: 600px) { .mem-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } .mem-face { font-size: .78rem; border-radius: 11px; } .mem-card { aspect-ratio: 1; } }

/* speed */
.speed-input { max-width: 420px; margin: 0 auto; }
.speed-input .input { text-align: center; font-size: 1.3rem; font-family: var(--mono); padding: 14px; }
.speed-input.ok .input { border-color: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.speed-input.bad .input { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.hint-mask { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .3em; color: var(--muted); margin: 8px 0 18px; }
.speed-feedback { min-height: 28px; margin-top: 12px; font-weight: 650; }
.speed-feedback.ok { color: var(--success); }
.speed-feedback.bad { color: var(--danger); }
.combo { display: inline-flex; align-items: center; gap: 6px; color: #f59e0b; font-weight: 800; font-family: var(--mono); }

/* bug hunt */
.bh-def { font-size: 1.12rem; font-weight: 600; max-width: 560px; margin: 0 auto 6px; line-height: 1.5; }
.bh-ru { color: var(--muted); font-size: .92rem; min-height: 1.4em; }
.slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 22px 0; }
.slot { width: 38px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-family: var(--mono); font-size: 1.35rem; font-weight: 800; text-transform: uppercase; background: var(--surface-2); border-bottom: 3px solid var(--border-2); }
.slot.gap { width: 16px; background: none; border: 0; }
.slot.fixed { background: none; border: 0; color: var(--muted); width: 16px; }
.slot.is-shown { border-bottom-color: var(--accent); animation: pop .3s; }
.slot.is-missed { color: var(--danger); border-bottom-color: var(--danger); }
.keyboard { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-top: 10px; }
.kb-row { display: flex; gap: 6px; }
.key { width: 40px; height: 46px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface); font-family: var(--mono); font-weight: 700; font-size: 1rem; text-transform: uppercase; transition: .12s; }
.key:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.key.hit { background: var(--success); color: #fff; border-color: var(--success); }
.key.miss { background: var(--surface-3); color: var(--muted); border-color: transparent; text-decoration: line-through; }
@media (max-width: 600px) {
  .keyboard { width: 100%; }
  .kb-row { gap: 4px; width: 100%; justify-content: center; }
  .key { flex: 1 1 0; min-width: 0; max-width: 36px; width: auto; height: 42px; font-size: .85rem; border-radius: 8px; padding: 0; }
  .slot { width: 26px; height: 40px; font-size: 1.05rem; }
  .slots { gap: 4px; }
  .server { flex-wrap: wrap; justify-content: center; max-width: 100%; }
  .server-bugs .i { width: 18px; height: 18px; }
}
.server { display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 16px; }
.server-bugs { display: flex; gap: 4px; }
.server-bugs .i { width: 22px; height: 22px; color: var(--border-2); transition: .2s; }
.server-bugs .i.on { color: var(--danger); animation: shake .4s; }
.server-status { font-family: var(--mono); font-size: .85rem; font-weight: 700; }
.server-status.s0 { color: var(--success); }
.server-status.s1 { color: var(--orange); }
.server-status.s2 { color: var(--danger); }

/* sort */
.sort-arena { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 16px; align-items: stretch; }
.bucket { border-radius: 18px; border: 2px dashed var(--border-2); padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 280px; transition: .2s; background: var(--surface); }
.bucket h3 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.bucket h3 .i { color: var(--accent); }
.bucket p { margin: 0 0 6px; font-size: .82rem; color: var(--muted); }
.bucket.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.bucket .b-item { padding: 6px 10px; border-radius: 9px; background: var(--success-soft); color: var(--text); font-size: .85rem; font-weight: 600; animation: pop .3s; }
.sort-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.sort-card { width: 100%; padding: 26px 20px; border-radius: 18px; background: var(--accent-grad); color: #fff; font-family: var(--font-display); font-size: 1.35rem; font-weight: 750; box-shadow: 0 18px 40px -18px var(--accent-shadow); cursor: grab; user-select: none; }
.sort-card:active { cursor: grabbing; }
.sort-btns { display: flex; gap: 10px; width: 100%; }
.sort-btns .btn { flex: 1; min-width: 0; white-space: normal; }
@media (max-width: 400px) { .sort-btns .btn { padding: 10px 8px; font-size: .85rem; gap: 4px; } }
@media (max-width: 600px) { .para { margin: 0 -8px 6px; padding: 12px 8px; } }
@media (max-width: 760px) {
  .sort-arena { grid-template-columns: 1fr 1fr; }
  .sort-center { grid-column: 1 / -1; order: -1; }
  .bucket { min-height: 160px; }
}

/* synonym */
.syn-sentence { font-size: clamp(1.15rem, 2.6vw, 1.45rem); line-height: 1.6; font-weight: 600; margin: 10px 0 24px; }
.syn-target { padding: 1px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.syn-target.done { background: var(--success-soft); color: var(--success); text-decoration: none; }
.syn-ru { margin-top: 16px; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: .95rem; text-align: left; }
.syn-ru b { display: block; font-size: .78rem; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* abbr */
.abbr-big { font-family: var(--mono); font-size: clamp(3rem, 10vw, 5rem); font-weight: 800; letter-spacing: .02em; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; margin: 4px 0 18px; }

/* ---------- Listening ---------- */
.panel { max-width: 860px; margin: 0 auto; }
.listen-hero { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.play-big {
  width: 76px; height: 76px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none;
  background: var(--accent-grad); color: #fff; box-shadow: 0 16px 34px -14px var(--accent-shadow); transition: transform .15s;
}
.play-big:hover { transform: scale(1.05); }
.play-big .i { width: 30px; height: 30px; }
.play-big.sm { width: 56px; height: 56px; }
.play-big.sm .i { width: 22px; height: 22px; }
.counter { font-family: var(--mono); color: var(--muted); font-size: .88rem; }
.diff { font-size: 1.08rem; line-height: 1.9; }
.diff .w-ok { color: var(--success); font-weight: 650; }
.diff .w-miss { color: var(--danger); background: var(--danger-soft); border-radius: 5px; padding: 0 4px; font-weight: 650; }
.diff .w-extra { color: var(--muted); text-decoration: line-through; }
.diff-row { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); margin-bottom: 8px; }
.diff-row small { display: block; font-family: var(--mono); font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.score-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 750; font-family: var(--mono); }
.score-pill.good { background: var(--success-soft); color: var(--success); }
.score-pill.mid { background: var(--orange-soft); color: var(--orange); }
.score-pill.low { background: var(--danger-soft); color: var(--danger); }
.text-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.text-pick { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); transition: .15s; display: flex; flex-direction: column; gap: 4px; }
.text-pick:hover { border-color: var(--accent); }
.text-pick.is-active { border-color: var(--accent); background: var(--accent-soft); }
.text-pick b { font-size: 1rem; }
.text-pick span { font-size: .84rem; color: var(--muted); }
.transcript { font-size: 1.04rem; line-height: 1.85; }
.transcript .s { border-radius: 5px; transition: background .2s; padding: 1px 0; }
.transcript .s.is-now { background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.tf-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tf-row:last-child { border-bottom: 0; }
.tf-row p { flex: 1 1 280px; margin: 0; font-weight: 550; }
.tf-btns { display: flex; gap: 6px; }
.tf-btns .opt { width: auto; padding: 8px 14px; }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.prompt-list { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); }
.prompt-list li { margin-bottom: 6px; }
.phrase-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.phrase { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .9rem; transition: .15s; text-align: left; }
.phrase:hover { border-color: var(--accent); }
.phrase .i { width: 14px; height: 14px; color: var(--accent); }
.rec-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px; border-radius: 16px; background: var(--surface-2); margin-top: 18px; }
.rec-time { font-family: var(--mono); font-size: 1.8rem; font-weight: 800; min-width: 90px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s steps(1) infinite; }
.rec-box audio { flex: 1 1 240px; min-width: 0; }

/* ---------- Podcasts ---------- */
.pod-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .pod-layout { grid-template-columns: 1fr; } }
.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep-item { display: flex; gap: 14px; align-items: center; padding: 10px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: .15s; width: 100%; }
.ep-item:hover { border-color: var(--accent); }
.ep-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.ep-cover { position: relative; flex: none; width: 64px; height: 64px; border-radius: 13px; display: grid; place-items: center; color: #fff; overflow: hidden; background: var(--cover, linear-gradient(135deg, #8b5cf6, #d946ef)); }
.ep-cover .i { width: 26px; height: 26px; position: relative; }
.ep-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .35), transparent 60%); }
.ep-meta { min-width: 0; flex: 1; }
.ep-meta small { font-family: var(--mono); font-size: .74rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.ep-meta b { display: block; font-size: .95rem; line-height: 1.3; margin: 2px 0; }
.ep-meta span { font-size: .8rem; color: var(--muted); }
.ep-done { color: var(--success); }
.ep-done .i { width: 14px; height: 14px; }
.player-card { border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.player-top { display: flex; gap: 22px; padding: 24px; align-items: center; background: linear-gradient(180deg, var(--accent-soft), transparent); flex-wrap: wrap; }
.player-cover { position: relative; width: 150px; height: 150px; border-radius: 22px; flex: none; display: flex; flex-direction: column; justify-content: space-between; padding: 14px; color: #fff; overflow: hidden; background: var(--cover); box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .5); }
.player-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 25% 15%, rgba(255, 255, 255, .35), transparent 55%); }
.player-cover .pc-ep { font-family: var(--mono); font-size: .78rem; font-weight: 700; opacity: .9; position: relative; }
.player-cover .pc-num { font-family: var(--font-display); font-size: 3.4rem; font-weight: 800; line-height: .9; position: relative; }
.player-cover .pc-brand { font-family: var(--mono); font-size: .7rem; opacity: .8; position: relative; }
.player-cover.is-playing .eq { opacity: 1; }
.eq { position: absolute; right: 12px; top: 12px; display: flex; gap: 3px; align-items: flex-end; height: 18px; opacity: 0; transition: opacity .3s; z-index: 1; }
.eq i { width: 4px; background: #fff; border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; }
.eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.player-info { flex: 1 1 260px; min-width: 0; }
.player-info h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin-bottom: 6px; }
.player-info p { color: var(--text-2); margin: 0 0 10px; font-size: .95rem; }
.speakers { display: flex; gap: 8px; flex-wrap: wrap; }
.speaker { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .84rem; font-weight: 600; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: .78rem; flex: none; }
.avatar.a { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.avatar.b { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.player-controls { display: flex; align-items: center; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.player-progress { flex: 1 1 200px; display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.player-progress .bar { height: 6px; cursor: pointer; }
.player-progress small { font-family: var(--mono); font-size: .78rem; color: var(--muted); display: flex; justify-content: space-between; }
.speed-group { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.speed-group button { border: 0; background: transparent; padding: 5px 9px; border-radius: 8px; font-family: var(--mono); font-size: .8rem; font-weight: 700; color: var(--muted); }
.speed-group button.is-active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.lines { max-height: 520px; overflow-y: auto; padding: 12px 16px 16px; scroll-behavior: smooth; }
.line { display: flex; gap: 12px; padding: 12px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.line:hover { background: var(--surface-2); }
.line.is-now { background: var(--accent-soft); }
.line.is-past .line-en { color: var(--text-2); }
.line .avatar { width: 34px; height: 34px; font-size: .88rem; margin-top: 2px; }
.line-body { min-width: 0; flex: 1; }
.line-name { font-size: .78rem; font-weight: 700; color: var(--muted); font-family: var(--mono); }
.line-en { font-size: 1.02rem; line-height: 1.6; }
.line-ru { font-size: .9rem; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.pod-below { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 760px) { .pod-below { grid-template-columns: 1fr; } .player-top { padding: 18px; } .player-cover { width: 110px; height: 110px; } .player-cover .pc-num { font-size: 2.6rem; } .player-controls { padding: 14px 16px; } }

/* ---------- Video player ---------- */
.vid-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .vid-layout { grid-template-columns: 1fr; } }
.vp { border-radius: 20px; overflow: hidden; background: #070914; box-shadow: var(--shadow-lg); color: #eef0ff; }
.vp:fullscreen { display: flex; flex-direction: column; justify-content: center; border-radius: 0; background: #000; }
.vp:fullscreen .vp-stage, .vp:fullscreen .vp-subs, .vp:fullscreen .vp-controls { width: min(100vw, calc((100vh - 170px) * 16 / 9)); margin: 0 auto; }
.vp-stage {
  --u: 1cqw; /* scene scale unit: 1% of the stage width */
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; container-type: inline-size;
  background:
    radial-gradient(60% 70% at 15% 10%, rgba(99, 102, 241, .35), transparent 70%),
    radial-gradient(50% 60% at 90% 90%, rgba(6, 182, 212, .25), transparent 70%),
    #0b0e22;
}
.vp-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: calc(var(--u) * 4) calc(var(--u) * 4); }
.vp-scene { position: absolute; inset: 0; padding: calc(var(--u) * 5) calc(var(--u) * 7); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; animation: scene-in .5s ease; }
@keyframes scene-in { from { opacity: 0; transform: scale(.98); } }
.vp-scene [data-at] { opacity: 0; transform: translateY(calc(var(--u) * 1.2)); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i, 0) * 90ms); }
.vp-scene [data-at].on { opacity: 1; transform: none; }
.vp-subs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 86px; padding: 12px 20px; text-align: center; background: #0b0e22; border-top: 1px solid rgba(255, 255, 255, .06); }
.vp-subs span { font-size: clamp(14px, 1.5vw, 18px); line-height: 1.45; color: #fff; max-width: 70ch; }
.vp-subs .ru { color: #fde68a; font-size: clamp(13px, 1.3vw, 16px); }
.vp-subs:empty { min-height: 0; padding: 0; border: 0; }
@media (max-width: 600px) { .vp-subs { min-height: 110px; padding: 10px 14px; } }
.vp-overlay { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--u) * 2); background: rgba(5, 7, 18, .55); backdrop-filter: blur(3px); text-align: center; padding: calc(var(--u) * 4); }
.vp-overlay h3 { color: #fff; font-size: max(18px, calc(var(--u) * 3.4)); margin: 0; }
.vp-overlay p { color: rgba(255, 255, 255, .8); margin: 0; font-size: max(13px, calc(var(--u) * 1.7)); }
.vp-bigplay { width: max(64px, calc(var(--u) * 10)); height: max(64px, calc(var(--u) * 10)); border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #f43f5e, #fb923c); box-shadow: 0 calc(var(--u) * 1.5) calc(var(--u) * 4) calc(var(--u) * -1) rgba(244, 63, 94, .7); transition: transform .15s; }
.vp-bigplay:hover { transform: scale(1.06); }
.vp-bigplay .i { width: 42%; height: 42%; margin-left: 6%; }
.vp-overlay .row { justify-content: center; }
.vp-controls { display: flex; align-items: center; gap: 6px; padding: 10px 12px; background: #0d1024; border-top: 1px solid rgba(255, 255, 255, .06); flex-wrap: wrap; }
.vp-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: #dfe3ff; display: inline-grid; place-items: center; transition: .15s; flex: none; }
.vp-btn:hover { background: rgba(255, 255, 255, .08); }
.vp-btn .i { width: 20px; height: 20px; }
.vp-btn.txt { width: auto; padding: 0 10px; font-family: var(--mono); font-size: .8rem; font-weight: 700; }
.vp-btn.is-on { color: #fda4af; }
.vp-track { flex: 1 1 200px; display: flex; gap: 3px; height: 26px; align-items: center; min-width: 120px; }
.vp-seg { position: relative; flex: var(--w, 1); height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); cursor: pointer; overflow: hidden; transition: height .15s; border: 0; padding: 0; }
.vp-track:hover .vp-seg { height: 9px; }
.vp-seg > span { position: absolute; inset: 0; width: var(--p, 0%); background: linear-gradient(90deg, #f43f5e, #fb923c); transition: width .35s ease; }
.vp-time { font-family: var(--mono); font-size: .78rem; color: rgba(255, 255, 255, .6); padding: 0 6px; white-space: nowrap; }
@media (max-width: 600px) { .vp-controls { gap: 2px; padding: 8px; } .vp-btn { width: 34px; height: 34px; } .vp-track { order: -1; flex-basis: 100%; } .vp-time { margin-right: auto; } }

.vid-list { display: flex; flex-direction: column; gap: 10px; }
.vid-item { display: flex; gap: 12px; padding: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: .15s; width: 100%; }
.vid-item:hover { border-color: var(--accent); }
.vid-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.vid-thumb { position: relative; flex: none; width: 116px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; display: grid; place-items: center; color: #fff; background: var(--thumb); }
.vid-thumb .i { width: 26px; height: 26px; position: relative; }
.vid-thumb::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .3), transparent 60%); }
.vid-thumb .dur { position: absolute; right: 5px; bottom: 4px; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, .55); font-family: var(--mono); font-size: .66rem; z-index: 1; }
.vid-meta { min-width: 0; }
.vid-meta small { font-family: var(--mono); font-size: .72rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.vid-meta b { display: block; font-size: .92rem; line-height: 1.3; margin-top: 2px; }
.vid-info { margin-top: 20px; }
.vid-info h2 { margin-bottom: 6px; }
.chapters { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chapter { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: .84rem; font-weight: 600; color: var(--text-2); }
.chapter:hover { border-color: var(--accent); color: var(--accent); }
.chapter.is-now { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chapter .n { font-family: var(--mono); font-size: .74rem; opacity: .7; }

/* Scene visuals (inside .vp-stage — sizes use container units) */
.sc-kicker { display: inline-block; padding: calc(var(--u) * .5) calc(var(--u) * 1.4); border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15); font-family: var(--mono); font-size: calc(var(--u) * 1.35); letter-spacing: .12em; text-transform: uppercase; color: #c7d2fe; margin-bottom: calc(var(--u) * 1.6); }
.sc-h { font-size: calc(var(--u) * 5.4); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; margin: 0 0 calc(var(--u) * 1.2); color: #fff; background: linear-gradient(92deg, #fff 20%, #a5b4fc 60%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sc-sub { font-size: calc(var(--u) * 2.1); color: rgba(238, 240, 255, .75); margin: 0; }
.sc-h2 { font-size: calc(var(--u) * 3.2); font-weight: 800; color: #fff; margin: 0 0 calc(var(--u) * 2.4); letter-spacing: -0.02em; }
.sc-orb { position: absolute; border-radius: 50%; filter: blur(2px); opacity: .5; }
.sc-orb.o1 { width: calc(var(--u) * 22); height: calc(var(--u) * 22); left: calc(var(--u) * -6); top: calc(var(--u) * -6); background: radial-gradient(circle, rgba(99, 102, 241, .6), transparent 70%); animation: float 7s ease-in-out infinite; }
.sc-orb.o2 { width: calc(var(--u) * 18); height: calc(var(--u) * 18); right: calc(var(--u) * -4); bottom: calc(var(--u) * 6); background: radial-gradient(circle, rgba(236, 72, 153, .5), transparent 70%); animation: float 8s ease-in-out infinite reverse; }
.sc-bigicon { width: calc(var(--u) * 9); height: calc(var(--u) * 9); border-radius: calc(var(--u) * 2.4); display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #06b6d4); margin-bottom: calc(var(--u) * 2); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * -2) rgba(99, 102, 241, .8); }
.sc-bigicon .i { width: 55%; height: 55%; color: #fff; }

.flow { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: calc(var(--u) * 2); align-items: center; width: 100%; }
.flow-node { padding: calc(var(--u) * 2); border-radius: calc(var(--u) * 2); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * .8); min-height: calc(var(--u) * 18); justify-content: center; }
.flow-node .fn-icon { width: calc(var(--u) * 6); height: calc(var(--u) * 6); border-radius: calc(var(--u) * 1.6); display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #8b5cf6); }
.flow-node.server .fn-icon { background: linear-gradient(135deg, #06b6d4, #3b82f6); }
.flow-node .fn-icon .i { width: 60%; height: 60%; color: #fff; }
.flow-node b { font-size: calc(var(--u) * 1.9); color: #fff; }
.fn-url { font-family: var(--mono); font-size: calc(var(--u) * 1.25); padding: calc(var(--u) * .3) calc(var(--u) * 1); border-radius: calc(var(--u) * .6); background: rgba(0, 0, 0, .35); color: #a5b4fc; }
.fn-items { display: flex; flex-wrap: wrap; gap: calc(var(--u) * .6); justify-content: center; }
.fn-item { display: inline-flex; align-items: center; gap: calc(var(--u) * .5); padding: calc(var(--u) * .4) calc(var(--u) * 1); border-radius: calc(var(--u) * .7); background: rgba(0, 0, 0, .35); font-family: var(--mono); font-size: calc(var(--u) * 1.3); color: #e0e7ff; }
.fn-item .i { width: calc(var(--u) * 1.6); height: calc(var(--u) * 1.6); color: #67e8f9; }
.flow-lanes { display: flex; flex-direction: column; gap: calc(var(--u) * 3); }
.lane { position: relative; height: calc(var(--u) * 3.2); }
.lane::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: calc(var(--u) * .25) dashed rgba(255, 255, 255, .25); }
.lane-label { position: absolute; left: 50%; top: calc(var(--u) * -1.2); transform: translateX(-50%); font-family: var(--mono); font-size: calc(var(--u) * 1.25); color: #c7d2fe; background: #0b0e22; padding: 0 calc(var(--u) * .8); border-radius: calc(var(--u) * .4); white-space: nowrap; }
.lane .packet { position: absolute; top: 50%; width: calc(var(--u) * 2.2); height: calc(var(--u) * 2.2); margin-top: calc(var(--u) * -1.1); border-radius: calc(var(--u) * .6); background: #a5b4fc; box-shadow: 0 0 calc(var(--u) * 2) rgba(165, 180, 252, .9); }
.lane.res .packet { background: #86efac; box-shadow: 0 0 calc(var(--u) * 2) rgba(134, 239, 172, .9); }
.lane.on .packet { animation: pkt-right 1.8s ease-in-out infinite; }
.lane.res.on .packet { animation-name: pkt-left; }
@keyframes pkt-right { 0% { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: calc(100% - calc(var(--u) * 2.2)); opacity: 0; } }
@keyframes pkt-left { 0% { left: calc(100% - calc(var(--u) * 2.2)); opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { left: 0; opacity: 0; } }
.sc-note { margin: calc(var(--u) * 2.6) 0 0; padding: calc(var(--u) * 1) calc(var(--u) * 2); border-radius: calc(var(--u) * 1.2); background: rgba(250, 204, 21, .12); border: 1px solid rgba(250, 204, 21, .3); color: #fde68a; font-size: calc(var(--u) * 1.8); font-weight: 600; }

.cmp { display: grid; grid-template-columns: 1fr auto 1fr; gap: calc(var(--u) * 2); width: 100%; align-items: stretch; }
.cmp-col { text-align: left; padding: calc(var(--u) * 2.2); border-radius: calc(var(--u) * 2); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.cmp-col h4 { display: flex; align-items: center; gap: calc(var(--u) * 1); font-size: calc(var(--u) * 2.3); margin: 0 0 calc(var(--u) * 1.4); color: #fff; }
.cmp-col h4 .i { width: calc(var(--u) * 2.6); height: calc(var(--u) * 2.6); }
.cmp-col.c1 h4 { color: #a5b4fc; }
.cmp-col.c2 h4 { color: #67e8f9; }
.cmp-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(var(--u) * 1); }
.cmp-col li { display: flex; gap: calc(var(--u) * 1); align-items: flex-start; font-size: calc(var(--u) * 1.75); color: #e5e7ff; line-height: 1.35; }
.cmp-col li::before { content: ""; flex: none; width: calc(var(--u) * 1); height: calc(var(--u) * 1); margin-top: calc(var(--u) * .55); border-radius: calc(var(--u) * .3); background: currentColor; opacity: .6; }
.cmp-col.c1 li::before { background: #818cf8; opacity: 1; }
.cmp-col.c2 li::before { background: #22d3ee; opacity: 1; }
.cmp-vs { align-self: center; width: calc(var(--u) * 6); height: calc(var(--u) * 6); border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: calc(var(--u) * 1.8); background: linear-gradient(135deg, #f43f5e, #fb923c); color: #fff; }

.blist { list-style: none; margin: 0; padding: 0; display: grid; gap: calc(var(--u) * 1.4); width: min(100%, calc(var(--u) * 70)); text-align: left; }
.blist li { display: flex; align-items: center; gap: calc(var(--u) * 1.8); padding: calc(var(--u) * 1.4) calc(var(--u) * 2); border-radius: calc(var(--u) * 1.6); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: calc(var(--u) * 2.05); color: #f1f2ff; font-weight: 600; }
.blist .bn { flex: none; width: calc(var(--u) * 3.8); height: calc(var(--u) * 3.8); border-radius: calc(var(--u) * 1); display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #06b6d4); font-family: var(--mono); font-size: calc(var(--u) * 1.7); font-weight: 800; }
.blist .bn .i { width: 55%; height: 55%; }
.blist li.on { border-color: rgba(165, 180, 252, .5); }

.sc-codewin { width: min(100%, calc(var(--u) * 72)); text-align: left; border-radius: calc(var(--u) * 1.6); overflow: hidden; background: #070914; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 calc(var(--u) * 3) calc(var(--u) * 6) calc(var(--u) * -3) rgba(0, 0, 0, .8); }
.sc-codewin .cw-bar { padding: calc(var(--u) * 1) calc(var(--u) * 1.4); gap: calc(var(--u) * .6); }
.sc-codewin .cw-dot { width: calc(var(--u) * 1); height: calc(var(--u) * 1); }
.sc-codewin .cw-file { margin-left: calc(var(--u) * 1); font-family: var(--mono); font-size: calc(var(--u) * 1.2); color: var(--code-muted); }
.sc-codewin pre { margin: 0; padding: calc(var(--u) * 1.8) calc(var(--u) * 2.2); font-family: var(--mono); font-size: calc(var(--u) * 1.75); line-height: 1.65; white-space: pre; overflow: hidden; }
.sc-codewin .cl { display: block; min-height: 1.65em; }
.sc-codewin .cl.hl { background: rgba(250, 204, 21, .1); box-shadow: calc(var(--u) * -2.2) 0 0 rgba(250, 204, 21, .1), calc(var(--u) * 2.2) 0 0 rgba(250, 204, 21, .1); }
.sc-caption { margin: calc(var(--u) * 2) 0 0; font-size: calc(var(--u) * 1.8); color: rgba(238, 240, 255, .8); }

.term-big { padding: calc(var(--u) * 3) calc(var(--u) * 5); border-radius: calc(var(--u) * 2.6); background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(6, 182, 212, .25)); border: 1px solid rgba(255, 255, 255, .15); }
.term-big h2 { font-size: calc(var(--u) * 6); color: #fff; margin: 0; letter-spacing: -0.03em; }
.term-big .ipa { font-family: var(--mono); font-size: calc(var(--u) * 2); color: #a5b4fc; }
.term-big .ru { font-size: calc(var(--u) * 2.4); color: #fde68a; margin: calc(var(--u) * 1) 0 0; font-weight: 700; }
.term-ex { margin: calc(var(--u) * 2.4) 0 0; font-size: calc(var(--u) * 2); color: rgba(238, 240, 255, .85); max-width: calc(var(--u) * 60); font-style: italic; }

.steps { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); gap: calc(var(--u) * 2); width: 100%; position: relative; }
.steps::before { content: ""; position: absolute; left: 12%; right: 12%; top: calc(var(--u) * 4); border-top: calc(var(--u) * .3) dashed rgba(255, 255, 255, .2); }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: calc(var(--u) * 1); }
.step-dot { width: calc(var(--u) * 8); height: calc(var(--u) * 8); border-radius: calc(var(--u) * 2.2); display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #06b6d4); box-shadow: 0 calc(var(--u) * 1.5) calc(var(--u) * 4) calc(var(--u) * -1.5) rgba(99, 102, 241, .9); }
.step:nth-child(2) .step-dot { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.step:nth-child(3) .step-dot { background: linear-gradient(135deg, #f59e0b, #f43f5e); }
.step:nth-child(4) .step-dot { background: linear-gradient(135deg, #10b981, #06b6d4); }
.step-dot .i { width: 50%; height: 50%; color: #fff; }
.step b { font-size: calc(var(--u) * 2.2); color: #fff; }
.step span { font-size: calc(var(--u) * 1.5); color: rgba(238, 240, 255, .7); line-height: 1.35; }

.layers { display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); width: min(100%, calc(var(--u) * 76)); }
.layer { padding: calc(var(--u) * 1.8) calc(var(--u) * 2.2); border-radius: calc(var(--u) * 2); text-align: left; border: 1px solid rgba(255, 255, 255, .12); }
.layer.front { background: linear-gradient(135deg, rgba(99, 102, 241, .35), rgba(139, 92, 246, .2)); }
.layer.back { background: linear-gradient(135deg, rgba(6, 182, 212, .28), rgba(59, 130, 246, .18)); }
.layer-head { display: flex; align-items: center; gap: calc(var(--u) * 1.2); margin-bottom: calc(var(--u) * 1.2); }
.layer-head .i { width: calc(var(--u) * 3); height: calc(var(--u) * 3); color: #fff; }
.layer-head b { font-size: calc(var(--u) * 2.4); color: #fff; }
.layer-head span { font-size: calc(var(--u) * 1.5); color: rgba(238, 240, 255, .7); }
.layer-items { display: flex; flex-wrap: wrap; gap: calc(var(--u) * .8); }
.layer-items span { padding: calc(var(--u) * .5) calc(var(--u) * 1.3); border-radius: calc(var(--u) * .8); background: rgba(0, 0, 0, .3); font-size: calc(var(--u) * 1.6); color: #eef0ff; }
.layer-link { font-family: var(--mono); font-size: calc(var(--u) * 1.5); color: #fde68a; }

.sc-q { font-size: calc(var(--u) * 3); color: #fff; max-width: calc(var(--u) * 70); margin: 0 0 calc(var(--u) * 2.4); line-height: 1.25; }
.sc-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: calc(var(--u) * 1.4); width: min(100%, calc(var(--u) * 70)); }
.sc-opt { padding: calc(var(--u) * 1.6) calc(var(--u) * 2); border-radius: calc(var(--u) * 1.6); background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); font-size: calc(var(--u) * 2); font-weight: 650; color: #fff; text-align: left; transition: .4s; }
.sc-opts.marked .sc-opt.right { background: rgba(16, 185, 129, .3); border-color: #34d399; transform: scale(1.03); }
.sc-opts.marked .sc-opt:not(.right) { opacity: .35; }

.outro-check { width: calc(var(--u) * 9); height: calc(var(--u) * 9); border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #10b981, #06b6d4); margin-bottom: calc(var(--u) * 2); box-shadow: 0 calc(var(--u) * 2) calc(var(--u) * 5) calc(var(--u) * -2) rgba(16, 185, 129, .9); }
.outro-check .i { width: 50%; height: 50%; color: #fff; stroke-width: 3; }
.outro-chips { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1); justify-content: center; max-width: calc(var(--u) * 72); }
.chip-dark { padding: calc(var(--u) * .7) calc(var(--u) * 1.6); border-radius: 99px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); font-family: var(--mono); font-size: calc(var(--u) * 1.7); color: #e0e7ff; }

/* Phones: vertical video with larger text and stacked scene layouts */
@media (max-width: 640px) {
  .vp-stage { --u: 1.7cqw; aspect-ratio: 4 / 5; }
  .vp-scene { padding: calc(var(--u) * 3) calc(var(--u) * 2.4); }
  .sc-kicker, .fn-url, .lane-label, .fn-item, .cw-file { font-size: calc(var(--u) * 1.6); }
  .sc-h { font-size: calc(var(--u) * 5); }
  .flow { grid-template-columns: 1fr; gap: calc(var(--u) * 1.4); }
  .flow-node { min-height: 0; padding: calc(var(--u) * 1.6); }
  .flow-lanes { gap: calc(var(--u) * 3.4); padding: calc(var(--u) * 1.4) 0; }
  .cmp { grid-template-columns: 1fr; gap: calc(var(--u) * 1.4); }
  .cmp-vs { display: none; }
  .cmp-col { padding: calc(var(--u) * 1.8); }
  .cmp-col ul { gap: calc(var(--u) * .7); }
  .steps { grid-template-columns: 1fr 1fr; row-gap: calc(var(--u) * 3); }
  .steps::before { display: none; }
  .step span { font-size: calc(var(--u) * 1.7); }
  .blist, .sc-codewin, .layers, .sc-opts, .sc-q { width: 100%; max-width: none; }
  .blist li { padding: calc(var(--u) * 1.2) calc(var(--u) * 1.6); }
  .sc-codewin pre { font-size: calc(var(--u) * 1.4); padding: calc(var(--u) * 1.4); }
  .layer-items span, .layer-head span { font-size: calc(var(--u) * 1.6); }
  .term-big { padding: calc(var(--u) * 3); }
  .term-ex { max-width: none; }
}

/* ---------- Test ---------- */
.test-wrap { max-width: 780px; margin: 0 auto; }
.test-intro { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 20px 0 24px; }
.ti-item { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.ti-item .i { color: var(--accent); width: 22px; height: 22px; }
.ti-item b { display: block; }
.ti-item span { font-size: .85rem; color: var(--muted); }
@media (max-width: 600px) { .test-intro { grid-template-columns: 1fr; } }
.grade-table { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.grade-table div { padding: 10px; border-radius: 12px; background: var(--surface-2); text-align: center; font-size: .85rem; color: var(--muted); }
.grade-table b { display: block; font-size: 1.5rem; font-family: var(--font-display); color: var(--text); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.q-text { font-size: clamp(1.15rem, 2.4vw, 1.4rem); font-weight: 700; margin: 18px 0 20px; line-height: 1.4; }
.q-type { display: inline-flex; gap: 6px; align-items: center; }
.q-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.score-ring { --p: 0; width: 170px; height: 170px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: conic-gradient(var(--ring, #10b981) calc(var(--p) * 1%), var(--surface-3) 0); }
.score-ring > div { width: 136px; height: 136px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; text-align: center; }
.score-ring b { display: block; font-family: var(--font-display); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.score-ring span { font-size: .82rem; color: var(--muted); }
.grade-big { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 14px; font-weight: 750; margin-bottom: 20px; }
.review { display: grid; gap: 10px; margin-top: 20px; text-align: left; }
.review-item { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.review-item.ok { border-left: 4px solid var(--success); }
.review-item.bad { border-left: 4px solid var(--danger); }
.review-item p { margin: 0 0 6px; font-weight: 650; }
.review-item small { display: block; color: var(--text-2); }
.review-item small b { color: var(--success); }
.review-item small s { color: var(--danger); }

.cert-modal { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 20px; background: rgba(5, 7, 18, .6); backdrop-filter: blur(4px); overflow-y: auto; }
.cert-box { width: min(860px, 100%); display: flex; flex-direction: column; gap: 14px; }
.certificate {
  position: relative; aspect-ratio: 1.414; width: 100%; padding: 5%; border-radius: 18px; overflow: hidden; color: #11152e;
  background: radial-gradient(circle at 0 0, rgba(99, 102, 241, .16), transparent 40%), radial-gradient(circle at 100% 100%, rgba(236, 72, 153, .14), transparent 40%), #fffdf8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); container-type: inline-size;
}
.certificate::before { content: ""; position: absolute; inset: 2.2cqw; border: .3cqw solid #c7c3f5; border-radius: 1.4cqw; pointer-events: none; }
.certificate .c-brand { font-family: var(--mono); font-weight: 700; font-size: 2cqw; color: #4f46e5; }
.certificate .c-title { font-family: var(--font-display); font-size: 5.4cqw; font-weight: 800; letter-spacing: -0.02em; margin: 1.5cqw 0 .5cqw; color: #11152e; }
.certificate .c-sub { font-size: 1.9cqw; color: #555b7a; }
.certificate .c-name { font-family: var(--font-display); font-size: 4.6cqw; font-weight: 800; margin: 2cqw 0 1cqw; padding: 0 3cqw .6cqw; border-bottom: .25cqw solid #11152e; color: #4338ca; }
.certificate .c-text { font-size: 1.9cqw; color: #333856; max-width: 70cqw; }
.certificate .c-foot { display: flex; justify-content: space-between; width: 80%; margin-top: 3cqw; font-size: 1.6cqw; color: #555b7a; }
.certificate .c-foot b { display: block; font-size: 2.2cqw; color: #11152e; }
.certificate .c-seal { position: absolute; right: 6%; top: 8%; width: 13cqw; height: 13cqw; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #6366f1, #db2777); color: #fff; font-family: var(--mono); font-weight: 800; font-size: 1.6cqw; text-align: center; line-height: 1.2; transform: rotate(-12deg); box-shadow: 0 1cqw 3cqw rgba(99, 102, 241, .4); }
.cert-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--surface); padding: 12px; border-radius: 14px; }
.cert-actions .input { flex: 1 1 220px; width: auto; }

@media print {
  body * { visibility: hidden !important; }
  .certificate, .certificate * { visibility: visible !important; }
  .cert-modal { position: static; background: none; padding: 0; backdrop-filter: none; }
  .certificate { position: fixed; left: 0; top: 0; width: 100%; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: A4 landscape; margin: 10mm; }
}

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