/* Веб-апп клуба «МАЭСТРО ИИ». Токены и правила из tasks/klub-maestro/vizual/dizayn-final.md */
@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:#A67C1F; --brandfill:#D4A855; --track:#ECECEA; --ok:#1E8E4E; --err:#D23B2F;
  --glass:rgba(255,255,255,.72); --glassline:rgba(0,0,0,.08); --shadow:0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.06);
  --code:#F7F7F5; --var:#F3E6C6; --sheet:#FFFFFF; --sheettext:#121212;
}
html[data-theme="dark"] {
  --canvas:#12100D; --surface:#1D1A16; --line:#2E2A24; --text:#F2EEE6; --muted:#A39B8E; --btn:#F2EEE6; --btntext:#14120F;
  --brand:#E3BC6A; --brandfill:#D4A855; --track:#2E2A24; --ok:#4CC38A; --err:#FF6B5E;
  --glass:rgba(29,26,22,.62); --glassline:rgba(255,236,200,.12); --shadow:0 8px 24px rgba(0,0,0,.35);
  --code:#16130F; --var:#3A3122; --sheet:#1A1714; --sheettext:#E9E3D7;
}

* { 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; }
html[data-theme="dark"] body { background: radial-gradient(260px 200px at 95% 0%, #3a2a10 0%, rgba(58,42,16,0) 70%) no-repeat, var(--canvas); }
.serif { font-family: "Literata", Georgia, serif; font-weight: 600; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--brand); }
[hidden] { display: none !important; }

.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: 10px; right: 10px; height: 38px; border-radius: 19px; z-index: 5;
       display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.brand { display: flex; align-items: center; gap: 6px; }
.znak { height: 20px; } html[data-theme="light"] .znak-cream, html[data-theme="dark"] .znak-ink { display: none; }

.tabs { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); height: 58px; border-radius: 29px; z-index: 5;
        display: grid; grid-template-columns: repeat(4,1fr); align-items: center; box-shadow: var(--shadow); }
.tabs button { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--muted); }
.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(58px + env(safe-area-inset-top)) 15px calc(90px + 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: 10px; margin: 2px 0 14px; }
.ava { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex: none; }
.ini { background: var(--brandfill); color: #121212; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 19px; }
.t1 { font-size: 12.5px; color: var(--muted); }
.t2 { font-size: 21px; line-height: 1.15; }

/* карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow); }
.mark { font-size: 12.5px; font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.ttl { font-size: 16.5px; line-height: 1.25; margin-bottom: 5px; }
.txt { font-size: 13px; line-height: 1.45; color: var(--muted); }
.bar { height: 6px; border-radius: 9px; margin: 11px 0 2px; background: var(--track); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brandfill); border-radius: 9px; transition: width .4s; }
.btn { display: block; width: 100%; text-align: center; font-size: 14px; font-weight: 700; padding: 12px; border-radius: 99px; margin-top: 12px; background: var(--btn); color: var(--btntext); }
.btn2 { display: inline-block; font-size: 13.5px; font-weight: 700; padding: 8px 16px; border-radius: 99px; margin-top: 10px; background: var(--track); color: var(--brand); }
.rowtitle { font-size: 15px; font-weight: 700; margin: 14px 2px 8px; }
.why { font-size: 12.5px; color: var(--muted); } .why b { color: var(--text); font-weight: 600; }

/* обложка: одна яркая на экран */
.hero { position: relative; border-radius: 22px; overflow: hidden; height: 214px; margin-bottom: 10px; color: #fff; display: block; width: 100%; text-align: left;
        background: linear-gradient(140deg, #F2B544 0%, #E36A2E 48%, #7A1E3A 100%); box-shadow: 0 10px 26px rgba(122,30,58,.28); }
.hero .glow { position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -60px; background: radial-gradient(circle, rgba(255,240,200,.55), rgba(255,240,200,0) 65%); }
.hero img { position: absolute; right: -22px; bottom: 58px; width: 104px; height: 104px; border-radius: 50%; }
.hero .eye { position: absolute; left: 16px; top: 16px; font-size: 11.5px; font-weight: 700; letter-spacing: .7px; opacity: .9; }
.hero .ht { position: absolute; left: 16px; top: 36px; width: 60%; font-size: 20px; line-height: 1.12; }
.hero .hs { position: absolute; left: 16px; top: 104px; width: 58%; font-size: 13px; line-height: 1.35; opacity: .92; }
.hero .strip { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px;
        background: rgba(70,18,30,.28); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: 12.5px; font-weight: 600; }
.hero .gbtn { background: rgba(255,255,255,.24); border: 1px solid rgba(255,255,255,.35); padding: 7px 16px; border-radius: 99px; font-weight: 700; font-size: 13px; }

/* путь */
.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: 2px; }
.chk { width: 44px; height: 44px; margin: -9px 0 0 -9px; flex: none; display: flex; align-items: center; justify-content: center; }
.chk span { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; }
.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: 600; }
.step .st { font-size: 15.5px; font-weight: 600; line-height: 1.25; }
.step.done .st { color: var(--muted); }
.step .sd { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.step .sl { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; 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: 18px; padding: 12px; margin-bottom: 8px; box-shadow: var(--shadow); }
.mat .cov { width: 56px; height: 56px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--brand); background: var(--track); }
.mat .mt { font-size: 15px; font-weight: 600; line-height: 1.25; }
.mat .mm { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.mat .mm b { color: var(--brand); font-weight: 600; }

/* страница материала */
.cover { position: relative; height: 196px; margin: -58px -15px 0; border-radius: 0 0 0 0; overflow: hidden; }
.cover .c1 { position: absolute; width: 190px; height: 190px; border-radius: 50%; left: -40px; top: 40px; background: radial-gradient(circle, rgba(255,255,255,.35), rgba(255,255,255,0) 68%); }
.cover .ce { position: absolute; left: 18px; bottom: 30px; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .7px; opacity: .9; }
.sheet { background: var(--sheet); color: var(--sheettext); border-radius: 22px 22px 0 0; margin: -16px -15px 0; padding: 18px 18px 30px; min-height: 60vh; }
.mat-h { font-size: 23px; line-height: 1.18; margin-bottom: 5px; color: var(--text); }
.meta { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--track); border-radius: 12px; padding: 3px; font-size: 13px; font-weight: 600; text-align: center; margin-bottom: 14px; }
.seg button { padding: 9px 0; border-radius: 9px; color: var(--muted); }
.seg .sel { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.seg3 { grid-template-columns: repeat(3,1fr); }
.video { aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 14px; }
.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: 22px; }
.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: 13.5px; background: var(--code); padding: 1px 5px; border-radius: 5px; }
.prose pre { background: var(--code); border: 1px solid var(--line); border-radius: 14px; padding: 34px 12px 11px; 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: 10px; top: 8px; font-family: "Medeo Sans", sans-serif; font-size: 12px; font-weight: 600; color: var(--brand); }
.agent { background: var(--code); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.agent .ah { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.agent .ah span:last-child { color: var(--brand); }
.agent pre { font-family: "Medeo Mono", monospace; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; }

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

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

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); padding: 10px 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600; z-index: 9; box-shadow: var(--shadow); }
.toast .ok { color: var(--ok); }

.fade { animation: fade .25s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade { animation: none; } .bar i { transition: none; } }
