/* ==========================================================================
   YAVKA AGENCY — sections & pages
   ========================================================================== */

/* В шапке шесть пунктов помещаются не на всякой ширине: между 1024 и 1280 px
   «Студия» уезжает за кнопку. Прячем именно её — это якорь на секцию той же
   страницы, и он остаётся в мобильном меню и в подвале, тогда как «Сводки» —
   отдельный раздел, попасть в который больше неоткуда. */
.nav__item--wide { display: none; }
@media (min-width: 1280px) { .nav__item--wide { display: list-item; } }

/* --- Шапка --- */
.header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  border-bottom: 1px solid transparent; background: transparent;
  transition: transform var(--dur-base) var(--ease-out), background var(--dur-base), border-color var(--dur-base);
}
.header.is-scrolled {
  background: var(--header-bg); border-color: var(--line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.header.is-hidden { transform: translateY(-100%); }
body.menu-open .header { background: var(--bg); border-color: var(--line); }
.header__in { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); height: 100%; }
.nav { display: none; }
/* До 1280 px в шапке умещается ровно всё и без запаса, поэтому промежутки там
   меньше: лишние четыре пикселя выталкивают кнопку за край окна. */
.header__actions { display: flex; align-items: center; gap: var(--s-2); }
@media (min-width: 1280px) { .header__actions { gap: var(--s-3); } }
.header__cta { display: none; }
@media (min-width: 768px) { .header__cta { display: inline-flex; } }
@media (min-width: 1024px) {
  .nav { display: block; }
  .nav ul { display: flex; gap: var(--s-6); }
  .nav a { font-size: 15px; font-weight: 500; color: var(--fg-2); transition: color var(--dur-fast); padding: 8px 0; }
  .nav a:hover, .nav a[aria-current="page"] { color: var(--fg); }
}

/* --- Мобильное меню --- */
.menu {
  position: fixed; inset: 0; z-index: 90; background: var(--bg); color: var(--fg);
  padding-top: calc(var(--header-h) + var(--s-6)); padding-bottom: var(--s-6);
  opacity: 0; transition: opacity var(--dur-base);
}
.menu.is-open { opacity: 1; }
.menu__in { display: flex; flex-direction: column; gap: var(--s-7); height: 100%; overflow: auto; }
.menu__nav a {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  font-family: var(--ff-display); font-weight: 500; letter-spacing: -.02em; line-height: 1.15;
  font-size: clamp(1.75rem, 7vw, 2.75rem); padding: 8px 0; border-bottom: 1px solid var(--line);
}
.menu__nav a .ico { width: 24px; height: 24px; color: var(--accent); }
.menu__bottom { margin-top: auto; display: grid; gap: var(--s-5); }
.menu__contacts { display: grid; gap: var(--s-2); color: var(--fg-2); font-size: 15px; }
.menu__contacts a:hover { color: var(--fg); }

/* --- Hero --- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: calc(100svh - var(--header-h));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-top: clamp(40px, 8vw, 96px); padding-bottom: clamp(40px, 6vw, 72px);
  background: var(--bg); color: var(--fg);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.5px);
  background-size: 28px 28px; opacity: .55;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);
}
.hero::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  width: 70vw; height: 70vw; max-width: 960px; max-height: 960px; right: -25vw; top: -35vw;
  background: radial-gradient(closest-side, rgba(255, 77, 28, .26), transparent 72%);
}
.hero__grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gap); row-gap: var(--s-6); }
.hero__eyebrow { grid-column: 1 / -1; }
.hero__title {
  grid-column: 1 / -1; margin: 0; max-width: none;
  font-family: var(--ff-display); font-weight: 700; font-size: var(--fs-display);
  line-height: .95; letter-spacing: -.03em;
}
.hero__stamp { grid-column: 1 / -1; justify-self: start; }
.hero__lead { grid-column: 1 / -1; }
.hero__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.hero__stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-6) var(--s-5);
  border-top: 1px solid var(--line); padding-top: var(--s-6); margin-top: var(--s-6);
}
@media (max-width: 479px) {
  .hero__actions .btn { width: 100%; }
}
@media (min-width: 768px) { .hero__stats { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1024px) {
  .hero__title { grid-column: 1 / 11; grid-row: 2; }
  .hero__stamp { grid-column: 11 / -1; grid-row: 2; justify-self: end; align-self: start; margin-top: 8px; }
  .hero__lead { grid-column: 1 / 8; }
}

/* --- Клиенты --- */
.clients { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-block: var(--s-5); background: var(--bg); }
.clients__in { display: flex; align-items: center; gap: var(--s-6); }
.clients__label { flex: none; color: var(--fg-3); display: none; }
@media (min-width: 768px) { .clients__label { display: block; } }
.clients .marquee {
  flex: 1; min-width: 0;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.client { font-weight: 600; font-size: 18px; color: var(--fg-3); white-space: nowrap; transition: color var(--dur-fast); }
.client:hover { color: var(--fg); }

/* --- Услуги --- */
.services .section-head { margin-bottom: var(--s-6); }

/* --- Процесс --- */
.process__steps { display: grid; gap: var(--gap); row-gap: var(--s-7); }
@media (min-width: 640px) { .process__steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .process__steps { grid-template-columns: repeat(5, 1fr); } }
.guarantees { display: grid; gap: var(--gap); margin-top: var(--s-9); }
@media (min-width: 768px) { .guarantees { grid-template-columns: repeat(3, 1fr); } }

/* --- Принципы --- */
.why__grid { display: grid; gap: var(--gap); }
@media (min-width: 768px) { .why__grid { grid-template-columns: repeat(2, 1fr); } }

/* --- Аудит --- */
.audit__grid { display: grid; gap: var(--s-7); }
@media (min-width: 1024px) { .audit__grid { grid-template-columns: 7fr 5fr; gap: var(--s-9); align-items: center; } }
.audit h2 { max-width: 16ch; }
.audit__text { margin-top: var(--s-5); color: var(--fg-2); max-width: 52ch; font-size: var(--fs-lead); line-height: 1.45; }
.audit__points { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.audit__points .tag { border-color: var(--line-strong); color: var(--fg); }
.audit__form { padding: clamp(24px, 3vw, 40px); border-radius: var(--r-lg); background: var(--bg); color: var(--fg); }

/* --- Отзывы --- */
.reviews__track {
  display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; padding-bottom: 4px;
  margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
}
.reviews__track::-webkit-scrollbar { display: none; }
.reviews__nav { display: flex; gap: var(--s-2); }

/* --- Студия --- */
.studio__grid { display: grid; gap: var(--s-8); }
@media (min-width: 1024px) { .studio__grid { grid-template-columns: 7fr 5fr; gap: var(--s-9); } }
.studio__text { margin-top: var(--s-5); display: grid; gap: 1em; color: var(--fg-2); max-width: 58ch; font-size: var(--fs-lead); line-height: 1.45; }
.facts { margin-top: var(--s-7); display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); border-top: 1px solid var(--line); padding-top: var(--s-5); }
.fact__label { color: var(--fg-3); }
.fact__value { margin-top: var(--s-2); font-weight: 500; }
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); align-content: start; }
.studio__posts { margin-top: var(--s-8); border-top: 1px solid var(--line); }
.post {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--line); font-weight: 500; transition: color var(--dur-fast);
}
.post:hover { color: var(--accent); }
.post .ico { color: var(--fg-3); }

/* --- FAQ --- */
.faq__grid { display: grid; gap: var(--s-7); }
@media (min-width: 1024px) { .faq__grid { grid-template-columns: 5fr 7fr; } }
.faq__lead { margin-top: var(--s-5); }

/* --- Контакты --- */
.contacts__grid { display: grid; gap: var(--s-8); }
@media (min-width: 1024px) { .contacts__grid { grid-template-columns: 1fr 1fr; gap: var(--s-9); align-items: start; } }
.contacts__list { margin-top: var(--s-7); border-top: 1px solid var(--line); }
.contacts__form { padding: clamp(24px, 3vw, 40px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-2); }
.contacts__alt { margin-top: var(--s-5); font-size: 15px; color: var(--fg-2); }
.contacts__alt button { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.contacts__alt button:hover { color: var(--accent); }

/* --- Подвал --- */
.footer { background: var(--bg); color: var(--fg); border-top: 1px solid var(--line); padding-top: var(--s-7); overflow: hidden; }
.footer__marquee { --marquee-gap: .3em; margin-bottom: var(--s-7); }
.footer__word {
  font-family: var(--ff-display); font-weight: 700; font-size: clamp(3.5rem, 12vw, 12rem);
  line-height: 1; letter-spacing: -.03em; color: transparent; white-space: nowrap;
  -webkit-text-stroke: 1px var(--line-strong);
}
/* Звёздочка в бегущей строке — акцент, который должен читаться на фоне подвала.
   Берём семантический токен, а не палитру: в светлой теме он темнее. */
.footer__word--fill { color: var(--accent); -webkit-text-stroke: 0; }
.footer__cta { display: grid; gap: var(--s-5); padding-block: var(--s-8); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.footer__cta h2 { max-width: 16ch; }
.footer__cta-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
@media (min-width: 768px) { .footer__cta { grid-template-columns: 1fr auto; align-items: center; } }
.footer__cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-7) var(--gap); padding-block: var(--s-8); }
@media (min-width: 768px) { .footer__cols { grid-template-columns: repeat(4, 1fr); } }
.footer__col .meta { color: var(--fg-3); margin-bottom: var(--s-4); display: block; }
.footer__col ul { display: grid; gap: var(--s-2); }
.footer__col a { color: var(--fg-2); font-size: 15px; transition: color var(--dur-fast); }
.footer__col a:hover { color: var(--fg); }
.footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3);
  padding-block: var(--s-5); border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-3);
}
.footer__bottom a:hover { color: var(--fg); }

/* --- Внутренние страницы: общий hero --- */
.page-hero { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(32px, 5vw, 56px); }
.page-hero h1 { margin-top: var(--s-4); }
.page-hero .lead { margin-top: var(--s-5); }

/* --- Все работы --- */
.filters { display: flex; flex-wrap: wrap; gap: var(--s-2); padding-bottom: var(--s-7); }
.works-page { padding-bottom: var(--section-y); }
.works__empty { grid-column: 1 / -1; color: var(--fg-2); padding: var(--s-8) 0; }

/* --- Кейс --- */
.case-hero { padding-top: clamp(40px, 7vw, 88px); }
.case-hero h1 { margin-top: var(--s-4); }
.case-hero .lead { margin-top: var(--s-5); }
.case-hero__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-6); }
.case-cover { margin-top: clamp(32px, 5vw, 64px); border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21 / 9; position: relative; background: var(--bg-2); }
.case-cover .cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.case-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-5); padding-block: var(--s-7); border-bottom: 1px solid var(--line); }
@media (min-width: 768px) { .case-meta { grid-template-columns: repeat(4, 1fr); } }
.case-meta__label { color: var(--fg-3); }
.case-meta__value { margin-top: var(--s-2); font-weight: 500; }
.case-meta__value a { text-decoration: underline; text-underline-offset: 3px; }
.case-section { display: grid; gap: var(--s-5); padding-block: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); }
@media (min-width: 1024px) { .case-section { grid-template-columns: 4fr 8fr; gap: var(--gap); } }
.case-section h2 { font-size: var(--fs-h3); font-family: var(--ff-text); font-weight: 600; max-width: none; margin-top: var(--s-3); }
.case-section__body { display: grid; gap: 1em; color: var(--fg-2); font-size: var(--fs-lead); line-height: 1.5; max-width: 64ch; }
.case-goals { display: grid; counter-reset: g; }
.case-goals li {
  display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); padding: var(--s-4) 0;
  border-top: 1px solid var(--line); font-size: var(--fs-lead); line-height: 1.45; color: var(--fg);
}
.case-goals li::before {
  counter-increment: g; content: counter(g, decimal-leading-zero);
  font-family: var(--ff-mono); font-size: 13px; color: var(--accent); padding-top: 6px;
}
.solutions { display: grid; }
.solution { display: grid; gap: var(--s-5); padding-block: var(--s-6); border-top: 1px solid var(--line); }
.solution:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 768px) { .solution { grid-template-columns: 1fr 1fr; align-items: center; gap: var(--s-7); } .solution:nth-child(even) .solution__ill { order: -1; } }
.solution__ill { border-radius: var(--r-md); overflow: hidden; aspect-ratio: 4 / 3; position: relative; background: var(--bg-2); }
.solution__ill .cover { position: absolute; inset: 0; width: 100%; height: 100%; }
.solution__title { font-size: 1.375rem; }
.solution__text { margin-top: var(--s-3); color: var(--fg-2); }
.metrics { display: grid; gap: var(--gap); }
@media (min-width: 640px) { .metrics { grid-template-columns: repeat(3, 1fr); } }
.case-review { padding-block: clamp(48px, 7vw, 96px); border-bottom: 1px solid var(--line); }
.case-review blockquote {
  font-family: var(--ff-display); font-weight: 500; letter-spacing: -.01em; line-height: 1.3;
  font-size: clamp(1.25rem, 1rem + 1.5vw, 2rem); max-width: 30ch; text-wrap: pretty; margin-top: var(--s-5);
}
.case-review__who { margin-top: var(--s-5); color: var(--fg-2); }
.case-review__who b { color: var(--fg); font-weight: 600; }
.case-next { padding-block: clamp(48px, 7vw, 96px); }
.case-next .case-card { max-width: 880px; margin-top: var(--s-6); }
.case-cta { padding-bottom: var(--section-y); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4); }
.case-cta h2 { max-width: 14ch; }

/* --- 404 --- */
.nf { min-height: calc(100svh - var(--header-h)); display: grid; place-items: center; text-align: center; padding-block: var(--s-9); }
.nf__in { display: grid; gap: var(--s-5); justify-items: center; }
.nf h1 { font-size: var(--fs-display); }
.nf p { color: var(--fg-2); font-size: var(--fs-lead); max-width: 36ch; }
.nf__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; justify-content: center; margin-top: var(--s-4); }

/* --- Политика --- */
.policy { padding-block: clamp(40px, 7vw, 88px) var(--section-y); }
.policy__in { max-width: 760px; }
.policy h1 { margin-top: var(--s-4); font-size: var(--fs-h2); }
.policy .prose { margin-top: var(--s-7); color: var(--fg-2); font-size: 17px; }
.policy .prose h2 { color: var(--fg); }
.policy__date { margin-top: var(--s-4); color: var(--fg-3); }
