/* ============================================================
   Айсель Китаева — минималистичный сайт (серо-чёрная редакция)
   ============================================================ */

/* Самостоятельно размещённые шрифты.
   Сняты с Google Fonts по двум причинам: IP посетителя больше не уходит
   к Google (LG München I, 3 O 17493/20), и таблица стилей шрифтов больше
   не блокирует рендер сторонним запросом (было 782 мс на мобильном).

   Оба семейства — вариативные, поэтому вес задан диапазоном: один файл
   обслуживает и 500, и 600. Подмножества обрезаны до кириллицы и латиницы;
   unicode-range ниже точно описывает, что внутри, — браузер не станет
   качать латиницу ради кириллического текста. */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-cyrillic.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+2116;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2015, U+2018-201D, U+2026, U+2039-203A, U+20AC, U+2116;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-italic-cyrillic.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+2116;
}

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/cormorant-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2015, U+2018-201D, U+2026, U+2039-203A, U+20AC, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0400-045F, U+0490-0491, U+2116;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2010-2015, U+2018-201D, U+2026, U+2039-203A, U+20AC, U+2116;
}
:root {
  --bg: #eceae6;
  --bg-alt: #dfdcd6;
  --ink: #403d38;
  /* --ink-soft и --accent затемнены до контраста 4.5:1 на обоих светлых фонах
     (WCAG 2.2 AA). Тон и насыщенность не тронуты — двигали только светлоту,
     поэтому тёплый песочный характер палитры сохранён:
       --ink-soft #6e6a62 -> #646159  (4.48 -> 5.16 на --bg, 3.93 -> 4.53 на --bg-alt)
       --accent   #8a7d68 -> #6a6050  (3.35 -> 5.14 на --bg, 2.94 -> 4.51 на --bg-alt) */
  --ink-soft: #646159;
  --hairline: rgba(64, 61, 56, 0.18);
  --hairline-light: rgba(244, 242, 238, 0.18);
  --accent: #6a6050;
  /* на тёмных секциях акцент должен идти вверх, а не вниз: #6a6050 там даёт 1.50 */
  --accent-on-dark: #bcb4a7;
  --dark: #4a4741;
  --light: #f4f2ee;

  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", -apple-system, sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --container: 1200px;
  --pad: clamp(20px, 4vw, 48px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

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

/* display: contents — <picture> обёртка не должна создавать свой бокс,
   иначе img перестал бы быть прямым потомком figure и вёрстка поехала бы */
picture { display: contents; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--pad);
}
.container--narrow { max-width: 820px; }

::selection { background: var(--ink); color: var(--bg); }

/* ============ Header ============ */
.header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  transition: background-color 300ms ease, box-shadow 300ms ease,
              transform 500ms var(--ease-out);
}
.header.is-scrolled {
  background: rgba(236, 234, 230, 0.93);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--hairline);
}
.header.is-hidden { transform: translateY(-100%); }

.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  gap: 32px;
  transition: padding 300ms ease;
}
.header.is-scrolled .header__inner { padding-block: 14px; }

.header__logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header__nav {
  display: flex;
  gap: 28px;
  margin-left: auto;
}
.header__nav a {
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .header__nav a:hover { color: var(--ink); }
}

.header__burger { display: none; }

/* ============ Buttons & links ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 34px;
  background: var(--ink);
  color: var(--light);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: 100px;
  border: 1px solid var(--ink);
  transition: transform 160ms var(--ease-out),
              background-color 250ms ease,
              color 250ms ease;
}
.btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: transparent; color: var(--ink); }
  .btn--light:hover { background: transparent; color: var(--light); }
}
.btn--small { padding: 11px 24px; font-size: 14px; }
.btn--light {
  background: var(--light);
  color: var(--dark);
  border-color: var(--light);
}
/* ============ «Связаться» — выпадающее меню ============ */
.reach { position: relative; display: inline-block; z-index: 1; }
.reach__toggle { cursor: pointer; font-family: inherit; }

/* GSAP-reveal вешает transform на .hero__actions и .contact__actions, они становятся
   контекстами наложения — и z-index панели внутри них уже не может подняться выше
   следующих соседей (.hero__meta, .contact__grid), те рисуются поверх меню.
   Поэтому поднимать нужно сами контейнеры, а не панель. */
.hero__actions,
.contact__actions {
  position: relative;
  z-index: 20;
}

.reach__list {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  min-width: 232px;
  display: flex;
  flex-direction: column;
  padding: 6px;
  /* поверхность заметно светлее страницы (#eceae6) — иначе панель читается
     как полупрозрачная и сквозь неё «видно» страницу */
  background: #fbfaf8;
  border: 1px solid rgba(64, 61, 56, 0.09);
  border-radius: 12px;
  box-shadow:
    0 1px 2px rgba(64, 61, 56, 0.10),
    0 8px 16px -10px rgba(64, 61, 56, 0.22),
    0 28px 46px -24px rgba(64, 61, 56, 0.45);
  opacity: 0;
  visibility: hidden;
  /* не scale(0) — панель «вырастает» из кнопки, а не появляется из ниоткуда */
  transform: scale(0.96) translateY(-4px);
  transform-origin: top left;
  /* уход быстрее прихода */
  transition: opacity 130ms ease, transform 130ms var(--ease-out),
              visibility 0s 130ms;
}
.reach.is-open .reach__list {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  transition: opacity 170ms ease, transform 210ms var(--ease-out);
}
/* в шапке меню прижато к правому краю кнопки */
.header__cta .reach__list { left: auto; right: 0; transform-origin: top right; }
/* кнопки по центру — меню центрируется под ними */
.reach--light .reach__list,
.mobile-menu__cta .reach__list {
  left: 50%;
  margin-left: -116px;
  transform-origin: top center;
}

.reach__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: background-color 150ms ease, transform 150ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .reach__item:hover { background: rgba(64, 61, 56, 0.06); }
}
.reach__item:active { transform: scale(0.98); }
.reach__item:focus-visible {
  background: rgba(64, 61, 56, 0.06);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* фирменные цвета логотипов перекрыты цветом темы */
.reach__icon {
  width: 19px; height: 19px;
  flex-shrink: 0;
  fill: var(--accent);
  color: var(--accent);
  transition: fill 200ms ease;
}
.reach__item:hover .reach__icon { fill: var(--ink); }

/* без JS меню показывается статичным списком под кнопкой */
html:not(.has-js) .reach__list {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  margin-top: 10px;
  margin-left: 0;
}

/* ============ Hero (фото — в обрез правого края) ============ */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 64px;
  background:
    linear-gradient(to bottom, rgba(64, 61, 56, 0.05), rgba(64, 61, 56, 0) 260px);
}
.hero__inner {
  width: 100%;
  margin: 0 auto;
  padding-left: max(var(--pad), calc((100% - var(--container)) / 2 + var(--pad)));
  padding-right: 0;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(32px, 5vw, 88px);
  align-items: center;
}

.hero__eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 26px;
}

/* заголовок — длинное тихое утверждение, поэтому кегль сдержанный */
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(25px, 2.9vw, 38px);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.005em;
  margin-bottom: 28px;
}
.line--accent,
.accent { font-style: italic; color: var(--accent); }

.hero__text {
  font-size: 16px;
  color: var(--ink-soft);
  max-width: 48ch;
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 38px;
}

.hero__meta {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.hero__media { position: relative; }
.hero__img-wrap {
  overflow: hidden;
  /* ближе к пропорции самого кадра (2:3) — обрезается меньше.
     4/5 — самое высокое, что ещё умещается в 100svh вместе с отступами hero */
  aspect-ratio: 4 / 5;
}
.hero__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
/* малый кадр-деталь поверх основного фото */
.hero__detail {
  position: absolute;
  left: clamp(-84px, -6vw, -48px);
  bottom: -44px;
  width: clamp(150px, 15vw, 210px);
  aspect-ratio: 1;
  overflow: hidden;
  border: 8px solid var(--bg);
  box-shadow: 0 28px 48px -30px rgba(64, 61, 56, 0.4);
}
.hero__detail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============ Карточка с регалиями ============
   Выделенный тёмный блок сразу под hero — регалии должны считываться первыми. */
.creds-wrap { padding-block: clamp(48px, 5.5vw, 72px); }
.creds {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--dark);
  color: var(--light);
  padding: clamp(30px, 3.2vw, 44px) clamp(28px, 3vw, 44px);
  box-shadow: 0 30px 60px -40px rgba(64, 61, 56, 0.65);
}
/* Ритм ячейки: разделитель — 16px — квадрат — 16px — текст.
   Квадрат не должен липнуть к линии разделителя. */
.creds li {
  position: relative;
  padding: 2px 16px 2px 38px;
  border-right: 1px solid var(--hairline-light);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: rgba(244, 242, 238, 0.92);
}
.creds li::before {
  content: "";
  position: absolute;
  left: 16px; top: 8px;
  width: 6px; height: 6px;
  background: var(--accent);
}
/* у первой ячейки слева нет разделителя — отступ не нужен */
.creds li:first-child { padding-left: 22px; }
.creds li:first-child::before { left: 0; }
.creds li:last-child { border-right: none; padding-right: 0; }

/* ============ Sections ============ */
.section { padding-block: clamp(80px, 10vw, 130px); }
.section--alt { background: var(--bg-alt); }
.section--dark { background: var(--dark); color: var(--light); }

.section__head {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: clamp(44px, 5.5vw, 72px);
}
.section__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding-inline: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  flex-shrink: 0;
}
.section--dark .section__num { background: var(--light); color: var(--dark); }
.section__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ============ About ============ */
.about__grid {
  display: grid;
  /* узкая колонка под вертикальный кадр 9:16 */
  grid-template-columns: 0.62fr 1.38fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
/* колонка тянется на всю высоту ряда, липнет само изображение:
   sticky на grid-элементе с align-items:start не срабатывает */
.about__media { align-self: stretch; }
.about__media img {
  position: sticky;
  top: 120px;
}
.about__lead {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 28px;
}
.about__body p:not(.about__lead) {
  color: var(--ink-soft);
  margin-bottom: 20px;
  max-width: 64ch;
}

/* ============ Timeline ============ */
.timeline { border-top: 1px solid var(--hairline); }
.timeline__row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--hairline);
}
.timeline__year {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding-top: 5px;
  white-space: nowrap;
}
.timeline__body h3 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 25px);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}
.timeline__body p {
  font-size: 15px;
  color: var(--ink-soft);
}

/* ============ Направления работы ============ */
/* аккордеон: заголовок и первая мысль видны всегда, остальное раскрывается по клику */
.dir { border-top: 1px solid var(--hairline); }
.dir:first-of-type { border-top: none; }

.dir__head {
  display: grid;
  grid-template-columns: 0.62fr 1.38fr 13px;
  column-gap: clamp(28px, 6vw, 96px);
  row-gap: 0;
  align-items: start;
  padding-block: clamp(34px, 4vw, 52px);
  cursor: pointer;
  list-style: none;
  transition: color 200ms ease;
}
.dir__head::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) {
  .dir__head:hover { color: var(--accent); }
}
.dir__idx {
  grid-column: 1; grid-row: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.dir__title {
  grid-column: 1; grid-row: 2;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.dir__teaser {
  grid-column: 2; grid-row: 1 / span 2;
  color: var(--ink-soft);
  max-width: 60ch;
}
.dir__icon { grid-column: 3; grid-row: 1; margin-top: 9px; }

/* высоту .dir__body анимирует GSAP — отступы живут на потомке */
.dir__body { overflow: hidden; }
.dir__content {
  display: grid;
  grid-template-columns: 0.62fr 1.38fr 13px;
  column-gap: clamp(28px, 6vw, 96px);
  padding-bottom: clamp(34px, 4vw, 52px);
}
.dir__content > * { grid-column: 2; }
.dir__content p {
  color: var(--ink-soft);
  margin-bottom: 18px;
  max-width: 64ch;
}
.dir__content > :last-child { margin-bottom: 0; }
.dir__label {
  color: var(--ink) !important;
  font-weight: 500;
  margin-bottom: 14px !important;
}
.dir__closing {
  font-family: var(--font-display);
  font-size: clamp(20px, 2vw, 25px);
  font-style: italic;
  line-height: 1.4;
  color: var(--ink) !important;
  max-width: 46ch !important;
  margin-top: 26px;
}

/* маркированные списки */
.bullets { margin-bottom: 26px; }
.bullets li {
  position: relative;
  padding-left: 22px;
  padding-block: 5px;
  font-size: 15.5px;
  color: var(--ink-soft);
  max-width: 62ch;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 15px;
  width: 7px; height: 7px;
  background: var(--accent);
}

/* врезка с важным уточнением */
.note {
  margin-top: 28px;
  padding: 26px 28px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
}
.section--alt .note { background: rgba(64, 61, 56, 0.06); }
.note p {
  font-size: 15px;
  margin-bottom: 14px !important;
}
.note p:last-child { margin-bottom: 0 !important; }
.note strong {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ============ Моя цель ============ */
.goal__grid {
  display: grid;
  grid-template-columns: 0.62fr 1.38fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.goal__media { overflow: hidden; }
.goal__title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 56px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
}
.goal__lead {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 24px;
}
.goal__body p:not(.goal__lead) {
  color: var(--ink-soft);
  margin-bottom: 20px;
  max-width: 62ch;
}
.goal__body p:last-child { margin-bottom: 0; }

/* ============ Quote (тёмная секция с ч/б фото) ============ */
.quote__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}
.quote__media {
  overflow: hidden;
  max-width: 460px;
  justify-self: end;
}
.quote__text {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 50px);
  font-weight: 500;
  font-style: italic;
  line-height: 1.22;
  letter-spacing: -0.01em;
}
.quote__note {
  margin-top: 26px;
  font-family: var(--font-body);
  font-size: 16px;
  font-style: normal;
  line-height: 1.65;
  color: rgba(244, 242, 238, 0.68);
  max-width: 48ch;
}
.quote__caption {
  margin-top: 24px;
  font-family: var(--font-body);
  font-size: 13px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 242, 238, 0.65);
}

/* ============ Форматы и стоимость ============ */
/* аккордеон: по умолчанию виден только заголовок и цена */
.rates { border-top: 1px solid var(--hairline); }
.rate { border-bottom: 1px solid var(--hairline); }

.rate__head {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  align-items: center;
  gap: clamp(20px, 3vw, 56px);
  padding-block: clamp(24px, 2.6vw, 32px);
  cursor: pointer;
  list-style: none;
  transition: color 200ms ease;
}
.rate__head::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) {
  .rate__head:hover { color: var(--accent); }
  .rate__head:hover .rate__icon { border-color: var(--accent); }
}
.rate__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.3vw, 29px);
  font-weight: 600;
  line-height: 1.2;
}
.rate__sub {
  display: block;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 8px;
}
.rate__prices {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.rate__price {
  display: flex;
  align-items: baseline;
  gap: 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.rate__price b {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  color: inherit;
}
.rate__head:not(:hover) .rate__price b { color: var(--ink); }

/* стрелка-шеврон — общая для всех трёх аккордеонов */
.chev {
  position: relative;
  width: 13px; height: 13px;
  justify-self: end;
  transition: transform 300ms var(--ease-out);
}
.chev::before {
  content: "";
  position: absolute;
  left: 1px; top: 2px;
  width: 9px; height: 9px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
details[open] > summary .chev { transform: rotate(180deg); }

/* padding на потомке, а не на самом .rate__body — его высоту анимирует GSAP.
   overflow здесь НЕ задан: он нужен только на время твина и вешается инлайном
   из JS. Иначе выпадающее меню «Связаться» внутри формата было бы обрезано. */
.rate__body p {
  color: var(--ink-soft);
  max-width: 64ch;
  margin-bottom: 16px;
}
.rate__body > :last-child { margin-bottom: clamp(24px, 3vw, 34px); }
.rate__note {
  margin-top: 16px;
  padding-left: 18px;
  border-left: 2px solid var(--accent);
  font-size: 14.5px;
}
/* «Записаться» — только в раскрытом формате, у правого края.
   Сетка повторяет шапку (1fr auto 18px), поэтому правый край кнопки
   встаёт ровно под правым краем цены, а не под шевроном. */
.rate__cta {
  display: grid;
  grid-template-columns: 1fr auto 18px;
  gap: clamp(20px, 3vw, 56px);
  margin-top: clamp(20px, 2.4vw, 28px);
}
.rate__cta .reach { grid-column: 2; justify-self: end; }
/* кнопка прижата вправо — панель раскрывается от неё, а не за край страницы */
.rate__cta .reach__list { left: auto; right: 0; transform-origin: top right; }
/* Пока меню открыто, формат поднимается над соседями. GSAP-reveal оставляет
   на каждом .rate трансформ, а значит и собственный контекст наложения —
   без этого панель уходит под следующий формат. Тот же приём, что и
   у .hero__actions / .contact__actions. */
.rate.is-menu-open { position: relative; z-index: 30; }

/* ============ Режим и условия работы ============ */
.terms { margin-top: clamp(56px, 7vw, 88px); }
.terms__title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 33px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 20px;
}
.terms p {
  color: var(--ink-soft);
  max-width: 68ch;
  margin-bottom: 14px;
}
.terms > p:last-child { margin-bottom: 0; }

.terms__list {
  border-top: 1px solid var(--hairline);
  margin-top: clamp(30px, 3.5vw, 44px);
}
.terms__item { border-bottom: 1px solid var(--hairline); }
.terms__head {
  display: grid;
  grid-template-columns: 1fr 13px;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  padding-block: clamp(17px, 1.9vw, 22px);
  cursor: pointer;
  list-style: none;
  transition: color 200ms ease;
}
.terms__head::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) {
  .terms__head:hover { color: var(--accent); }
}
.terms__name {
  font-family: var(--font-display);
  font-size: clamp(19px, 1.9vw, 23px);
  font-weight: 600;
  line-height: 1.25;
}
.terms__body { overflow: hidden; }
.terms__content { padding-bottom: clamp(20px, 2.4vw, 28px); }
.terms__content p {
  color: var(--ink-soft);
  font-size: 15.5px;
  max-width: 68ch;
  margin-bottom: 14px;
}
.terms__content > :last-child { margin-bottom: 0; }

.rates-footnote {
  position: relative;
  margin-top: clamp(28px, 3.5vw, 44px);
  padding-left: 34px;
  max-width: 74ch;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* «Искра»: один короткий проблеск, когда сноска впервые попадает в кадр.
   Только opacity/transform — никакого лэйаута, анимация уходит на GPU. */
.spark {
  position: absolute;
  left: 0; top: 3px;
  width: 17px; height: 17px;
  color: var(--accent);
}
.spark svg { display: block; width: 100%; height: 100%; fill: currentColor; }
.spark::after {
  content: "";
  position: absolute;
  inset: -11px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(138, 125, 104, 0.38) 0%, rgba(138, 125, 104, 0) 70%);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}
.has-js .spark svg {
  opacity: 0;
  transform: scale(0.7) rotate(-35deg);
  transition: opacity 300ms ease-out, transform 560ms var(--ease-out);
}
.has-js .spark.is-lit svg { opacity: 1; transform: none; }
/* одноразовый проблеск — keyframes здесь уместны: ничего не прерывается */
.spark.is-lit::after { animation: spark-halo 880ms var(--ease-out) forwards; }
@keyframes spark-halo {
  0%   { opacity: 0; transform: scale(0.4); }
  32%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.7); }
}
html.no-anim .spark svg { opacity: 1 !important; transform: none !important; }
html.no-anim .spark::after { display: none; }

/* ============ Contact ============ */
.contact { text-align: center; }
.contact__title {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 110px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin-bottom: 28px;
}
.contact__text {
  color: rgba(244, 242, 238, 0.65);
  max-width: 46ch;
  margin: 0 auto 48px;
}
.contact__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-bottom: clamp(56px, 6vw, 76px);
}
.contact__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline-light);
  text-align: left;
}
.contact__grid li {
  padding: 26px 24px 26px 0;
  border-right: 1px solid var(--hairline-light);
}
.contact__grid li:not(:first-child) { padding-left: 24px; }
.contact__grid li:last-child { border-right: none; }
.contact__label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(244, 242, 238, 0.65);
  margin-bottom: 8px;
}
.contact__grid a {
  font-size: 16px;
  color: var(--light);
  transition: color 200ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .contact__grid a:hover { color: var(--accent-on-dark); }
}

/* ============ Footer ============ */
.footer {
  background: var(--dark);
  color: rgba(244, 242, 238, 0.65);
  border-top: 1px solid var(--hairline-light);
  padding-block: 28px;
  font-size: 13px;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ============ Mobile menu ============ */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 48px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms ease, visibility 0s 350ms;
}
.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 350ms ease;
}
.mobile-menu__nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.mobile-menu__nav a {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  padding: 8px 16px;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease, transform 500ms var(--ease-out);
}
.mobile-menu.is-open .mobile-menu__nav a {
  opacity: 1;
  transform: translateY(0);
}
.mobile-menu.is-open .mobile-menu__nav a:nth-child(1) { transition-delay: 60ms; }
.mobile-menu.is-open .mobile-menu__nav a:nth-child(2) { transition-delay: 110ms; }
.mobile-menu.is-open .mobile-menu__nav a:nth-child(3) { transition-delay: 160ms; }
.mobile-menu.is-open .mobile-menu__nav a:nth-child(4) { transition-delay: 210ms; }
.mobile-menu__cta {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 400ms ease 320ms, transform 500ms var(--ease-out) 320ms;
}
.mobile-menu.is-open .mobile-menu__cta { opacity: 1; transform: translateY(0); }

/* ============ Reveal animations (JS-gated) ============ */
.has-js .line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.has-js .line { display: block; transform: translateY(115%); }
.has-js .reveal { opacity: 0; }
/* Фото не анимируются: показаны полностью и сразу. */

html:not(.has-js) .line,
html.no-anim .line { transform: none !important; }
html.no-anim .reveal { opacity: 1 !important; }

@media (prefers-reduced-motion: reduce) {
  .has-js .line { transform: none; }
  .has-js .reveal { opacity: 1; }
  .has-js .spark svg { opacity: 1; transform: none; }
  .spark::after { display: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15s !important;
  }
}

/* ============ Responsive ============ */
@media (max-width: 1023px) {
  .header__nav, .header__cta { display: none; }
  .header__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px; height: 44px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 60;
    position: relative;
  }
  .header__burger span {
    display: block;
    width: 26px; height: 1.5px;
    background: var(--ink);
    margin-left: 9px;
    transition: transform 300ms var(--ease-out);
  }
  .header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
  .header__burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-right: 0;
  }
  .hero { padding-top: 96px; }
  .hero__media { order: -1; }
  /* на мобильном кадр показывается почти целиком (было 16/11 — видно меньше половины) */
  .hero__img-wrap { aspect-ratio: 3 / 4; }
  .hero__detail { display: none; }
  .hero__content { padding-right: var(--pad); }

  .creds { grid-template-columns: repeat(2, 1fr); row-gap: 20px; }
  .creds li:nth-child(2n) { border-right: none; padding-right: 0; }
  /* в левой колонке разделителя слева нет — убираем отступ под него */
  .creds li:nth-child(odd) { padding-left: 22px; }
  .creds li:nth-child(odd)::before { left: 0; }

  .about__grid { grid-template-columns: 1fr; }
  .about__media { max-width: 380px; }
  .about__media img { position: static; }

  .timeline__row { grid-template-columns: 120px 1fr; gap: 20px; }

  /* шеврон встаёт рядом с заголовком, анонс уходит на строку ниже */
  .dir__head {
    grid-template-columns: 1fr 13px;
    padding-block: clamp(26px, 4vw, 40px);
  }
  .dir__icon { grid-column: 2; grid-row: 2; align-self: center; margin-top: 0; }
  .dir__teaser {
    grid-column: 1 / -1; grid-row: 3;
    margin-top: 14px;
    max-width: none;
  }
  .dir__content { grid-template-columns: 1fr; }
  .dir__content > * { grid-column: 1; }

  .goal__grid { grid-template-columns: 1fr; gap: 40px; }
  .goal__media { max-width: 380px; }

  .quote__grid { grid-template-columns: 1fr; gap: 40px; }
  .quote__media { justify-self: start; max-width: 380px; }
  .contact__grid { grid-template-columns: repeat(2, 1fr); }
  .contact__grid li:nth-child(2n) { border-right: none; }
  .contact__grid li:nth-child(odd) { padding-left: 0; }
  .contact__grid li:nth-child(even) { padding-left: 24px; }
  .contact__grid li:nth-last-child(-n+2) { padding-bottom: 26px; }
  .contact__grid li:nth-child(-n+2) { border-bottom: 1px solid var(--hairline-light); padding-bottom: 26px; }
}

@media (max-width: 767px) {
  .creds { grid-template-columns: 1fr; row-gap: 16px; }
  .creds li { border-right: none; padding-right: 0; padding-left: 22px; }
  .creds li::before { left: 0; }

  /* цена уходит на вторую строку под заголовком */
  .rate__head { grid-template-columns: 1fr 18px; row-gap: 10px; }
  .rate__title { grid-column: 1; grid-row: 1; }
  .rate__icon { grid-column: 2; grid-row: 1; }
  .rate__prices {
    grid-column: 1; grid-row: 2;
    flex-direction: row; flex-wrap: wrap;
    align-items: baseline; gap: 6px 20px;
  }
  /* на узком экране цена прижата влево — кнопка и её панель следуют за ней */
  .rate__cta { display: block; }
  .rate__cta .reach__list { left: 0; right: auto; transform-origin: top left; }

  .timeline__row { grid-template-columns: 1fr; gap: 6px; }
  .timeline__year { padding-top: 0; }

  .hero__actions { gap: 12px; }
  .footer__inner { justify-content: center; text-align: center; }

  .note { padding: 22px 20px; }

  .contact__grid { grid-template-columns: 1fr; }
  .contact__grid li {
    padding: 22px 0 !important;
    border-right: none;
    border-bottom: 1px solid var(--hairline-light);
  }
  .contact__grid li:last-child { border-bottom: none; }
}

/* ============ Фокус с клавиатуры ============ */
/* Раньше собственное кольцо было только у пунктов выпадающего меню — всё
   остальное держалось на умолчании браузера, которое спорит с палитрой.
   :where() держит специфичность нулевой, поэтому частные правила (например
   у .reach__item) по-прежнему выигрывают. */
:where(a, button, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
/* на тёмных секциях кольцо тоже должно читаться */
.section--dark :where(a, button, summary):focus-visible,
.footer :where(a, button):focus-visible {
  outline-color: var(--accent-on-dark);
}
:where(summary):focus-visible { outline-offset: -2px; }

/* ============ Ссылка «к содержанию» ============ */
/* Первый Tab на странице: без неё клавиатурный посетитель каждый раз
   проходит всю навигацию. Видна только когда получает фокус. */
.skip-link {
  position: absolute;
  top: 0; left: 50%;
  z-index: 100;
  padding: 12px 22px;
  background: var(--ink);
  color: var(--light);
  font-size: 14px;
  font-weight: 500;
  border-radius: 0 0 10px 10px;
  transform: translate(-50%, -130%);
  transition: transform 180ms var(--ease-out);
}
/* именно :focus, а не :focus-visible — ссылка должна выезжать при любом
   способе получения фокуса, иначе она невидима ровно тогда, когда нужна */
.skip-link:focus {
  transform: translate(-50%, 0);
  outline-offset: -4px;
}

/* ============ Юридические страницы ============ */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 96px) var(--pad) clamp(56px, 8vw, 96px);
}
.legal__back { margin-bottom: 32px; font-size: 14px; color: var(--ink-soft); }
.legal__back a { border-bottom: 1px solid var(--hairline); }
.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 16px;
}
.legal h2 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
}
.legal p, .legal li { color: var(--ink-soft); margin-bottom: 12px; }
.legal ul { margin: 0 0 16px 0; }
.legal li { position: relative; padding-left: 20px; }
.legal li::before {
  content: "";
  position: absolute; left: 4px; top: 0.7em;
  width: 5px; height: 1px; background: var(--accent);
}
.legal a { border-bottom: 1px solid var(--hairline); }
.legal__note { font-size: 14.5px; }
.legal__meta { margin-top: 40px; font-size: 13.5px; }
.legal__warning {
  padding: 16px 18px;
  border-left: 2px solid var(--accent);
  background: rgba(64, 61, 56, 0.04);
}

/* ============ Печать ============ */
/* Клиенты распечатывают раздел «Форматы и стоимость», поэтому аккордеоны
   на печати раскрыты, а интерфейсная обвязка убрана. */
@media print {
  .header, .mobile-menu, .skip-link, .header__burger,
  .reach, .hero__media, .about__media, .goal__media, .quote__media {
    display: none !important;
  }
  body { background: #fff; color: #000; font-size: 11pt; line-height: 1.45; }
  .section, .hero { padding-block: 16px; min-height: 0; }
  .section--dark, .section--alt, .footer, .quote {
    background: #fff !important;
    color: #000 !important;
  }
  .hero__inner, .about__grid, .goal__grid, .quote__grid {
    display: block !important;
    padding-inline: 0 !important;
  }
  /* раскрываем все три аккордеона */
  details > *:not(summary) {
    display: block !important;
    content-visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
    overflow: visible !important;
  }
  .chev { display: none !important; }
  /* анимации на печати не отрабатывают — снимаем стартовые состояния */
  .reveal { opacity: 1 !important; }
  .line { transform: none !important; }
  /* адрес ссылки виден на бумаге */
  .contact__grid a::after { content: " (" attr(href) ")"; font-size: 9pt; }
  a[href^="#"]::after { content: none; }
}

/* ссылки на импрессум и политику — обязательный для Германии блок в подвале */
.footer__legal { margin-top: 6px; }
.footer__legal a { border-bottom: 1px solid var(--hairline-light); }
