/* Веб-апп клуба AI 1-2-3. Токены из tasks/klub-maestro/vizual/dizayn-final.md, правки по аудиту unslop 02.11.2026 (vizual/unslop-audit.md).
   Правила: сетка 4px, радиусы по размеру (кнопки 12, карточки 16, меню 20), веса 400/500/600, без градиентов и свечений,
   тень только у плавающих слоёв, золото одним акцентом, подпись бренда: дирижёрская палочка (линия прогресса шага ноль). */
@font-face { font-family: "Medeo Sans"; src: url("fonts/MedeoSansVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Medeo Mono"; src: url("fonts/MedeoMonoVariable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root, html[data-theme="light"] {
  --canvas:#F2F2F1; --surface:#FFFFFF; --line:#E4E4E1; --text:#121212; --muted:#6B6B68; --btn:#141414; --btntext:#FFFFFF;
  --brand:#886519; --brandfill:#D4A855; --track:#ECECEA;   /* золото текстом: #886519, контраст 5,35:1 на белом (решение Антона 02.11.2026) */ --ok:#1E8E4E; --err:#D23B2F;
  --glass:rgba(255,255,255,.78); --glassline:rgba(0,0,0,.08); --float:0 1px 2px rgba(0,0,0,.06), 0 8px 24px rgba(0,0,0,.08);
  --code:#F7F7F5; --sheet:#FFFFFF; --sheettext:#121212;
  --stage:#1C1813; --stagetext:#F2EEE6; --stagemuted:#B8AE9C; --stagegold:#E3BC6A;   /* обложка: сцена, тёплый графит в обеих темах */
}
html[data-theme="dark"] {
  --canvas:#12100D; --surface:#1D1A16; --line:#2E2A24; --text:#F2EEE6; --muted:#A39B8E; --btn:#F2EEE6; --btntext:#14120F;
  --brand:#E3BC6A; --brandfill:#D4A855; --track:#2A2620; --ok:#4CC38A; --err:#FF6B5E;
  --glass:rgba(29,26,22,.72); --glassline:rgba(255,236,200,.12); --float:0 8px 24px rgba(0,0,0,.35);
  --code:#16130F; --sheet:#1A1714; --sheettext:#E9E3D7;
  --stage:#24201A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--canvas); color: var(--text); font-family: "Medeo Sans", system-ui, sans-serif; font-size: 15px; line-height: 1.45;
       -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
.serif { font-family: "Literata", Georgia, serif; font-weight: 600; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brandfill); outline-offset: 2px; }
a { color: var(--brand); }
[hidden] { display: none !important; }
svg.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.glass { background: var(--glass); border: 1px solid var(--glassline); -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%); }
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* шапка и меню: плавающие слои; тень только у меню и тоста */
.top { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 12px; right: 12px; height: 40px; border-radius: 12px; z-index: 5;
       display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 500; }
.brand { display: flex; align-items: center; gap: 8px; }
.znak { height: 20px; } html[data-theme="light"] .znak-cream, html[data-theme="dark"] .znak-ink { display: none; }
body.na-scene .top { background: rgba(28,24,19,.72); color: var(--stagetext); border-color: rgba(255,236,200,.12); }
body.na-scene .znak-ink { display: none; } body.na-scene .znak-cream { display: block; }

.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 60px; border-radius: 20px; z-index: 5;
        display: grid; grid-template-columns: repeat(4,1fr); align-items: center; box-shadow: var(--float); }
.tabs button { position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); transition: color .15s; }
.tabs b { display: flex; height: 24px; align-items: center; justify-content: center; }
.tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs .on { color: var(--text); } .tabs .on b { color: var(--brand); }
.zk { height: 22px; display: none; }
html[data-theme="light"] .zk.ml, html[data-theme="dark"] .zk.md { display: block; }
html[data-theme="light"] .on .zk.ml, html[data-theme="dark"] .on .zk.md { display: none; }
html[data-theme="light"] .on .zk.gl, html[data-theme="dark"] .on .zk.gd { display: block; }

main { padding: calc(60px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
@media (min-width: 700px) { .top, .tabs { max-width: 540px; margin: 0 auto; } }

/* приветствие */
.hello { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.ava { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.ini { background: var(--brandfill); color: #121212; display: flex; align-items: center; justify-content: center; font-weight: 500; font-size: 19px; }
.t1 { font-size: 13px; color: var(--muted); }
.t2 { font-size: 22px; line-height: 1.15; }

/* карточки: белые на сером, без тени, на хайрлайне */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 12px; }
.mark { font-size: 13px; font-weight: 500; color: var(--brand); margin-bottom: 4px; }
.ttl { font-size: 17px; line-height: 1.25; margin-bottom: 4px; }
.txt { font-size: 14px; line-height: 1.45; color: var(--muted); }
/* палочка как прогресс: тонкая линия, золотой наконечник на конце пройденного */
.bar { position: relative; height: 2px; margin: 16px 0 4px; background: var(--track); }
.bar i { position: relative; display: block; height: 100%; background: var(--brandfill); transition: width .4s; }
.bar i::after { content: ""; position: absolute; right: -3px; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--brandfill); }
.bar i[style="width:0%"]::after { display: none; }
.btn { display: block; width: 100%; text-align: center; font-size: 15px; font-weight: 500; padding: 12px; border-radius: 12px; margin-top: 12px; background: var(--btn); color: var(--btntext); transition: opacity .15s; }
.btn:active { opacity: .85; }
.btn2 { display: inline-block; font-size: 14px; font-weight: 500; padding: 8px 16px; border-radius: 10px; margin-top: 8px; background: var(--track); color: var(--brand); }
.rowtitle { font-size: 15px; font-weight: 500; margin: 16px 0 8px; }
.why { font-size: 13px; color: var(--muted); } .why b { color: var(--text); font-weight: 500; }

/* обложка: одна на экран, сцена: тёплый графит, кремовый текст, силуэт Маэстро целиком */
.hero { position: relative; border-radius: 16px; overflow: hidden; min-height: 200px; margin-bottom: 12px; width: 100%; text-align: left;
        display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
        background: var(--stage); color: var(--stagetext); padding: 16px; }
.hero .fig { position: absolute; right: 4px; bottom: 0; height: 152px; width: auto; }
.hero .eye { font-size: 13px; font-weight: 500; color: var(--stagegold); margin-bottom: 8px; }
.hero .ht { max-width: 56%; font-size: 22px; line-height: 1.12; margin-bottom: 8px; }
.hero .hs { max-width: 52%; font-size: 14px; line-height: 1.4; color: var(--stagemuted); }
.hero .foot { margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--stagemuted); }
@media (max-width: 360px) { .hero .fig { height: 120px; } .hero .ht { max-width: 62%; font-size: 20px; } .hero .hs { max-width: 60%; } }

/* строка-ссылка на Главной: не карточка, чтобы экран не был стопкой одинаковых */
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 12px 16px; border-top: 1px solid var(--line); }
.row .rt { font-size: 15px; font-weight: 500; line-height: 1.25; }
.row .rm { font-size: 13px; color: var(--muted); margin-top: 4px; }
.row .ic { color: var(--muted); }

/* путь */
.step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step:last-child { padding-bottom: 0; }
.chk { width: 44px; height: 44px; margin: -10px 0 0 -10px; /* область нажатия 44 при кружке 24: сдвиг на (44-24)/2 */ flex: none; display: flex; align-items: center; justify-content: center; }
.chk span { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s; }
.chk svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; display: none; }
.step.done .chk span { background: var(--ok); border-color: var(--ok); } .step.done .chk svg { display: block; }
.step .sn { font-size: 12px; color: var(--brand); font-weight: 500; }
.step .st { font-size: 16px; font-weight: 500; line-height: 1.25; }
.step.done .st { color: var(--muted); }
.step .sd { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.step .sl { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 500; color: var(--brand); }

/* список материалов */
.mat { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.mat .cov { width: 48px; height: 48px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--track); }
.mat .mt { font-size: 15px; font-weight: 500; line-height: 1.25; }
.mat .mm { font-size: 13px; color: var(--muted); margin-top: 4px; }
.mat .mm b { color: var(--brand); font-weight: 500; }
.mat.zakryt { opacity: .62; }

/* страница материала */
.cover { position: relative; height: 200px; margin: -60px -16px 0; overflow: hidden; background: var(--stage); color: var(--stagetext); }
.cover .fig { position: absolute; right: 8px; bottom: 4px; height: 124px; opacity: .9; }
@media (max-width: 360px) { .cover .fig { height: 100px; } }
.cover .ce { position: absolute; left: 20px; bottom: 32px; color: var(--stagegold); font-size: 13px; font-weight: 500; }
.sheet { position: relative; background: var(--sheet); color: var(--sheettext); border-radius: 16px 16px 0 0; margin: -16px -16px 0; padding: 20px 20px 32px; min-height: 60vh; }
.mat-h { font-size: 24px; line-height: 1.18; margin-bottom: 4px; color: var(--text); }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--track); border-radius: 10px; padding: 4px; font-size: 14px; font-weight: 500; text-align: center; margin-bottom: 16px; }
.seg button { padding: 8px 0; border-radius: 6px; color: var(--muted); transition: background .15s, color .15s; }
.seg .sel { background: var(--surface); color: var(--text); }
.seg3 { grid-template-columns: repeat(3,1fr); }
.video { aspect-ratio: 16/9; border-radius: 12px; overflow: hidden; background: #000; margin-bottom: 16px; }
.video iframe { width: 100%; height: 100%; border: 0; }
.prose { font-size: 16px; line-height: 1.6; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin-bottom: 12px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose h2, .prose h3 { font-family: "Literata", Georgia, serif; font-weight: 600; line-height: 1.25; margin: 20px 0 8px; color: var(--text); }
.prose h2 { font-size: 20px; } .prose h3 { font-size: 17px; }
.prose a { word-break: break-word; }
.prose img { max-width: 100%; border-radius: 12px; }
.prose code { font-family: "Medeo Mono", monospace; font-size: 14px; background: var(--code); padding: 1px 4px; border-radius: 4px; }
.prose pre { background: var(--code); border: 1px solid var(--line); border-radius: 12px; padding: 36px 12px 12px; margin-bottom: 12px; overflow: auto; position: relative; }
.prose pre code { background: none; padding: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.prose pre .copy { position: absolute; right: 12px; top: 8px; font-family: "Medeo Sans", sans-serif; font-size: 13px; font-weight: 500; color: var(--brand); }
/* задание агенту: моно на листе цвета кода; «партитура» с номерами тактов отложена */
.agent { background: var(--code); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.agent .ah { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 8px; }
.agent .ah button { color: var(--brand); }
.agent pre { font-family: "Medeo Mono", monospace; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.note { font-size: 14px; color: var(--muted); line-height: 1.45; }

/* вкладка Маэстро */
.mem { display: flex; justify-content: space-between; align-items: center; font-size: 15px; padding: 12px 0; border-top: 1px solid var(--line); }
.mem:first-of-type { border-top: 0; padding-top: 0; }
.mem:last-of-type { padding-bottom: 0; }
.mem span:last-child { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* закрытый экран */
.zakryto { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 12px; }
.zakryto img { width: 96px; height: 96px; border-radius: 50%; margin-bottom: 8px; }
.z-h { font-size: 22px; } .z-t { font-size: 15px; color: var(--muted); max-width: 300px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(88px + env(safe-area-inset-bottom)); padding: 8px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; z-index: 9; box-shadow: var(--float); }
.toast .ok { color: var(--ok); }

/* один вход на экран: карточки поднимаются с лёгкой задержкой, не больше четырёх */
.fade { animation: fade .3s cubic-bezier(.2,.7,.2,1) both; }
main > .fade:nth-child(2) { animation-delay: .04s; } main > .fade:nth-child(3) { animation-delay: .08s; } main > .fade:nth-child(n+4) { animation-delay: .12s; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
html.gotov .fade { animation: none; }   /* вход только при открытии веб-аппа, не при каждой смене вкладки */
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } .bar i { transition: none; } }

/* экран «Вступить»: документы и крупный текст оферты */
.txt.big { font-size: 15px; color: var(--text); }
.doks { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.doklink { display: inline-block; text-align: left; font-size: 14px; font-weight: 500; color: var(--brand); background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-family: inherit; }
.card .btn2 { display: block; width: 100%; text-align: center; }
