/* Сайт приложения (site/README.md). Цвета — из приложения (ui/theme/Color.kt): «лён» и «умбра» днём, «тушь» и
   «бумага» ночью. Шрифты — системные: ни внешних шрифтов, ни скриптов, ни счётчиков. */

:root {
  color-scheme: light dark;
  --bg: #ece8e1;
  --surface: #ddd6cb;
  --text: #1e1a16;
  --muted: #5a5249;
  --accent: #6a4610;
  --line: #cbc2b6;
  --todo: #a3472f;
  --ok: #3f6b2f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0d0c;
    --surface: #1c1916;
    --text: #ede6dc;
    --muted: #cbc2b6;
    --accent: #e2c48a;
    --line: #302b26;
    --todo: #e3a58f;
    --ok: #a9cf8f;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

.page {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: Literata, Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

/* Язык — выпадающее меню без скриптов (<details>). */
details.lang { position: relative; font-size: .95rem; border: 0; padding: 0; }
details.lang > summary {
  list-style: none;
  cursor: pointer;
  padding: .3rem .75rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font: inherit;
  color: var(--text);
}
details.lang > summary::-webkit-details-marker { display: none; }
details.lang > summary::after { content: "▾"; margin-left: .4rem; color: var(--muted); }
details.lang[open] > summary { border-color: var(--accent); }
details.lang ul {
  position: absolute;
  right: 0;
  z-index: 2;
  min-width: 9rem;
  margin: .35rem 0 0;
  padding: .3rem 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .18);
}
details.lang li { margin: 0; }
details.lang li > * { display: block; padding: .4rem 1rem; text-decoration: none; }
details.lang li > span { color: var(--muted); }
details.lang li > a:hover { background: var(--surface); }

h1, h2, h3 {
  font-family: Literata, Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.25;
}
h1 { font-size: 1.9rem; margin: 2rem 0 .5rem; }
h2 { font-size: 1.35rem; margin: 2.25rem 0 .5rem; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 .25rem; }

p, ul, ol { margin: .6rem 0; }
ul, ol { padding-left: 1.3rem; }
li { margin: .3rem 0; }

a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }

.lead { font-size: 1.15rem; }
.muted, .updated { color: var(--muted); }
.updated { font-size: .95rem; margin-top: 0; }

.summary {
  background: var(--surface);
  border-radius: .75rem;
  padding: .75rem 1.25rem;
  margin: 1.25rem 0;
}

main details { border-top: 1px solid var(--line); padding: .25rem 0; }
main details:last-of-type { border-bottom: 1px solid var(--line); }
main summary {
  cursor: pointer;
  padding: .6rem 0;
  font-family: Literata, Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
}
main details > :not(summary) { margin-left: 0; }

/* Не дописано автором: такую страницу site/deploy.py не выкладывает. */
mark.todo { background: none; color: var(--todo); font-weight: 600; outline: 2px dashed var(--todo); padding: 0 .2em; }

footer.bottom {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .95rem;
  color: var(--muted);
}
footer.bottom a { margin-right: 1rem; }

/* --- Главная (body.home): шире, с картинами. Картинки — свои, в img/ (открытые обложки коллекций, site/README.md). */

.home .page { max-width: 64rem; }
.home main > section > p, .home .hint-demo figcaption { max-width: 42rem; }
.small { font-size: .9rem; }

.button {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .8rem 1.4rem;
  border-radius: 2rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 18px rgb(0 0 0 / .18);
  transition: transform .15s ease, box-shadow .15s ease;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgb(0 0 0 / .24); }
.button.ghost { background: none; color: var(--accent); border: 1px solid var(--accent); box-shadow: none; }
.play-icon { width: 1.1em; height: 1.1em; fill: currentColor; }
.stores { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.5rem 0 .75rem; }

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 1.5rem 0 1rem;
}
.eyebrow { color: var(--accent); font-size: .95rem; letter-spacing: .02em; margin: 0; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.2rem); margin: .4rem 0 .75rem; }
.hero .lead { font-size: 1.2rem; }

/* «Музейная стена»: три картины в рамах внахлёст. */
.wall { position: relative; width: 100%; max-width: 30rem; aspect-ratio: 1.3; margin: 0 auto; }
.frame {
  position: absolute;
  margin: 0;
  padding: .45rem;
  background: linear-gradient(135deg, #b48a4a, #6e4f22 55%, #c9a35f);
  border-radius: 3px;
  box-shadow: 0 14px 32px rgb(0 0 0 / .35);
}
.frame img { display: block; width: 100%; height: auto; }
.frame.f1 { width: 62%; left: 0; top: 0; transform: rotate(-2.5deg); z-index: 1; }
.frame.f2 { width: 52%; right: 0; top: 9%; transform: rotate(2deg); z-index: 2; }
.frame.f3 { width: 50%; left: 16%; bottom: 0; transform: rotate(-.5deg); z-index: 3; }

@media (min-width: 52rem) {
  .hero { grid-template-columns: 1.05fr 1fr; padding-top: 3rem; }
  .wall { max-width: none; aspect-ratio: 1.15; }
}

/* Лента эпох — прокручивается вбок. */
.epochs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(13rem, 16rem);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  margin: 1.25rem -1rem 0;
  padding: .25rem 1rem 1rem;
  list-style: none;
}
@media (min-width: 52rem) {
  .epochs { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); overflow: visible; margin: 1.25rem 0 0; padding: .25rem 0 0; gap: 1.5rem 1.25rem; }
}
.epoch {
  scroll-snap-align: start;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .92rem;
  color: var(--muted);
}
.epoch img {
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: .6rem;
  margin-bottom: .45rem;
  box-shadow: 0 6px 16px rgb(0 0 0 / .2);
}
.epoch strong {
  color: var(--text);
  font-family: Literata, Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 1.3;
}

/* Пример «На что посмотреть»: всё, кроме области, притемнено. */
.hint-demo { margin: 1.25rem 0 0; display: grid; gap: 1.25rem; align-items: center; }
.hint-picture { position: relative; overflow: hidden; border-radius: .6rem; line-height: 0; }
.hint-picture img { width: 100%; height: auto; }
.hint-region {
  position: absolute;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 200vmax rgb(0 0 0 / .45);
}
.hint-demo figcaption {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: var(--surface);
  border-radius: .75rem;
  padding: 1rem 1.25rem;
}
.hint-text { font-size: 1.05rem; }
.chip {
  align-self: flex-start;
  padding: .15rem .7rem;
  border-radius: 2rem;
  background: var(--accent);
  color: var(--bg);
  font-size: .85rem;
  font-weight: 600;
}
@media (min-width: 52rem) {
  .hint-demo { grid-template-columns: 1.2fr 1fr; }
}

/* «Кто написал?» без скриптов: ответ — radio, разбор показывает :has. */
.quiz {
  margin: 1.25rem 0 0;
  max-width: 36rem;
  background: var(--surface);
  border-radius: .75rem;
  padding: 1rem 1.25rem 1.25rem;
}
.quiz img { width: 100%; height: auto; border-radius: .5rem; display: block; }
@media (min-width: 52rem) {
  .quiz { max-width: none; display: grid; grid-template-columns: 1.3fr 1fr; gap: 0 1.5rem; align-items: start; padding: 1.25rem; }
  .quiz-try { grid-column: 1 / -1; }
  .quiz img { grid-row: span 4; }
  .quiz-q { margin-top: 0; }
}
.quiz-try { margin: 0 0 .6rem; }
.quiz-q { font-family: Literata, Georgia, "Times New Roman", serif; font-size: 1.25rem; margin: .9rem 0 .6rem; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.options input { position: absolute; opacity: 0; pointer-events: none; }
.options label {
  cursor: pointer;
  text-align: center;
  padding: .7rem .5rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--bg);
}
.options label:hover { border-color: var(--accent); }
.options input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.options input:checked + label { border-color: var(--todo); color: var(--todo); }
.quiz:has(input:checked) label.right,
.options input.right:checked + label { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.verdict { display: none; margin: .9rem 0 0; }
.quiz:has(input.right:checked) .is-right,
.quiz:has(input:not(.right):checked) .is-wrong { display: block; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .75rem;
  padding: 0;
  list-style: none;
}
.tiles li {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border-radius: .75rem;
  color: var(--muted);
}
.tiles strong { color: var(--text); font-family: Literata, Georgia, "Times New Roman", serif; font-weight: 500; font-size: 1.1rem; }

.cta { text-align: center; margin: 2.75rem 0 1rem; }
