:root {
  --bg: #ffffff;
  --tint: #f4f7f6;
  --ink: #17211f;
  --muted: #5f6f6b;
  --line: #e2e8e6;
  --accent: #12b886;
  --accent-dark: #0e9c72;
  --accent-soft: #e6f7f1;
  --radius: 16px;
}

* { box-sizing: border-box; }

/* Атрибут hidden важнее display из авторских правил (.modal/.card): без этого
   фильтр каталога и модальное окно не скрывались бы. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.18; letter-spacing: -.015em; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; background: var(--accent); color: #fff; padding: 12px 18px; z-index: 100; }
.skip:focus { left: 0; }

/* Шапка */
.header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; gap: 26px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 20px; color: var(--accent-dark); }
.logo__mark { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 18px; }
.nav { display: flex; gap: 22px; }
.nav a { text-decoration: none; font-size: 15px; color: #33413d; }
.nav a:hover { color: var(--accent-dark); }
.header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 20px;
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: background .18s, border-color .18s, color .18s;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: #c6d3cf; }
.btn--lg { padding: 14px 26px; font-size: 16px; }
.btn--small { padding: 8px 14px; font-size: 13.5px; }
.btn--block { width: 100%; }
.burger { display: none; }

/* Хиро */
.hero { background: linear-gradient(180deg, var(--accent-soft), #fff 78%); border-bottom: 1px solid var(--line); }
.hero__inner { padding: 64px 0 56px; max-width: 780px; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); font-weight: 700; }
.lead { font-size: 18px; color: var(--muted); max-width: 56ch; }
.search { display: flex; gap: 10px; margin: 26px 0 28px; max-width: 620px; }
.search input {
  flex: 1; border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px;
  font: inherit; font-size: 15px; background: #fff;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero__facts { display: flex; gap: 34px; list-style: none; margin: 0; padding: 0; }
.hero__facts b { display: block; font-size: 21px; }
.hero__facts span { font-size: 13.5px; color: var(--muted); }

/* Секции */
.section { padding: 64px 0; }
.section--tint { background: var(--tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { font-size: clamp(25px, 3vw, 34px); }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 30px; }
.section__sub { color: var(--muted); margin: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; cursor: pointer; color: #33413d; }
.tab:hover { border-color: #c6d3cf; }
.tab.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: box-shadow .2s, border-color .2s;
}
.card:hover { box-shadow: 0 14px 34px rgba(23, 33, 31, .08); border-color: #cfdad7; }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chip { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--tint); color: #41524d; }
.chip--free { background: var(--accent-soft); color: var(--accent-dark); }
.rating { font-size: 13px; color: #b07d00; font-weight: 600; }
.card h3 { font-size: 19px; margin: 2px 0 0; }
.card__text { color: var(--muted); font-size: 14.5px; margin: 0; flex: 1; }
.card__meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.card__bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.card__author { font-size: 12.5px; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding-top: 30px; }

/* Колонки */
.cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.col h3 { font-size: 17px; }
.col p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* Отзывы */
.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.review { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.review blockquote { margin: 0; font-size: 15px; line-height: 1.6; flex: 1; }
.review figcaption { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.review small { display: block; color: var(--muted); font-size: 12.5px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-dark); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }

/* CTA */
.cta { padding: 12px 0 64px; }
.cta__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px;
  background: var(--accent); color: #fff; border-radius: 22px; padding: 38px 40px;
}
.cta h2 { font-size: clamp(23px, 2.6vw, 30px); }
.cta p { margin: 0; color: rgba(255, 255, 255, .86); }
.cta .btn--primary { background: #fff; color: var(--accent-dark); }
.cta .btn--primary:hover { background: #eefbf6; }

/* Подвал */
.footer { background: var(--tint); border-top: 1px solid var(--line); padding: 48px 0 24px; }
.footer__inner { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.5fr); gap: 36px; }
.footer__brand p { color: var(--muted); font-size: 14px; }
.logo--footer { margin-bottom: 10px; }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.footer__cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer__cols a { display: block; text-decoration: none; font-size: 14.5px; padding: 4px 0; }
.footer__cols a:hover { text-decoration: underline; }
.footer__bottom { display: flex; justify-content: space-between; gap: 14px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Модальное окно */
body.is-locked { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(23, 33, 31, .55); }
.modal__dialog { position: relative; width: min(430px, 100%); background: #fff; border-radius: 20px; padding: 30px; box-shadow: 0 26px 70px rgba(0, 0, 0, .24); }
.modal__close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 50%; font-size: 21px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal__text { color: var(--muted); font-size: 15px; }
.form { display: grid; gap: 13px; margin-top: 16px; }
.field { display: grid; gap: 6px; font-size: 14px; }
.field span { color: var(--muted); }
.field input { border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: inherit; font-size: 15px; background: var(--tint); }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; background: #fff; }
.form__done { margin: 16px 0 0; padding: 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); font-size: 15px; }

/* Адаптив */
@media (max-width: 980px) {
  .grid, .cols, .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 16px 14px; }
  .header.is-open .nav { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
  .burger span, .burger span::before, .burger span::after { content: ""; display: block; width: 17px; height: 2px; background: var(--ink); margin: 0 auto; position: relative; }
  .burger span::before { position: absolute; top: -5px; }
  .burger span::after { position: absolute; top: 5px; }
  .header__actions .btn--ghost { display: none; }
  .search { flex-direction: column; }
  .grid, .cols, .reviews, .footer__cols { grid-template-columns: 1fr; }
  .hero__facts { gap: 22px; flex-wrap: wrap; }
  .section { padding: 48px 0; }
  .cta__inner { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
