/* ==========================================================
   «Тёплый ряд» — сайт о вязании и рукоделии
   Токены: чернильно-сливовый + бумага + пряжа-фуксия + шалфей
   ========================================================== */

:root {
  --ink: #221A2B;
  --ink-2: #342941;
  --paper: #F3F0F5;
  --paper-2: #E5DEEC;
  --line: #D6CCE0;
  --yarn: #E0447C;
  --yarn-deep: #A32A5B;
  --sage: #5F8A6A;
  --ochre: #C98A2E;
  --chalk: #FFFFFF;
  --muted: #6E6280;

  --display: 'Yeseva One', Georgia, 'Times New Roman', serif;
  --body: 'Golos Text', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Courier New', monospace;

  --wrap: 1180px;
  --r: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--yarn-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.5px; }
h2 { font-size: clamp(1.8rem, 4vw, 2.9rem); }
h3 { font-size: 1.25rem; line-height: 1.25; }
p { margin: 0 0 1rem; }

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

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding: 5.5rem 0; }
.section--tight { padding: 3.5rem 0; }

/* ---------- Служебные элементы ---------- */

.eyebrow {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before {
  content: "";
  width: 10px; height: 10px;
  border: 1.5px solid var(--yarn);
  transform: rotate(45deg);
  flex: none;
}

/* шов «вперёд иголку» */
.stitch-rule {
  height: 2px;
  border: 0;
  margin: 0;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 14px, transparent 14px 24px);
}

.lead { font-size: 1.12rem; color: #4C4258; max-width: 56ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .97rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--yarn-deep); color: var(--chalk); }
.btn--primary:hover { background: #8C2049; }
.btn--ghost { border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); }
.btn--light { background: var(--paper); color: var(--ink); }

.tag {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  display: inline-block;
}
.tag--yarn { background: rgba(224, 68, 124, .14); color: var(--yarn-deep); }
.tag--sage { background: rgba(95, 138, 106, .16); color: #3F6449; }

/* ---------- Шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 240, 245, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: .2px;
}
.logo__mark {
  width: 30px; height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: .95rem;
  color: var(--yarn-deep);
}
.nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--yarn); font-weight: 600; }

.burger {
  display: none;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .5rem .7rem;
  font-family: var(--mono);
  font-size: .85rem;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Схема (фирменный элемент) ---------- */

.chart {
  display: grid;
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--ink);
  padding: 2px;
  border-radius: 6px;
}
.chart__cell {
  aspect-ratio: 1;
  background: var(--chalk);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: clamp(.6rem, 1.5vw, .95rem);
  color: var(--ink-2);
  animation: cellIn .5s ease both;
}
.chart__cell--yarn { background: var(--yarn); color: var(--chalk); }
.chart__cell--sage { background: rgba(95, 138, 106, .22); color: #3F6449; }
.chart__cell--ink { background: var(--ink); color: var(--paper); }
.chart__cell:hover { outline: 2px solid var(--yarn-deep); outline-offset: -2px; }

@keyframes cellIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.4rem;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  margin-top: .9rem;
  list-style: none;
  padding: 0;
}
.chart-legend b { color: var(--ink); font-weight: 500; }

/* ---------- Первый экран ---------- */

.hero { padding: 4.5rem 0 4rem; }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 4rem;
  align-items: center;
}
.hero h1 span { color: var(--yarn-deep); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.hero__facts {
  display: flex;
  gap: 2rem;
  margin-top: 2.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.hero__facts b { display: block; font-size: 1.5rem; color: var(--ink); font-weight: 500; }

/* ---------- Карточки ---------- */

.grid { display: grid; gap: 1.6rem; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card--link:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(34, 26, 43, .1); }
.card p { margin: 0; color: #55495F; font-size: .95rem; }
.card__meta {
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .9rem;
  margin-top: auto;
  padding-top: .8rem;
}
.card__link { color: var(--yarn-deep); font-weight: 600; font-size: .92rem; text-decoration: none; }
.card__link:hover { text-decoration: underline; }

/* образец вязания вместо фотографии */
.swatch {
  height: 168px;
  border-radius: 10px;
  background-color: var(--c, #8A7BA6);
  background-image:
    repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 3px, transparent 3px 11px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 3px, transparent 3px 11px);
  background-size: 22px 22px;
  border: 1px solid rgba(34, 26, 43, .12);
  position: relative;
  overflow: hidden;
}
.swatch--tall { height: 230px; }
.swatch__badge {
  position: absolute;
  left: .7rem; bottom: .7rem;
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  padding: .2rem .65rem;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--ink);
}

/* ---------- Тёмная полоса ---------- */

.band {
  background: var(--ink);
  color: var(--paper);
}
.band h2, .band h3 { color: var(--chalk); }
.band .eyebrow { color: #B3A6C4; }
.band .lead { color: #CFC5DA; }
.band .stitch-rule { background-image: repeating-linear-gradient(90deg, #4B3E5C 0 14px, transparent 14px 24px); }

.quote {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.25;
  margin: 0 0 1.2rem;
  max-width: 22ch;
}
.quote-author { font-family: var(--mono); font-size: .8rem; color: #B3A6C4; }

/* ---------- Ряды мастер-класса ---------- */

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.2rem; }
.row-step {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 1.6rem;
  align-items: start;
  background: var(--chalk);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.3rem 1.5rem;
}
.row-step__num {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--yarn-deep);
  background: rgba(224, 68, 124, .12);
  border-radius: 8px;
  padding: .4rem .5rem;
  text-align: center;
  text-transform: uppercase;
}
.row-step h3 { margin-bottom: .35rem; }
.row-step p { margin: 0; color: #55495F; }
.row-step__note {
  margin-top: .7rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--sage);
  border-left: 2px solid var(--sage);
  padding-left: .7rem;
}

/* ---------- Таблицы и формы ---------- */

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.table th { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 500; }
.table td b { font-weight: 600; }

.form { display: grid; gap: .9rem; max-width: 460px; }
.field { display: grid; gap: .35rem; }
.field label { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input, .field textarea, .field select {
  font-family: var(--body);
  font-size: 1rem;
  padding: .75rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--chalk);
  color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--yarn); outline: none; }
.hint { font-size: .82rem; color: var(--muted); }

/* ---------- Прочее ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.split--wide { grid-template-columns: 1.15fr .85fr; }

.section__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
}

.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter {
  font-family: var(--mono);
  font-size: .78rem;
  padding: .45rem .9rem;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.price { font-family: var(--mono); font-size: 1.1rem; font-weight: 500; }
.price s { color: var(--muted); font-size: .85rem; margin-right: .4rem; }

.note-box {
  background: rgba(95, 138, 106, .1);
  border: 1px solid rgba(95, 138, 106, .35);
  border-radius: var(--r);
  padding: 1.3rem 1.5rem;
}
.note-box h3 { margin-bottom: .5rem; }

/* ---------- Подвал ---------- */

.footer { background: var(--ink); color: #CFC5DA; padding: 4rem 0 2rem; }
.footer a { color: #CFC5DA; text-decoration: none; }
.footer a:hover { color: var(--chalk); text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: #8E7FA3; margin: 0 0 .9rem; font-weight: 500; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; font-size: .93rem; }
.footer .logo { color: var(--chalk); margin-bottom: .7rem; }
.footer .logo__mark { border-color: #5B4C6E; color: var(--yarn); }
.footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.4rem;
  border-top: 1px solid #3D3150;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .74rem;
  color: #8E7FA3;
}

/* ---------- Адаптив ---------- */

@media (max-width: 960px) {
  .hero__grid, .split, .split--wide { grid-template-columns: 1fr; gap: 2.5rem; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 4rem 0; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .burger { display: block; }
  .nav {
    position: absolute;
    inset: 100% 0 auto;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 1rem 1.25rem 1.4rem;
    display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: .9rem; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .row-step { grid-template-columns: 1fr; gap: .8rem; }
  .row-step__num { justify-self: start; padding: .3rem .8rem; }
  .footer__grid { grid-template-columns: 1fr; }
  .hero { padding: 2.5rem 0 3rem; }
}

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