/* Общее для всех страниц MathZer0: тёмно-синий экран, голубой главный цвет, карточки с мягкой рамкой.
   Здесь цвета, шрифты, шапка, кнопки, окна и нижнее меню. Своё у каждой страницы лежит в ней самой. */
/* шрифты лежат на самом сайте: Manrope для текста, STIX Two Text для формул (оба под лицензией OFL, тексты лицензий рядом с файлами) */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/manrope-cyrillic.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/manrope-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/stix-latin.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: italic; font-weight: 500; font-display: swap; src: url(/assets/fonts/stix-latin-italic.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "STIX Two Text"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/stix-greek.woff2) format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
:root {
  --bg: #07111F; --card: #0E1C33; --card2: #0B172B; --soft: #13233D; --line: #24364F;
  --ink: #F3F6FB; --text: #DCE4F0; --dim: #A7B4C8; --faint: #8091AA;
  --cyan: #19DDF0; --blue: #4BA8FF; --violet: #9B6BFF; --pink: #E38BFF; --on-cyan: #031822;
  --ok: #3FE08A; --warn: #FFD166; --bad: #FF8A8F; --track: #1A2A44;
  --ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --math: "STIX Two Text", "Cambria Math", "Times New Roman", serif;
  color-scheme: dark;
}
[hidden] { display: none !important; }
html { background: var(--bg); }
body { box-sizing: border-box; min-height: 100vh; min-height: 100dvh; margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 calc(108px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #0A1830 0, var(--bg) 420px) var(--bg); color: var(--ink);
  font-family: var(--ui); font-size: 16px; font-weight: 500; line-height: 1.45; -webkit-text-size-adjust: 100%; }
.page { box-sizing: border-box; max-width: 620px; margin-inline: auto; padding-block: 16px 24px;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 26px; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
h1 { font-weight: 800; font-size: clamp(28px, 7.8vw, 38px); line-height: 1.1; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-weight: 800; font-size: 21px; line-height: 1.2; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button, select, input { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 10px; }

/* шапка: слово MathZer0 слева, справа поиск и профиль (их добавляет site.js) */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; }
.logo { width: fit-content; font-weight: 800; font-size: 25px; letter-spacing: -.02em; line-height: 1; }
.logo i { font-style: normal; color: var(--cyan); }
.top-acts { display: flex; gap: 12px; }
.rb { box-sizing: border-box; position: relative; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background: rgba(14, 28, 51, .55); border: 1.5px solid #3B4C68; color: var(--ink); cursor: pointer; }
.rb svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rb.soon { color: #71819A; border-color: #27384F; cursor: default; }
.rb.soon::after, .mz-nav .soon::after { content: "скоро"; position: absolute; padding: 2px 5px; border-radius: 7px; font-size: 9px; font-weight: 700; line-height: 1.2; background: #16263F; color: #8FA0BA; }
.rb.soon::after { right: -7px; top: -6px; }
button.rb:active { border-color: var(--cyan); color: var(--cyan); }

.head { display: flex; flex-direction: column; gap: 8px; }
.status { font-size: 14px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.crumbs { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.crumb { font-size: 14px; font-weight: 600; color: var(--dim); }
.crumb a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
.lead { color: var(--text); max-width: 32em; text-wrap: pretty; }
.small { font-size: 14.5px; color: var(--dim); max-width: 34em; }
.m { font-family: var(--math); font-weight: 500; white-space: nowrap; }
.m i { font-style: italic; }

.card { background: linear-gradient(180deg, var(--card), var(--card2)); border: 1px solid var(--line); border-radius: 18px; }
a.card:hover { border-color: var(--cyan); }
.btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 6px 16px; border-radius: 28px;
  font-weight: 700; font-size: 15.5px; line-height: 1.15; text-align: center; cursor: pointer; }
.btn.go { background: var(--cyan); color: var(--on-cyan); border: 0; box-shadow: 0 0 26px rgba(25, 221, 240, .35); }
.btn.ghost { background: none; border: 1.5px solid #C9D3E2; color: var(--ink); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: translateY(1px); }
.chev { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tag { padding: 4px 9px; border-radius: 9px; background: var(--track); font-size: 12px; font-weight: 700; color: var(--dim); white-space: nowrap; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 14px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bar i { display: block; height: 8px; border-radius: 8px; background: #2A3A57; overflow: hidden; }
.bar i::before { content: ""; display: block; height: 100%; width: var(--w, 0%); border-radius: 8px; background: var(--cyan); box-shadow: 0 0 10px rgba(25, 221, 240, .6); transition: width .4s ease; }
.item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px; }
.item .th { width: 64px; height: 56px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; }
.item .th svg { width: 44px; height: 40px; fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.item small { display: block; font-size: 14px; color: var(--dim); }
.item b { display: block; font-weight: 700; font-size: 18px; line-height: 1.25; margin-top: 2px; }
.item .bar { margin-top: 8px; }
.ic { display: grid; place-items: center; width: 52px; height: 44px; flex: none; color: var(--cyan); }
.ic svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic em { font-family: var(--math); font-style: italic; font-weight: 500; font-size: 33px; line-height: 1; }
.ic.vio { color: var(--violet); }
.ic.vio em { background: linear-gradient(120deg, var(--pink), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 3px; }
footer { font-size: 13.5px; color: var(--faint); }

/* список шагов раздела: открытый шаг светится, остальные ждут */
.part { overflow: hidden; }
.part summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; gap: 10px; align-items: center; padding: 15px 14px 15px 16px; cursor: pointer; list-style: none; }
.part summary::-webkit-details-marker { display: none; }
.part summary b { font-weight: 700; font-size: 17px; line-height: 1.25; }
.part summary small { font-size: 13.5px; font-weight: 600; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.part summary .chev { transform: rotate(90deg); transition: transform .2s ease; stroke: var(--dim); }
.part[open] summary .chev { transform: rotate(-90deg); }
.part ol { list-style: none; padding: 0 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.part li > * { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 9px 8px; border-radius: 12px; color: var(--faint); }
.part .n { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.part li a { color: var(--ink); font-weight: 700; background: rgba(25, 221, 240, .1); box-shadow: inset 0 0 0 1px rgba(25, 221, 240, .35); }
.part li a .n { color: var(--cyan); }
.part li a em { font-style: normal; font-size: 13.5px; font-weight: 700; color: var(--cyan); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .part summary .chev { transition: none; } }

/* окна: «Как это работает» и профиль */
dialog { box-sizing: border-box; width: min(92vw, 26em); padding: 22px 20px 18px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 20px; }
dialog::backdrop { background: rgba(3, 8, 16, .72); }
dialog h2 { margin-bottom: 10px; }
dialog p { color: var(--text); margin-bottom: 10px; }
dialog p.small { color: var(--dim); margin-bottom: 2px; }
dialog .btn { margin-top: 6px; width: 100%; }
.code { font-weight: 800; font-size: 26px; letter-spacing: .03em; color: var(--cyan); -webkit-user-select: all; user-select: all; }

/* нижнее меню: одно на все страницы, его рисует site.js */
body::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 19; height: calc(104px + env(safe-area-inset-bottom, 0px)); pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 17, 31, 0), var(--bg) 62%); }
.mz-nav { box-sizing: border-box; position: fixed; z-index: 20; left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px;
  background: rgba(12, 23, 42, .95); border: 1px solid var(--line); border-radius: 26px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.mz-nav .it { box-sizing: border-box; position: relative; justify-self: center; width: min(100%, 88px); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 2px 8px; border-radius: 16px;
  font-size: 12.5px; font-weight: 600; line-height: 1.1; color: var(--text); }
.mz-nav svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mz-nav .on { color: #fff; font-weight: 700; background: linear-gradient(180deg, rgba(25, 221, 240, .32), rgba(25, 221, 240, .14));
  box-shadow: inset 0 0 0 1px rgba(25, 221, 240, .6), 0 0 18px rgba(25, 221, 240, .3); }
.mz-nav .on svg { color: var(--cyan); }
.mz-nav .soon { color: #71819A; }
.mz-nav .soon::after { top: 2px; left: 50%; margin-left: 7px; }
@media (min-width: 720px) { .mz-nav { left: 50%; right: auto; width: 620px; transform: translateX(-50%); bottom: 14px; } body { padding-bottom: 124px; } }
@media (prefers-reduced-motion: reduce) { .bar i::before { transition: none; } }
