/* ============================================================
   Мария Ваулина — сайт-визитка
   Палитра, типографика и сетка
   ============================================================ */

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-cyrillic.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('../fonts/cormorant-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122;
}

:root {
  --bg:          #FAF7F5;
  --bg-tint:     #F0EAF4;
  --bg-deep:     #EDE6F1;
  --surface:     #FFFFFF;
  --lavender:    #B9A7D6;
  --primary:     #6B5A8E;
  --primary-dk:  #57497A;
  --ink:         #3E3350;
  --body:        #565064;
  --muted:       #6F6880;   /* 5.0:1 на фоне — проходит WCAG AA */
  --sand:        #E3D3C0;
  --line:        rgba(62, 51, 80, .13);
  --line-soft:   rgba(62, 51, 80, .07);

  --font-display: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;

  --wide: 1140px;
  --text: 700px;
  --pad: clamp(20px, 5vw, 48px);
  --radius: 16px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* height:auto обязателен — иначе атрибут height в HTML перебивает aspect-ratio */
img { max-width: 100%; height: auto; display: block; }

/* Трекинг ровно нулевой: у Cormorant в начертании 300 отрицательный
   добавляет ощущение сжатости, рисунок шрифта и так плотный */
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 400;
  letter-spacing: normal;
  margin: 0;
  /* Над крупным заголовком курсор остаётся стрелкой, а не «I»:
     выделять заголовок незачем, а вид курсора сбивает */
  cursor: default;
}

/* text-wrap: balance выравнивает длину строк в заголовке — без него
   длинные русские слова дают рваный край и полупустые строки */
h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.14; font-weight: 300; text-wrap: balance; }
h2 { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.2; font-weight: 300; text-wrap: balance; }
h3 { font-size: 20px; line-height: 1.35; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--primary); text-decoration: none; }

.container { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--pad); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary); color: #fff; padding: 12px 20px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* ── Надзаголовок ──────────────────────────────────────── */
.eyebrow {
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 18px;
  font-weight: 500;
}

/* ── Кнопки ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  padding: 15px 30px; border-radius: 999px; border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dk); }
.btn--ghost { color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn--sm { padding: 11px 22px; font-size: 14px; }
.btn:active { transform: scale(.98); }

/* ── Шапка ─────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250, 247, 245, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.header.is-scrolled { border-bottom-color: var(--line-soft); }

.header__inner { display: flex; align-items: center; gap: 24px; min-height: 74px; }

.logo { margin-right: auto; line-height: 1.2; }
.logo__name { font-family: var(--font-display); font-size: 22px; color: var(--ink); }

.nav { display: flex; gap: 26px; }
.nav a {
  font-size: 14.5px; color: var(--body); position: relative; padding: 4px 0;
  transition: color .2s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; width: 0; height: 1px;
  background: var(--primary); transition: width .3s var(--ease);
}
.nav a:hover { color: var(--primary); }
.nav a:hover::after { width: 100%; }

.burger { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.burger span {
  display: block; width: 22px; height: 1.5px; background: var(--ink); border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease);
}
.burger span + span { margin-top: 5px; }
.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 { padding: clamp(48px, 8vw, 96px) 0 clamp(56px, 9vw, 110px); position: relative; overflow: hidden; }
.hero::before {
  content: ''; position: absolute; top: -18%; right: -12%;
  width: 620px; height: 620px; border-radius: 50%;
  background: radial-gradient(circle, rgba(185,167,214,.28) 0%, rgba(185,167,214,0) 68%);
  pointer-events: none;
}
.hero__inner {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px); align-items: center; position: relative;
}

.hero__figure { margin: 0; }
/* Файл уже обрезан под 4:5, поэтому здесь кадр совпадает один в один
   и object-position ни на что не влияет */
.hero__figure img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center;
  border-radius: 200px 200px var(--radius) var(--radius);
  background: var(--bg-tint);
}
.hero__figure figcaption { margin-top: 18px; text-align: center; line-height: 1.55; }
.hero__figure figcaption span { font-size: 14px; color: var(--muted); }

.hero__text h1 { margin-bottom: 24px; max-width: 11em; }
.lead { font-size: 18.5px; color: var(--body); max-width: 46ch; margin-bottom: 32px; }


/* ── Секции ────────────────────────────────────────────── */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section--tint { background: var(--bg-tint); }
.section--story { background: var(--ink); }
.section--story h2, .section--story .prose p { color: #F3EFF6; }
.section--story .eyebrow { color: var(--lavender); }
.section--story .prose p { color: rgba(243, 239, 246, .82); }

/* Ширину задаёт сам заголовок, а не обёртка, и задаёт в em, а не в ch:
   ch — это ширина нуля, а у Cormorant ноль старостильный, ростом со строчную
   букву, поэтому любые ch-ограничения на серифе схлопываются примерно на треть. */
.section__head { margin-bottom: clamp(36px, 5vw, 56px); }
.section__head h2 { max-width: 14em; }
.section__note { margin-top: 18px; font-size: 14.5px; color: var(--body); max-width: 46ch; }

.prose { max-width: var(--text); font-size: 17.5px; }
.prose p + p { margin-top: 0; }

/* ── Карточки ──────────────────────────────────────────── */
.cards { list-style: none; margin: 0 0 clamp(40px, 5vw, 64px); padding: 0; display: grid; gap: 16px; }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cards:last-child { margin-bottom: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 26px 26px 28px;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.card:hover { border-color: var(--lavender); transform: translateY(-2px); }
.card h3 { margin-bottom: 10px; font-size: 19px; }
.card p { font-size: 15px; line-height: 1.65; color: var(--muted); margin: 0; }

.cards--flat .card { background: transparent; border-color: var(--line); }
.cards--flat .card:hover { background: var(--surface); }

/* ── Методы: названия без описаний ─────────────────────── */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.chips li {
  border: 1px solid var(--line); border-radius: 999px;
  padding: 12px 24px; font-size: 16px; color: var(--ink); line-height: 1.4;
}

/* ── Направления работы ────────────────────────────────── */
/* Две колонки, а не три: при трёх длинные пункты переносились на две строки,
   строка сетки вырастала целиком, и под короткими пунктами зиял лишний отступ */
.focus {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 0 48px;
}
.focus li {
  display: flex; align-items: baseline; gap: 16px;
  padding: 17px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 17px; color: var(--ink);
}
/* Тире — флекс-элемент, а не абсолютный: так оно само встаёт по базовой линии
   и не съезжает, если пункт всё-таки перенесётся */
.focus li::before {
  content: ''; flex: 0 0 14px; height: 1px;
  background: var(--lavender); transform: translateY(-5px);
}

/* ── Образование ───────────────────────────────────────── */
.edu { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(32px, 5vw, 64px); }
.edu__title {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--primary);
  margin-bottom: 22px;
}
.edu__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.edu__list li {
  padding: 0 0 22px 26px; position: relative; font-size: 16.5px; color: var(--ink);
}
.edu__list li:last-child { padding-bottom: 0; }
.edu__list li::before {
  content: ''; position: absolute; left: -4.5px; top: 11px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--bg); border: 1.5px solid var(--lavender);
}
.section--tint .edu__list li::before { background: var(--bg-tint); }

/* ── Цитата ────────────────────────────────────────────── */
.quote {
  margin: clamp(40px, 5vw, 64px) 0 0; padding: 0 0 0 28px;
  border-left: 2px solid var(--lavender);
  font-family: var(--font-display); font-weight: 300;
  font-size: clamp(22px, 2.6vw, 30px); line-height: 1.4; color: var(--ink);
  max-width: 18em; text-wrap: balance; cursor: default;
}

/* ── Галерея сертификатов ──────────────────────────────── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }

.gallery__item {
  margin: 0; padding: 0; border: 1px solid var(--line-soft); background: var(--surface);
  border-radius: 12px; overflow: hidden; cursor: zoom-in; display: block; width: 100%;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.gallery__item:hover { border-color: var(--lavender); transform: translateY(-2px); }
.gallery__item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; }
.gallery__cap { display: block; padding: 12px 14px; font-size: 13px; color: var(--muted); text-align: left; }

.gallery__item[hidden] { display: none; }

.gallery__more {
  display: block; margin: 20px auto 0; background: none;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 30px; font-family: var(--font-sans); font-size: 15px;
  color: var(--ink); cursor: pointer;
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.gallery__more:hover { border-color: var(--primary); color: var(--primary); }

.gallery__empty {
  grid-column: 1 / -1; padding: 44px; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--body); font-size: 15px;
}

/* ── Лайтбокс ──────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(38, 30, 50, .93);
  display: flex; align-items: center; justify-content: center; padding: 4vh 4vw;
  opacity: 0; transition: opacity .28s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox.is-open { opacity: 1; }
.lightbox__figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lightbox__figure img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 8px; background: #fff; }
.lightbox__figure figcaption { color: rgba(255,255,255,.7); font-size: 14px; text-align: center; }

.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,.1); border: 0; color: #fff;
  width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  font-size: 26px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease);
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: 18px; right: 18px; font-size: 30px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 32px; }
.lightbox__nav--prev { left: 14px; }
.lightbox__nav--next { right: 14px; }
.lightbox__nav[hidden] { display: none; }

body.is-locked { overflow: hidden; }

/* ── Формат и стоимость ────────────────────────────────── */
.pricing {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: clamp(28px, 4vw, 44px);
  max-width: var(--wide);
}
.pricing__list {
  list-style: none; margin: 0 0 28px; padding: 0 0 28px;
  border-bottom: 1px solid var(--line-soft);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 24px;
}
.pricing__list li { display: flex; flex-direction: column; gap: 2px; }
/* Прописные цифры: по умолчанию Cormorant рисует старостильные,
   и «10 000 ₽» читается как «1о ооо ₽» */
.pricing__list b {
  font-family: var(--font-display); font-size: 30px; font-weight: 400;
  color: var(--ink); line-height: 1.2;
  font-variant-numeric: lining-nums;
  font-feature-settings: "lnum" 1;
}
.pricing__list span { font-size: 14px; color: var(--muted); }

.pricing__foot { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.pricing__note { font-size: 16px; color: var(--body); max-width: 52ch; margin: 0; }
.pricing__cta { flex: 0 0 auto; }

/* ── Контакты ──────────────────────────────────────────── */
.section--contacts { background: var(--bg-deep); }
.contacts { max-width: var(--wide); }
.contacts h2 { max-width: 13em; margin-bottom: 18px; }
.contacts__lead { max-width: 48ch; margin-bottom: 36px; }

.contacts__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.contact {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid transparent; border-radius: var(--radius);
  padding: 22px 26px; transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.contact:hover { border-color: var(--lavender); transform: translateY(-2px); }
/* Карточка мессенджеров — не ссылка: номер переносят в приложение руками */
.contact--static:hover { border-color: transparent; transform: none; }
.contact--static .contact__value { user-select: all; }
.contact__label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact__value { font-size: 17px; color: var(--ink); font-weight: 500; }

/* ── Подвал ────────────────────────────────────────────── */
.footer { padding: 44px 0 calc(44px + env(safe-area-inset-bottom)); background: var(--bg); }
.footer__inner { border-top: 1px solid var(--line-soft); padding-top: 32px; }
.footer p { font-size: 14px; color: var(--muted); }
.footer__note { font-size: 13px; max-width: 62ch; margin-top: 10px; }

/* ── Появление при прокрутке ───────────────────────────── */
/* Прячем только если JS работает — иначе страница осталась бы пустой */
.js .reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.cards .reveal:nth-child(2), .contacts__grid .reveal:nth-child(2) { transition-delay: .06s; }
.cards .reveal:nth-child(3) { transition-delay: .12s; }
.cards .reveal:nth-child(4) { transition-delay: .06s; }
.cards .reveal:nth-child(5) { transition-delay: .12s; }

/* ── Адаптив ───────────────────────────────────────────── */
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; justify-items: start; }
  .hero__figure { max-width: 320px; }
  .hero__text h1 { max-width: 100%; }
  .burger { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px var(--pad) 20px;
    background: var(--bg); border-bottom: 1px solid var(--line-soft);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 13px 0; border-bottom: 1px solid var(--line-soft); font-size: 16px; }
  .nav a::after { display: none; }
  .header__inner { gap: 12px; }
  .header__cta { padding: 9px 16px; font-size: 13.5px; }
  .section__head { max-width: 100%; }
  .section__head h2 { max-width: 100%; }
}

/* Раньше 560px: иначе пояснение сжимается в узкую колонку рядом с кнопкой */
@media (max-width: 780px) {
  .pricing__foot { flex-direction: column; align-items: stretch; gap: 26px; }
  .pricing__cta { width: 100%; }
}

@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 24px; }
  .hero__figure { max-width: 100%; }
  /* Горизонтальный кроп: при квадрате заголовок и кнопка уезжают за первый экран,
     и плавающая кнопка появляется раньше времени */
  /* 4:3 из кадра 4:5 режет по вертикали: 5% оставляют воздух над головой
     и не срезают плечи */
  .hero__figure img { border-radius: var(--radius); aspect-ratio: 4 / 3; object-position: center 5%; }
  .hero__figure figcaption { margin-top: 14px; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .quote { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .header, .lightbox { display: none; }
  body { background: #fff; }
}
