/* ===== Аватар: Легенда об Аанге — небесная тема ===== */
:root {
  --sky-1: #eaf7ff;
  --sky-2: #bfe6fb;
  --sky-3: #7fc6ee;
  --blue: #2f9fe0;
  --blue-deep: #1473b8;
  --ink: #123c5e;
  --ink-soft: #3f6d90;
  --white: #ffffff;
  --card: #ffffff;
  --air: #59c1e8;
  --water: #2f8fd8;
  --fire: #ef7a4a;
  --earth: #7bb26a;
  --radius: 22px;
  --shadow: 0 14px 34px rgba(20, 115, 184, .16);
  --shadow-sm: 0 6px 18px rgba(20, 115, 184, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, #f7fcff 40%, var(--sky-1) 100%);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
b { color: var(--blue-deep); }

.grad {
  background: linear-gradient(92deg, var(--blue-deep), var(--air) 60%, #9be3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.container { max-width: 1140px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 860px; }

/* ===== Облака ===== */
.clouds { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, .85);
  border-radius: 100px;
  filter: blur(2px);
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: inherit; border-radius: 50%;
}
.cloud-1 { width: 210px; height: 56px; top: 12%; left: -25%; animation-duration: 70s; }
.cloud-1::before { width: 90px; height: 90px; top: -42px; left: 34px; }
.cloud-1::after { width: 66px; height: 66px; top: -28px; left: 110px; }
.cloud-2 { width: 150px; height: 44px; top: 34%; left: -20%; animation-duration: 95s; animation-delay: -30s; }
.cloud-2::before { width: 66px; height: 66px; top: -30px; left: 26px; }
.cloud-3 { width: 260px; height: 62px; top: 62%; left: -30%; animation-duration: 120s; animation-delay: -60s; opacity: .7; }
.cloud-3::before { width: 110px; height: 110px; top: -52px; left: 44px; }
.cloud-3::after { width: 80px; height: 80px; top: -34px; left: 140px; }
.cloud-4 { width: 130px; height: 40px; top: 78%; left: -15%; animation-duration: 85s; animation-delay: -15s; opacity: .8; }
.cloud-4::before { width: 58px; height: 58px; top: -26px; left: 22px; }

@keyframes drift { to { transform: translateX(160vw); } }

/* ===== Навигация ===== */
.nav {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1140px; margin: 0 auto; padding: 20px 22px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.15rem; letter-spacing: .04em;
  color: var(--white); text-decoration: none;
}
.logo-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: rgba(255, 255, 255, .22); border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%; color: var(--white);
  animation: spinSlow 14s linear infinite;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }

.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a {
  color: var(--white); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 8px 14px; border-radius: 999px; transition: .25s;
}
.nav-links a:hover { background: rgba(255, 255, 255, .22); }
.nav-quiz { background: rgba(255, 255, 255, .9); color: var(--blue-deep) !important; }
.nav-quiz:hover { background: #fff; }

/* ===== HERO ===== */
.hero {
  position: relative; z-index: 1;
  background:
    radial-gradient(1000px 460px at 78% 10%, rgba(255, 255, 255, .35), transparent 60%),
    linear-gradient(160deg, #4fb6ec 0%, #2f9fe0 45%, #1c7fc4 100%);
  color: var(--white);
  padding-bottom: 90px;
}
.hero-inner {
  max-width: 1140px; margin: 0 auto; padding: 30px 22px 10px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; background: rgba(255, 255, 255, .2);
  border: 1px solid rgba(255, 255, 255, .4);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); line-height: 1.08; letter-spacing: -.01em; }
.hero h1 .grad { color: transparent; background: linear-gradient(92deg, #ffffff, #d9f3ff 55%, #aee6ff); -webkit-background-clip: text; background-clip: text; }
.lead { font-size: clamp(1.02rem, 1.7vw, 1.2rem); margin-top: 18px; max-width: 560px; color: #eaf7ff; }

.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 30px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary { background: var(--white); color: var(--blue-deep); box-shadow: 0 12px 26px rgba(9, 62, 100, .3); }
.btn-primary:hover { box-shadow: 0 16px 32px rgba(9, 62, 100, .38); }
.btn-ghost { border-color: rgba(255, 255, 255, .75); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); }

.jump-hint {
  min-height: 24px; margin-top: 14px; font-weight: 700; font-size: .95rem;
  color: #d9f3ff; opacity: 0; transform: translateY(-6px); transition: .35s;
}
.jump-hint.show { opacity: 1; transform: none; }

/* Подсветка секции после перехода по кнопке */
.section.flash { animation: secFlash 1.6s ease; }
@keyframes secFlash {
  0% { background-color: rgba(127, 198, 238, 0); }
  25% { background-color: rgba(127, 198, 238, .35); }
  100% { background-color: rgba(127, 198, 238, 0); }
}
.sec-title.flash-title { animation: titlePulse 1.6s ease; }
@keyframes titlePulse {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.04); text-shadow: 0 0 24px rgba(47, 159, 224, .55); }
}

/* Волна воздуха от нажатой кнопки */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
  position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .65);
  transform: scale(0); animation: ripple .6s ease-out; pointer-events: none;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.hero-stats { display: flex; gap: 34px; margin-top: 34px; flex-wrap: wrap; }
.stat b { display: block; font-size: 2rem; line-height: 1; color: #fff; }
.stat span { font-size: .88rem; color: #d5efff; }

.hero-art { position: relative; }
.glider { animation: float 5.5s ease-in-out infinite; filter: drop-shadow(0 22px 30px rgba(8, 55, 90, .35)); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }
.wind { stroke-dasharray: 90; animation: windFlow 3.4s ease-in-out infinite; }
.w2 { animation-delay: .8s; } .w3 { animation-delay: 1.6s; }
@keyframes windFlow { 0% { stroke-dashoffset: 90; opacity: 0; } 40% { opacity: .95; } 100% { stroke-dashoffset: -90; opacity: 0; } }

.badge {
  position: absolute; bottom: -6px; right: 8px;
  background: rgba(255, 255, 255, .95); color: var(--blue-deep);
  font-weight: 700; font-size: .85rem; padding: 8px 16px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.wave { position: absolute; left: 0; right: 0; bottom: -1px; }
.wave svg { display: block; width: 100%; height: 90px; }

/* ===== Секции ===== */
.section { position: relative; z-index: 1; padding: 74px 0; }
.section-alt {
  background: linear-gradient(180deg, #f2fbff, #e6f6ff);
  border-top: 1px solid #d5edfb; border-bottom: 1px solid #d5edfb;
}
.sec-title { font-size: clamp(1.7rem, 3.4vw, 2.5rem); text-align: center; letter-spacing: -.01em; }
.sec-sub { text-align: center; color: var(--ink-soft); max-width: 720px; margin: 14px auto 46px; font-size: 1.04rem; }

/* ===== Завязка ===== */
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.story-card {
  position: relative; background: var(--card); border-radius: var(--radius);
  padding: 34px 26px 28px; box-shadow: var(--shadow);
  border-top: 5px solid var(--air); overflow: hidden;
}
.story-card:nth-child(2) { border-top-color: var(--water); }
.story-card:nth-child(3) { border-top-color: var(--fire); }
.story-num {
  position: absolute; top: 8px; right: 18px;
  font-size: 3.4rem; font-weight: 800; color: rgba(47, 159, 224, .12); line-height: 1;
}
.story-card h3 { font-size: 1.28rem; margin-bottom: 10px; }
.story-card p { color: var(--ink-soft); font-size: .98rem; }

.hook {
  margin-top: 34px; display: flex; gap: 22px; align-items: flex-start;
  background: linear-gradient(135deg, #ffffff, #eaf7ff);
  border: 2px dashed var(--sky-3); border-radius: var(--radius);
  padding: 30px 32px; box-shadow: var(--shadow-sm);
}
.hook-icon { font-size: 2.4rem; line-height: 1; animation: float 4s ease-in-out infinite; }
.hook h3 { font-size: 1.3rem; margin-bottom: 10px; }
.hook p { color: var(--ink-soft); margin-bottom: 10px; }
.hook-note { font-size: .92rem !important; color: var(--blue-deep) !important; font-weight: 600; margin-bottom: 0 !important; }

/* ===== Персонажи ===== */
.chars-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.char {
  display: flex; flex-direction: column; background: var(--card);
  border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow-sm);
  border-bottom: 5px solid var(--sky-3); transition: transform .25s, box-shadow .25s;
}
.char:hover { transform: translateY(-8px); box-shadow: var(--shadow); }
.char-water { border-bottom-color: var(--water); }
.char-fire { border-bottom-color: var(--fire); }
.char-earth { border-bottom-color: var(--earth); }
.char-avatar {
  width: 68px; height: 68px; display: grid; place-items: center;
  font-size: 2rem; border-radius: 50%; margin-bottom: 14px;
  background: radial-gradient(circle at 30% 25%, #ffffff, #d8f0fd);
  border: 3px solid #bfe6fb;
}
.tag {
  display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}
.tag-air { background: #e2f6ff; color: #1a7fb8; }
.tag-water { background: #e0f0ff; color: #1c6cb0; }
.tag-fire { background: #ffe9df; color: #c9531f; }
.tag-earth { background: #e8f5e3; color: #4a7f3c; }
.tag-nost { background: #eef2f6; color: #4a6377; }
.char h3 { font-size: 1.3rem; margin-bottom: 8px; }
.char p { font-size: .93rem; color: var(--ink-soft); }

.pets { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.pet {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 10px 20px;
  box-shadow: var(--shadow-sm); font-size: .95rem;
}
.pet span { font-size: 1.4rem; }
.pet i { color: var(--ink-soft); font-style: normal; font-size: .88rem; }

/* ===== Почему стоит ===== */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.why {
  background: var(--card); border-radius: var(--radius); padding: 26px 22px;
  box-shadow: var(--shadow-sm); text-align: center; transition: transform .25s;
}
.why:hover { transform: translateY(-6px); }
.why-ico { font-size: 2.2rem; margin-bottom: 10px; }
.why h3 { font-size: 1.1rem; margin-bottom: 8px; }
.why p { font-size: .92rem; color: var(--ink-soft); }

.quote {
  margin: 44px auto 0; max-width: 760px; text-align: center;
  font-size: 1.25rem; font-style: italic; color: var(--blue-deep);
  background: #eef8ff; border-left: 6px solid var(--air);
  border-radius: 18px; padding: 26px 30px;
}
.quote cite { display: block; margin-top: 10px; font-size: .9rem; font-style: normal; color: var(--ink-soft); }

/* ===== Тест ===== */
.section-quiz {
  background:
    radial-gradient(700px 320px at 85% 0%, rgba(255, 255, 255, .5), transparent 65%),
    linear-gradient(180deg, #dcf2fe, #c9ebfd);
  border-top: 1px solid #bfe6fb;
}
.quiz { background: #fff; border-radius: 26px; box-shadow: var(--shadow); overflow: hidden; }
.quiz-progress { height: 8px; background: #e3f2fc; }
.quiz-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--blue), var(--air)); transition: width .35s; }

.q-list { list-style: none; padding: 34px 34px 6px; }
.q { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px dashed #d9edfa; }
.q:last-child { border-bottom: none; }
.q-text { font-weight: 700; margin-bottom: 14px; font-size: 1.05rem; }
.q label {
  display: block; margin-bottom: 9px; cursor: pointer;
  background: #f4fbff; border: 2px solid #dcf0fc; border-radius: 14px;
  padding: 11px 16px; transition: .18s; font-size: .98rem;
}
.q label:hover { border-color: var(--air); background: #eaf8ff; }
.q label:has(input:checked) { border-color: var(--blue); background: #e3f4ff; box-shadow: 0 4px 12px rgba(47, 159, 224, .2); }
.q input { margin-right: 10px; accent-color: var(--blue); transform: scale(1.1); }

.q label.correct { border-color: #4caf50; background: #e9f8ea; }
.q label.wrong { border-color: #ef6a5a; background: #fdecea; }
.q label.dim { opacity: .6; }

.quiz-actions { display: flex; gap: 14px; justify-content: flex-end; padding: 6px 34px 34px; flex-wrap: wrap; }
.quiz .btn-ghost { color: var(--blue-deep); border-color: var(--blue-deep); }
.quiz .btn-ghost:hover { background: #eaf7ff; }
.quiz .btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff; box-shadow: 0 12px 26px rgba(20, 115, 184, .35); }

/* Результат */
.result { text-align: center; padding: 14px 34px 40px; animation: pop .5s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
.result-ring {
  width: 150px; height: 150px; margin: 0 auto 20px; border-radius: 50%;
  display: grid; place-items: center; align-content: center;
  background: conic-gradient(var(--blue) var(--deg, 0deg), #e3f2fc 0deg);
  position: relative; transition: background .6s;
}
.result-ring::after {
  content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%;
}
.result-ring span, .result-ring small { position: relative; z-index: 1; }
.result-ring span { font-size: 3rem; font-weight: 800; color: var(--blue-deep); line-height: 1; }
.result-ring small { color: var(--ink-soft); font-size: 1rem; }
.result h3 { font-size: 1.5rem; margin-bottom: 8px; }
.result p { color: var(--ink-soft); max-width: 520px; margin: 0 auto 22px; }

/* ===== Подвал ===== */
.footer {
  position: relative; z-index: 1;
  background: linear-gradient(160deg, #1c7fc4, #12597f);
  color: #d5efff; padding: 30px 0;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer b { color: #fff; }
.footer a { color: #aee6ff; text-decoration: none; font-weight: 600; }
.footer a:hover { text-decoration: underline; }

/* ===== Появление при скролле ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.show { opacity: 1; transform: none; }

/* ===== Адаптив ===== */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-actions, .hero-stats { justify-content: center; }
  .hero-art { max-width: 420px; margin: 0 auto; }
  .chars-grid, .why-grid { grid-template-columns: repeat(2, 1fr); }
  .story-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav { flex-direction: column; gap: 12px; }
  .chars-grid, .why-grid { grid-template-columns: 1fr; }
  .q-list { padding: 26px 20px 6px; }
  .quiz-actions { padding: 6px 20px 28px; }
  .hook { flex-direction: column; padding: 24px 22px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
