/* «Ум в клетку»: сайт. Цвета и шрифт из design/tokens.json (одна палитра с приложением).
   Радиус один на всю страницу: --r. Тема следует за системой (светлая / тёмная). Внешних запросов нет (152-ФЗ). */

@font-face {
  font-family: "Golos Text";
  src: url("/fonts/GolosText-Variable.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --band: #eef0f3;
  --surface: #ffffff;
  --ink: #1e2230;
  --ink-2: #4f5565;
  --line: #d5d9e0;
  --blue: #1f45b5;
  --on-blue: #ffffff;
  --cell: #dce5f2;
  --marker: #fff0a0;
  --marker-strong: #ffd84d;
  --pen: #1f45b5;
  --focus: #1f45b5;
  --ring: #1f45b5;
  --r: 14px;
  --max: 1180px;
  --pad: clamp(20px, 4vw, 48px);
  --shadow: 0 1px 0 rgb(30 34 48 / 0.06), 0 18px 40px -24px rgb(31 69 181 / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d;
    --band: #181b22;
    --surface: #1d2129;
    --ink: #e9ebf0;
    --ink-2: #b7bcc8;
    --line: #343a46;
    --blue: #8db0ff;
    --on-blue: #10141c;
    --cell: #283244;
    --marker: #353019;
    --marker-strong: #4a3e12;
    --pen: #8db0ff;
    --focus: #ffd84d;
    --ring: #ffd84d;
    --shadow: 0 1px 0 rgb(0 0 0 / 0.4), 0 18px 40px -24px rgb(0 0 0 / 0.8);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.1875rem; /* 19px: аудитория 35 до 70 лет */
  line-height: 1.65;
  font-weight: 400;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: 0.2em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--blue); color: var(--on-blue); padding: 12px 18px; border-radius: var(--r); z-index: 10; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: min(100% - 2 * var(--pad), var(--max)); margin-inline: auto; }

h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.3rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); font-weight: 700; margin-bottom: 20px; }
h3 { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1em; max-width: 62ch; }
.lead { font-size: 1.3rem; line-height: 1.55; color: var(--ink-2); max-width: 36ch; }

/* ---------- шапка ---------- */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.nav { display: flex; gap: clamp(14px, 2.4vw, 32px); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 500; padding: 14px 2px; white-space: nowrap; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--blue); }
@media (max-width: 860px) { .nav { display: none; } }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 56px; padding: 0 28px;
  background: var(--blue); color: var(--on-blue);
  border: 2px solid var(--blue); border-radius: var(--r);
  font: inherit; font-weight: 700; font-size: 1.1rem; text-decoration: none; white-space: nowrap;
  transition: transform 0.12s ease;
}
a.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn[aria-disabled="true"] { background: transparent; color: var(--blue); cursor: default; }

/* ---------- первый экран ---------- */
.hero { padding-block: clamp(40px, 7vw, 88px) clamp(48px, 7vw, 96px); }
.hero .wrap { display: grid; grid-template-columns: 7fr 5fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { margin-bottom: 24px; }
.hero .lead { margin-bottom: 36px; }
.hero .btn { min-width: 240px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; } .hero .btn { width: 100%; } }

/* кроссворд из букв (графика, не снимок экрана): слова про сам сайт */
.board {
  background: #1f45b5; padding: clamp(14px, 2.4vw, 26px); border-radius: var(--r);
  box-shadow: var(--shadow); justify-self: end; width: min(100%, 470px);
}
.grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: clamp(3px, 0.6vw, 6px); }
.c {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 6px;
  background: #ffffff; color: #1f45b5;
  font-weight: 800; font-size: clamp(1rem, 2.6vw, 1.7rem); line-height: 1;
}
.c.e { background: transparent; }
.c.word { background: #fff0a0; }
.c.cur { background: #ffd84d; box-shadow: inset 0 0 0 3px #1f45b5; }
@media (prefers-reduced-motion: no-preference) {
  .c:not(.e) { animation: fill 0.5s ease backwards; animation-delay: calc(var(--i) * 45ms + 150ms); }
  @keyframes fill { from { opacity: 0; transform: scale(0.6); } }
}

/* ---------- секции ---------- */
section { padding-block: clamp(56px, 8vw, 104px); }
.band { background: var(--band); }
.sub { color: var(--ink-2); font-size: 1.2rem; max-width: 52ch; margin-bottom: 48px; }

/* реклама: два столбца текста, слово «Никогда» выделено маркером */
.ads-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 6vw, 96px); }
.ads-cols h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; margin-bottom: 18px; letter-spacing: -0.02em; }
.mark { background: var(--marker-strong); color: var(--ink); padding: 0 0.22em; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ads-cols ul { margin: 0; padding: 0; list-style: none; }
.ads-cols li { padding: 12px 0 12px 22px; position: relative; max-width: 36ch; }
.ads-cols li::before { content: ""; position: absolute; left: 0; top: 1.15em; width: 8px; height: 8px; border-radius: 2px; background: var(--blue); }
@media (max-width: 760px) { .ads-cols { grid-template-columns: 1fr; } }

/* размер шрифта: живая проба */
.size { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(28px, 5vw, 80px); align-items: center; }
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(20px, 3vw, 32px); box-shadow: var(--shadow); }
.demo fieldset { border: 0; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 10px; }
.demo legend { font-weight: 700; margin-bottom: 12px; padding: 0; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border: 2px solid var(--line); border-radius: var(--r); font-weight: 600; cursor: pointer; background: var(--bg); }
.opt input:checked + span { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--marker); color: var(--ink); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.qpanel { background: var(--cell); border-radius: var(--r); padding: 18px 20px; color: var(--ink); }
.qpanel b { display: block; font-weight: 600; line-height: 1.25; font-size: var(--q, 1.35rem); transition: font-size 0.2s ease; }
.qpanel small { display: block; margin-top: 4px; color: var(--ink-2); font-size: calc(var(--q, 1.35rem) * 0.7); transition: font-size 0.2s ease; }
@media (prefers-reduced-motion: reduce) { .qpanel b, .qpanel small { transition: none; } }
@media (max-width: 860px) { .size { grid-template-columns: 1fr; } }

/* подсказки по ступеням */
.hints { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(28px, 6vw, 96px); align-items: center; }
.hints figure { margin: 0; justify-self: center; width: min(100%, 360px); }
.hints img { border-radius: var(--r); box-shadow: var(--shadow); }
.ladder { margin: 28px 0 0; padding: 0; list-style: none; counter-reset: step; }
.ladder li { counter-increment: step; display: grid; grid-template-columns: 48px 1fr; gap: 6px 16px; padding: 14px 0; }
.ladder li::before { content: counter(step); grid-row: span 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--blue); color: var(--on-blue); font-weight: 800; font-size: 1.2rem; }
.ladder b { font-weight: 700; display: block; }
.ladder span { color: var(--ink-2); }
@media (max-width: 860px) { .hints { grid-template-columns: 1fr; } }

/* журнал: обложки разной величины и текст */
.shelf { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr 1fr; gap: 14px; align-items: end; margin-bottom: 56px; }
.cover { border-radius: var(--r); padding: 18px 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; min-height: 200px; }
.cover small { font-weight: 500; font-size: 0.95rem; opacity: 0.95; }
.cover strong { font-size: clamp(2.6rem, 6vw, 5rem); font-weight: 800; line-height: 0.95; letter-spacing: -0.03em; }
.cover:nth-child(1) { background: #1f45b5; min-height: 300px; }
.cover:nth-child(2) { background: #d2232a; min-height: 230px; }
.cover:nth-child(3) { background: #2e7d4f; min-height: 270px; }
.cover:nth-child(4) { background: #94600a; min-height: 210px; }
.cover:nth-child(5) { background: #7b3f8c; min-height: 250px; }
@media (max-width: 760px) { .shelf { grid-template-columns: repeat(2, 1fr); } .cover { min-height: 170px !important; } }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 36px clamp(28px, 6vw, 96px); }
.duo h3 { margin-bottom: 8px; }
.duo p { color: var(--ink-2); margin: 0; }
@media (max-width: 760px) { .duo { grid-template-columns: 1fr; } }

/* вопросы и ответы */
.faq { max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 20px 40px 20px 0; font-weight: 700; font-size: 1.2rem; list-style: none; position: relative; min-height: 56px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 1.8rem; font-weight: 500; color: var(--blue); line-height: 1; }
details[open] summary::after { content: "\2212"; }
details p { padding-bottom: 20px; margin: 0; color: var(--ink-2); }

/* ---------- подвал ---------- */
.foot { background: var(--band); padding-block: 56px 40px; font-size: 1rem; }
.foot .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 40px; }
.foot h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 12px; letter-spacing: 0; }
.foot ul { margin: 0; padding: 0; list-style: none; }
.foot li { margin-bottom: 4px; }
.foot a { display: inline-block; padding: 8px 0; }
.foot p { color: var(--ink-2); margin-bottom: 0.6em; font-size: 0.97rem; }
.foot .fine { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 24px; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--ink-2); }
.age { display: inline-grid; place-items: center; min-width: 44px; height: 32px; padding: 0 8px; border: 2px solid var(--ink-2); border-radius: 8px; font-weight: 800; color: var(--ink-2); }
@media (max-width: 860px) { .foot .wrap { grid-template-columns: 1fr; } }

/* ---------- юридические страницы ---------- */
.doc { padding-block: clamp(32px, 5vw, 64px) clamp(48px, 7vw, 96px); }
.doc .wrap { max-width: 860px; }
.doc h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: 8px; }
.doc h2 { font-size: 1.5rem; margin: 2.2em 0 0.6em; line-height: 1.2; }
.doc p, .doc li { max-width: 72ch; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: 0.4em; }
.doc .tw { overflow-x: auto; margin: 1.2em 0 1.6em; border: 1px solid var(--line); border-radius: var(--r); }
.doc table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.97rem; line-height: 1.45; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.doc th { background: var(--band); font-weight: 700; }
.doc tr:last-child td { border-bottom: 0; }
.crumbs { margin-bottom: 28px; font-size: 1rem; }
