/* Вовняна казка — стилі сайту.
   Палітра виміряна з фотографії печатки логотипа; шрифти самохостяться
   (див. fonts.css), тому CSP лишається суворою: default-src 'self'. */

:root {
  --paper: #fbf8ec;
  --warm: #f3ebd8;
  --deep: #e7dcc4;
  --ink: #2a2117;
  --ink-2: #4a3d2b;
  --taupe: #9a896f;
  /* Приглушений текст окремим токеном: --taupe годиться лише для декору
     (3.19:1 на папері), а дрібний підпис мусить брати 4.5:1. */
  --muted: #756545;
  --line: #d9ceb6;
  --olive: #6b6845;
  --olive-d: #4c4a2f;
  --caramel: #b38f6b;

  --wrap: 1240px;
  --pad: 60px;
  --radius: 2px;
  --tap: 44px;

  --step: 1.62;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  /* Липкий хедер не має накривати заголовок секції при переході по анкору. */
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-2);
  font: 400 17px/var(--step) Manrope, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: Lora, "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.012em;
  text-wrap: pretty;
}

p,
ul,
ol,
blockquote,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--olive);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

a:hover {
  color: var(--olive-d);
}

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

hr {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}

mark {
  background: linear-gradient(transparent 68%, rgba(179, 143, 107, 0.32) 0);
  color: inherit;
}

.glyph,
.chev {
  flex: none;
}

/* ── службове ─────────────────────────────────────────────────────────── */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  background: var(--olive);
  color: var(--paper);
  font: 600 15px/1 Manrope, sans-serif;
}

.skip:focus {
  left: 12px;
  top: 12px;
  color: var(--paper);
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.weave {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(154, 137, 111, 0.14) 1px, transparent 0),
    repeating-linear-gradient(90deg, rgba(154, 137, 111, 0.045) 0 1px, transparent 1px 6px);
  background-size: 7px 7px, 6px 6px;
}

.weave-d {
  background-image:
    radial-gradient(circle at 1px 1px, rgba(251, 248, 236, 0.075) 1px, transparent 0),
    repeating-linear-gradient(90deg, rgba(251, 248, 236, 0.03) 0 1px, transparent 1px 6px);
  background-size: 7px 7px, 6px 6px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font: 600 12px/1 Manrope, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  flex: none;
  width: 30px;
  height: 1px;
  background: var(--caramel);
}

.lead {
  font-size: 19px;
  line-height: 1.68;
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

/* ── кнопки ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border-radius: var(--radius);
  font: 600 15px/1 Manrope, sans-serif;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.btn-p {
  background: var(--olive);
  border: 1px solid var(--olive);
  color: var(--paper);
}

.btn-p:hover {
  background: var(--olive-d);
  border-color: var(--olive-d);
  color: var(--paper);
}

.btn-s {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.btn-s:hover {
  border-color: var(--taupe);
  color: var(--ink);
}

.btn-l {
  background: var(--paper);
  border: 1px solid var(--paper);
  color: var(--olive-d);
}

.btn-l:hover {
  background: var(--warm);
  border-color: var(--warm);
  color: var(--olive-d);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chips li {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font: 500 13px/1.3 Manrope, sans-serif;
  color: var(--ink-2);
}

.chips-c {
  justify-content: center;
}

/* ── хедер ────────────────────────────────────────────────────────────── */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s var(--ease);
}

.site-head.is-scrolled {
  box-shadow: 0 6px 24px -18px rgba(42, 33, 23, 0.5);
}

.head-in {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 88px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-right: auto;
  color: var(--ink);
}

.brand img {
  border-radius: 50%;
}

.brand span {
  font: 600 19px/1.1 Lora, Georgia, serif;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  font: 500 15px/1 Manrope, sans-serif;
  color: var(--ink-2);
}

.nav a:hover {
  color: var(--ink);
}

/* Специфічність навмисно вища за .nav a — інакше кнопка в хедері успадковує
   темний колір тексту й дає 1.85:1 на оливі. */
.nav a.nav-cta,
.nav a.nav-cta:hover {
  min-height: 46px;
  padding: 0 20px;
  color: var(--paper);
}

.burger {
  display: none;
  width: var(--tap);
  height: var(--tap);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

/* ── hero ─────────────────────────────────────────────────────────────── */

.hero {
  padding: 82px 0 74px;
}

.hero-in {
  display: grid;
  grid-template-columns: 1.04fr 0.96fr;
  gap: 64px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero-copy h1 {
  font-size: clamp(46px, 5.4vw, 78px);
  line-height: 0.99;
  letter-spacing: -0.022em;
}

.hero-copy h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--olive);
}

.hero-copy .lead {
  max-width: 44ch;
}

.row-btn {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-mark {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 470px;
}

.hero-mark img {
  position: relative;
  width: clamp(240px, 30vw, 390px);
  height: auto;
  filter: drop-shadow(0 26px 54px rgba(42, 33, 23, 0.26));
}

.halo,
.halo-pattern,
.halo-ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.halo,
.halo-pattern {
  width: clamp(280px, 34vw, 446px);
  aspect-ratio: 1;
}

.halo {
  background: var(--warm);
}

.halo-pattern {
  background: url("../img/pattern-knit.svg") repeat;
  opacity: 0.5;
}

.halo-ring {
  width: clamp(300px, 36vw, 470px);
  aspect-ratio: 1;
  border: 1px solid var(--caramel);
  opacity: 0.5;
}

/* ── смуги секцій ─────────────────────────────────────────────────────── */

.band {
  padding: 66px 0;
  background: var(--warm);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
}

.cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 26px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  text-align: center;
}

.cat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
}

.cat-icon img {
  width: auto;
  max-width: 100%;
  height: 100%;
}

.cat h3 {
  font-size: 16px;
  line-height: 1.3;
}

.cat p {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

/* ── роботи ───────────────────────────────────────────────────────────── */

.works {
  padding: 78px 0;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* Тягнемо десять постів: на мобілці дві колонки дають рівні 5 рядків.
   Тут колонок три, тому десятий сховано — інакше останній рядок стояв би
   з одною плиткою. display:none лишає lazy-картинку незавантаженою. */
.works-grid > li:nth-child(10) {
  display: none;
}

.tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--warm);
}

.tile img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}

.tile:hover img,
.tile:focus-visible img {
  transform: scale(1.035);
}

.tile-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 40px 16px 14px;
  background: linear-gradient(rgba(42, 33, 23, 0), rgba(42, 33, 23, 0.78));
  color: var(--paper);
  font: 500 13px/1.4 Manrope, sans-serif;
}

.works-more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.works-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 58px 40px;
  background: var(--warm);
  border: 1px solid var(--line);
  text-align: center;
}

.works-empty img {
  border-radius: 50%;
}

.works-empty h3 {
  font-size: 26px;
  line-height: 1.2;
}

/* ── про майстерню ────────────────────────────────────────────────────── */

.about {
  padding: 84px 0;
}

.about-in {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 74px;
  align-items: center;
}

.about-art {
  position: relative;
}

.about-art::after {
  content: "";
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1px solid var(--caramel);
  pointer-events: none;
}

.about-art img {
  position: relative;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.about-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.about-copy h2 {
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1.1;
}

.about-copy p {
  font-size: 16.5px;
}

.about-copy .lead {
  font-size: 19px;
}

.about-copy blockquote {
  padding-left: 22px;
  border-left: 2px solid var(--caramel);
  font: italic 500 24px/1.44 Lora, Georgia, serif;
  color: var(--ink);
}

.about-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 22px;
}

.about-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 15px/1 Manrope, sans-serif;
}

.about-links span {
  color: var(--line);
}

/* ── кроки ────────────────────────────────────────────────────────────── */

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 34px;
}

.steps li {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-n {
  font: 600 42px/1 Lora, Georgia, serif;
  color: var(--olive);
}

.steps h3 {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.24;
}

.steps p {
  font-size: 15px;
  line-height: 1.62;
}

/* ── питання ──────────────────────────────────────────────────────────── */

.faq {
  padding: 80px 0;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
}

.faq details {
  border-top: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--tap);
  padding: 18px 0;
  cursor: pointer;
  font: 600 19px/1.34 Lora, Georgia, serif;
  color: var(--ink);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary .chev {
  color: var(--taupe);
  transition: transform 0.22s var(--ease);
}

.faq details[open] summary .chev {
  transform: rotate(180deg);
}

.faq details p {
  padding: 0 40px 20px 0;
  font-size: 15.5px;
  line-height: 1.66;
}

/* ── фінальний CTA ────────────────────────────────────────────────────── */

.cta {
  padding: 78px 0;
  background: var(--olive-d);
}

.cta-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.cta img {
  border-radius: 50%;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
}

.cta h2 {
  max-width: 22ch;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.12;
  color: var(--paper);
}

.cta p {
  max-width: 46ch;
  color: rgba(251, 248, 236, 0.86);
}

.cta-at {
  font: 500 14px/1 Manrope, sans-serif;
  letter-spacing: 0.04em;
  color: rgba(251, 248, 236, 0.76);
}

/* ── футер ────────────────────────────────────────────────────────────── */

.site-foot {
  padding: 52px 0 40px;
  border-top: 1px solid var(--line);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
}

.foot-title {
  margin-bottom: 12px;
  font: 600 12px/1 Manrope, sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.foot-grid li {
  font-size: 15px;
}

.foot-grid a,
.about-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.foot-grid li + li {
  margin-top: 10px;
}

.foot-grid a {
  color: var(--ink-2);
}

.foot-grid a:hover {
  color: var(--olive);
}

.site-foot hr {
  margin: 34px 0 18px;
}

.foot-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font: 400 13.5px/1.4 Manrope, sans-serif;
  color: var(--muted);
}

/* ── поява на скролі ──────────────────────────────────────────────────── */

.reveal {
  opacity: 1;
}

/* Ховаємо лише коли є JS: без нього вміст мусить бути видимим одразу. */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ── адаптив ──────────────────────────────────────────────────────────── */

@media (max-width: 1080px) {
  :root {
    --pad: 40px;
  }

  .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 34px;
  }

  .about-in {
    grid-template-columns: 280px 1fr;
    gap: 48px;
  }
}

@media (max-width: 900px) {
  .burger {
    display: flex;
    order: 3;
  }

  .nav {
    display: none;
    order: 4;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 8px 0 20px;
  }

  .nav.is-open {
    display: flex;
  }

  .nav a {
    display: flex;
    align-items: center;
    min-height: var(--tap);
    padding: 4px 0;
    font-size: 17px;
  }

  .nav-cta {
    justify-content: center;
    margin-top: 10px;
  }

  .head-in {
    flex-wrap: wrap;
    min-height: 68px;
  }

  .hero {
    padding: 40px 0 48px;
  }

  .hero-in {
    grid-template-columns: 1fr;
    gap: 34px;
    justify-items: center;
    text-align: center;
  }

  .hero-copy {
    order: 2;
    align-items: center;
    gap: 22px;
  }

  .hero-copy .eyebrow {
    justify-content: center;
  }

  .hero-copy .lead {
    max-width: 46ch;
  }

  .row-btn {
    width: 100%;
    flex-direction: column;
  }

  .row-btn .btn {
    width: 100%;
  }

  .chips {
    justify-content: center;
  }

  .hero-mark {
    order: 1;
    min-height: 0;
    padding: 18px 0 6px;
  }

  .about-in {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .about-art {
    max-width: 340px;
    margin: 0 auto;
  }

  /* На тач-екрані цілі мусять бути справді тапабельні. */
  .foot-grid a,
  .about-links a {
    min-height: var(--tap);
  }

  .foot-grid li + li {
    margin-top: 2px;
  }

  .faq-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --pad: 20px;
  }

  body {
    font-size: 16.5px;
  }

  .band,
  .works,
  .about,
  .faq {
    padding: 40px 0;
  }

  .cta {
    padding: 44px 0;
  }

  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .cat {
    padding: 18px 10px;
  }

  .cat-icon {
    height: 64px;
  }

  .works-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .works-grid > li:nth-child(10) {
    display: block;
  }

  .tile-cap {
    padding: 30px 12px 10px;
    font-size: 12px;
  }

  .works-more .btn,
  .works-empty .btn {
    width: 100%;
  }

  .works-empty {
    padding: 34px 20px;
  }

  .steps {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .step-n {
    font-size: 32px;
  }

  .about-copy blockquote {
    font-size: 21px;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* ── повага до налаштувань користувача ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

@media print {
  .site-head,
  .burger,
  .cta,
  .works-more {
    display: none;
  }

  body {
    background: #fff;
  }
}
