/* =========================================================
   Trot&Knot — макраме мастерская
   Цвета взяты из логотипа. Шрифты: положите woff2 в /fonts
   (см. README), иначе используются системные запасные.
   ========================================================= */

/* Шрифт с прежнего сайта на Tilda. Положите файл spsl_new_cyrillic.woff
   в папку /fonts (см. README). Без файла используется Arial, как и на Tilda. */
@font-face {
  font-family: "SPSL-New-Cyrillic";
  src: url("../fonts/spsl_new_cyrillic.woff2") format("woff2"),
       url("../fonts/spsl_new_cyrillic.woff") format("woff");
  font-weight: 100 900; /* один файл на все начертания, жирный браузер дорисует сам — так же было на Tilda */
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #192c4a;
  --navy-deep: #0f1d33;
  --red: #991d25;
  --red-dark: #7c161d;
  --cream: #f4ece3;
  --cream-2: #faf6f1;
  --paper: #ffffff;
  --ink: #1d2433;
  --muted: #5c6474;
  --line: #e4dbd0;
  --serif: "SPSL-New-Cyrillic", Arial, sans-serif;
  --sans: "SPSL-New-Cyrillic", Arial, sans-serif;
  --radius: 18px;
  --shadow: 0 18px 40px -22px rgba(15, 29, 51, .35);
  --wrap: 1180px;
  --header-h: 76px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream-2);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0 0 .5em; color: var(--navy); }
h1 { font-size: clamp(44px, 7vw, 84px); }
h2 { font-size: clamp(34px, 4.6vw, 54px); }
h3 { font-size: 30px; }
p { margin: 0 0 1em; }

.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.section { padding: clamp(64px, 9vw, 120px) 0; }
.eyebrow {
  display: inline-block;
  font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin-bottom: 14px;
}
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--muted); max-width: 640px; }
.center { text-align: center; }
.center .lead { margin-inline: auto; }

.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  font: 700 15px/1 var(--sans); letter-spacing: .02em;
  border: 2px solid transparent; border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 3px solid rgba(153, 29, 37, .35); outline-offset: 3px; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { border-color: currentColor; color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--cream); }
.btn-ghost-light { border-color: rgba(255,255,255,.6); color: #fff; }
.btn-ghost-light:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(250, 246, 241, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 24px -18px rgba(15,29,51,.4); }
.header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: block; flex: none; }
.logo img { height: 52px; width: auto; }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; font-size: 15px; font-weight: 600; color: var(--navy); position: relative; padding: 6px 0; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s; }
.nav a:hover::after { transform: scaleX(1); }
.header .btn { min-height: 44px; padding: 0 22px; font-size: 14px; }
.burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 10px; }
.burger span { display: block; height: 2px; background: var(--navy); margin: 6px 0; transition: transform .25s, opacity .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 1020px) {
  .header .btn-header { display: none; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; gap: 0;
    background: var(--cream-2); border-bottom: 1px solid var(--line);
    padding: 8px 16px 20px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 17px; }
  .nav a::after { display: none; }
}

/* ---------- Первый экран ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: calc(100svh - var(--header-h));
  display: flex; align-items: center;
  background: var(--cream);
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(250,246,241,.97) 0%, rgba(250,246,241,.9) 38%, rgba(250,246,241,.35) 70%, rgba(250,246,241,0) 100%);
}
.hero .wrap { position: relative; z-index: 1; padding: 80px 0; }
.hero-content { max-width: 620px; }
.hero h1 { margin-bottom: 24px; }
.hero h1 em { font-style: italic; color: var(--red); font-weight: 500; }
.hero p { font-size: clamp(17px, 1.7vw, 20px); color: #3a4254; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
@media (max-width: 760px) {
  .hero::after { background: linear-gradient(180deg, rgba(250,246,241,.82) 0%, rgba(250,246,241,.94) 55%, rgba(250,246,241,.98) 100%); }
  .hero .btn { flex: 1 1 100%; }
}

/* ---------- Миссия ---------- */
.mission .wrap { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.mission-photo { position: relative; }
.mission-photo img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; aspect-ratio: 4/3.4; object-fit: cover; }
.mission-photo::before {
  content: ""; position: absolute; inset: 24px -24px -24px 24px;
  border: 2px solid var(--red); border-radius: var(--radius); z-index: -1; opacity: .35;
}
.brush-title {
  position: relative; display: inline-block; isolation: isolate;
  color: #fff; font-family: var(--serif); font-size: clamp(22px, 2.4vw, 28px); font-weight: 600;
  padding: 10px 34px 14px; margin: 0 0 22px 10px;
}
.brush-title::before {
  content: ""; position: absolute; inset: -6px -10px; z-index: -1;
  background: url("../img/brush.webp") center / 100% 100% no-repeat;
}
.mission h2 { margin-bottom: 26px; }
.mission p { color: #3a4254; }
@media (max-width: 860px) {
  .mission .wrap { grid-template-columns: 1fr; }
  .mission-photo { max-width: 560px; margin-right: 24px; }
}

/* ---------- Лавка ---------- */
.shop { background: var(--cream); }
.shop-head { margin-bottom: 52px; }
/* Сетка подстраивается под число видимых карточек (если какие-то выключены в config.js) */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.product {
  display: flex; flex-direction: column;
  background: var(--paper); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s;
}
.product:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -24px rgba(15,29,51,.45); }
.product-media { position: relative; aspect-ratio: 1 / 1.05; overflow: hidden; background: var(--cream); }
.product-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .4s, transform .6s; }
.product-media img + img { opacity: 0; }
.product:hover .product-media img + img,
.product:focus-within .product-media img + img { opacity: 1; }
.product:hover .product-media img:only-child { transform: scale(1.04); }
.badge {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
}
.product-body { display: flex; flex-direction: column; flex: 1; padding: 24px 24px 26px; }
.product h3 { margin-bottom: 4px; }
.price { font-weight: 700; color: var(--red); font-size: 18px; margin-bottom: 14px; }
.product p { font-size: 15px; color: var(--muted); line-height: 1.6; flex: 1; }
.product .btn { min-height: 46px; margin-top: 8px; align-self: flex-start; }

/* ---------- Мастер-классы ---------- */
.workshops { position: relative; background: var(--navy); color: #e7ecf4; overflow: hidden; }
.workshops::before {
  content: ""; position: absolute; inset: 0;
  background: url("../img/ropes.webp") center / cover no-repeat;
  opacity: .18; mix-blend-mode: luminosity;
}
.workshops .wrap { position: relative; display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.workshops h2 { color: #fff; }
.workshops .eyebrow { color: #f1a7ad; }
.workshops p { color: #cfd7e4; }
.workshops-photo img { border-radius: var(--radius); width: 100%; aspect-ratio: 4/5; object-fit: cover; box-shadow: 0 30px 60px -30px rgba(0,0,0,.7); }
.ws-points { list-style: none; margin: 24px 0 32px; padding: 0; display: grid; gap: 12px; }
.ws-points li { position: relative; padding-left: 30px; color: #e7ecf4; }
.ws-points li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 14px; border-radius: 50%; border: 2px solid #f1a7ad; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 860px) {
  .workshops .wrap { grid-template-columns: 1fr; }
  .workshops-photo { max-width: 460px; }
}

/* ---------- Автор ---------- */
.author { background: #f4ece5; } /* точно в цвет фона фото */
.author .wrap { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.author-photo img { width: 100%; max-width: 440px; margin-inline: auto; }
.author h2 { margin-bottom: 6px; }
.author .role { font-family: var(--serif); font-style: italic; font-size: 24px; color: var(--red); margin-bottom: 26px; }
.author-facts { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.author-facts li { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; }
.author-facts .num { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--navy); font-weight: 600; white-space: nowrap; }
.author-facts .ico { width: 44px; height: 44px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
.author-facts .ico svg { width: 22px; height: 22px; }
.author-facts p { margin: 0; color: #3a4254; }
@media (max-width: 860px) { .author .wrap { grid-template-columns: 1fr; } .author-photo { max-width: 340px; } }

/* ---------- Заказ ---------- */
.order { position: relative; background: var(--navy-deep); overflow: hidden; }
.order-bg { position: absolute; inset: 0; }
.order-bg img { width: 100%; height: 100%; object-fit: cover; }
.order::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, rgba(15,29,51,.92), rgba(15,29,51,.7)); }
.order .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.order-intro { color: #e7ecf4; padding-top: 12px; }
.order-intro h2 { color: #fff; }
.order-intro .eyebrow { color: #f1a7ad; }
.order-intro p { color: #cfd7e4; font-size: 18px; }
.order-alt { margin-top: 28px; font-size: 15px; color: #aab6c8; }
.order-alt .socials { margin-top: 12px; }

.form-card { background: var(--paper); border-radius: 22px; padding: clamp(24px, 4vw, 40px); box-shadow: 0 40px 80px -40px rgba(0,0,0,.6); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label, .field .label { font-size: 13px; font-weight: 700; color: var(--navy); letter-spacing: .02em; }
.field .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--ink);
  background: var(--cream-2); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 4px rgba(25,44,74,.1); }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--red); }
.field .err { font-size: 13px; color: var(--red); min-height: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 600; color: var(--navy); background: var(--cream-2); transition: all .2s; }
.chips input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.chips input:focus-visible + span { box-shadow: 0 0 0 4px rgba(25,44,74,.18); }
.consent { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-size: 14px; color: var(--muted); line-height: 1.5; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--navy); }
.consent a { color: var(--navy); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-actions { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.form-actions .btn { min-width: 200px; }
.btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.form-status { font-size: 15px; font-weight: 600; }
.form-status.ok { color: #1f7a4a; }
.form-status.bad { color: var(--red); }
.form-success { text-align: center; padding: 36px 8px; }
.form-success .check { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; }
.form-success .check svg { width: 34px; height: 34px; }
@media (max-width: 960px) { .order .wrap { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } .form-actions .btn { width: 100%; } }

/* ---------- Контакты ---------- */
.contacts { background: var(--cream-2); }
.contacts .wrap { display: grid; grid-template-columns: auto 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.contacts-logo img { width: clamp(200px, 26vw, 320px); }
.contacts h2 { margin-bottom: 22px; }
.contact-list { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 10px; }
.contact-list a { text-decoration: none; font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; color: var(--navy); }
.contact-list a:hover { color: var(--red); }
.contact-note { color: var(--muted); margin-bottom: 22px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; }
.social {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px;
  border-radius: 999px; text-decoration: none; font-weight: 700; font-size: 14px;
  background: var(--navy); color: #fff; transition: background .2s, transform .2s;
}
.social:hover { background: var(--red); transform: translateY(-1px); }
.social svg { width: 20px; height: 20px; }
.order-alt .social { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); }
.order-alt .social:hover { background: #fff; color: var(--navy); }
@media (max-width: 760px) { .contacts .wrap { grid-template-columns: 1fr; } }

/* ---------- Подвал ---------- */
.footer { background: var(--navy); color: #aab6c8; font-size: 14px; padding: 26px 0; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.footer a { color: #dbe2ee; text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }

.to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--red); color: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 22px; height: 22px; }

/* ---------- Анимация появления ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Текстовые страницы (политика, согласие) ---------- */
.doc { padding: clamp(40px, 6vw, 80px) 0 100px; }
.doc .wrap { max-width: 860px; }
.doc h1 { font-size: clamp(36px, 5vw, 56px); }
.doc h2 { font-size: clamp(26px, 3vw, 32px); margin-top: 1.6em; }
.doc p, .doc li { color: #333b4b; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin-bottom: .4em; }
.doc .meta { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.fill { background: #fff2a8; padding: 0 4px; border-radius: 4px; font-weight: 600; }
.back-link { display: inline-flex; gap: 8px; align-items: center; color: var(--navy); font-weight: 700; text-decoration: none; margin-bottom: 28px; }
.back-link:hover { color: var(--red); }

/* Скрытие блоков через js/config.js */
[data-block].is-hidden { display: none !important; }
