/* ================================================================
   Инклюзивная платформа — базовые стили.

   Цель: мгновенная загрузка на старом телефоне и медленном 3G.
   Поэтому: ни одного внешнего шрифта, ни одной анимации,
   один CSS-файл, ноль зависимостей.
   ================================================================ */

:root {
  --bg: #ffffff;
  --surface: #f5f7fa;
  --text: #1a1d21;
  --muted: #4a5259;
  --accent: #0b5d3b;
  --accent-text: #ffffff;
  --border: #d4dae0;
  --focus: #0b5d3b;
  --radius: 10px;
  --font: 17px;
  --line: 1.65;
  --maxw: 900px;
}

/* --- Профиль: слабовидящие --- */
body.p-vision {
  --bg: #000000;
  --surface: #101010;
  --text: #ffe600;
  --muted: #ffe600;
  --accent: #ffe600;
  --accent-text: #000000;
  --border: #ffe600;
  --focus: #ffe600;
  --font: 26px;
  --line: 1.9;
}
body.p-vision img { filter: grayscale(1) contrast(1.4); }

/* --- Профиль: аутизм / РАС --- */
body.p-calm {
  --bg: #f4f1ec;
  --surface: #ebe6de;
  --text: #3d3a35;
  --muted: #6a655d;
  --accent: #7d8c7a;
  --accent-text: #ffffff;
  --border: #d6cfc4;
  --focus: #7d8c7a;
}
body.p-calm img,
body.p-calm .decor { display: none !important; }
body.p-calm .card { box-shadow: none; }

/* --- Профиль: эпилепсия --- */
body.p-epilepsy *,
body.p-epilepsy *::before,
body.p-epilepsy *::after {
  animation: none !important;
  transition: none !important;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: var(--font);
  line-height: var(--line);
}

/* Фокус виден всегда — для тех, кто ходит по сайту с клавиатуры */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

/* Переход к содержимому — для скринридеров и клавиатуры */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-text);
  padding: 12px 20px;
  z-index: 100;
}
.skip:focus { left: 0; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }

/* --- Шапка --- */
header.site {
  background: var(--surface);
  border-bottom: 2px solid var(--border);
}
.bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 0; }
.brand { font-weight: 700; font-size: 1.15em; color: var(--text); text-decoration: none; }
nav.main { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
nav.main a {
  color: var(--text);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: var(--radius);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
}
nav.main a[aria-current="page"] { background: var(--accent); color: var(--accent-text); font-weight: 700; }
nav.main a:hover { text-decoration: underline; }

.langs { display: flex; gap: 4px; }
.langs button {
  min-width: 52px; min-height: 48px;
  border: 2px solid var(--border);
  background: var(--bg); color: var(--text);
  border-radius: var(--radius);
  font: inherit; font-weight: 700; cursor: pointer;
}
.langs button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

/* --- Содержимое --- */
main { padding: 28px 0 60px; }
h1 { font-size: 1.9em; line-height: 1.25; margin: 0 0 14px; }
h2 { font-size: 1.4em; line-height: 1.3; margin: 34px 0 12px; }
h3 { font-size: 1.15em; margin: 0 0 8px; }
p { margin: 0 0 14px; max-width: 68ch; }
.lead { font-size: 1.1em; color: var(--muted); }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { margin-top: 0; }
.card p { margin-bottom: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  background: var(--accent); color: var(--accent-text);
  border: 2px solid var(--accent); border-radius: var(--radius);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.secondary { background: var(--bg); color: var(--text); border-color: var(--border); }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li {
  counter-increment: s;
  border: 2px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 16px 62px; margin-bottom: 12px; position: relative;
  background: var(--surface);
}
.steps li::before {
  content: counter(s);
  position: absolute; left: 16px; top: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-text);
  display: grid; place-items: center; font-weight: 700;
}

/* --- Видео --- */
.player { width: 100%; background: #000; border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.player video { width: 100%; display: block; }
.controls { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; align-items: center; }
.controls label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
select {
  min-height: 48px; padding: 0 12px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit;
}

.note {
  border-left: 6px solid var(--accent);
  background: var(--surface);
  padding: 14px 16px; margin: 18px 0; border-radius: 0 var(--radius) var(--radius) 0;
}

/* --- Форма --- */
form .field { margin-bottom: 18px; }
form label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], input[type="tel"], textarea {
  width: 100%; min-height: 52px; padding: 12px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 130px; resize: vertical; }
.hint { color: var(--muted); font-size: .95em; margin-top: 4px; }
.ok {
  border: 2px solid var(--accent); background: var(--surface);
  padding: 16px; border-radius: var(--radius); font-weight: 700;
}

/* --- Панель доступности --- */
.a11y-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 60;
  min-height: 60px; min-width: 60px; padding: 0 18px;
  border-radius: 999px; border: 3px solid var(--accent-text);
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.a11y-panel {
  position: fixed; right: 16px; bottom: 88px; z-index: 61;
  width: min(340px, calc(100vw - 32px));
  max-height: 78vh; overflow-y: auto;
  background: var(--bg); color: var(--text);
  border: 3px solid var(--accent); border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 26px rgba(0,0,0,.3);
}
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { margin: 0 0 12px; font-size: 1.15em; }
.a11y-panel .opt {
  display: block; width: 100%; text-align: left;
  min-height: 54px; padding: 12px 14px; margin-bottom: 8px;
  border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer;
}
.a11y-panel .opt[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700;
}
.a11y-panel .opt small { display: block; font-weight: 400; opacity: .85; }
.a11y-row { display: flex; gap: 8px; margin-bottom: 8px; }
.a11y-row button { flex: 1; min-height: 52px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }

footer.site { border-top: 2px solid var(--border); background: var(--surface); padding: 22px 0; color: var(--muted); }
footer.site p { margin: 0 0 6px; }

/* Телефон */
@media (max-width: 640px) {
  nav.main { width: 100%; margin-left: 0; }
  nav.main a { flex: 1 1 44%; justify-content: center; }
  h1 { font-size: 1.55em; }
}

/* Уважаем системную настройку «меньше движения» */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
