/* Сайт maribooks.ru — в стиле приложения: тёплая «бумага», слива, плитки bento, Onest + Literata */

@font-face { font-family: Onest; src: url(/fonts/onest-cyrillic.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: Onest; src: url(/fonts/onest-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; 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: Literata; src: url(/fonts/literata-cyrillic.woff2) format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: Literata; src: url(/fonts/literata-latin.woff2) format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }
@font-face { font-family: Literata; font-style: italic; src: url(/fonts/literata-italic-cyrillic.woff2) format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+301, U+400-45F, U+490-491, U+4B0-4B1, U+2116; }
@font-face { font-family: Literata; font-style: italic; src: url(/fonts/literata-italic-latin.woff2) format('woff2'); font-weight: 200 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD; }

:root {
  color-scheme: light dark;

  --plum-50: oklch(0.975 0.012 305);
  --plum-100: oklch(0.945 0.028 305);
  --plum-200: oklch(0.89 0.055 305);
  --plum-300: oklch(0.81 0.095 305);
  --plum-400: oklch(0.71 0.145 305);
  --plum-500: oklch(0.61 0.18 303);
  --plum-600: oklch(0.53 0.19 302);
  --plum-700: oklch(0.46 0.17 302);
  --plum-800: oklch(0.39 0.14 302);
  --plum-900: oklch(0.33 0.11 302);
  --plum-950: oklch(0.25 0.08 302);

  --bg: oklch(0.982 0.006 80);
  --surface: oklch(0.958 0.011 75);
  --surface-high: oklch(0.938 0.013 75);
  --border: oklch(0.91 0.012 75);
  --text: oklch(0.21 0.012 300);
  --text-toned: oklch(0.4 0.012 300);
  --text-muted: oklch(0.53 0.012 300);
  --accent: var(--plum-600);
  --accent-text: var(--plum-700);
  --on-accent: #fff;

  --tint-plum: oklch(0.945 0.03 305);
  --tint-amber: oklch(0.955 0.045 85);
  --tint-sage: oklch(0.945 0.035 150);
  --tint-sky: oklch(0.945 0.028 240);
  --ink-plum: var(--plum-800);
  --ink-amber: oklch(0.47 0.11 70);
  --ink-sage: oklch(0.43 0.09 155);
  --ink-sky: oklch(0.44 0.1 245);

  --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .28 0 0 0 0 .18 .32 0 0 0 -.09'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  --radius-tile: 28px;
  --ease-emphasized: cubic-bezier(0.2, 0, 0, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(0.17 0.008 300);
    --surface: oklch(0.215 0.012 300);
    --surface-high: oklch(0.25 0.014 300);
    --border: oklch(0.29 0.012 300);
    --text: oklch(0.96 0.006 300);
    --text-toned: oklch(0.82 0.01 300);
    --text-muted: oklch(0.68 0.012 300);
    --accent: var(--plum-300);
    --accent-text: var(--plum-200);
    --on-accent: var(--plum-950);

    --tint-plum: oklch(0.255 0.045 305);
    --tint-amber: oklch(0.255 0.035 70);
    --tint-sage: oklch(0.245 0.03 155);
    --tint-sky: oklch(0.245 0.035 250);
    --ink-plum: var(--plum-200);
    --ink-amber: oklch(0.85 0.1 80);
    --ink-sage: oklch(0.84 0.09 155);
    --ink-sky: oklch(0.84 0.08 245);

    --paper-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 .95 0 0 0 0 .9 .2 0 0 0 -.06'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--bg) var(--paper-grain);
  color: var(--text);
  font: 400 17px/1.6 Onest, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 0.92em; }
:focus-visible { outline: 3px solid var(--plum-400); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.icon { width: 24px; height: 24px; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- Шапка и подвал --- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.top nav { display: flex; align-items: center; gap: 6px; }
.top nav a:not(.btn) {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-toned);
  font-weight: 500;
  text-decoration: none;
}
.top nav a:not(.btn):hover { background: var(--surface); color: var(--text); }
@media (max-width: 560px) {
  .top nav a:not(.btn) { display: none; }
}

.foot {
  margin-top: 96px;
  padding-block: 32px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 15px;
}
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--text-toned); }

/* --- Кнопки --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 999px;
  font: 600 16px/1.2 Onest, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s var(--ease-emphasized), background-color 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 88%, var(--text)); }
.btn.tonal { background: var(--surface-high); color: var(--text); }
.btn.small { min-height: 40px; padding: 8px 16px; font-size: 15px; }
.btn.large { min-height: 56px; padding: 14px 28px; font-size: 18px; }
.btn[aria-disabled='true'] { background: transparent; color: var(--text-muted); box-shadow: inset 0 0 0 1.5px var(--border); cursor: default; }
.btn[aria-disabled='true']:active { transform: none; }

/* --- Первый экран --- */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 32px;
  padding-block: 40px 56px;
}
.eyebrow {
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin-top: 14px;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 800;
}
.hero h1 em {
  font-family: Literata, Georgia, serif;
  font-weight: 500;
  font-style: italic;
  color: var(--accent-text);
}
.lead {
  max-width: 34em;
  margin-top: 20px;
  color: var(--text-toned);
  font-size: 19px;
}
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.meta { margin-top: 14px; color: var(--text-muted); font-size: 15px; }

.hero-mari { position: relative; display: grid; justify-items: center; }
/* Картинка — как адаптивная иконка, с полями вокруг: крупнее и с отрицательными отступами */
.hero-mari .mari {
  width: min(500px, 100%);
  aspect-ratio: 1;
  margin-block: -56px -48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bubble {
  position: relative;
  z-index: 1;
  max-width: 300px;
  padding: 14px 18px;
  border-radius: 22px 22px 22px 6px;
  background: var(--surface-high);
  color: var(--text);
  font-family: Literata, Georgia, serif;
  font-size: 17px;
  line-height: 1.45;
  justify-self: start;
  margin-left: 8%;
  animation: bubble-in 0.6s 0.9s var(--ease-emphasized) both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(10px) scale(0.96); } }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 8px; gap: 0; }
  .hero-mari { order: -1; }
  .hero-mari .mari { width: 260px; margin-top: -28px; margin-bottom: -16px; }
  .bubble { justify-self: center; margin-left: 0; font-size: 16px; border-radius: 22px 22px 22px 6px; }
}

/* --- Разделы --- */
.section { margin-top: 96px; }
.section-head { max-width: 40em; margin-bottom: 32px; }
.section-head h2 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 800; }
.section-head p { margin-top: 12px; color: var(--text-toned); font-size: 18px; }

/* --- Плитки возможностей --- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 26px;
  border-radius: var(--radius-tile);
  background: var(--surface);
}
.tile.wide { grid-column: span 2; }
.tile h3 { font-size: 21px; font-weight: 700; }
.tile p { color: var(--text-toned); font-size: 16px; }
.tile .badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: color-mix(in oklab, var(--ink) 14%, transparent);
  color: var(--ink);
}
.tint-plum { background: var(--tint-plum); --ink: var(--ink-plum); }
.tint-amber { background: var(--tint-amber); --ink: var(--ink-amber); }
.tint-sage { background: var(--tint-sage); --ink: var(--ink-sage); }
.tint-sky { background: var(--tint-sky); --ink: var(--ink-sky); }

.sample-quote {
  margin: 8px 0 0;
  padding: 18px 20px;
  border-radius: 20px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  border-left: 4px solid var(--ink);
}
.sample-quote blockquote {
  margin: 0;
  font: italic 500 20px/1.4 Literata, Georgia, serif;
}
.sample-quote figcaption { margin-top: 6px; color: var(--text-muted); font-size: 14px; }

@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .bento { grid-template-columns: 1fr; }
  .tile.wide { grid-column: auto; }
  .tile { padding: 22px; }
}

/* --- Снимки экрана --- */
.screens {
  display: flex;
  gap: 20px;
  margin-inline: -16px;
  padding: 8px 16px 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.screens figure {
  flex: none;
  width: 240px;
  margin: 0;
  scroll-snap-align: center;
}
.screens img {
  width: 100%;
  height: auto;
  border-radius: 30px;
  border: 6px solid var(--text);
  background: var(--surface);
  box-shadow: 0 18px 40px -18px oklch(0.25 0.08 302 / 0.45);
}
.screens figcaption { margin-top: 12px; color: var(--text-toned); font-size: 15px; text-align: center; }
/* На широком экране все снимки в ряд, в пределах колонки */
@media (min-width: 1100px) {
  .screens { justify-content: center; overflow: visible; margin-inline: 0; padding-inline: 0; }
  .screens figure { flex: 1 1 0; width: auto; max-width: 240px; }
}

/* --- Приватность --- */
.privacy-band {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 32px;
  padding: 40px;
  border-radius: 36px;
  background: linear-gradient(135deg, var(--plum-700), var(--plum-900));
  color: #fff;
}
.privacy-band h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.privacy-band > div > p { margin-top: 12px; color: rgb(255 255 255 / 0.82); }
.privacy-band ul { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.privacy-band li { display: flex; gap: 14px; align-items: flex-start; }
.privacy-band li .icon { margin-top: 2px; color: var(--plum-200); }
.privacy-band li strong { display: block; }
.privacy-band li span { color: rgb(255 255 255 / 0.8); font-size: 16px; }
.privacy-band a { color: #fff; }
@media (max-width: 820px) {
  .privacy-band { grid-template-columns: 1fr; padding: 28px 22px; border-radius: 28px; }
}

/* --- Скачать --- */
.download {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.download .tile { padding: 30px; }
.download .version { color: var(--text-muted); font-size: 15px; }
.download h3 { font-size: 26px; }
.steps { display: grid; gap: 12px; margin: 6px 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: flex; gap: 14px; color: var(--text-toned); }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-high);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.fingerprint { display: grid; gap: 6px; }
.fingerprint + .fingerprint { margin-top: 10px; }
.fingerprint dt { color: var(--text-toned); font-size: 15px; font-weight: 600; }
.fingerprint dd {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
}
.fingerprint code {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in oklab, var(--bg) 70%, transparent);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-all;
}
.copy {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-toned);
  cursor: pointer;
}
.copy:hover { background: var(--surface-high); color: var(--text); }
.copy.done { color: var(--ink-sage); }
.copy .i-done, .copy.done .i-copy { display: none; }
.copy.done .i-done { display: block; }
.note { color: var(--text-muted); font-size: 15px; }
@media (max-width: 820px) {
  .download { grid-template-columns: 1fr; }
  .download .tile { padding: 24px 20px; }
}

/* --- Вопросы --- */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details {
  border-radius: 22px;
  background: var(--surface);
}
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform 0.2s var(--ease-emphasized); color: var(--text-muted); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--text-toned); }

/* --- Документы и выпуски --- */
.doc { max-width: 760px; padding-top: 24px; }
.doc h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; }
.doc .edition { margin-top: 10px; color: var(--text-muted); }
.doc h2 { margin-top: 40px; font-size: 24px; font-weight: 700; }
.doc p, .doc ul { margin-top: 14px; color: var(--text-toned); }
.doc ul { padding-left: 22px; }
.doc li + li { margin-top: 6px; }
.doc strong { color: var(--text); }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; color: var(--text-toned); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--text); }

.release { margin-top: 28px; padding: 26px; border-radius: var(--radius-tile); background: var(--surface); }
.release h2 { margin: 0; font-size: 24px; }
.release .version { margin-top: 4px; color: var(--text-muted); font-size: 15px; }
.release dl { margin: 18px 0 0; }

.notfound { display: grid; justify-items: center; gap: 16px; padding-top: 40px; text-align: center; }
.notfound .mari { width: 240px; height: 240px; }
.notfound h1 { font-size: 40px; font-weight: 800; }
.notfound p { color: var(--text-toned); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .bubble { animation: none; }
  .mari * { animation: none !important; }
}

/* Не scoped: части картинки приходят через v-html */
.mari svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
/* Голова и задний слой волос поворачиваются вместе вокруг шеи */
.mari .m-head,
.mari .m-hair-back {
  transform-box: view-box;
  transform-origin: 512px 560px;
}
.mari .m-eye-l,
.mari .m-eye-r {
  transform-box: fill-box;
  transform-origin: 50% 60%;
}
.mari .m-eyes-read,
.mari .m-spark {
  transform-box: fill-box;
  transform-origin: center;
}
/* Рука — от запястья, руки при аплодисментах — от локтя */
.mari .m-hand {
  transform-box: view-box;
  transform-origin: 0 0;
}
.mari .m-arm-l {
  transform-box: view-box;
  transform-origin: 362px 905px;
}
.mari .m-arm-r {
  transform-box: view-box;
  transform-origin: 662px 905px;
}

/* read — по кругу 9 с: читает, водит глазами, поднимает взгляд, дважды моргает, снова читает */
.mari-read .m-book { animation: mari-read-book 9s ease-in-out infinite; }
.mari-read .m-head,
.mari-read .m-hair-back { animation: mari-read-head 9s ease-in-out infinite; }
.mari-read .m-brows { animation: mari-read-brows 9s ease-in-out infinite; }
.mari-read .m-eyes-read { animation: mari-read-down 9s linear infinite, mari-scan 1.6s ease-in-out infinite alternate; }
.mari-read .m-mouth-read { animation: mari-read-down 9s linear infinite; }
.mari-read .m-eyes-look,
.mari-read .m-mouth-look { animation: mari-read-up 9s linear infinite; }
.mari-read .m-eye-l,
.mari-read .m-eye-r { animation: mari-read-blink 9s linear infinite; }
@keyframes mari-read-book { 0%, 50% { transform: none; } 56%, 84% { transform: translateY(16px); } 90%, 100% { transform: none; } }
@keyframes mari-read-head { 0%, 50% { transform: none; } 56%, 84% { transform: rotate(-3deg) translateY(-6px); } 90%, 100% { transform: none; } }
@keyframes mari-read-brows { 0%, 52% { transform: none; } 57%, 84% { transform: translateY(-10px); } 89%, 100% { transform: none; } }
@keyframes mari-read-down { 0%, 53% { opacity: 1; } 54%, 86% { opacity: 0; } 87%, 100% { opacity: 1; } }
@keyframes mari-read-up { 0%, 53% { opacity: 0; } 54%, 86% { opacity: 1; } 87%, 100% { opacity: 0; } }
@keyframes mari-read-blink { 0%, 64% { transform: none; } 65.5% { transform: scaleY(0.1); } 67%, 77% { transform: none; } 78.5% { transform: scaleY(0.1); } 80%, 100% { transform: none; } }
@keyframes mari-scan { from { transform: translateX(-4px); } to { transform: translateX(4px); } }

/* peek — 5 с один раз: опускает книгу, смотрит, моргает, подмигивает, читает дальше */
.mari-peek .m-book { animation: mari-peek-book 5s ease-in-out both; }
.mari-peek .m-head,
.mari-peek .m-hair-back { animation: mari-peek-head 5s ease-in-out both; }
.mari-peek .m-brows { animation: mari-peek-brows 5s ease-in-out both; }
.mari-peek .m-eyes-read,
.mari-peek .m-mouth-read { animation: mari-peek-down 5s linear both; }
.mari-peek .m-eyes-look,
.mari-peek .m-mouth-look { animation: mari-peek-up 5s linear both; }
.mari-peek .m-eye-l { animation: mari-peek-blink 5s linear both; }
.mari-peek .m-eye-r { animation: mari-peek-wink 5s linear both; }
@keyframes mari-peek-book { 0%, 8% { transform: none; } 18%, 70% { transform: translateY(72px); } 82%, 100% { transform: none; } }
@keyframes mari-peek-head { 0%, 10% { transform: none; } 20%, 70% { transform: rotate(-3deg) translateY(-6px); } 82%, 100% { transform: none; } }
@keyframes mari-peek-brows { 0%, 12% { transform: none; } 20%, 70% { transform: translateY(-10px); } 78%, 100% { transform: none; } }
@keyframes mari-peek-down { 0%, 13% { opacity: 1; } 14%, 73% { opacity: 0; } 74%, 100% { opacity: 1; } }
@keyframes mari-peek-up { 0%, 13% { opacity: 0; } 14%, 73% { opacity: 1; } 74%, 100% { opacity: 0; } }
@keyframes mari-peek-blink { 0%, 34% { transform: none; } 36% { transform: scaleY(0.1); } 38%, 100% { transform: none; } }
@keyframes mari-peek-wink { 0%, 34% { transform: none; } 36% { transform: scaleY(0.1); } 38%, 50% { transform: none; } 52%, 58% { transform: scaleY(0.1); } 60%, 100% { transform: none; } }

/* wave — 5,2 с один раз: опускает книгу, отпускает её одной рукой и машет */
.mari-wave .m-book { animation: mari-wave-book 5.2s ease-in-out both; }
.mari-wave .m-head,
.mari-wave .m-hair-back { animation: mari-wave-head 5.2s ease-in-out both; }
.mari-wave .m-brows { animation: mari-wave-brows 5.2s ease-in-out both; }
.mari-wave .m-eyes-read,
.mari-wave .m-mouth-read { animation: mari-wave-down 5.2s linear both; }
.mari-wave .m-eyes-look,
.mari-wave .m-mouth-look { animation: mari-wave-up 5.2s linear both; }
.mari-wave .m-fingers-l { animation: mari-wave-fingers 5.2s linear both; }
.mari-wave .m-hand { animation: mari-wave-hand 5.2s ease-in-out both; }
.mari-wave .m-eye-l,
.mari-wave .m-eye-r { animation: mari-wave-blink 5.2s linear both; }
@keyframes mari-wave-book { 0%, 6% { transform: none; } 16%, 74% { transform: translateY(72px); } 86%, 100% { transform: none; } }
@keyframes mari-wave-head { 0%, 8% { transform: none; } 18%, 74% { transform: rotate(-3deg) translateY(-6px); } 86%, 100% { transform: none; } }
@keyframes mari-wave-brows { 0%, 10% { transform: none; } 18%, 74% { transform: translateY(-10px); } 82%, 100% { transform: none; } }
@keyframes mari-wave-down { 0%, 11% { opacity: 1; } 12%, 77% { opacity: 0; } 78%, 100% { opacity: 1; } }
@keyframes mari-wave-up { 0%, 11% { opacity: 0; } 12%, 77% { opacity: 1; } 78%, 100% { opacity: 0; } }
@keyframes mari-wave-fingers { 0%, 12% { opacity: 1; } 16%, 70% { opacity: 0; } 74%, 100% { opacity: 1; } }
@keyframes mari-wave-hand {
  0%, 12% { opacity: 0; transform: translateY(150px) rotate(0deg); }
  22% { opacity: 1; transform: translateY(0) rotate(0deg); }
  28% { transform: translateY(0) rotate(-16deg); }
  34% { transform: translateY(0) rotate(12deg); }
  40% { transform: translateY(0) rotate(-16deg); }
  46% { transform: translateY(0) rotate(12deg); }
  52% { transform: translateY(0) rotate(-10deg); }
  58%, 62% { opacity: 1; transform: translateY(0) rotate(0deg); }
  72%, 100% { opacity: 0; transform: translateY(150px) rotate(0deg); }
}
@keyframes mari-wave-blink { 0%, 48% { transform: none; } 50% { transform: scaleY(0.1); } 52%, 100% { transform: none; } }

/* clap — по кругу 3,4 с: три хлопка, пауза с улыбкой; звёздочки вспыхивают вразнобой */
.mari-clap .m-arm-l { animation: mari-clap-l 3.4s ease-in-out infinite; }
.mari-clap .m-arm-r { animation: mari-clap-r 3.4s ease-in-out infinite; }
.mari-clap .m-eye-l,
.mari-clap .m-eye-r { animation: mari-clap-blink 3.4s linear infinite; }
.mari-clap .m-spark { animation: mari-spark 1.8s ease-in-out infinite both; }
.mari-clap .m-spark-1 { animation-delay: -0.6s; }
.mari-clap .m-spark-2 { animation-delay: -1.2s; }
.mari-clap .m-spark-3 { animation-delay: -0.3s; }
.mari-clap .m-spark-4 { animation-delay: -0.9s; }
.mari-clap .m-spark-5 { animation-delay: -1.5s; }
@keyframes mari-clap-l { 0% { transform: none; } 7% { transform: rotate(-9deg); } 13% { transform: none; } 20% { transform: rotate(-9deg); } 26% { transform: none; } 33% { transform: rotate(-9deg); } 39%, 100% { transform: none; } }
@keyframes mari-clap-r { 0% { transform: none; } 7% { transform: rotate(9deg); } 13% { transform: none; } 20% { transform: rotate(9deg); } 26% { transform: none; } 33% { transform: rotate(9deg); } 39%, 100% { transform: none; } }
@keyframes mari-clap-blink { 0%, 68% { transform: none; } 70% { transform: scaleY(0.1); } 72%, 100% { transform: none; } }
@keyframes mari-spark {
  0% { opacity: 0; transform: scale(0) rotate(0deg); }
  35% { opacity: 1; transform: scale(1.15) rotate(30deg); }
  65% { opacity: 1; transform: scale(0.9) rotate(60deg); }
  100% { opacity: 0; transform: scale(0) rotate(90deg); }
}

/* Сезонные наряды: в картинках скрыты атрибутом display, включает тема оформления.
   Наряд появляется — шапка падает сверху (анимация стартует, когда элемент становится видимым:
   при открытии экрана и при смене темы), шарф проявляется на месте */
html[data-season="winter"] .mari .m-winter,
html[data-season="spring"] .mari .m-spring,
html[data-season="summer"] .mari .m-summer,
html[data-season="autumn"] .mari .m-autumn {
  display: inline;
}
html[data-season] .mari:not(.mari-undressed) .m-clip {
  display: none;
}
.mari .m-season {
  animation: mari-dress 0.7s cubic-bezier(0.2, 0, 0, 1) both;
}
.mari .m-scarf {
  animation-name: mari-fade;
}
.mari-undressed .m-season {
  animation: none;
  opacity: 0;
}
@keyframes mari-dress { from { opacity: 0; transform: translateY(-90px); } }
@keyframes mari-fade { from { opacity: 0; } }

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