/* ==========================================================================
   Эркинай — сайты для малого бизнеса
   erkinai.ru
   Палитра взята из личной визитки: шалфей, золото, крем.
   ========================================================================== */

:root {
  /* Палитра */
  --sage:        #7fb69a;
  --sage-dark:   #4f8a6d;
  --sage-deep:   #3c6b54;
  --sage-soft:   #e7f3ec;
  --gold:        #c9a25c;
  --gold-soft:   #f7f0e2;
  --cream:       #faf7f1;
  --white:       #ffffff;
  --ink:         #2c3a33;
  --muted:       #66766d;
  --line:        #e4ece6;
  --line-soft:   #eef4ef;
  --error:       #b4463a;

  /* Типографика */
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* Ритм */
  --radius-sm: 12px;
  --radius:    20px;
  --radius-lg: 28px;
  --radius-pill: 100px;

  --shadow-sm: 0 2px 8px rgba(44, 58, 51, .05);
  --shadow:    0 12px 32px rgba(44, 58, 51, .08);
  --shadow-lg: 0 28px 64px rgba(44, 58, 51, .12);

  --container: 1180px;
  --gap: 24px;
  --section-y: 88px;
  --header-h: 76px;
}

/* --------------------------------------------------------------------------
   База
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--sage-deep); text-decoration: none; transition: color .25s; }
a:hover { color: var(--ink); }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sage); color: #fff; }

/* --------------------------------------------------------------------------
   Типографика
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.1rem, 1.9vw, 1.3rem); }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

.lead { font-size: clamp(1rem, 1.4vw, 1.14rem); color: var(--muted); line-height: 1.7; }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   Сетка
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: var(--section-y) 0; }
.section--tight { padding: 56px 0; }
.section--soft { background: var(--white); }
.section--sage { background: var(--sage-soft); }

.section-head { max-width: 700px; margin-bottom: 48px; }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--aside { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); align-items: center; }
@media (max-width: 900px) { .grid--aside { grid-template-columns: minmax(0, 1fr); } }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 30px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: .95rem; font-weight: 600; line-height: 1;
  text-align: center; cursor: pointer; white-space: nowrap;
  transition: all .25s cubic-bezier(.4, 0, .2, 1);
}
.btn--primary { background: var(--sage-dark); color: #fff; box-shadow: 0 8px 22px rgba(79, 138, 109, .3); }
.btn--primary:hover { background: var(--sage-deep); color: #fff; transform: translateY(-2px); }
.btn--gold { background: var(--gold); color: #fff; box-shadow: 0 8px 22px rgba(201, 162, 92, .3); }
.btn--gold:hover { filter: brightness(.96); color: #fff; transform: translateY(-2px); }
.btn--ghost { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--cream); }
.btn--light { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn--light:hover { border-color: var(--sage); color: var(--sage-deep); }
.btn--sm { padding: 11px 22px; font-size: .88rem; }
.btn--block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* --------------------------------------------------------------------------
   Хедер
   -------------------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h); display: flex; align-items: center;
  background: rgba(250, 247, 241, .88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }

.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); flex-shrink: 0; }
.logo:hover { color: var(--sage-deep); }
.logo__name { font-family: var(--font-display); font-size: 1.22rem; line-height: 1.1; display: block; }
.logo__sub { display: block; font-size: .62rem; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; margin-top: 3px; }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a { position: relative; font-size: .93rem; color: var(--ink); padding: 6px 0; }
.nav a:not(.btn)::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--sage-dark); transition: width .25s;
}
.nav a:not(.btn):hover::after { width: 100%; }
.nav > .btn { display: none; }

.header__cta { display: flex; align-items: center; gap: 14px; }
.header__phone { font-size: .95rem; font-weight: 600; white-space: nowrap; }

.burger { display: none; width: 44px; height: 44px; padding: 0; background: none; border: 0; cursor: pointer; position: relative; z-index: 120; }
.burger span { display: block; width: 24px; height: 1.5px; margin: 5px auto; background: var(--ink); transition: transform .25s, opacity .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Первый экран
   -------------------------------------------------------------------------- */
.hero { position: relative; padding: 68px 0 84px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(52rem 34rem at 10% 6%, rgba(231, 243, 236, .9), transparent 62%),
    radial-gradient(40rem 28rem at 94% 2%, rgba(247, 240, 226, .75), transparent 60%);
}
.hero__inner { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 56px; }
.hero__title { margin-bottom: 20px; }
.hero__title em { font-style: italic; color: var(--sage-deep); }
.hero__text { max-width: 540px; margin-bottom: 30px; }
.hero__media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}

.hero__facts {
  display: flex; flex-wrap: wrap; gap: 36px;
  margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line);
}
.fact__num { display: block; font-family: var(--font-display); font-size: 1.9rem; line-height: 1; color: var(--sage-deep); }
.fact__label { font-size: .83rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Карточки услуг
   -------------------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px 24px;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--sage); }

.card__icon {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 14px; background: var(--sage-soft); margin-bottom: 18px; color: var(--sage-deep);
}
.card__icon svg { width: 24px; height: 24px; }
.card h3 { margin-bottom: 8px; }
.card p { font-size: .93rem; color: var(--muted); flex-grow: 1; }

.card__meta {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
}
.card__price { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); white-space: nowrap; }
.card__time { font-size: .82rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Портфолио
   -------------------------------------------------------------------------- */
.work {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s;
}
.work:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.work__cover {
  aspect-ratio: 16 / 10; display: grid; place-items: center;
  padding: 28px; text-align: center; position: relative; overflow: hidden;
}
.work__cover--sage { background: linear-gradient(140deg, var(--sage-soft), #d6ebe0); }
.work__cover--gold { background: linear-gradient(140deg, var(--gold-soft), #f0e2c8); }
.work__cover--ink  { background: linear-gradient(140deg, #33413a, #4f8a6d); }
.work__cover--rose { background: linear-gradient(140deg, #f7ece7, #ecd9d0); }

.work__cover-title {
  font-family: var(--font-display); font-size: 1.6rem; line-height: 1.2;
  color: var(--ink); position: relative; z-index: 1;
}
.work__cover--ink .work__cover-title { color: var(--cream); }

.work__body { padding: 24px; display: flex; flex-direction: column; flex-grow: 1; }
.work__body h3 { margin-bottom: 8px; font-size: 1.15rem; }
.work__body p { font-size: .92rem; color: var(--muted); flex-grow: 1; margin-bottom: 16px; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.tag {
  font-size: .74rem; padding: 4px 11px; border-radius: var(--radius-pill);
  background: var(--sage-soft); color: var(--sage-deep);
}
.tag--gold { background: var(--gold-soft); color: #8a6d2e; }

.work__link { font-size: .9rem; font-weight: 600; color: var(--sage-deep); }
.work__link:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Шаги
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 22px; }
.step { position: relative; }
.step__num {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--white); border: 1px solid var(--sage);
  color: var(--sage-deep); display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 16px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 7px; }
.step p { font-size: .9rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Прайс
   -------------------------------------------------------------------------- */
.price-row {
  display: flex; align-items: baseline; gap: 14px;
  padding: 16px 0; border-bottom: 1px dashed var(--line);
}
.price-row__name { flex-shrink: 0; font-weight: 500; }
.price-row__note { display: block; font-size: .83rem; color: var(--muted); font-weight: 400; }
.price-row__dots { flex-grow: 1; border-bottom: 1px dotted var(--line); transform: translateY(-4px); }
.price-row__value { font-family: var(--font-display); font-size: 1.15rem; white-space: nowrap; }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq details {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 20px 24px; margin-bottom: 12px;
}
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.3rem; line-height: 1; color: var(--sage-dark); flex-shrink: 0; }
.faq details[open] summary::after { content: '−'; }
.faq details[open] summary { margin-bottom: 12px; }
.faq p { font-size: .94rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Форма
   -------------------------------------------------------------------------- */
.form-wrap { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: .89rem; font-weight: 600; margin-bottom: 7px; }
.field .req { color: var(--gold); }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; background: var(--cream);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .25s, box-shadow .25s; appearance: none;
}
.field textarea { resize: vertical; min-height: 100px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(127, 182, 154, .2); background: var(--white);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2366766d' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center; padding-right: 42px;
}
.field .err { display: none; font-size: .82rem; color: var(--error); margin-top: 6px; }
.field.bad input, .field.bad select { border-color: var(--error); }
.field.bad .err { display: block; }

.consent { display: flex; align-items: flex-start; gap: 12px; font-size: .85rem; color: var(--muted); line-height: 1.5; }
.consent input { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; accent-color: var(--sage-dark); }
.consent.bad { color: var(--error); }

.result { display: none; margin-top: 20px; background: var(--sage-soft); border: 1px solid var(--sage); border-radius: var(--radius-sm); padding: 20px; }
.result.show { display: block; }
.result textarea { width: 100%; min-height: 120px; margin: 12px 0; padding: 12px; border: 1px solid var(--sage); border-radius: 10px; background: var(--white); font-family: inherit; font-size: .93rem; }

/* --------------------------------------------------------------------------
   Контакты и подвал
   -------------------------------------------------------------------------- */
.info-list li { display: flex; gap: 15px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.info-list li:last-child { border-bottom: 0; }
.info-list__icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 50%;
  background: var(--sage-soft); display: grid; place-items: center; color: var(--sage-deep);
}
.info-list__icon svg { width: 20px; height: 20px; }
.info-list__label { display: block; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.info-list a { font-weight: 600; }

.footer { background: var(--ink); color: rgba(250, 247, 241, .68); padding: 56px 0 0; font-size: .9rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 40px; padding-bottom: 40px; }
.footer h4 { color: var(--cream); font-family: var(--font-body); font-size: .77rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.footer .logo { color: var(--cream); margin-bottom: 14px; }
.footer .logo__sub { color: rgba(250, 247, 241, .5); }
.footer a { color: rgba(250, 247, 241, .68); }
.footer a:hover { color: var(--cream); }
.footer li { margin-bottom: 9px; }
.footer__bottom {
  border-top: 1px solid rgba(250, 247, 241, .12);
  padding: 20px 0 26px; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 12px; font-size: .82rem; color: rgba(250, 247, 241, .5);
}

.mobile-cta {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 247, 241, .95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); gap: 10px;
}
.mobile-cta .btn { flex: 1; padding: 14px 16px; }

/* --------------------------------------------------------------------------
   Служебное
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; padding: 12px 20px; background: var(--ink); color: var(--cream); }
.skip-link:focus { left: 0; color: var(--cream); }

.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Адаптив
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root { --section-y: 64px; }
  .hero__inner { grid-template-columns: 1fr; gap: 40px; }
  /* Фото идёт ПОСЛЕ текста: на телефоне человек сначала читает предложение,
     а уже потом видит портрет */
  .hero__media { order: 1; max-width: 420px; margin: 0 auto; }
  .hero { padding: 44px 0 64px; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 30px; }
}

@media (max-width: 768px) {
  :root { --header-h: 64px; --gap: 18px; }
  body { font-size: 15px; }

  .nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 110;
    flex-direction: column; align-items: stretch; gap: 0; padding: 18px;
    background: var(--cream); overflow-y: auto;
    transform: translateX(100%); transition: transform .25s; visibility: hidden;
  }
  .nav.is-open { transform: translateX(0); visibility: visible; }
  .nav a { padding: 17px 4px; font-size: 1.05rem; font-family: var(--font-display); border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav > .btn { display: inline-flex; margin-top: 20px; }

  .burger { display: block; }
  .header__phone, .header__cta .btn { display: none; }

  .mobile-cta { display: flex; }
  body { padding-bottom: 74px; }

  .hero__facts { gap: 22px; }
  .fact__num { font-size: 1.6rem; }
  .form-wrap { padding: 24px 20px; }
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .footer__bottom { flex-direction: column; }
  .price-row { flex-wrap: wrap; }
  .price-row__dots { display: none; }
  .price-row__value { margin-left: auto; }
  .steps { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 380px) {
  .btn { padding: 13px 20px; font-size: .9rem; }
  .steps { grid-template-columns: 1fr; }
}

@media print {
  .header, .footer, .mobile-cta { display: none; }
  body { background: #fff; }
}
