/* Публичный сайт. Цвета берутся из CSS-переменных темы (/theme.css). */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Доп. токены поверх темы (/theme.css). Тёплые, многослойные тени. */
:root {
  --shadow-sm: 0 1px 2px rgba(46, 36, 28, .06), 0 2px 8px rgba(46, 36, 28, .05);
  --shadow-md: 0 10px 28px -14px rgba(46, 36, 28, .25);
  --shadow-lg: 0 30px 60px -28px rgba(46, 36, 28, .38);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 38%, transparent);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --z-header: 100;
  --z-sticky: 90;
  --z-skip: 200;
}

/* Единый размер иконок набора */
.icon { width: 22px; height: 22px; display: inline-block; vertical-align: middle; flex: none; }
.icon--xl { width: 56px; height: 56px; stroke-width: 1.5; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
p { text-wrap: pretty; }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.container--narrow { width: min(760px, 100% - 2.5rem); }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 var(--radius) 0; z-index: 200;
}
.skip-link:focus { left: 0; }

/* ── Кнопки ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  font: inherit; font-weight: 600; border: 0; border-radius: 999px;
  padding: .85rem 1.6rem; transition: transform .15s ease, box-shadow .2s ease, opacity .2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn--primary:hover { box-shadow: 0 12px 28px -8px var(--accent); }
.btn--outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn--outline:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.btn--small { padding: .5rem 1rem; font-size: .9rem; }
.btn:active { transform: translateY(0); }

/* Блок-кнопка (отдельная секция-кнопка, добавляемая в любом месте) */
.block-button { padding: .6rem 0 1.6rem; }
.block-button .container { display: flex; }
.block-button--center .container { justify-content: center; }
.block-button--left .container { justify-content: flex-start; }
.block-button--right .container { justify-content: flex-end; }

/* ── Шапка ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}
.site-header__inner { display: flex; align-items: center; gap: 1rem 1.4rem; padding: .7rem 0; }
/* Бренд: компактно в своём углу, перенос максимум в 2 строки — без обрезания */
.brand {
  font-weight: 700; color: var(--text); font-size: .9rem; line-height: 1.25; letter-spacing: -.01em;
  text-decoration: none; margin-right: auto; max-width: 13rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.brand:hover { text-decoration: none; }
/* Десктоп-навигация: строго одна строка с равными отступами (ниже брейкпоинта — гамбургер) */
.site-nav { display: flex; align-items: center; flex-wrap: nowrap; justify-content: flex-end; gap: clamp(.9rem, 1.5vw, 1.6rem); }
.site-nav a:not(.site-nav__cta) { color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; transition: color .15s ease; }
.site-nav a:not(.site-nav__cta):hover { color: var(--text); text-decoration: none; }
.site-nav__cta { display: none; }
.site-header__actions { display: flex; align-items: center; gap: .6rem; flex: none; }
.nav-toggle {
  display: none; cursor: pointer; width: 40px; height: 40px; border-radius: 12px; place-items: center;
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); background: var(--surface); color: var(--text);
  transition: color .15s, border-color .15s;
}
.nav-toggle:hover { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.nav-toggle .icon { width: 20px; height: 20px; }

/* Гамбургер-меню ниже 1080px (полное меню + полное имя помещаются только на широких) */
@media (max-width: 1079px) {
  .nav-toggle { display: grid; }
  .site-header__cta { display: none; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0;
    background: var(--surface); border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
    box-shadow: var(--shadow-md); padding: .25rem clamp(1.25rem, 5vw, 2rem) 1.25rem;
    max-height: calc(100dvh - 64px); overflow-y: auto; display: none;
  }
  .site-header.nav-open .site-nav { display: flex; }
  .site-nav a:not(.site-nav__cta) { font-size: 1.05rem; padding: .95rem 0; border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
  .site-nav__cta { display: inline-flex; align-self: stretch; justify-content: center; margin-top: 1.1rem; }
}
@media (min-width: 1080px) { .nav-toggle { display: none; } }
.theme-toggle {
  cursor: pointer; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  background: var(--surface); border-radius: 999px; width: 40px; height: 40px; font-size: 1rem;
  display: grid; place-items: center; color: var(--text); transition: transform .2s;
}
.theme-toggle:hover { transform: rotate(-12deg); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.theme-toggle .icon { width: 18px; height: 18px; }
.theme-toggle__sun { display: none; }
.theme-toggle__moon { display: block; }
[data-theme="dark"] .theme-toggle__sun { display: block; }
[data-theme="dark"] .theme-toggle__moon { display: none; }

/* ── Секции ─────────────────────────────────────────────── */
.section { padding: clamp(3rem, 7vw, 6rem) 0; }
.section__head { max-width: 640px; margin-bottom: 2.5rem; }
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.section__subtitle { color: var(--muted); font-size: 1.1rem; margin: 0; }

/* ── Hero ───────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(3rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(60% 80% at 85% 10%, color-mix(in srgb, var(--accent2) 45%, transparent), transparent 70%),
    radial-gradient(50% 60% at 5% 90%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%);
}
.hero__inner { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero__eyebrow {
  display: inline-block; font-weight: 600; font-size: .85rem; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: .35rem .8rem; border-radius: 999px; margin: 0 0 1.1rem;
}
.hero__title { font-size: clamp(2.05rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.03em; }
.hero__subtitle { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 46ch; }
.hero__buttons { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 1.6rem; }
.btn--kwork { background: #127f47; color: #fff; box-shadow: 0 8px 20px -8px #127f47; }
.btn--kwork:hover { box-shadow: 0 12px 28px -8px #127f47; color: #fff; }
.btn--kwork .icon { width: 20px; height: 20px; }
.hero__media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow-lg); }
.hero__media--art { aspect-ratio: 4/5; border-radius: calc(var(--radius) * 1.4); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero__art { width: 100%; height: 100%; display: block; }
@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 300px; margin-inline: auto; }
}

/* ── Карточки (услуги, отзывы) ──────────────────────────── */
/* Карточки: фиксированное число в ряду по брейкпоинтам — ряды всегда заполнены,
   неполный ряд центрируется и содержит минимум 2 элемента (без одиночных «сирот») */
.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.2rem; }
.card {
  flex: 0 1 100%;
  background: var(--surface); border-radius: var(--radius); padding: 1.6rem;
  border: 1px solid color-mix(in srgb, var(--text) 7%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
/* Услуги: 1 колонка → 3 в ряд (5 шт = ряд из 3 + ряд из 2 по центру). Запас 1.3rem — против flex-квирка переноса */
@media (min-width: 700px) { .specialization .card { flex-basis: calc(33.333% - 1.3rem); } }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.card__icon {
  width: 50px; height: 50px; border-radius: 14px; margin-bottom: 1rem;
  display: grid; place-items: center; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.card__icon .icon { width: 26px; height: 26px; }
.card__title { font-size: 1.2rem; margin: 0 0 .4rem; }
.card__text { color: var(--muted); margin: 0; }

/* ── О себе ─────────────────────────────────────────────── */
.about__inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.about__media img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.about__photo-blank {
  aspect-ratio: 1; border-radius: var(--radius); display: grid; place-items: center;
  color: color-mix(in srgb, var(--accent) 55%, var(--muted));
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent2) 40%, var(--surface)), var(--surface));
}
.about__text p { margin: 0 0 1rem; }
.about__contacts { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .6rem; }
.about__contacts li { display: flex; gap: .6rem; flex-wrap: wrap; }
.about__contact-label { color: var(--muted); min-width: 70px; font-weight: 600; }
@media (max-width: 720px) { .about__inner { grid-template-columns: 1fr; } .about__media { max-width: 280px; margin-inline: auto; } }

/* ── Карусель (портфолио и отзывы) ──────────────────────── */
/* Ограничена шириной контента — карточки не вылезают на всю страницу */
.carousel { position: relative; width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.carousel__bar { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.carousel__btn {
  cursor: pointer; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
  background: var(--surface); color: var(--text); width: 44px; height: 44px; border-radius: 999px;
  font-size: 1.4rem; line-height: 1; display: grid; place-items: center; transition: background .15s, transform .15s;
}
.carousel__btn:hover { background: var(--accent); color: #fff; transform: scale(1.05); }
.carousel__dots { display: flex; gap: .4rem; margin-inline: auto; }
.carousel__dot { width: 8px; height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 20%, transparent); border: 0; padding: 0; cursor: pointer; }
.carousel__dot--active { background: var(--accent); width: 22px; }
.carousel__viewport { overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: .5rem; }
.carousel__viewport::-webkit-scrollbar { display: none; }
.carousel__viewport:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius); }
.carousel__track { display: flex; gap: 1.2rem; padding-inline: 0; }
.carousel__slide { scroll-snap-align: start; flex: 0 0 min(360px, 85%); }
@media (prefers-reduced-motion: reduce) { .carousel__viewport { scroll-behavior: auto; } }

.project { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid color-mix(in srgb, var(--text) 7%, transparent); display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.project:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project__media img, .project__media-blank { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.project__media-blank { display: grid; place-items: center; color: color-mix(in srgb, var(--accent) 50%, var(--muted)); background: linear-gradient(135deg, color-mix(in srgb, var(--accent2) 32%, var(--surface)), var(--surface)); }
.project__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.project__title { margin: 0; font-size: 1.25rem; }
.project__tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 600; }
.project__desc { color: var(--muted); margin: 0; }
.project__case { margin-top: .2rem; }
.project__case summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.project__case dl { margin: .6rem 0 0; }
.project__case dt { font-weight: 700; margin-top: .5rem; }
.project__case dd { margin: 0 0 .2rem; color: var(--muted); }
.project__link { margin-top: auto; font-weight: 600; }

/* ── Отзывы ─────────────────────────────────────────────── */
/* Карточки отзывов — единая высота; автор выровнен по низу карточки */
.testimonial { display: flex; flex-direction: column; gap: 1.1rem; height: 100%; }
.testimonial__text { margin: 0; font-size: 1.05rem; flex: 1 0 auto; }
.testimonial__author { display: flex; align-items: center; gap: .75rem; margin: 0; padding-top: .9rem; border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent); }
.testimonial__author > span { line-height: 1.3; }
.testimonial__avatar { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; }
.testimonial__avatar--blank { display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; }
/* Отзыв как слайд карусели: один в моменте + край следующего, текст крупнее */
.testimonials .carousel__slide { flex: 0 0 min(820px, 86%); }
.testimonials .testimonial { padding: clamp(1.5rem, 3vw, 2.2rem); }
.testimonials .testimonial__text { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.5; }

/* ── Процесс ────────────────────────────────────────────── */
/* Шаги: grid с фиксированным числом колонок — 1 → 2×2 → 4 (4 делится ровно, орфанов нет) */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
@media (min-width: 560px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.step { display: flex; gap: 1rem; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 1.4rem; border: 1px solid color-mix(in srgb, var(--text) 7%, transparent); transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.step__num { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 999px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step__body h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.step__body p { margin: 0; color: var(--muted); }

/* ── FAQ ────────────────────────────────────────────────── */
.faq__list { display: grid; gap: .8rem; }
.faq__item { background: var(--surface); border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--text) 8%, transparent); padding: 0 1.3rem; }
.faq__item summary { cursor: pointer; font-weight: 600; padding: 1.1rem 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; color: var(--accent); font-size: 1.4rem; font-weight: 400; }
.faq__item[open] summary::after { content: "–"; }
.faq__answer { padding-bottom: 1.1rem; color: var(--muted); }
.faq__answer p { margin: 0 0 .6rem; }

/* ── CTA ────────────────────────────────────────────────── */
.cta__inner {
  text-align: center; background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; border-radius: calc(var(--radius) * 1.4); padding: clamp(2.2rem, 5vw, 3.5rem);
  box-shadow: 0 30px 60px -30px var(--accent);
}
.cta__title { color: #fff; font-size: clamp(1.5rem, 3.5vw, 2.2rem); }
.cta__subtitle { color: rgba(255,255,255,.9); margin: 0 0 1.5rem; }
.cta .btn--primary { background: #fff; color: var(--accent); }

/* ── Контакты / мессенджеры ─────────────────────────────── */
.contacts__inner { text-align: center; }
.contacts__inner .section__head { margin-inline: auto; }
.contacts__buttons { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.msg-btn {
  display: inline-flex; align-items: center; gap: .6rem; color: #fff; font-weight: 700;
  padding: .9rem 1.5rem; border-radius: 999px; text-decoration: none; transition: transform .15s, box-shadow .2s;
}
.msg-btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 14px 26px -12px rgba(0,0,0,.4); }
.msg-btn--telegram { background: #1B86C0; }
.msg-btn--whatsapp { background: #1FA855; }
.msg-btn--max { background: linear-gradient(135deg, #6E3AED, #B14FE0); }
.msg-btn--kwork { background: #127f47; }

/* ── Плавающая панель контактов (мобайл) ───────────────── */
.sticky-contacts { position: fixed; right: 1rem; bottom: 1rem; display: none; flex-direction: column; gap: .6rem; z-index: 90; }
.sticky-msg { width: 52px; height: 52px; border-radius: 999px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 24px -8px rgba(0,0,0,.5); }
.sticky-msg--telegram { background: #1B86C0; }
.sticky-msg--whatsapp { background: #1FA855; }
.sticky-msg--max { background: linear-gradient(135deg, #6E3AED, #B14FE0); }
.sticky-msg--kwork { background: #127f47; }
@media (max-width: 820px) { .sticky-contacts { display: flex; } }

/* ── Подвал ─────────────────────────────────────────────── */
.site-footer { padding: 2.5rem 0; border-top: 1px solid color-mix(in srgb, var(--text) 8%, transparent); color: var(--muted); text-align: center; }
.site-footer p { margin: .2rem 0; }

/* ── Анимации появления ─────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1 !important; transform: none !important; transition: none; } }

/* ── Узкие экраны (телефоны) ────────────────────────────── */
@media (max-width: 560px) {
  .section { padding: clamp(2.5rem, 9vw, 3.75rem) 0; }
  .section__head { margin-bottom: 1.75rem; }
  .hero { padding: 2.5rem 0 2.25rem; }
  .cta__inner { padding: 1.9rem 1.3rem; }
  .contacts__buttons { flex-direction: column; align-items: stretch; }
  .msg-btn { justify-content: center; }
  .card, .step { padding: 1.25rem; }
  .brand { font-size: .95rem; max-width: 62vw; }
}

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