/* ===== Смешарики — стиль сайта ===== */

:root {
  --sky-top: #aee6ff;
  --sky-bottom: #e7f9e4;
  --grass: #8fd77a;
  --ink: #2c3244;
  --ink-soft: #5b6478;
  --card: #ffffff;
  --accent: #ff8b3d;
  --accent-2: #3fb6e8;
  --radius: 24px;
  --shadow: 0 14px 34px rgba(44, 50, 68, 0.14);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 62%, var(--grass) 62%, #7ecf6a 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.55;
}

.container {
  width: min(var(--container), 92%);
  margin: 0 auto;
}

h1, h2, h3 {
  line-height: 1.15;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

button {
  font-family: inherit;
}

/* ---- облака ---- */
.sky-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cloud {
  position: absolute;
  width: 160px;
  height: 46px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50px;
  filter: blur(0.4px);
  animation: drift 46s linear infinite;
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: inherit;
  border-radius: 50%;
}

.cloud::before {
  width: 70px;
  height: 70px;
  left: 26px;
  top: -34px;
}

.cloud::after {
  width: 52px;
  height: 52px;
  right: 30px;
  top: -24px;
}

.cloud--1 { top: 10%; animation-duration: 52s; }
.cloud--2 { top: 26%; transform: scale(0.7); animation-duration: 66s; animation-delay: -20s; }
.cloud--3 { top: 46%; transform: scale(0.5); animation-duration: 80s; animation-delay: -45s; }

@keyframes drift {
  from { left: -220px; }
  to { left: 110%; }
}

/* ---- шапка ---- */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 22px rgba(44, 50, 68, 0.1);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
}

.logo__ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff9, transparent 55%), #ff8b3d;
  border: 3px solid #d17c2f;
  animation: spinBall 6s linear infinite;
}

@keyframes spinBall {
  to { transform: rotate(360deg); }
}

.nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.2s, transform 0.2s;
}

.nav a:hover {
  background: #fff;
  transform: translateY(-2px);
}

.burger {
  display: none;
  margin-left: auto;
  font-size: 24px;
  line-height: 1;
  border: 0;
  background: #fff;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

/* ---- hero ---- */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(40px, 7vw, 84px) 0 clamp(30px, 5vw, 60px);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero__eyebrow {
  display: inline-block;
  background: #fff;
  color: var(--accent-2);
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: pop 0.7s cubic-bezier(.2, 1.5, .4, 1) both;
}

.hero__title {
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 900;
  margin-top: 14px;
}

.hero__title span {
  background: linear-gradient(90deg, #ff8b3d, #ff5f9e, #3fb6e8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--ink-soft);
  font-weight: 600;
  max-width: 52ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 22px;
}

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 900;
  font-size: 16px;
  padding: 14px 26px;
  border-radius: 999px;
  transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
}

.btn:hover {
  transform: translateY(-3px) scale(1.03);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, #ff9b4d, #ff6b3d);
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 107, 61, 0.42);
}

.btn--ghost {
  background: #fff;
  color: var(--accent-2);
  box-shadow: var(--shadow);
}

/* летающие персонажи в hero */
.hero__art {
  position: relative;
  min-height: 340px;
}

.floaty {
  position: absolute;
  filter: drop-shadow(0 16px 20px rgba(44, 50, 68, 0.22));
  animation: float 5s ease-in-out infinite;
}

.floaty--1 { top: 0; left: 6%; animation-delay: 0s; }
.floaty--2 { top: 34%; left: 42%; animation-delay: -1.4s; }
.floaty--3 { top: 52%; left: 4%; animation-delay: -2.6s; }
.floaty--4 { top: 6%; right: 2%; animation-delay: -3.8s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-18px) rotate(4deg); }
}

@keyframes pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- секции ---- */
.section {
  position: relative;
  z-index: 1;
  padding: clamp(36px, 6vw, 70px) 0;
}

.section--alt {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 48px;
}

.section__title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 900;
  text-align: center;
}

.section__sub {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 700;
  margin-bottom: 30px;
}

/* появление блоков */
.section__title,
.hero-card,
.about__card,
.episode,
.fact {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2, 1.1, .3, 1);
}

.is-visible {
  opacity: 1;
  transform: none;
}

/* ---- герои ---- */
.heroes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 20px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  background: var(--card);
  border: 4px solid transparent;
  border-radius: var(--radius);
  padding: 22px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.hero-card::after {
  content: '';
  position: absolute;
  inset: auto 18px 12px;
  height: 6px;
  border-radius: 6px;
  background: var(--card-color);
  opacity: 0.35;
}

.hero-card:hover {
  transform: translateY(-8px) rotate(-1deg);
  border-color: var(--card-color);
  box-shadow: 0 20px 40px rgba(44, 50, 68, 0.2);
}

.hero-card:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
}

.hero-card .face {
  transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1);
}

.hero-card:hover .face {
  transform: scale(1.08) rotate(4deg);
}

.hero-card__name {
  font-size: 22px;
  font-weight: 900;
}

.hero-card__role {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* ---- о мультфильме ---- */
.about {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.about__card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--accent-2);
  font-weight: 600;
  color: var(--ink-soft);
}

.about__card:nth-child(2) { border-top-color: #ff5f9e; }
.about__card:nth-child(3) { border-top-color: var(--accent); }
.about__card:nth-child(4) { border-top-color: #9b8cf0; }

.about__card h3 {
  color: var(--ink);
  font-size: 20px;
}

.about__card strong {
  color: var(--ink);
}

/* ---- серии ---- */
.episodes {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 26px;
  align-items: start;
}

.episodes__list {
  display: grid;
  gap: 14px;
}

.episode {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--card);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.episode:hover {
  transform: translateX(6px);
}

.episode__num {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe6d0, #ffd0ea);
  font-weight: 900;
  color: var(--accent);
}

.episode h3 {
  font-size: 18px;
  margin-bottom: 4px;
}

.episode p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 15px;
}

.picker {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.picker__result {
  width: 100%;
  background: #fff;
  border: 4px dashed var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.picker__result h3 {
  font-size: 24px;
  color: var(--accent);
}

.picker__result p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 600;
}

/* ---- факты ---- */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.fact {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 6px 20px;
}

.fact summary {
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  font-size: 17px;
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fact summary::-webkit-details-marker {
  display: none;
}

.fact__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-2);
  flex: 0 0 auto;
  transition: transform 0.25s, background 0.25s;
}

.fact[open] .fact__dot {
  transform: rotate(180deg) scale(1.3);
  background: var(--accent);
}

.fact p {
  color: var(--ink-soft);
  font-weight: 600;
  animation: pop 0.3s ease both;
  margin-bottom: 16px;
}

/* ---- модалка ---- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 34, 50, 0.55);
  backdrop-filter: blur(4px);
}

.modal__card {
  position: relative;
  background: #fff;
  border-radius: 30px;
  padding: 34px 30px 28px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  animation: pop 0.35s cubic-bezier(.2, 1.5, .4, 1) both;
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: #ffeef4;
  color: #ff5f9e;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s;
}

.modal__close:hover {
  transform: rotate(90deg) scale(1.1);
}

.modal__card h3 {
  font-size: 30px;
  margin-top: 8px;
}

.modal__role {
  color: var(--accent-2);
  font-weight: 800;
}

.modal__desc {
  color: var(--ink-soft);
  font-weight: 600;
}

.modal__quote {
  font-style: italic;
  font-weight: 800;
  background: #fff5e8;
  border-radius: 16px;
  padding: 12px 16px;
  margin-bottom: 0;
  color: var(--accent);
}

/* ---- подвал ---- */
.footer {
  position: relative;
  z-index: 1;
  background: #3f7a3a;
  color: #eaf7e6;
  padding: 26px 0;
}

.footer__inner {
  text-align: center;
}

.footer p {
  margin: 0;
  font-weight: 700;
}

.footer__hint {
  opacity: 0.8;
  font-size: 14px;
  margin-top: 6px !important;
}

/* ---- адаптив ---- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__art {
    min-height: 260px;
    order: -1;
  }

  .episodes {
    grid-template-columns: 1fr;
  }

  .picker {
    position: static;
    order: -1;
  }
}

@media (max-width: 720px) {
  .burger {
    display: block;
  }

  .nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.97);
    padding: 12px;
    gap: 4px;
    box-shadow: var(--shadow);
    display: none;
  }

  .nav--open {
    display: flex;
  }

  .floaty .face {
    width: 96px;
    height: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .section__title,
  .hero-card,
  .about__card,
  .episode,
  .fact {
    opacity: 1;
    transform: none;
  }
}
