/* GoPath — кофейный уютный минимализм.
   Светлая тема — сливочная бумага меню, тёмная — эспрессо поздним вечером. Все цвета — токены :root. */

:root {
  --bg: #f6f0e6;
  --bg-2: #efe5d6;
  --surface: #fcf8f2;
  --surface-2: #f3eadd;
  --ink: #2b1d15;
  --ink-2: #5b4436;
  --muted: #8d7767;
  --line: #e4d6c3;
  --line-2: #d6c3aa;
  --accent: #5e3b26;
  --accent-ink: #fbf3e8;
  --caramel: #b07c52;
  --crema: #d9b48f;
  --foam: #fbf7f0;
  --ok: #557245;
  --ok-bg: #e4ead7;
  --bad: #a3433a;
  --bad-bg: #f3dfd7;
  --warn: #9a6a1c;
  --warn-bg: #f4e6c8;
  --code-bg: #2a1e17;
  --code-ink: #f1e6d8;
  --code-muted: #9f8a79;
  --code-line: #3a2b22;
  --shadow: 0 1px 2px rgba(60, 35, 20, .06), 0 8px 24px -12px rgba(60, 35, 20, .18);
  --shadow-lg: 0 2px 4px rgba(60, 35, 20, .06), 0 24px 48px -20px rgba(60, 35, 20, .28);
  --radius: 18px;
  --radius-sm: 10px;
  --font-display: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  --wrap: 1200px;
  /* подсветка кода: тёмная доска даже в светлой теме — как меловая доска в кофейне */
  --hl-kw: #e2a76f;
  --hl-str: #b5c98a;
  --hl-num: #e6c07b;
  --hl-com: #8a7564;
  --hl-fn: #f0d6b4;
  --hl-type: #d9a5b3;
  --hl-builtin: #9fc4c8;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110d;
    --bg-2: #1f1712;
    --surface: #241a14;
    --surface-2: #2c2119;
    --ink: #f2e7d9;
    --ink-2: #d4c2ae;
    --muted: #a28d7b;
    --line: #3a2c23;
    --line-2: #4a382c;
    --accent: #d9b48f;
    --accent-ink: #20160f;
    --caramel: #d39a68;
    --crema: #c99c71;
    --foam: #f3e8da;
    --ok: #9cbc84;
    --ok-bg: #26301f;
    --bad: #e08a7b;
    --bad-bg: #3a201b;
    --warn: #e2b25f;
    --warn-bg: #362a17;
    --code-bg: #120d0a;
    --code-line: #2a1f18;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #17110d;
  --bg-2: #1f1712;
  --surface: #241a14;
  --surface-2: #2c2119;
  --ink: #f2e7d9;
  --ink-2: #d4c2ae;
  --muted: #a28d7b;
  --line: #3a2c23;
  --line-2: #4a382c;
  --accent: #d9b48f;
  --accent-ink: #20160f;
  --caramel: #d39a68;
  --crema: #c99c71;
  --foam: #f3e8da;
  --ok: #9cbc84;
  --ok-bg: #26301f;
  --bad: #e08a7b;
  --bad-bg: #3a201b;
  --warn: #e2b25f;
  --warn-bg: #362a17;
  --code-bg: #120d0a;
  --code-line: #2a1f18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 24px 48px -20px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font-body);
  font-feature-settings: "ss01";
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--caramel); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--crema); color: #2b1d15; }
:focus-visible { outline: 2px solid var(--caramel); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ——— загрузка ——— */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--muted); font-family: var(--font-display); letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.boot__cup { width: 56px; height: 56px; border-radius: 50%; border: 6px solid var(--line-2); border-top-color: var(--caramel); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ——— шапка ——— */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { max-width: var(--wrap); margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand svg { width: 34px; height: 34px; }
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .14em; line-height: 1; }
.brand__tag { display: block; font-family: var(--font-display); font-weight: 600; font-size: 8.5px; letter-spacing: .22em; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.nav { display: flex; gap: 2px; margin-left: 8px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  text-decoration: none; padding: 8px 11px; border-radius: 999px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 600; font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2);
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
.topbar__end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2);
}
.iconbtn:hover { border-color: var(--line-2); color: var(--ink); }
.iconbtn svg { width: 18px; height: 18px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 14px; text-decoration: none; text-transform: uppercase;
}
.menu-toggle { display: none; }

/* ——— каркас страниц ——— */
.page { max-width: var(--wrap); margin: 0 auto; padding: 32px 24px 96px; }
.page--narrow { max-width: 880px; }
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
}
.eyebrow::after { content: ""; flex: 0 0 36px; height: 1px; background: var(--line-2); }
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.02; margin: 0; }
h1.display { font-size: clamp(34px, 5vw, 58px); }
h2.display { font-size: clamp(24px, 3vw, 32px); }
.lead { color: var(--ink-2); font-size: 18px; max-width: 62ch; margin: 14px 0 0; }
.section { margin-top: 56px; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 16px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 28px 0; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
}
.card--flat { box-shadow: none; }
.card--panel { background: var(--bg-2); border-color: transparent; box-shadow: none; }
.card h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: .02em; }

/* ——— кнопки и поля ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); transition: transform .12s ease, background .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn svg { width: 16px; height: 16px; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn--soft { background: var(--surface-2); color: var(--ink); }
.btn--soft:hover { background: var(--line); box-shadow: none; }
.btn--danger { background: var(--bad); color: #fff; }
.btn--sm { padding: 7px 14px; font-size: 11px; }
.btn--block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--caramel); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.field { display: grid; gap: 6px; }
.field > span { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--foam);
  color: #2b1d15; outline: none; transition: border-color .15s, box-shadow .15s;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] select.input { background: var(--surface-2); color: var(--ink); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .input { background: var(--surface-2); color: var(--ink); } }
.input:focus { border-color: var(--caramel); box-shadow: 0 0 0 3px color-mix(in srgb, var(--caramel) 25%, transparent); }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; margin-top: 3px; flex-shrink: 0; }

/* ——— «ценник» из меню: тёмная бирка ——— */
.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px 0 14px; position: relative;
  background: var(--accent); color: var(--accent-ink); border-radius: 0 6px 6px 0;
  font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: .06em; white-space: nowrap;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%);
}
.tag--light { background: var(--surface-2); color: var(--ink-2); }
.tag--ok { background: var(--ok); color: #fff; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill--ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.pill--bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.pill--warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ——— главная ——— */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); gap: 0; min-height: 440px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero__menu { background: var(--bg-2); padding: 40px 44px; display: flex; flex-direction: column; }
.hero__brand { padding: 44px 0 40px 44px; position: relative; display: flex; flex-direction: column; overflow: hidden; }
.hero__title { font-family: var(--font-display); font-weight: 800; font-size: clamp(42px, 6vw, 76px); letter-spacing: .08em; line-height: .95; margin: 0; }
.hero__sub { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-2); margin-top: 10px; }
.hero__cup { position: absolute; right: -130px; top: 50%; transform: translateY(-38%); width: 340px; height: 340px; filter: drop-shadow(0 30px 40px rgba(60, 35, 20, .25)); }
.hero__slogan { margin-top: auto; position: relative; z-index: 1; max-width: calc(100% - 230px); min-width: 190px; }
.hero__slogan p { margin: 0 0 14px; font-size: 14px; color: var(--ink-2); }
.hero__big { font-family: var(--font-display); font-weight: 800; font-size: clamp(20px, 2.2vw, 28px); line-height: 1.08; letter-spacing: .04em; text-transform: uppercase; }
.hero__big span { font-weight: 600; }
.continue { margin-top: 18px; display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
.continue:hover { box-shadow: var(--shadow-lg); }
.continue > svg { width: 64px; height: 64px; }
.continue b { display: block; font-family: var(--font-display); font-size: 15px; letter-spacing: .02em; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.stat { background: var(--surface); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }

/* ——— меню модулей ——— */
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.menu-item {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: relative;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.menu-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.menu-item svg.cup { width: 96px; height: 96px; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.menu-item:hover svg.cup { transform: rotate(-14deg); }
.menu-item__num { font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .2em; color: var(--muted); }
.menu-item__title { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; margin: 2px 0 4px; line-height: 1.15; }
.menu-item__sub { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.menu-item__foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--caramel), var(--accent)); border-radius: inherit; transition: width .6s ease; }

/* активность: зёрна */
.beans { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.bean { width: 13px; height: 13px; border-radius: 50%; background: var(--surface-2); position: relative; }
.bean[data-l="1"] { background: color-mix(in srgb, var(--crema) 55%, var(--surface-2)); }
.bean[data-l="2"] { background: var(--crema); }
.bean[data-l="3"] { background: var(--caramel); }
.bean[data-l="4"] { background: var(--accent); }
.bean[data-l]:not([data-l="0"])::after { content: ""; position: absolute; left: 6px; top: 2px; width: 1px; height: 9px; background: rgba(255, 255, 255, .45); border-radius: 1px; transform: rotate(12deg); }

/* ——— модуль ——— */
.module-hero { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: center; }
.module-hero svg.cup { width: 220px; height: 220px; filter: drop-shadow(0 24px 30px rgba(60, 35, 20, .22)); }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin: 36px 0 28px; }
.tabs button {
  background: none; border: 0; padding: 12px 18px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px 28px; }
.step-link {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; text-decoration: none;
  padding: 12px 6px; border-bottom: 1px dashed var(--line-2);
}
.step-link:hover .step-link__title { color: var(--caramel); }
.step-link svg { width: 44px; height: 44px; }
.step-link__num { font-family: var(--font-display); font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 700; }
.step-link__title { font-weight: 700; line-height: 1.3; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.aside { position: sticky; top: 84px; display: grid; gap: 16px; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); text-decoration: none; font-size: 14px; color: var(--ink-2); }
.toc a:hover { border-left-color: var(--caramel); color: var(--ink); }
.toc a.lvl3 { padding-left: 24px; font-size: 13px; }
.linklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.linklist a { display: flex; gap: 8px; align-items: baseline; text-decoration: none; font-size: 14px; font-weight: 600; }
.linklist a::before { content: "↗"; color: var(--caramel); font-size: 12px; }
.linklist a:hover { color: var(--caramel); }

/* ——— статья (Markdown) ——— */
.prose { font-size: 17px; line-height: 1.75; max-width: 76ch; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); letter-spacing: .02em; line-height: 1.25; scroll-margin-top: 90px; }
.prose h2 { font-size: 26px; margin: 2em 0 .6em; font-weight: 800; }
.prose h3 { font-size: 20px; margin: 1.8em 0 .5em; font-weight: 700; }
.prose h4 { font-size: 16px; margin: 1.4em 0 .4em; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); }
.prose p { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--caramel); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose a { color: var(--caramel); font-weight: 600; }
.prose a.btn { color: var(--accent-ink); text-decoration: none; }
.prose blockquote {
  margin: 1.4em 0; padding: 16px 20px; border-radius: 14px; background: var(--bg-2); border-left: 4px solid var(--caramel); color: var(--ink-2);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.prose table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { font-family: var(--font-display); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.prose :not(pre) > code, .ic {
  font-family: var(--font-mono); font-size: .86em; background: var(--surface-2); border: 1px solid var(--line); padding: .1em .4em; border-radius: 6px; color: var(--ink);
}
.prose pre, pre.code { margin: 1.2em 0; }

/* блок кода */
pre.code {
  background: var(--code-bg); color: var(--code-ink); border-radius: 14px; padding: 16px 18px; overflow-x: auto; position: relative;
  font: 14px/1.6 var(--font-mono); tab-size: 4; box-shadow: inset 0 0 0 1px var(--code-line);
}
pre.code[data-lang]::before {
  content: attr(data-lang); position: absolute; right: 12px; top: 8px; font: 600 10px/1 var(--font-display); letter-spacing: .2em;
  text-transform: uppercase; color: var(--code-muted);
}
pre.code code { font: inherit; background: none; border: 0; padding: 0; color: inherit; }
.tk-kw { color: var(--hl-kw); font-weight: 500; }
.tk-str { color: var(--hl-str); }
.tk-num { color: var(--hl-num); }
.tk-com { color: var(--hl-com); font-style: italic; }
.tk-fn { color: var(--hl-fn); }
.tk-type { color: var(--hl-type); }
.tk-bi { color: var(--hl-builtin); }
.tk-key { color: var(--hl-kw); }

/* ——— шаг ——— */
.step-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: start; }
.step-page--quiz { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--caramel); }
.step-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(24px, 3vw, 32px); letter-spacing: .03em; margin: 6px 0 16px; line-height: 1.15; }
.theory { position: sticky; top: 84px; }
.theory .prose { font-size: 16px; }
.hint { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 12px 16px; font-size: 15px; }
.hint b { color: inherit; }

.options { display: grid; gap: 10px; margin: 18px 0; }
.option {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; text-align: left; cursor: pointer;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); font-size: 15.5px; line-height: 1.45;
  transition: border-color .15s, background .15s, transform .1s;
}
.option:hover:not(:disabled) { border-color: var(--caramel); background: var(--foam); }
:root[data-theme="dark"] .option:hover:not(:disabled) { background: var(--surface-2); }
.option:disabled { cursor: default; }
.option__n {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2);
  font-family: var(--font-display); font-weight: 800; font-size: 13px;
}
.option[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.option[aria-pressed="true"] .option__n { background: var(--accent); color: var(--accent-ink); }
.option.is-right { border-color: var(--ok); background: var(--ok-bg); }
.option.is-right .option__n { background: var(--ok); color: #fff; }
.option.is-wrong { border-color: var(--bad); background: var(--bad-bg); }
.option.is-wrong .option__n { background: var(--bad); color: #fff; }
.verdict { border-radius: 14px; padding: 16px 18px; display: grid; gap: 6px; }
.verdict--ok { background: var(--ok-bg); color: var(--ink); }
.verdict--bad { background: var(--bad-bg); color: var(--ink); }
.verdict b { font-family: var(--font-display); letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }
.verdict--ok b { color: var(--ok); }
.verdict--bad b { color: var(--bad); }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.step-nav a { text-decoration: none; display: grid; gap: 2px; max-width: 45%; }
.step-nav a span { font-family: var(--font-display); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.step-nav a b { font-weight: 700; }
.step-nav a:last-child { text-align: right; margin-left: auto; }

/* ——— редактор ——— */
.ide { border-radius: 18px; overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-lg); border: 1px solid var(--code-line); }
.ide__bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; background: color-mix(in srgb, var(--code-bg) 85%, #fff 4%); border-bottom: 1px solid var(--code-line); flex-wrap: wrap; }
.ide__file { font: 500 12.5px var(--font-mono); color: var(--code-muted); display: flex; align-items: center; gap: 8px; }
.ide__file::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--caramel); }
.ide__bar .spacer { flex: 1; }
.ide .btn--soft { background: rgba(255, 255, 255, .07); color: var(--code-ink); }
.ide .btn--soft:hover { background: rgba(255, 255, 255, .13); }
.ide .btn { background: var(--crema); color: #2b1d15; }
.ide .btn.btn--soft { background: rgba(255, 255, 255, .07); color: var(--code-ink); }
.ide__tabs { display: flex; gap: 2px; overflow-x: auto; }
.ide__tabs button { background: none; border: 0; padding: 6px 12px; border-radius: 8px; color: var(--code-muted); font: 500 12.5px var(--font-mono); cursor: pointer; white-space: nowrap; }
.ide__tabs button[aria-selected="true"] { background: rgba(255, 255, 255, .08); color: var(--code-ink); }
.editor { position: relative; display: grid; grid-template-columns: auto 1fr; font: 14px/1.65 var(--font-mono); tab-size: 4; min-height: 260px; max-height: 70vh; overflow: auto; }
.editor__gutter { padding: 14px 10px 14px 14px; color: #6f5b4c; text-align: right; user-select: none; white-space: pre; position: sticky; left: 0; background: var(--code-bg); z-index: 1; }
.editor__body { position: relative; min-width: 0; }
.editor__body pre, .editor__body textarea {
  margin: 0; padding: 14px 18px 14px 8px; border: 0; font: inherit; white-space: pre; tab-size: 4; letter-spacing: 0; word-spacing: 0;
  overflow: hidden; min-height: 100%;
}
.editor__body pre { pointer-events: none; color: var(--code-ink); }
.editor__body textarea {
  position: absolute; inset: 0; width: 100%; height: 100%; resize: none; background: transparent; color: transparent; caret-color: #f5d9b6;
  outline: none; -webkit-text-fill-color: transparent;
}
.editor__body textarea::selection { background: rgba(217, 180, 143, .35); -webkit-text-fill-color: transparent; }
.ide__foot { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--code-line); color: var(--code-muted); font: 12px var(--font-mono); flex-wrap: wrap; }
.ide__foot kbd { background: rgba(255, 255, 255, .08); border-radius: 4px; padding: 1px 6px; font: inherit; }

.results { margin-top: 18px; display: grid; gap: 14px; }
.checks { display: grid; gap: 8px; }
.checkrow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font: 14px var(--font-mono); }
.checkrow i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font: 700 12px var(--font-display); flex-shrink: 0; }
.checkrow.ok i { background: var(--ok); color: #fff; }
.checkrow.bad i { background: var(--bad); color: #fff; }
.checkrow.skip i { background: var(--line-2); color: var(--ink-2); }
.console {
  background: var(--code-bg); color: var(--code-ink); border-radius: 14px; padding: 14px 16px; font: 13px/1.6 var(--font-mono);
  white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; margin: 0; box-shadow: inset 0 0 0 1px var(--code-line);
}
.console .pass { color: #9cbc84; }
.console .fail { color: #f09a8a; }
.console .run { color: var(--code-muted); }
.status { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; font-weight: 600; }
.status b { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; }
.status--ok { background: var(--ok-bg); color: var(--ok); }
.status--bad { background: var(--bad-bg); color: var(--bad); }
.status--warn { background: var(--warn-bg); color: var(--warn); }
.status svg { width: 34px; height: 34px; flex-shrink: 0; }

/* ——— экзамен ——— */
.exam-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.exam-bar .meter { flex: 1; height: 8px; }
.timer { font: 700 16px var(--font-mono); padding: 6px 14px; border-radius: 999px; background: var(--surface-2); }
.result-score { font-family: var(--font-display); font-weight: 800; font-size: 72px; line-height: 1; letter-spacing: .02em; }

/* ——— карточки собеседования ——— */
.flash { min-height: 320px; display: flex; flex-direction: column; }
.flash__q { font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1.35; letter-spacing: .01em; margin: 6px 0 18px; }
.flash__a { border-top: 1px dashed var(--line-2); padding-top: 18px; }
.flash__actions { margin-top: auto; padding-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; padding: 16px 4px; display: flex; gap: 12px; align-items: baseline; list-style: none; font-weight: 700; font-size: 16.5px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::before { content: "+"; font-family: var(--font-display); color: var(--caramel); font-weight: 800; width: 14px; flex-shrink: 0; }
.qa[open] summary::before { content: "–"; }
.qa .prose { padding: 0 4px 18px 30px; font-size: 16px; }

/* ——— сетки карточек ——— */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.prog { display: flex; flex-direction: column; gap: 10px; }
.prog ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-2); }
.prog__project { font-size: 14px; background: var(--bg-2); border-radius: 12px; padding: 10px 14px; }
.lib-item { display: block; text-decoration: none; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: border-color .15s, transform .15s; }
.lib-item:hover { border-color: var(--caramel); transform: translateY(-2px); }
.lib-item b { display: block; font-weight: 700; }
.lib-item span { font-size: 14px; color: var(--ink-2); }
.lib-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; word-break: break-all; }

.checklist { list-style: none; margin: 0 0 1em; padding: 0; display: grid; gap: 8px; }
.checklist li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.checklist li.done { background: var(--ok-bg); border-color: transparent; }
.checklist li.done span { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--ok) 60%, transparent); }

/* ——— таблица ——— */
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-family: var(--font-display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

/* ——— вход ——— */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login__art { background: var(--bg-2); display: grid; place-items: center; padding: 56px 48px; position: relative; overflow: hidden; }
.login__inner { width: min(520px, 100%); position: relative; z-index: 1; }
.login__art svg.cup {
  position: absolute; right: clamp(-200px, -9vw, -80px); bottom: clamp(-180px, -8vw, -60px);
  width: clamp(280px, 34vw, 620px); height: auto; aspect-ratio: 1; filter: drop-shadow(0 30px 40px rgba(60, 35, 20, .25));
}
.login__form { display: grid; place-items: center; padding: 40px 24px; }
.login__form form { width: min(420px, 100%); display: grid; gap: 18px; }
.login__form h2.display { font-size: clamp(28px, 2.6vw, 40px); }
.login__menu { display: grid; gap: 4px; margin-top: 40px; max-width: 320px; }
.login__menu div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line-2); padding: 7px 0; font-size: 14px; }
.login__menu b { font-family: var(--font-display); letter-spacing: .06em; font-size: 12px; text-transform: uppercase; }
@media (max-width: 1180px) { .login__menu { display: none; } }
.error { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 1.4em; }

/* ——— тосты и диалоги ——— */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(460px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14.5px; animation: up .25s ease; }
.toast--bad { background: var(--bad); color: #fff; }
.toast--ok { background: var(--ok); color: #fff; }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }
dialog { border: 0; border-radius: 22px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); width: min(520px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(30, 18, 10, .45); backdrop-filter: blur(3px); }
dialog form, .dialog__body { padding: 26px; display: grid; gap: 14px; }
dialog h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 18px; }
.dialog__actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty svg { width: 120px; height: 120px; margin: 0 auto 14px; opacity: .9; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer .page { padding-top: 22px; padding-bottom: 32px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ——— адаптив ——— */
@media (max-width: 1080px) {
  .step-page, .step-page--quiz { grid-template-columns: 1fr; }
  .theory { position: static; }
  .layout-2 { grid-template-columns: 1fr; }
  .aside { position: static; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .topbar__in { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .menu-toggle { display: grid; }
  .nav { order: 3; width: 100%; margin: 0; display: none; flex-direction: column; gap: 2px; padding-bottom: 6px; }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 12px; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero__brand { order: -1; padding: 32px 24px; min-height: 300px; }
  .hero__menu { padding: 28px 24px; }
  .hero__cup { width: 240px; height: 240px; right: -90px; }
  .hero__slogan { max-width: calc(100% - 150px); }
  .module-hero { grid-template-columns: 1fr; gap: 16px; }
  .module-hero svg.cup { width: 150px; height: 150px; }
  .login { grid-template-columns: 1fr; min-height: auto; }
  .login__art { padding: 32px 24px; min-height: 280px; place-items: start; }
  .login__art svg.cup { width: 260px; right: -70px; bottom: -70px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page { padding: 22px 16px 72px; }
  .stats { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat b { font-size: 20px; }
  .menu-item { grid-template-columns: 72px 1fr; padding: 14px; }
  .menu-item svg.cup { width: 72px; height: 72px; }
  .steps { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .prose { font-size: 16px; }
  .editor { font-size: 13px; }
  .brand__tag { display: none; }
}
