/* «Мурлыкия» — кошачья страна знаний. Сайт полностью самостоятельный:
   без внешних шрифтов и CDN; интерактив — собственный /assets/app.js. */

:root {
  --cream: #fff7ea;      /* фон — молочный */
  --card: #ffffff;       /* карточки */
  --ink: #33241c;        /* текст — тёплый тёмно-какао */
  --sun: #ffd166;        /* жёлтый — солнышко */
  --coral: #ff8a5c;      /* оранжевый */
  --berry: #e8618c;      /* розовый */
  --teal: #2fb5a0;       /* бирюзовый */
  --sky: #59b6e8;        /* голубой */
  --leaf: #82c76b;       /* зелёный */
  --night: #4a3524;      /* подвал */
  --radius: 26px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Comic Sans MS", "Chalkboard SE", "Comfortaa", "Segoe UI", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, #ffe9b8 0 22%, transparent 42%),
    radial-gradient(circle at 88% 4%, #ffe0ea 0 18%, transparent 38%),
    var(--cream);
  min-height: 100vh;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem; }

/* ── Шапка и меню ─────────────────────────────────────────── */
.site-head {
  background: var(--sun);
  border-bottom: 4px dashed var(--coral);
  padding: 0.9rem 0 1rem;
  position: sticky;
  top: 0;
  z-index: 5;
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
    gap: 0.6rem 1.2rem;
}
.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}
nav[aria-label] { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.site-head nav a {
  text-decoration: none;
  color: var(--ink);
  background: var(--card);
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-size: 1.05rem;
}
.site-head nav a:hover, .site-head nav a:focus { border-color: var(--coral); }
.site-head nav a[aria-current="page"] {
  background: var(--coral);
  color: #fff;
  font-weight: 700;
}

/* ── Типографика ──────────────────────────────────────────── */
h1 {
  font-size: clamp(2rem, 6vw, 3.3rem);
  line-height: 1.15;
  margin: 1.4rem 0 0.4rem;
}
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); margin: 2.2rem 0 0.8rem; }
.lead { font-size: 1.3rem; max-width: 46ch; }
main { padding-bottom: 3rem; }

/* ── Картинки ─────────────────────────────────────────────── */
figure { margin: 1.4rem 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 5px solid var(--card);
  box-shadow: 0 10px 24px rgba(74, 53, 36, 0.18);
}
figcaption {
  text-align: center;
  font-size: 1rem;
  opacity: 0.75;
  margin-top: 0.5rem;
}

/* ── Плитки «выбери приключение» и сетки карточек ─────────── */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}
/* Контентные сетки: на десктопе ровно 2 колонки (узкие колонки нечитабельны),
   на телефоне — одна колонка. */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
  margin-top: 1.4rem;
}
@media (min-width: 680px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
.card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 0.7rem;
}
.tile, .card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  border: 3px solid transparent;
  box-shadow: 0 6px 16px rgba(74, 53, 36, 0.12);
}
a.tile {
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease;
}
a.tile:hover, a.tile:focus { transform: translateY(-4px); }
.tile .emoji, .card .emoji { font-size: 2.4rem; display: block; margin-bottom: 0.35rem; }
.tile strong { font-size: 1.35rem; display: block; margin-bottom: 0.3rem; }
.tile--coral  { border-color: var(--coral); }
.tile--teal   { border-color: var(--teal); }
.tile--sky    { border-color: var(--sky); }
.tile--berry  { border-color: var(--berry); }
.tile--leaf   { border-color: var(--leaf); }

.card h3 { font-size: 1.35rem; margin: 0.2rem 0 0.6rem; }
.card--no { border: 3px dashed var(--berry); background: #fff0f4; }

/* ── Чек-листы ────────────────────────────────────────────── */
ul.check, ul.taboo { list-style: none; padding: 0; margin: 0.4rem 0 0; }
ul.check li, ul.taboo li { padding-left: 2rem; position: relative; margin: 0.45rem 0; }
ul.check li::before {
  content: "✔";
  position: absolute; left: 0.15rem;
  color: var(--teal);
  font-weight: 700;
}
ul.taboo li::before {
  content: "✖";
  position: absolute; left: 0.15rem;
  color: var(--berry);
  font-weight: 700;
}

/* ── Зналки «А ты знал?» ──────────────────────────────────── */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
}
.fact {
  background: var(--sun);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  font-size: 1.05rem;
}

/* ── История ──────────────────────────────────────────────── */
.story { border-left: 10px solid var(--sky); }
.story h3 { margin-top: 0; }
.story p:last-child { margin-bottom: 0; }

/* ── Кнопка-ссылка ────────────────────────────────────────── */
.big-link {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 0.8rem 1.8rem;
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(255, 138, 92, 0.45);
}
.big-link:hover, .big-link:focus { filter: brightness(1.08); }

/* ── Подвал ───────────────────────────────────────────────── */
footer {
  background: var(--night);
  color: #ffe9cf;
  padding: 1.4rem 0 1.8rem;
  font-size: 1rem;
}
footer a { color: var(--sun); }

/* ── Интерактив ─────────────────────────────────────────────── */

/* Лапки по клику */
.paw-print {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0);
  animation: paw-pop 1.25s ease forwards;
  filter: drop-shadow(0 3px 4px rgba(74, 53, 36, 0.3));
}
/* «эхо» — лапка, пришедшая с прошлой страницы после перехода по ссылке */
.paw-print--echo { animation-duration: 2.2s; }
@keyframes paw-pop {
  0%   { opacity: 0;    transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(0); }
  22%  { opacity: 0.95; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1.18); }
  40%  { opacity: 0.95; transform: translate(-50%, -50%) rotate(var(--rot, 0deg)) scale(1); }
  78%  { opacity: 0.9;  transform: translate(-50%, -52%) rotate(var(--rot, 0deg)) scale(1); }
  100% { opacity: 0;    transform: translate(-50%, -58%) rotate(var(--rot, 0deg)) scale(1.04); }
}

/* Плитки: прыгун-иконка и вжатие (наклон — из app.js) */
.tile .emoji, .card .emoji { transition: transform 0.2s ease; }
.tile:hover .emoji, .tile:focus .emoji { animation: emoji-bounce 0.55s ease; }
@keyframes emoji-bounce {
  0%, 100% { transform: none; }
  30% { transform: translateY(-9px) rotate(-8deg); }
  60% { transform: translateY(2px) rotate(4deg); }
  80% { transform: translateY(-4px); }
}
a.tile:active { transform: translateY(-1px) scale(0.975); }

/* Моргающий кот в подвале */
footer.has-cat { position: relative; }
.footer-cat {
  position: absolute;
  bottom: calc(100% - 16px); /* лапки цепляются за край подвала */
  right: 8%;
  line-height: 0;
  pointer-events: none;
}
.cat-lids rect {
  transform-box: fill-box;
  transform-origin: 50% 0;
  transform: scaleY(0);
  animation: cat-blink 4.2s infinite;
  animation-play-state: paused;
}
/* моргает, только когда подвал в поле зрения — иначе не дождёшься */
.footer-cat.in-view .cat-lids rect { animation-play-state: running; }
@keyframes cat-blink {
  0%, 52%  { transform: scaleY(0); }
  54%, 58% { transform: scaleY(1); }
  60%      { transform: scaleY(0); }
  63%, 67% { transform: scaleY(1); }
  70%, 100% { transform: scaleY(0); }
}
@media (max-width: 640px) {
  .footer-cat { right: 3%; transform: scale(0.8); transform-origin: bottom right; }
}

/* Поглаживалка */
.pets {
  background: var(--card);
  border: 3px dashed var(--sun);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  margin-top: 2.2rem;
  box-shadow: 0 6px 16px rgba(74, 53, 36, 0.12);
}
.pets-inner { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.pets-cat { font-size: 3.4rem; line-height: 1; user-select: none; }
.pets-cat.is-happy { animation: pet-squish 0.5s ease; }
@keyframes pet-squish {
  0%, 100% { transform: none; }
  35% { transform: scale(1.25) rotate(-6deg); }
  70% { transform: scale(0.92) rotate(4deg); }
}
.pets-box { flex: 1; min-width: 220px; }
.pets-btn {
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: var(--coral);
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.6rem;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(255, 138, 92, 0.45);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.pets-btn:hover, .pets-btn:focus { filter: brightness(1.08); }
.pets-btn:active { transform: scale(0.94); box-shadow: 0 3px 8px rgba(255, 138, 92, 0.4); }
.pets-msg { margin: 0.5rem 0 0; opacity: 0.85; font-size: 1.05rem; }
.pets-sound {
  font-size: 1.5rem;
  background: none;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}
.pets-sound:hover, .pets-sound:focus { border-color: var(--coral); }

/* Уважаем просителей тишины и покоя */
@media (prefers-reduced-motion: reduce) {
  .paw-print, .cat-lids rect, .pets-cat.is-happy,
  .tile:hover .emoji, .tile:focus .emoji { animation: none !important; }
  .paw-print { display: none; }
  a.tile, .pets-btn { transition: none; }
}
