/* ============================================================================
   clovo.lab — дизайн-система. Токени з §12 брифу.
   Шрифти: fonts.css підключається ОКРЕМИМ <link> у кожній сторінці, ДО цього
   файлу — @import створював ланцюжок послідовних запитів і сповільнював
   перший рендер на мобільних.
   ========================================================================== */

:root {
  --bg:          #FAFAF7;
  --surface:     #FFFFFF;
  --ink:         #16181F;
  --ink-muted:   #5C6172;
  /* #8A8F9E давав контраст ~3.4:1 на --bg — нижче за WCAG AA (4.5:1)
     для дрібного тексту; затемнено до ~4.5:1 */
  --ink-faint:   #6E7383;
  --line:        #E4E2DA;
  --line-strong: #CFCCC1;
  --accent:      #2E4BEE;
  --accent-deep: #2138C4;
  --accent-tint: #EDEFFE;

  --display: 'Fixel Display', 'Fixel', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text:    'Fixel Text', 'Fixel', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  /* липка шапка інакше накриває заголовок, на який веде якір
     (картки послуг на головній, посилання на розділи правових документів) */
  scroll-padding-top: 5.5rem;
}
/* на вузьких екранах навігація переноситься у два рядки — шапка вища */
@media (max-width: 46em) {
  html { scroll-padding-top: 10rem; }
}

/* Тексти сторінок редагує власниця — довге посилання чи слово без пробілів
   не має розтягувати сторінку вбік. `anywhere`, а не `break-word`:
   лише воно впливає на мінімальну ширину клітинок у сітці. */
p, li, dd, h1, h2, h3, .spec__val, .card p, .card h3 { overflow-wrap: anywhere; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: 'ss01', 'kern';
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); margin-top: 2.5em; }
h3 { font-size: 1.15rem; margin-top: 2em; }

p  { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); padding-left: 1.2em; }
li { margin-bottom: 0.4em; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--accent-deep); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Каркас ---------- */

.wrap { max-width: 68rem; margin: 0 auto; padding: 0 var(--gutter); }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 10;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.25rem; flex-wrap: wrap;
}

.logo {
  font-family: var(--display);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none;
}
.logo span { color: var(--accent); }

.nav { display: flex; gap: 1.35rem; flex-wrap: wrap; }
.nav a {
  color: var(--ink-muted); text-decoration: none; font-size: 0.94rem;
  padding: 0.2rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current='page'] {
  color: var(--ink); border-bottom-color: var(--accent);
}

main { padding: clamp(2.5rem, 6vw, 4.5rem) 0 5rem; }

.eyebrow {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faint); margin: 0 0 0.9rem;
}

.lede { font-size: 1.16rem; color: var(--ink-muted); max-width: 38rem; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 3.5rem 0; }

/* ---------- Сітка карток ---------- */

.grid { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 2.5rem 0; }
@media (min-width: 40em) { .grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 58em) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--surface); padding: 1.6rem 1.5rem 1.8rem;
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
a.card:hover { background: var(--accent-tint); }
.card h3 { margin-top: 0; }
.card p { font-size: 0.96rem; color: var(--ink-muted); margin-bottom: 1.2rem; }
.card__foot { margin-top: auto; font-size: 0.9rem; color: var(--ink-faint); }

/* ---------- Специфікація продукту (підпис сторінки) ---------- */

.spec {
  margin: 2rem 0 2.5rem; max-width: 34rem;
  border-top: 1px solid var(--line-strong);
}
.spec__row {
  display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.5rem 1.25rem;
  padding: 0.72rem 0; border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
@media (max-width: 30em) { .spec__row { grid-template-columns: 1fr; gap: 0.15rem; } }
.spec__key { color: var(--ink-faint); letter-spacing: 0.01em; }
.spec__val { color: var(--ink); font-variant-numeric: tabular-nums; }
.spec__val strong { font-weight: 600; }
/* Сума редагується цілком (без вкладеного <strong>), тому вагу задаємо
   класом. Уточнення після суми («/ 60 хвилин») лишається звичайним. */
.spec__price { font-weight: 600; }

.price { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.price small { font-size: 0.8rem; font-weight: 400; color: var(--ink-faint); font-family: var(--text); letter-spacing: 0; }

/* ---------- Застереження ---------- */

.notice {
  border-left: 2px solid var(--line-strong);
  padding: 0.1rem 0 0.1rem 1.15rem;
  margin: 2rem 0; max-width: 36rem;
  font-size: 0.93rem; color: var(--ink-muted);
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--ink); font-weight: 600; }

/* ---------- Блок згоди + оплата ---------- */

.checkout {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 1.9rem);
  margin: 2.5rem 0; max-width: 36rem;
}

.consent__row {
  display: flex; gap: 0.8rem; align-items: flex-start;
  cursor: pointer; margin-bottom: 0.75rem;
}
.consent__box {
  flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: 0.28rem 0 0;
  accent-color: var(--accent); cursor: pointer;
}
.consent__text { font-size: 0.97rem; line-height: 1.55; }
.consent__note {
  margin: 0 0 0 1.95rem; font-size: 0.85rem; color: var(--ink-muted);
  max-width: none;
}

.btn {
  display: inline-block; margin-top: 1.5rem; width: 100%;
  font-family: var(--display); font-size: 1rem; font-weight: 600;
  padding: 0.92rem 1.5rem; border: 1px solid var(--accent);
  border-radius: var(--radius); background: var(--accent); color: #fff;
  cursor: pointer; transition: background 0.15s ease;
}
.btn:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn:disabled {
  background: var(--bg); color: var(--ink-faint);
  border-color: var(--line-strong); cursor: not-allowed;
}
.btn--ghost { background: transparent; color: var(--accent); width: auto; }
.btn--ghost:hover:not(:disabled) { background: var(--accent-tint); color: var(--accent-deep); }

.checkout__hint { margin: 0.9rem 0 0; font-size: 0.85rem; color: var(--ink-faint); }

/* ---------- Форма заявки ---------- */

.field { display: block; margin-bottom: 1.1rem; max-width: 34rem; }
.field span { display: block; font-size: 0.88rem; color: var(--ink-muted); margin-bottom: 0.35rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 0.97rem; color: var(--ink);
  padding: 0.65rem 0.8rem; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
}
.field textarea { min-height: 7rem; resize: vertical; }

/* ---------- Реквізити ---------- */

.requisites { max-width: 38rem; margin: 1.5rem 0; }
.requisites div {
  display: grid; grid-template-columns: 12rem 1fr; gap: 0.4rem 1.25rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line); font-size: 0.95rem;
}
@media (max-width: 32em) { .requisites div { grid-template-columns: 1fr; gap: 0.1rem; } }
.requisites dt { color: var(--ink-faint); }
.requisites dd { margin: 0; }

/* ---------- Футер ---------- */

.site-footer {
  border-top: 1px solid var(--line); padding: 2.5rem 0 3.5rem;
  font-size: 0.88rem; color: var(--ink-muted);
}
.site-footer p { max-width: 46rem; margin-bottom: 0.5rem; }
.site-footer a { color: var(--ink-muted); }
.site-footer__legal { margin-top: 1.5rem; color: var(--ink-faint); }

/* ---------- Дрібне ---------- */

.todo {
  background: #FFF6D9; border: 1px dashed #C9A227; color: #6B5310;
  padding: 0.7rem 0.95rem; border-radius: var(--radius);
  font-size: 0.86rem; margin: 1.25rem 0; max-width: 36rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Обкладинка продукту ---------- */

.cover {
  display: block; width: 100%; max-width: 26rem; height: auto;
  margin: 1.75rem 0 2.5rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}

/* ---------- Декоративний шар (стиль брендбука) ----------
   Абстрактні фігури по краях екрана: кільця, крапкова сітка, «хвиля
   думки», плюси. Лише на широких екранах, під контентом, у палітрі
   бренду — тихі, не конкурують із текстом. */

.decor { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; display: none; }
@media (min-width: 64em) { .decor { display: block; } }
.decor .d { position: absolute; }
.decor .ring { border: 5px solid var(--accent-tint); border-radius: 50%; }
.decor .ring--accent { border-color: rgba(46, 75, 238, 0.14); }
.decor .dotgrid {
  background-image: radial-gradient(var(--line-strong) 1.8px, transparent 2px);
  background-size: 14px 14px; opacity: 0.55;
}
.decor .plus { color: rgba(46, 75, 238, 0.22); font-family: var(--display); font-weight: 700; line-height: 1; }
.decor .pill { background: var(--accent-tint); border-radius: 999px; }
main { position: relative; z-index: 1; }

@media (prefers-reduced-motion: no-preference) {
  .decor .fl { animation: decor-float 9s ease-in-out infinite; }
  .decor .fl2 { animation: decor-float 13s ease-in-out infinite reverse; }
}
@keyframes decor-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

/* ---------- Стікери та печатка ---------- */

.sticker {
  display: inline-block; vertical-align: middle; margin-left: 0.75rem;
  font-family: var(--display); font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.02em; line-height: 1.2; white-space: nowrap;
  padding: 0.32rem 0.7rem; border: 1.5px solid var(--accent);
  border-radius: 999px; background: var(--accent-tint); color: var(--accent-deep);
  transform: rotate(-3deg);
}
.sticker--solid { background: var(--accent); border-color: var(--accent); color: #fff; }

.hero { position: relative; }
.hero .seal {
  position: absolute; z-index: 4; top: 0.2rem; right: 0;
  width: 96px; height: 96px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 0.66rem;
  letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
  transform: rotate(8deg);
}
.hero .seal::before {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.6); border-radius: 50%;
}
.hero .seal span { position: relative; padding: 0 0.5rem; }
@media (max-width: 46em) {
  .hero { padding-right: 5.5rem; }
  .hero .seal { width: 76px; height: 76px; font-size: 0.58rem; }
}

/* ---------- Режим зручного читання ----------
   Вмикається кнопкою «Аа» в шапці (site.js), вибір зберігається в
   localStorage і застосовується до першого рендера (assets/theme.js).
   Не overlay-віджет: лише CSS-змінні — більший кегль, вищий міжрядковий,
   коротший рядок, тепліше тло (рекомендації BDA для дислексії). */

html[data-reading] {
  --measure: 31rem;
  --bg: #F6F1E7;
  --surface: #FFFDF8;
}
html[data-reading] body {
  font-size: 19px;
  line-height: 1.8;
  letter-spacing: 0.01em;
  word-spacing: 0.04em;
}
html[data-reading] .lede,
html[data-reading] .notice { max-width: 33rem; }
html[data-reading] .consent__text { font-size: 1rem; line-height: 1.7; }

.a11y-toggle {
  flex: 0 0 auto;
  font-family: var(--display); font-weight: 600; font-size: 0.9rem; line-height: 1;
  color: var(--ink-muted); background: transparent;
  border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 0.45rem 0.7rem; cursor: pointer;
}
.a11y-toggle:hover { color: var(--accent); border-color: var(--accent); }
.a11y-toggle[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ---------- Доступність: перехід одразу до змісту ---------- */

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff;
  padding: 0.6rem 1.1rem; border-radius: 0 0 var(--radius) 0;
  text-decoration: none; font-size: 0.95rem;
}
.skip-link:focus { left: 0; }

/* ---------- Промокод у блоці оплати ---------- */

.promo { margin-top: 1.1rem; }
.promo__toggle {
  background: none; border: 0; padding: 0; font: inherit; font-size: 0.9rem;
  color: var(--accent); text-decoration: underline;
  text-underline-offset: 0.18em; text-decoration-thickness: 1px;
  cursor: pointer;
}
.promo__toggle:hover { color: var(--accent-deep); }
.promo__row { display: flex; gap: 0.6rem; margin-top: 0.75rem; }
.promo__row input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 0.95rem;
  color: var(--ink); padding: 0.55rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); text-transform: uppercase;
}
.promo__apply {
  flex: 0 0 auto; font: inherit; font-size: 0.9rem; font-weight: 500;
  padding: 0.55rem 0.95rem; border: 1px solid var(--accent);
  border-radius: var(--radius); background: transparent;
  color: var(--accent); cursor: pointer;
}
.promo__apply:hover:not(:disabled) { background: var(--accent-tint); color: var(--accent-deep); }
.promo__apply:disabled { opacity: 0.6; cursor: wait; }
.promo__hint { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--ink-muted); }

/* ---------- Сторінка товару: контент + липкий блок оплати праворуч ---------- */

@media (min-width: 62em) {
  .product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: start;
  }
  .product-aside {
    position: sticky; top: 5.75rem;
    max-height: calc(100vh - 6.75rem); overflow-y: auto;
  }
  .product-aside .checkout { margin: 0 0 1rem; }
}

/* мобільна плаваюча кнопка: веде до блоку оплати внизу сторінки */
.paycta {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 15;
  display: block; text-align: center; text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  padding: 0.85rem 1rem; border-radius: var(--radius);
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(22, 24, 31, 0.22);
}
.paycta:hover { background: var(--accent-deep); color: #fff; }
@media (min-width: 62em) { .paycta { display: none; } }
/* щоб плаваюча кнопка не накривала підвал */
body:has(.paycta) .site-footer { padding-bottom: 6.5rem; }
