:root {
  --cream: #FFF8EF;
  --paper: #FFFFFF;
  --coral: #FF6B4A;
  --coral-2: #FF8566;
  --teal: #0F4C5C;
  --yellow: #FFC857;
  --lilac: #CDB8FF;
  --mint: #A8E6CF;
  --ink: #1E2A32;
  --muted: #64707A;
  --head: 'Rubik', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); line-height: 1.6; -webkit-font-smoothing: antialiased; background-image: radial-gradient(rgba(15, 76, 92, .08) 1.2px, transparent 1.2px); background-size: 22px 22px; }
h1, h2, h3 { font-family: var(--head); margin: 0; line-height: 1.05; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 18px; }
.title { font-size: clamp(2.2rem, 9vw, 3.6rem); font-weight: 900; margin-bottom: 32px; color: var(--teal); }
.hand { font-family: var(--hand); font-weight: 700; color: var(--coral); font-size: 1.15em; }
.hl { position: relative; white-space: nowrap; z-index: 0; color: var(--teal); }
.hl::after { content: ''; position: absolute; left: -3%; right: -3%; bottom: .04em; height: .4em; background: var(--yellow); border-radius: 8px; z-index: -1; rotate: -2deg; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 15px 22px; border-radius: 16px; border: 2.5px solid var(--ink); font-weight: 800; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform .15s, box-shadow .15s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-ghost { background: var(--paper); }
.btn-sm { padding: 8px 14px; border-radius: 12px; font-size: .88rem; box-shadow: 3px 3px 0 var(--ink); }
.btn-block { width: 100%; }

.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 248, 239, .92); backdrop-filter: blur(10px); border-bottom: 2.5px solid var(--ink); }
.header-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.logo { display: flex; align-items: center; gap: 10px; font-family: var(--head); font-weight: 900; font-size: 1.25rem; color: var(--teal); }
.bubble { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px 12px 12px 4px; background: var(--coral); color: #fff; font-size: .9rem; font-weight: 900; border: 2px solid var(--ink); }
.nav { display: none; gap: 28px; font-weight: 800; }
.nav a:hover { color: var(--coral); }

/* герой з чатом */
.hero { padding: 34px 0 60px; }
.hero-in { display: grid; gap: 40px; }
.scribble { font-family: var(--hand); font-size: 1.5rem; color: var(--coral); rotate: -2deg; }
.hero h1 { margin-top: 10px; font-size: clamp(2.4rem, 11vw, 4.6rem); font-weight: 900; color: var(--ink); }
.hero h1 s { text-decoration-thickness: .12em; text-decoration-color: var(--coral); color: var(--muted); }
.lead { margin-top: 18px; color: var(--muted); font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }

.phone { justify-self: center; width: min(340px, 100%); padding: 14px; border-radius: 40px; background: var(--ink); box-shadow: 10px 10px 0 var(--coral); rotate: 2deg; }
.phone-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 26px 26px 6px 6px; background: var(--teal); color: #fff; }
.phone-top img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.phone-top b { display: block; font-size: .95rem; }
.phone-top small { font-size: .75rem; opacity: .75; }
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 330px; padding: 14px 10px; background: #ECE5DD; border-radius: 6px 6px 0 0; }
.msg { max-width: 85%; padding: 9px 13px; border-radius: 16px; font-size: .9rem; line-height: 1.35; opacity: 0; translate: 0 10px; scale: .95; transition: opacity .35s, translate .35s cubic-bezier(.34, 1.56, .64, 1), scale .35s; }
.msg.is-in { opacity: 1; translate: none; scale: 1; }
.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; }
.me { align-self: flex-end; background: #DCF8C6; border-bottom-right-radius: 4px; }
.msg.note { background: var(--yellow); font-weight: 700; }
.typing { display: flex; gap: 4px; padding: 0 20px 14px; height: 30px; align-items: center; background: #ECE5DD; border-radius: 0 0 26px 26px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9aa3a8; opacity: 0; }
.typing.is-on i { opacity: 1; animation: dot 1s infinite; }
.typing.is-on i:nth-child(2) { animation-delay: .15s; }
.typing.is-on i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 50% { translate: 0 -4px; } }

/* стікери форматів */
.formats { padding: 60px 0; }
.board { display: grid; gap: 26px; }
.sticker { position: relative; padding: 12px 12px 18px; background: var(--paper); border: 2.5px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); transition: rotate .25s, translate .25s; }
.sticker::before { content: ''; position: absolute; top: -14px; left: 50%; width: 90px; height: 26px; translate: -50% 0; background: rgba(255, 200, 87, .85); border: 1.5px solid rgba(30, 42, 50, .25); rotate: -4deg; }
.sticker img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border: 2px solid var(--ink); }
.sticker h3 { font-size: 1.35rem; font-weight: 900; margin: 14px 4px 4px; }
.sticker p { margin: 0 4px; color: var(--muted); }
.s1 { rotate: -2deg; } .s2 { rotate: 1.5deg; } .s3 { rotate: -1deg; } .s4 { rotate: 2deg; }
.s1 h3 { color: var(--coral); } .s2 h3 { color: var(--teal); } .s3 h3 { color: #C98A00; } .s4 h3 { color: #7A57E0; }
.sticker:hover { rotate: 0deg; translate: 0 -4px; }

/* тест-чат */
.test { padding: 40px 0 60px; }
.quiz-chat { max-width: 640px; margin: 0 auto; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 28px; box-shadow: 8px 8px 0 var(--teal); overflow: hidden; }
.quiz-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 2.5px solid var(--ink); background: var(--yellow); }
.quiz-head b { display: block; font-family: var(--head); }
.quiz-head small { font-size: .82rem; color: var(--ink); opacity: .7; }
.quiz-log { display: flex; flex-direction: column; gap: 10px; height: 320px; overflow-y: auto; padding: 18px; scroll-behavior: smooth; }
.qmsg { max-width: 82%; padding: 10px 14px; border-radius: 18px; animation: pop .35s cubic-bezier(.34, 1.56, .64, 1) both; }
.qmsg.bot { align-self: flex-start; background: #EEF4F5; border-bottom-left-radius: 4px; }
.qmsg.user { align-self: flex-end; background: var(--coral); color: #fff; font-weight: 800; border-bottom-right-radius: 4px; }
@keyframes pop { from { opacity: 0; scale: .8; } }
.quiz-answers { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 18px; border-top: 2px dashed #E6DED2; min-height: 74px; }
.quiz-answers button { padding: 10px 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--cream); font-weight: 800; cursor: pointer; transition: background .15s; }
.quiz-answers button:hover { background: var(--yellow); }

/* мапа рівнів */
.levels { padding: 60px 0; }
.map { position: relative; display: grid; gap: 16px; }
.map li { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--paper); border: 2.5px solid var(--ink); border-radius: 20px; box-shadow: 4px 4px 0 var(--ink); }
.map li:nth-child(even) { margin-left: 34px; }
.map b { display: flex; align-items: center; justify-content: center; width: 54px; height: 54px; flex-shrink: 0; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--mint); font-family: var(--head); font-weight: 900; font-size: 1.1rem; }
.map li:nth-child(2) b { background: var(--yellow); }
.map li:nth-child(3) b { background: var(--coral); color: #fff; }
.map li:nth-child(4) b { background: var(--lilac); }
.map li:nth-child(5) b { background: var(--teal); color: #fff; }
.map span { font-weight: 700; }

/* зошит з цінами */
.prices { padding: 40px 0 60px; }
.notebook { position: relative; max-width: 720px; margin: 0 auto; padding: 34px 22px 30px 54px; background: #fff; border: 2.5px solid var(--ink); box-shadow: 8px 8px 0 var(--ink);
  background-image: linear-gradient(90deg, transparent 38px, rgba(255, 107, 74, .5) 38px, rgba(255, 107, 74, .5) 40px, transparent 40px), repeating-linear-gradient(transparent 0 35px, #D6E6F2 35px 36px); }
.notebook h2 { font-family: var(--hand); font-size: 3rem; color: var(--teal); line-height: 1; margin-bottom: 8px; }
.notebook li { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px; min-height: 36px; padding-top: 6px; font-weight: 700; }
.notebook li i { border-bottom: 2px dotted #B8C4CC; translate: 0 -5px; }
.notebook li b { font-family: var(--head); font-weight: 900; }
.notebook .best b { color: var(--coral); }
.notebook .best em { position: absolute; right: -6px; top: -14px; font-family: var(--hand); font-style: normal; font-size: 1.2rem; color: var(--coral); rotate: 6deg; }
.notebook .best span { background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.ps { margin-top: 18px; font-family: var(--hand); font-size: 1.4rem; color: var(--muted); }

/* стікер-форма */
.signup { padding: 30px 0 90px; }
.signup-in { display: grid; justify-items: center; gap: 18px; }
.note-form { display: grid; gap: 12px; width: min(460px, 100%); padding: 30px 24px 26px; background: var(--yellow); border: 2.5px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); rotate: -1.5deg; }
.note-form h2 { font-family: var(--head); font-weight: 900; font-size: 2rem; }
.note-form h2 span { color: var(--coral); }
.note-form input, .note-form select { width: 100%; padding: 14px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; }
.note-form input:focus, .note-form select:focus { outline: 3px solid var(--teal); }
.signup-side { font-weight: 800; }

.footer { padding: 24px 0; border-top: 2.5px solid var(--ink); font-size: .85rem; color: var(--muted); background: var(--cream); }
.footer-in { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }

@media (min-width: 768px) {
  .wrap { padding: 0 32px; }
  .nav { display: flex; }
  .hero { padding: 64px 0 90px; }
  .hero-in { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .board { grid-template-columns: repeat(4, 1fr); gap: 22px; align-items: start; }
  .s2, .s4 { margin-top: 40px; }
  .map { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .map li { flex-direction: column; text-align: center; padding: 20px 14px; }
  .map li:nth-child(even) { margin: 50px 0 0; }
  .notebook { padding: 40px 40px 34px 70px; background-image: linear-gradient(90deg, transparent 52px, rgba(255, 107, 74, .5) 52px, rgba(255, 107, 74, .5) 54px, transparent 54px), repeating-linear-gradient(transparent 0 35px, #D6E6F2 35px 36px); }
}

@media (prefers-reduced-motion: reduce) { * { animation: none !important; } .msg { opacity: 1; translate: none; scale: 1; } }
