:root {
  --blue-900: #062a63;
  --blue-800: #0b3f8f;
  --blue-700: #1157b8;
  --blue-600: #1b6fd6;
  --blue-400: #57a9ff;
  --ink: #0e2246;
  --card: rgba(255, 255, 255, 0.93);
  --yellow: #ffd23f;
  --radius: 24px;
  --shadow: 0 18px 40px rgba(3, 20, 55, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Nunito", system-ui, -apple-system, sans-serif;
  color: #f2f7ff;
  background: linear-gradient(180deg, var(--blue-700) 0%, var(--blue-800) 45%, var(--blue-900) 100%);
  overflow-x: hidden;
}

/* фоновые смешарики */
.bg-float {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-float .ghost {
  position: absolute;
  opacity: 0.4;
  filter: drop-shadow(0 8px 16px rgba(2, 14, 40, 0.4));
  animation: bob 9s ease-in-out infinite;
}
.bg-float .ghost svg { display: block; width: 100%; height: 100%; }

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

main, .site-header, .site-footer { position: relative; z-index: 1; }

/* шапка */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  background: rgba(6, 34, 79, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 255, 255, 0.14);
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.logo__ball {
  width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, #9fe0ff, var(--blue-600));
  border: 2px solid #fff;
  animation: spinPulse 6s linear infinite;
}
@keyframes spinPulse { 50% { transform: scale(1.15); } }
.nav { display: flex; gap: clamp(0.5rem, 2vw, 1.4rem); flex-wrap: wrap; }
.nav a {
  color: #dbe9ff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  transition: 0.2s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.16); }
.nav__cta { background: var(--yellow); color: var(--ink) !important; }
.nav__cta:hover { background: #ffe47a !important; }

/* герой */
.hero { padding: clamp(3rem, 9vw, 6rem) clamp(1rem, 5vw, 2rem) 2rem; }
.hero__inner { max-width: 900px; margin: 0 auto; text-align: center; }
.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 7vw, 4.4rem);
  line-height: 1.05;
  text-shadow: 0 6px 24px rgba(2, 14, 40, 0.55);
}
.hero__lead {
  margin: 1.4rem auto 0;
  max-width: 720px;
  font-size: clamp(1rem, 2.4vw, 1.18rem);
  line-height: 1.65;
  color: #dbe9ff;
}
.hero__actions { margin-top: 1.8rem; display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-3px); }
.btn--primary { background: var(--yellow); color: var(--ink); box-shadow: 0 10px 24px rgba(255, 210, 63, 0.35); }
.btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border: 2px solid rgba(255, 255, 255, 0.5); }

.facts {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem;
  padding: 0;
  margin: 3rem auto 0;
  max-width: 900px;
}
.facts li {
  background: var(--card);
  color: var(--ink);
  border-radius: 18px;
  padding: 1rem 0.7rem;
  box-shadow: var(--shadow);
}
.facts strong { display: block; font-size: 1.25rem; color: var(--blue-700); }
.facts span { font-size: 0.85rem; color: #4a5b7a; }

/* секции */
.section { max-width: 1180px; margin: 0 auto; padding: clamp(2.5rem, 7vw, 4.5rem) clamp(1rem, 4vw, 2rem); }
.section__title {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  text-align: center;
  text-shadow: 0 4px 18px rgba(2, 14, 40, 0.5);
}
.section__sub { text-align: center; max-width: 640px; margin: 0.8rem auto 2.4rem; color: #cfe2ff; line-height: 1.6; }

/* карточки персонажей */
.chars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.4rem;
}
.char {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.4rem 1.3rem 1.5rem;
  box-shadow: var(--shadow);
  border-top: 8px solid var(--c, var(--blue-600));
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}
.char:hover { transform: translateY(-8px) rotate(-0.6deg); }
.char__art { width: 132px; height: 132px; margin: 0 auto; transition: transform 0.25s; }
.char:hover .char__art { transform: scale(1.08) rotate(3deg); }
.char__art svg { width: 100%; height: 100%; display: block; }
.char h3 { margin: 0.7rem 0 0.2rem; font-size: 1.5rem; }
.char__role { margin: 0; font-size: 0.9rem; color: var(--blue-700); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }
.char__desc { font-size: 0.95rem; line-height: 1.55; color: #33456b; margin: 0.75rem 0 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.tag {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #e6f0ff;
  color: var(--blue-700);
}
.char__quote {
  margin: 0.9rem 0 0;
  font-style: italic;
  font-size: 0.88rem;
  color: #5a6a8d;
  border-top: 1px dashed #c8d6f0;
  padding-top: 0.7rem;
}

/* сюжет */
.story { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.story__card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
}
.story__card--wide { grid-column: 1 / -1; background: linear-gradient(135deg, #fff, #e8f2ff); }
.story__num {
  position: absolute;
  top: -18px; right: 18px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--ink);
  display: grid; place-items: center;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(255, 210, 63, 0.4);
}
.story__card h3 { margin: 0.4rem 0 0.6rem; font-size: 1.25rem; color: var(--blue-800); }
.story__card p { margin: 0; line-height: 1.65; color: #33456b; font-size: 0.97rem; }

/* тест */
.section--quiz { padding-bottom: clamp(3rem, 8vw, 5rem); }
.quiz {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.4rem, 4vw, 2.4rem);
}
.quiz__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.quiz__progress { font-weight: 800; color: var(--blue-700); font-size: 0.95rem; }
.quiz__score { font-weight: 800; color: #b8860b; font-size: 0.95rem; }
.quiz__bar { height: 10px; background: #dbe7fb; border-radius: 999px; overflow: hidden; margin-top: 0.7rem; }
.quiz__bar i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue-600), #61d2ff); transition: width 0.35s; }
.quiz__q { font-size: clamp(1.15rem, 3vw, 1.5rem); margin: 1.4rem 0 1.2rem; line-height: 1.35; }
.answers { display: grid; gap: 0.75rem; }
.answer {
  text-align: left;
  font: inherit;
  font-size: 1rem;
  padding: 0.9rem 1.1rem;
  border-radius: 16px;
  border: 2px solid #ccdcf7;
  background: #f4f8ff;
  color: var(--ink);
  cursor: pointer;
  transition: 0.15s;
}
.answer:hover:not(:disabled) { border-color: var(--blue-600); background: #e7f1ff; transform: translateX(4px); }
.answer:disabled { cursor: default; }
.answer--right { border-color: #23a55a; background: #e2f9ec; font-weight: 700; }
.answer--wrong { border-color: #e0455a; background: #ffe8ec; }
.answer--muted { opacity: 0.55; }
.quiz__note { margin: 1rem 0 0; font-size: 0.95rem; line-height: 1.55; color: #40537d; background: #eef4ff; border-left: 4px solid var(--blue-600); padding: 0.75rem 0.9rem; border-radius: 0 12px 12px 0; }
.quiz__next { margin-top: 1.2rem; display: flex; justify-content: flex-end; }
.quiz__result { text-align: center; }
.quiz__result .big { font-size: 3.4rem; font-weight: 800; color: var(--blue-700); margin: 0.6rem 0 0.2rem; }
.quiz__rank { font-size: 1.35rem; font-weight: 800; color: #b8860b; margin: 0 0 0.6rem; }
.quiz__result p { color: #40537d; line-height: 1.6; margin: 0 auto 1.4rem; max-width: 46ch; }
.quiz__badge { font-size: 3.6rem; line-height: 1; }

.site-footer {
  text-align: center;
  padding: 2rem 1rem 2.6rem;
  color: #a9c6f2;
  font-size: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

@media (max-width: 640px) {
  .nav a:not(.nav__cta) { display: none; }
  .char__art { width: 110px; height: 110px; }
}
