/* =========================================================
   Головна: зошит у клітинку, маркер, шкільна дошка
   ========================================================= */

/* Повернуті стрічки й картки не мають розширювати сторінку вбік */
.page-landing main { overflow-x: clip; }
.section { padding-block: var(--section-y); }
.section__head { display: grid; gap: 12px; max-width: 900px; margin-bottom: clamp(32px, 4vw, 52px); }
.section__head--center { margin-inline: auto; text-align: center; justify-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 0.86rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--blue); }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }
.section__head--center .eyebrow::after { content: ""; width: 18px; height: 3px; border-radius: 2px; background: currentColor; }

/* ---------- Перший екран ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(48px, 6vw, 84px); overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero__copy { display: grid; gap: 20px; justify-items: start; }
.hero__note { font-size: 1.7rem; color: var(--blue); transform: rotate(-3deg); line-height: 1; margin-bottom: -6px; }
.hero__title { font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.6rem); line-height: 1.04; }
.hero__copy .lead { max-width: 36em; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.hero__proof { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 4px; font-size: 0.92rem; color: var(--ink-2); }
.hero__proof li { display: flex; align-items: center; gap: 8px; }
.hero__proof li::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--mint); color: #fff; font-size: 0.75rem; font-weight: 900; }
.hero__proof b { color: var(--ink); }

/* Демо: фото з зошита + аркуш із розв'язком */
.demo { position: relative; display: grid; gap: 14px; }
.demo__tabs { display: inline-flex; justify-self: start; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-print); }
.demo__tab {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2); font-weight: 700; font-size: 0.9rem;
  transition: background-color 160ms ease, color 160ms ease;
}
@media (hover: hover) { .demo__tab:hover { color: var(--ink); } }
.demo__tab[aria-selected="true"] { background: var(--ink); color: #fff; }
.demo__stage { position: relative; min-height: 470px; }
.demo__panel { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 0; align-items: start; }
.demo__photo {
  position: relative; z-index: 2;
  margin: 26px -34px 0 0; padding: 22px 16px 34px;
  background-color: #fffef7;
  background-image: linear-gradient(rgba(75, 61, 240, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(75, 61, 240, 0.12) 1px, transparent 1px);
  background-size: 16px 16px;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(29, 27, 46, 0.12), 0 22px 40px -18px rgba(29, 27, 46, 0.45);
  transform: rotate(-5deg);
  filter: saturate(0.95) contrast(1.02);
}
.demo__photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(130deg, rgba(255, 255, 255, 0.5), transparent 40%, rgba(29, 27, 46, 0.06)); pointer-events: none; }
.demo__tape { position: absolute; left: 50%; top: -12px; width: 86px; height: 26px; translate: -50% 0; rotate: 3deg; background: rgba(255, 225, 74, 0.75); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.demo__hand { font-family: var(--font-hand); font-size: 1.45rem; line-height: 1.1; color: #283593; }
.demo__hand p:first-child { color: var(--red-pen); font-weight: 700; }
.demo__hand p:last-child { font-weight: 700; }
.demo__photo figcaption { position: absolute; left: 12px; bottom: 8px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.demo__sheet {
  position: relative; z-index: 1;
  padding: 22px 24px 22px 54px;
  border-radius: var(--r-l);
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, transparent 35px, rgba(229, 72, 77, 0.5) 35px, rgba(229, 72, 77, 0.5) 37px, transparent 37px),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 22px 22px, 22px 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
}
.demo__meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 0.8rem; font-weight: 650; color: var(--ink-3); }
.demo__ok { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 0.72rem; font-weight: 900; }
.demo__sol { font-size: 0.95rem; line-height: 1.6; }
.demo__sol h3 { margin-top: 12px; font-size: 0.96rem; }
.demo__sol p.answer { margin-bottom: 4px; }
.demo__arrow { position: absolute; width: 110px; left: 4%; bottom: -36px; transform: rotate(8deg); opacity: 0.85; }
/* Поява розв'язку крок за кроком */
@media (prefers-reduced-motion: no-preference) {
  .demo__panel[data-play] .demo__sol > * { animation: write-in 520ms var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 260ms + 250ms); }
  .demo__panel[data-play] .demo__photo { animation: photo-in 600ms var(--ease-out) backwards; }
}
@keyframes write-in { from { opacity: 0; transform: translateY(6px); clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes photo-in { from { opacity: 0; transform: rotate(-12deg) translate(-20px, 10px); } }

@media (max-width: 1000px) {
  .hero__grid { grid-template-columns: 1fr; }
  .demo { max-width: 640px; }
}
@media (max-width: 560px) {
  .demo__stage { min-height: 0; }
  .demo__panel { grid-template-columns: 1fr; }
  .demo__photo { width: 76%; margin: 0 0 -18px 4px; padding: 16px 14px 28px; }
  .demo__hand { font-size: 1.25rem; }
  .demo__sheet { padding: 22px 16px 18px 38px; background-image: linear-gradient(90deg, transparent 22px, rgba(229, 72, 77, 0.5) 22px, rgba(229, 72, 77, 0.5) 24px, transparent 24px), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); }
  .demo__arrow { display: none; }
  .demo__tabs { justify-self: stretch; }
  .demo__tab { flex: 1; justify-content: center; padding: 0 8px; font-size: 0.84rem; }
  .hero__actions .btn { flex: 1 1 auto; }
}

/* ---------- Біжучий рядок ---------- */
.ticker { overflow: hidden; padding: 16px 0; background: var(--ink); color: var(--chalk); transform: rotate(-1.2deg); margin: 0 -10px; box-shadow: 0 10px 30px -18px rgba(29, 27, 46, 0.6); }
.ticker__track { display: flex; gap: 40px; width: max-content; font-family: var(--font-display); font-size: clamp(1rem, 0.9rem + 0.6vw, 1.35rem); font-weight: 500; letter-spacing: -0.02em; white-space: nowrap; }
.ticker__track span { display: inline-flex; align-items: center; gap: 40px; }
.ticker__track span::after { content: "✦"; color: var(--marker); font-size: 0.8em; }
@media (prefers-reduced-motion: no-preference) { .ticker__track { animation: ticker 40s linear infinite; } }
@keyframes ticker { to { transform: translateX(-50%); } }

/* ---------- Як це працює ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; counter-reset: s; }
.step {
  position: relative; display: grid; gap: 10px; align-content: start;
  padding: 26px 24px 24px; border-radius: var(--r-l);
  background: var(--paper); border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
}
.step:nth-child(2) { transform: translateY(18px) rotate(0.6deg); }
.step:nth-child(3) { transform: rotate(-0.6deg); }
.step__n { position: absolute; top: -26px; left: 18px; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--marker); border: 2px solid var(--ink); font-size: 2rem; font-weight: 700; line-height: 1; }
.step__art { height: 110px; display: grid; place-items: center; margin: 8px 0 4px; border-radius: var(--r-m); background: var(--studio); }
.step__art svg { width: 140px; height: 100px; }
.step p { color: var(--ink-2); }
@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; gap: 40px; }
  .step:nth-child(n) { transform: none; }
}

/* ---------- Можливості (бенто) ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bento__card { display: grid; gap: 10px; align-content: start; padding: 24px; border-radius: var(--r-l); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-print); transition: transform 200ms var(--ease-out), box-shadow 200ms ease; }
@media (hover: hover) { .bento__card:not(.bento__card--board):hover { transform: translateY(-3px); box-shadow: var(--shadow-float); } }
.bento__card p { color: var(--ink-2); }
.bento__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--marker-soft); font-size: 1.5rem; }
.bento__card--wide { grid-column: span 2; grid-row: span 2; }
.bento__card--board {
  position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, var(--board-2), var(--board) 60%);
  color: var(--chalk); border: 0;
  box-shadow: inset 0 0 0 8px #5b3d24, var(--shadow-float);
  padding: 34px;
}
.bento__card--board p { color: rgba(244, 241, 230, 0.82); max-width: 48ch; }
.bento__card--board .h3 { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 1rem + 1vw, 1.8rem); letter-spacing: -0.03em; color: #fff; }
.bento__kicker { font-size: 1.6rem; color: var(--marker); line-height: 1; }
.check-demo { margin-top: 14px; display: grid; gap: 8px; font-family: var(--font-hand); font-size: clamp(1.5rem, 1.2rem + 1vw, 2.1rem); color: #fff; }
.check-demo p { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.check-demo i { font-style: normal; font-weight: 700; }
.check-demo .ok { color: #8ee6a9; }
.check-demo .bad { color: #ff8a8d; }
.check-demo em { flex-basis: 100%; font-style: normal; font-size: 0.72em; color: #ffb3b5; padding-left: 12px; border-left: 2px solid #ff8a8d; }
.check-demo p:nth-child(2) span { text-decoration: line-through; text-decoration-color: #ff8a8d; text-decoration-thickness: 3px; }
@media (max-width: 960px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento__card--wide { grid-column: 1 / -1; grid-row: auto; }
}
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .bento__card--board { padding: 26px 22px; } }

/* ---------- Предмети ---------- */
.subjects-sec__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.subjects-sec__grid > div { display: grid; gap: 14px; }
.subject-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.subject-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px 10px 10px; border-radius: var(--r-pill);
  background: var(--paper); border: 1.5px solid var(--ink);
  font-weight: 700; font-size: 1rem;
  transition: transform 200ms var(--ease-out), background-color 160ms ease;
}
.subject-chip:nth-child(3n + 1) { rotate: -1.5deg; }
.subject-chip:nth-child(4n + 2) { rotate: 1.2deg; }
@media (hover: hover) { .subject-chip:hover { background: var(--marker); transform: translateY(-2px) rotate(-2deg); } }
.subject-chip__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--studio); font-size: 1.05rem; }
@media (max-width: 860px) { .subjects-sec__grid { grid-template-columns: 1fr; } }

/* ---------- Шкільна дошка ---------- */
.board {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 32px; align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 28px;
  background: radial-gradient(120% 140% at 0% 0%, var(--board-2), var(--board) 60%);
  color: var(--chalk);
  box-shadow: inset 0 0 0 12px #5b3d24, inset 0 0 0 14px rgba(0, 0, 0, 0.25), var(--shadow-float);
}
.board::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: 12px; height: 10px; border-radius: 4px; background: #7a5434; box-shadow: 0 -2px 0 rgba(0, 0, 0, 0.2); }
.board__text { display: grid; gap: 16px; justify-items: start; }
.board__kicker { font-size: 1.8rem; color: var(--marker); line-height: 1; }
.board .h2 { color: #fff; }
.board__text p { color: rgba(244, 241, 230, 0.85); max-width: 52ch; font-size: 1.05rem; }
.board__chalk { display: grid; gap: 6px; font-family: var(--font-hand); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.5rem); color: rgba(244, 241, 230, 0.92); text-shadow: 0 0 1px rgba(255, 255, 255, 0.4); }
.board__chalk p:nth-child(odd) { transform: rotate(-3deg); }
.board__chalk p:nth-child(even) { transform: rotate(2deg) translateX(28px); }
.board__chalk span { color: #8ee6a9; }
@media (max-width: 800px) { .board { grid-template-columns: 1fr; } .board__chalk { display: none; } }

/* ---------- Ціни ---------- */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 22px 22px; border-radius: var(--r-l); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-print); }
.plan--popular { border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); background: var(--marker-soft); transform: translateY(-8px); }
.plan__badge { position: absolute; top: -14px; left: 20px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--ink); color: var(--marker); font-size: 0.76rem; font-weight: 800; }
.plan__name { font-weight: 800; font-size: 1.15rem; }
.plan__note { font-size: 0.88rem; color: var(--ink-3); }
.plan__price { margin-top: 12px; font-weight: 700; font-size: 1.2rem; }
.plan__amount { font-family: var(--font-display); font-weight: 500; font-size: 2.6rem; letter-spacing: -0.05em; }
.plan__credits { margin-bottom: 16px; font-size: 0.92rem; color: var(--ink-2); }
.plan__credits b { color: var(--ink); }
.plan__save { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--ok-tint); color: var(--ok); font-weight: 800; font-size: 0.8rem; }
.plan .btn { margin-top: auto; }
.pricing__fine { margin-top: 28px; text-align: center; color: var(--ink-2); }
@media (max-width: 1000px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plan--popular { transform: none; } }
@media (max-width: 520px) { .plans { grid-template-columns: 1fr; } }

/* ---------- Відгуки ---------- */
.reviews__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 360px); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.review { scroll-snap-align: start; display: grid; gap: 14px; align-content: space-between; padding: 22px; border-radius: var(--r-l); background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-print); }
.review:nth-child(odd) { rotate: -0.8deg; }
.review blockquote { margin: 0; font-size: 1rem; line-height: 1.6; }
.review figcaption { font-family: var(--font-hand); font-size: 1.35rem; color: var(--blue); }
.review figcaption span { color: var(--ink-3); }

/* ---------- Питання ---------- */
.faq__grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.faq__aside { display: grid; gap: 14px; position: sticky; top: calc(var(--header-h) + 24px); }
.faq__aside-note { color: var(--ink-2); }
.faq__aside-note a { color: var(--blue); font-weight: 700; }
.faq__list { display: grid; gap: 10px; }
.faq__list details { border-radius: var(--r-m); background: var(--paper); border: 1px solid var(--line); transition: border-color 160ms ease, box-shadow 160ms ease; }
.faq__list details[open] { border-color: var(--ink); box-shadow: var(--shadow-sticker); }
.faq__list summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; font-weight: 750; font-size: 1.02rem; cursor: pointer; list-style: none; }
.faq__list summary::-webkit-details-marker { display: none; }
.faq__list summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--studio); font-size: 1.3rem; font-weight: 500; transition: transform 200ms var(--ease-out), background-color 160ms ease; }
.faq__list details[open] summary::after { transform: rotate(45deg); background: var(--marker); }
.faq__answer { padding: 0 20px 18px; color: var(--ink-2); line-height: 1.65; }
@media (max-width: 860px) { .faq__grid { grid-template-columns: 1fr; } .faq__aside { position: static; } }

/* ---------- Фінал ---------- */
.final { padding-top: 0; }
.final__card {
  display: grid; justify-items: center; gap: 18px; text-align: center;
  padding: clamp(36px, 6vw, 72px) 24px;
  border-radius: 32px;
  background: var(--marker);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.final__note { font-size: 1.7rem; color: var(--ink-2); line-height: 1; transform: rotate(-2deg); }
.final__card .h2 { max-width: 20ch; }
.final__card .btn--marker { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--blue); }
@media (hover: hover) { .final__card .btn--marker:hover { background: #2c2944; } }
