/* Спільні токени, типографіка та кнопки для головної сторінки і всіх демо.
   Правила з DESIGN.md: Inter (текст) + Playfair Display (заголовки),
   плавність 300ms ease-in-out, hover: підйом на 4px + м'яка тінь. */

:root {
  --ink: #171916;
  --paper: #f7f7f4;
  --sand: #eeefe9;
  --lime: #c8f169;
  --olive: #78933f;
  --muted: #6b6f66;
  --line: #dcded5;
  --radius: 14px;
  --ease: all 300ms ease-in-out;
  --font-text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-text); font-size: 1rem; line-height: 1.7; color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); }
h2 { font-size: clamp(2rem, 4.5vw, 2.75rem); }
h3 { font-size: 1.375rem; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--olive); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 46px; padding: .7rem 1.4rem; border: 1px solid transparent; border-radius: 999px; font-weight: 600; font-size: .9375rem; transition: var(--ease); }
/* Невидима «підошва» під елементом: коли він піднімається при hover, курсор не вислизає з нього (без мерехтіння) */
.btn, .demo-bar a, .add, .cart-btn { position: relative; }
.btn::before, .demo-bar a::before, .add::before, .cart-btn::before { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 8px; }
.btn:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -12px rgba(23, 25, 22, .35); }
.btn:active { transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-lime { background: var(--lime); color: var(--ink); }
.btn-line { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Тонка панель «назад до портфоліо» у кожному демо */
.demo-bar { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: .6rem; pointer-events: none; }
.demo-bar a { pointer-events: auto; display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1rem; background: rgba(23, 25, 22, .92); color: #fff; border-radius: 999px; font-size: .8125rem; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); transition: var(--ease); }
.demo-bar a:hover { transform: translateY(-4px); background: var(--ink); }
body.has-demo-bar { padding-bottom: 4.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
