/* Прототип лендинга. Палитра и типографика — из ТЗ «Студия» (часть А, §2.4).
   Шрифты Lora/Golos Text не подключены: файлов OFL в проекте пока нет,
   работает запасная пара. Положить woff2 в assets/fonts и раскомментировать @font-face. */

:root {
  --paper: #f6f3ec;
  --ink: #1e2a32;
  --accent: #1f3a5f;
  --brass: #8a6430;
  --muted: #5c6b76;
  --line: #d9d2c5;
  --ok: #2f6b4f;
  --err: #a33a2f;
  --radius: 10px;
  --max: 68rem;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 "Golos Text", "Segoe UI", system-ui, sans-serif;
  padding: 0 1.25rem;
}

h1, h2, h3 {
  font-family: Lora, Georgia, serif;
  line-height: 1.2;
  margin: 0 0 .6em;
  color: var(--accent);
}
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; max-width: 70ch; }

a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--brass); }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: .6em 1em; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

.site-header {
  max-width: var(--max); margin: 0 auto; padding: 1.2rem 0;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: baseline; justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.logo { font: 700 1.25rem/1 Lora, Georgia, serif; text-decoration: none; }
.logo span { color: var(--brass); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a[aria-current="page"] { border-bottom: 2px solid var(--brass); }

main { max-width: var(--max); margin: 0 auto; padding: 2.5rem 0 1rem; }

.hero { padding: 1rem 0 2rem; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--brass); }

.block { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.block-quiet { background: #efe9dd; border-radius: var(--radius); padding: 1.5rem; margin: 1rem 0; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card { background: #fffdf8; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none;
  padding: .8em 1.2em; border-radius: var(--radius); border: 0; font: inherit; cursor: pointer;
}
.btn:hover { background: #16304f; color: #fff; }
.btn-quiet { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .5em; }

.note { color: var(--muted); font-size: .9rem; }

.form { display: grid; gap: 1rem; max-width: 34rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; }
.form input, .form select {
  font: inherit; padding: .6em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fffdf8;
}
.form input[type="checkbox"] { width: 1.2rem; height: 1.2rem; }
.check { grid-template-columns: auto 1fr; align-items: start; font-weight: 400; }

details.block { cursor: pointer; }
details summary { font-weight: 700; font-family: Lora, Georgia, serif; color: var(--accent); }

.site-footer {
  max-width: var(--max); margin: 2rem auto 0; padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem;
}

@media (max-width: 640px) {
  body { padding: 0 .9rem; font-size: 16px; }
  .site-header { justify-content: flex-start; }
  .site-header nav { gap: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- предпросмотр: языки, баннер, доска, события --- */
.lang { font-size: .85rem; letter-spacing: .05em; text-decoration: none; border: 1px solid var(--line); padding: .35em .6em; border-radius: 8px; }
.draft-banner { background: #f3e7cf; border: 1px solid #e2cfa8; color: #6b4d1e; padding: .7em .9em; border-radius: 8px; font-size: .92rem; }

.study { display: grid; gap: 1.2rem; grid-template-columns: minmax(16rem, 28rem) 1fr; align-items: start; }
@media (max-width: 780px) { .study { grid-template-columns: 1fr; } }

.board-wrap { max-width: 28rem; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1 / 1; border: 2px solid var(--accent); border-radius: 6px; overflow: hidden; }
.sq { display: grid; place-items: center; font-size: clamp(18px, 5.2vw, 40px); line-height: 1; }
.sq.light { background: #efe6d2; }
.sq.dark { background: #97abc2; }
.sq.white { color: #fffdf8; text-shadow: 0 0 1px #1e2a32, 0 0 1px #1e2a32; }
.sq.black { color: #1e2a32; }
.move-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.move-list button { font: inherit; padding: .35em .6em; border: 1px solid var(--line); background: #fffdf8; border-radius: 6px; cursor: pointer; }
.move-list button[aria-pressed="true"] { border-color: var(--accent); background: #e7eef6; font-weight: 700; }
.comment { min-height: 3em; color: var(--ink); border-left: 3px solid var(--brass); padding-left: .8em; }
.event-date { font-weight: 700; color: var(--brass); margin: 0 0 .3em; }
/* --- встраивание главы Lichess --- */
#study-embed { max-width: 100%; }

/* --- встраивание главы Lichess --- */
.study-embed { max-width: 100%; }
.study-board { max-width: 520px; margin: 0 auto; }
.study-board .ib-board-host { width: 100%; }
.study-note { margin-top: .45em; }
/* --- уроки --- */
.lesson-list { list-style: none; padding: 0; display: grid; gap: .35rem; }
.lesson-list a { text-decoration: none; }
.lesson-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(280px, 520px); gap: 1.5rem; align-items: start; }
@media (max-width: 780px) { .lesson-layout { grid-template-columns: 1fr; } }
.chapters { list-style: none; padding: 0; display: grid; gap: .3rem; max-height: 60vh; overflow: auto; }
.chapters button { width: 100%; text-align: left; font: inherit; padding: .45em .6em; border: 1px solid var(--line); background: #fffdf8; border-radius: 8px; cursor: pointer; }
.chapters button.active { border-color: var(--accent); background: #e7eef6; font-weight: 600; }
.lesson-nav { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.lesson-board-wrap { min-width: 0; }