/* Раскладка: белая страница, зелёный зверёк ведёт по ней — в каждом разделе он в новой позе и чем-то занят. */
:root {
  --paper: #ffffff;
  --mist: #f0faee;
  --ink: #0f2a1a;
  --ink-soft: #4d6657;
  --leaf: #45c93b;
  --leaf-deep: #1e9a34;
  --leaf-pale: #d8f6d0;
  --line: #d9ecd5;
  --blush: #ff8fa3;
  --sun: #ffcf3f;
  --on-leaf: #0b2414;
  --shadow: 0 18px 40px -18px rgba(30, 154, 52, .45);
  --display: "Unbounded", "Trebuchet MS", "Segoe UI", sans-serif;
  --body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1a11; --mist: #10241a; --ink: #eaf8ea; --ink-soft: #a3c1ab; --leaf: #5ddc52; --leaf-deep: #7be56f;
    --leaf-pale: #183a25; --line: #224130; --blush: #ff8fa3; --sun: #ffd65c; --on-leaf: #08200f;
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1a11; --mist: #10241a; --ink: #eaf8ea; --ink-soft: #a3c1ab; --leaf: #5ddc52; --leaf-deep: #7be56f;
  --leaf-pale: #183a25; --line: #224130; --blush: #ff8fa3; --sun: #ffd65c; --on-leaf: #08200f;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .8); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 6.4vw, 4.3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.7rem); font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; }
.lead { font-size: clamp(1.05rem, 2.1vw, 1.25rem); color: var(--ink-soft); max-width: 34em; }
.muted { color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--leaf-deep); outline-offset: 3px; border-radius: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55em; min-height: 54px; padding: 0 1.5em; border-radius: 999px; border: 2px solid transparent; font: 600 1.02rem var(--body); text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn-main { background: var(--leaf); color: var(--on-leaf); box-shadow: var(--shadow); }
.btn-main:hover { transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--leaf); background: var(--mist); }
.btn-small { min-height: 42px; padding: 0 1.1em; font-size: .95rem; }

/* шапка */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.05rem var(--display); text-decoration: none; margin-right: auto; }
.brand svg { width: 40px; height: 40px; }
.nav { display: flex; gap: 22px; font-weight: 500; font-size: .96rem; }
.nav a { text-decoration: none; color: var(--ink-soft); }
.nav a:hover { color: var(--ink); }
@media (max-width: 820px) { .nav { display: none; } }

/* первый экран */
.hero { position: relative; padding-block: clamp(36px, 7vw, 84px) clamp(28px, 5vw, 56px); background: radial-gradient(60% 70% at 85% 30%, var(--leaf-pale), transparent 70%), var(--paper); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tag { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--leaf-pale); color: var(--ink); font-weight: 600; font-size: .9rem; }
.tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--leaf-deep); box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 30%, transparent); }
h1 em { font-style: normal; color: var(--leaf-deep); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 26px; padding: 0; margin: 6px 0 0; list-style: none; font-size: .97rem; color: var(--ink-soft); }
.facts b { display: block; font: 700 1.25rem var(--display); color: var(--ink); letter-spacing: -.02em; }
.hero-pet { position: relative; display: grid; place-items: center; min-width: 0; }
.hero-pet svg { width: min(100%, 420px); height: auto; }
.bubble { position: absolute; top: 4%; left: 0; max-width: 210px; padding: 12px 16px; border-radius: 20px 20px 20px 6px; background: var(--paper); border: 2px solid var(--line); font-weight: 600; font-size: .95rem; box-shadow: var(--shadow); }
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-pet { order: -1; }
  .hero-pet svg { width: min(62vw, 250px); }
  .bubble { left: auto; right: 0; top: 0; max-width: 170px; font-size: .86rem; }
}

section { padding-block: clamp(48px, 8vw, 96px); }
.band { background: var(--mist); }
.head { display: flex; flex-direction: column; gap: 12px; margin-bottom: clamp(24px, 4vw, 44px); }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.head-row > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pet-side { flex: none; width: clamp(96px, 16vw, 170px); margin-bottom: -18px; }
.pet-side svg { width: 100%; height: auto; display: block; }

/* что умеет */
.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.perk { display: flex; flex-direction: column; gap: 8px; padding: 26px 22px 26px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.perk .n { font: 800 2rem var(--display); color: var(--leaf-deep); letter-spacing: -.03em; }
.perk p { color: var(--ink-soft); font-size: .98rem; }

/* подключение */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.tab { min-height: 46px; padding: 0 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: 600 .97rem var(--body); cursor: pointer; }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 26px; background: var(--paper); border: 2px solid var(--line); min-width: 0; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--leaf); color: var(--on-leaf); font: 800 1rem var(--display); }
.steps p { color: var(--ink-soft); font-size: .98rem; }
.steps .links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.keydemo { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--mist); font: 500 .82rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-soft); overflow: hidden; }
.keydemo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.note { margin-top: 18px; font-size: .95rem; color: var(--ink-soft); max-width: 60em; }

/* тарифы */
.periods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.plan { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: 30px; border: 2px solid var(--line); background: var(--paper); min-width: 0; }
.plan.best { border-color: var(--leaf); background: linear-gradient(180deg, var(--leaf-pale), var(--paper) 55%); }
.plan .price { font: 800 clamp(2.2rem, 6vw, 3.1rem) var(--display); letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.plan .price small { font: 500 1rem var(--body); color: var(--ink-soft); letter-spacing: 0; }
.plan .per { color: var(--ink-soft); font-size: .96rem; min-height: 1.5em; }
.plan ul { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; list-style: none; font-size: .98rem; }
.plan li { display: flex; gap: 10px; }
.plan li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border-radius: 50%; background: var(--leaf) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4.5 9.4l3 2.9 6-6.3' fill='none' stroke='%230b2414' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.plan .btn { margin-top: auto; }
.save { align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: var(--sun); color: #3a2a00; font-weight: 700; font-size: .85rem; }
.save[hidden] { display: none; }
.plan-pet { position: absolute; right: 14px; top: -58px; width: 96px; }
.plan-pet svg { width: 100%; height: auto; display: block; }

/* друзья */
.ref { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (max-width: 820px) { .ref { grid-template-columns: 1fr; } }
.ref-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.calc { display: flex; flex-direction: column; gap: 18px; padding: 28px; border-radius: 30px; background: var(--ink); color: var(--paper); min-width: 0; }
.calc label { font-weight: 600; }
.calc output { font: 800 clamp(2.4rem, 7vw, 3.6rem) var(--display); letter-spacing: -.04em; line-height: 1; color: var(--leaf); font-variant-numeric: tabular-nums; }
.calc .sub { opacity: .8; font-size: .95rem; }
.calc input[type=range] { width: 100%; accent-color: var(--leaf); height: 28px; }
.levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.levels div { padding: 10px 6px; border-radius: 14px; text-align: center; font-size: .82rem; border: 1px solid color-mix(in srgb, var(--paper) 25%, transparent); }
.levels div b { display: block; font: 800 1.05rem var(--display); }
.levels div.on { background: var(--leaf); color: var(--on-leaf); border-color: var(--leaf); }

/* вопросы */
.faq { display: flex; flex-direction: column; border-top: 2px solid var(--ink); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 20px 0; font: 700 1.02rem var(--display); letter-spacing: -.01em; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; flex: none; font-size: 1.4rem; line-height: 1; color: var(--leaf-deep); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { padding: 0 0 22px; color: var(--ink-soft); max-width: 62ch; }

/* конец страницы */
.final { text-align: center; }
.final .wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.final .pet { width: clamp(150px, 30vw, 230px); }
.final .pet svg { width: 100%; height: auto; display: block; }
footer { border-top: 1px solid var(--line); padding-block: 26px; font-size: .92rem; color: var(--ink-soft); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); text-decoration: underline; }

/* зверёк */
.pet-body { fill: var(--leaf); }
.pet-dark { fill: var(--leaf-deep); }
.pet-belly { fill: var(--leaf-pale); }
.pet-eye { fill: #fff; }
.pet-pupil { fill: #10281a; transition: transform .12s ease-out; }
.pet-blush { fill: var(--blush); opacity: .75; }
.pet-line { fill: none; stroke: #10281a; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.pet-sun { fill: var(--sun); }
.pet-shadow { fill: var(--ink); opacity: .12; }
.floaty { animation: floaty 4.5s ease-in-out infinite; transform-origin: 50% 90%; }
.wave { animation: wave 1.6s ease-in-out infinite; transform-origin: 152px 118px; }
.zzz { animation: zzz 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-7px) rotate(-1.5deg); } }
@keyframes wave { 50% { transform: rotate(-22deg); } }
@keyframes zzz { 0%, 100% { opacity: .2; transform: translateY(4px); } 50% { opacity: 1; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .floaty, .wave, .zzz { animation: none; } .btn, .pet-pupil { transition: none; } }

/* ---------- личный кабинет ---------- */
.app { max-width: 720px; margin-inline: auto; padding-inline: 16px; padding-block: 20px 56px; display: flex; flex-direction: column; gap: 18px; }
.app-top { display: flex; align-items: center; gap: 12px; }
.app-top .brand { margin-right: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--mist); border: 1px solid var(--line); font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.linkbtn { background: none; border: 0; padding: 6px; color: var(--ink-soft); font: 500 .92rem var(--body); cursor: pointer; text-decoration: underline; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 28px; border: 2px solid var(--line); background: var(--paper); min-width: 0; }
.card h2 { font-size: 1.25rem; }
.card.soft { background: var(--mist); border-color: transparent; }
.status { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: center; border-color: var(--leaf); background: linear-gradient(160deg, var(--leaf-pale), var(--paper) 70%); }
.status svg { width: 96px; height: auto; display: block; }
.status .big { font: 800 clamp(1.3rem, 5vw, 1.7rem) var(--display); letter-spacing: -.02em; line-height: 1.15; }
.status.off { border-color: var(--line); background: var(--mist); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row .btn { flex: 1 1 200px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; }
.field input { min-height: 54px; padding: 0 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: 500 1.05rem var(--body); width: 100%; }
.field input:focus { outline: none; border-color: var(--leaf-deep); }
.field input.code { font: 800 1.6rem var(--display); letter-spacing: .3em; text-align: center; }
.msg { padding: 12px 14px; border-radius: 14px; font-size: .95rem; font-weight: 500; }
.msg.err { background: color-mix(in srgb, var(--blush) 22%, var(--paper)); color: var(--ink); }
.msg.ok { background: var(--leaf-pale); color: var(--ink); }
.keybox { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--mist); font: 500 .8rem ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--ink-soft); min-width: 0; }
.keybox span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.hint { font-size: .92rem; color: var(--ink-soft); }
.plan-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--paper); cursor: pointer; text-align: left; width: 100%; color: var(--ink); font: inherit; }
.plan-line:hover { border-color: var(--leaf); }
.plan-line b { font: 700 1rem var(--display); letter-spacing: -.01em; }
.plan-line .p { font: 800 1.15rem var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-line small { display: block; color: var(--ink-soft); font: 400 .88rem var(--body); }
.center { display: grid; place-items: center; gap: 16px; text-align: center; padding-block: 30px; }
.center svg { width: 150px; height: auto; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--leaf-deep); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

/* ---------- маскот-картинка ----------
   .pet-wrap — место и наклон к курсору (его двигает скрипт), img внутри — собственная анимация позы. */
.pet-wrap { display: block; position: relative; max-width: 100%; transition: transform .25s ease-out; transform-origin: 50% 92%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pet-wrap img { display: block; width: 100%; height: auto; transform-origin: 50% 96%; user-select: none; -webkit-user-drag: none; }
.pet-wrap::after { content: ""; position: absolute; left: 14%; right: 14%; bottom: -3%; height: 7%; border-radius: 50%; background: var(--ink); opacity: .13; z-index: -1; animation: pet-shadow 3.2s ease-in-out infinite; }
.brand .pet-wrap { width: 40px; cursor: inherit; }
.brand .pet-wrap::after, .plan-pet .pet-wrap::after { display: none; }
.hero-pet .pet-wrap { width: min(100%, 400px); }
@media (max-width: 820px) { .hero-pet .pet-wrap { width: min(62vw, 250px); } }
.pet-side .pet-wrap, .final .pet .pet-wrap, .plan-pet .pet-wrap { width: 100%; }
.status .pet-wrap { width: 96px; }
.center .pet-wrap { width: 150px; }
.hero-pet, .pet-side, .final .pet, .status, .center { isolation: isolate; }

/* покой: дышит — чуть приседает и расправляется */
.pet-wrap img { animation: pet-breathe 3.2s ease-in-out infinite; }
/* появление на первом экране: выпрыгивает и пружинит, дальше дышит */
.pet-hero img { animation: pet-pop .9s cubic-bezier(.2, 1.5, .4, 1) both, pet-breathe 3.2s ease-in-out .9s infinite; }
/* раздумывает — покачивается из стороны в сторону */
.pet-think img { animation: pet-sway 4s ease-in-out infinite; }
/* с ключом и радостный — подпрыгивает */
.pet-key img { animation: pet-hop 2.6s ease-in-out infinite; }
.pet-happy img { animation: pet-hop 1.9s ease-in-out infinite; }
/* спит — дышит медленно и глубоко */
.pet-sleep img { animation: pet-breathe 5.5s ease-in-out infinite; filter: saturate(.85); }
.pet-face img { animation: none; }
.brand:hover .pet-face img { animation: pet-wiggle .6s ease-in-out; }
/* разовые реакции: прыжок по нажатию и когда раздел появился на экране */
.pet-wrap.jump img { animation: pet-jump .7s cubic-bezier(.3, 0, .3, 1); }
.pet-wrap.jump::after { animation: pet-shadow-jump .7s cubic-bezier(.3, 0, .3, 1); }
.pet-wrap.seen img { animation: pet-jump .7s cubic-bezier(.3, 0, .3, 1); }

@keyframes pet-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.035, .955); } }
@keyframes pet-pop { 0% { transform: translateY(40%) scale(.5, .4); opacity: 0; } 55% { opacity: 1; } 70% { transform: translateY(-6%) scale(.96, 1.06); } 100% { transform: none; } }
@keyframes pet-sway { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) scale(1.02, .98); } }
@keyframes pet-hop { 0%, 55%, 100% { transform: none; } 62% { transform: scale(1.08, .88); } 78% { transform: translateY(-12%) scale(.95, 1.07); } 92% { transform: scale(1.05, .93); } }
@keyframes pet-jump { 0% { transform: none; } 18% { transform: scale(1.14, .8); } 50% { transform: translateY(-26%) scale(.92, 1.1) rotate(-5deg); } 80% { transform: scale(1.1, .86); } 100% { transform: none; } }
@keyframes pet-wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
@keyframes pet-shadow { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.06); } }
@keyframes pet-shadow-jump { 0%, 100% { transform: scaleX(1); opacity: .13; } 50% { transform: scaleX(.6); opacity: .06; } }
@media (prefers-reduced-motion: reduce) {
  .pet-wrap, .pet-wrap img, .pet-wrap::after { animation: none !important; transition: none; }
}
