/*
  СТИЛИ САЙТА / styles.css
  Принцип: сначала телефон, затем расширение сеток для планшета и компьютера.
  Не создавайте второй мобильный index: это дублирует тексты и усложняет обновления.
  Быстрые изменения: цвета и размеры — в :root; сетки — в @media в конце файла.
*/

/* 01. Переменные оформления. В комментариях — назначение и пример изменения. */
:root {
  --blue: #1e90ff; /* Основной Dodger Blue; например #1680e6 для более тёмного акцента. */
  --action: #1266b5; /* Фон кнопок с белым текстом; например #105a9f. Контраст выше, чем у яркого синего. */
  --navy: #16344b; /* Заголовки и основной текст; например #183047. */
  --muted: #526b7b; /* Дополнительный текст; например #475f70. */
  --paper: #fcfbf7; /* Тёплый фон первого экрана; например #fffdf9. */
  --white: #fff; /* Фон обычных разделов; например #fefefe. */
  --soft: #f0f7fc; /* Голубой фон чередующихся разделов; например #eaf4fc. */
  --line: #d8e5ee; /* Линии и границы; например #c8dae6. */
  --radius: 22px; /* Скругление карточек; например 16px. */
  --width: 1180px; /* Максимальная ширина содержимого; например 1120px. */
  --gutter: 20px; /* Боковой отступ на телефоне; например 24px. */
  --shadow: 0 18px 45px rgb(22 52 75 / 9%); /* Мягкая тень; например 0 12px 32px rgb(22 52 75 / 8%). */
}

/* 02. Базовые правила. border-box включает отступы в ширину элементов. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; color-scheme: light; }
body { margin: 0; background: var(--white); color: var(--navy); font-family: "Segoe UI", Arial, sans-serif; font-size: 16px; line-height: 1.7; -webkit-text-size-adjust: 100%; }
body.dialog-open { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 5px; }
button { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { color: inherit; }
h1, h2, h3, p, figure, blockquote { margin: 0; }
h1, h2, h3 { line-height: 1.18; }
h1, h2 { letter-spacing: -.045em; }
h2 { font-size: clamp(30px, 4vw, 46px); font-weight: 650; text-wrap: balance; }
h3 { font-size: 20px; font-weight: 650; letter-spacing: -.025em; }
p + p { margin-top: 18px; }
p { overflow-wrap: break-word; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; border-radius: 4px; }
::selection { background: #c9e7ff; color: var(--navy); }
.container { width: min(calc(100% - var(--gutter) * 2), var(--width)); margin-inline: auto; }
.section { padding-block: 66px; }
.soft { background: var(--soft); }
.eyebrow { color: var(--action); font-size: 12px; font-weight: 700; line-height: 1.6; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 19px; }
.section-heading { max-width: 700px; margin-bottom: 32px; }
.section-heading h2 { margin-bottom: 19px; }
.section-heading > p:last-child, .about-grid > div > p:not(.eyebrow), .resource-layout > div > p:not(.eyebrow) { color: var(--muted); }
.section-note { margin-top: 25px; max-width: 880px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.text-link { font-size: 15px; font-weight: 650; color: var(--action); text-decoration-thickness: 1px; }
.text-link:hover { color: var(--navy); }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 13px 23px; border: 1px solid transparent; border-radius: 9px; font-weight: 650; text-decoration: none; line-height: 1.45; text-align: center; transition: background .18s, transform .18s; }
.button:hover { transform: translateY(-2px); }
.primary { background: var(--action); color: var(--white); }
.primary:hover { background: var(--navy); }
.skip-link { position: fixed; z-index: 100; top: -100px; left: 16px; padding: 10px 20px; background: var(--navy); color: var(--white); }
.skip-link:focus { top: 12px; }

/* 03. Шапка и переключение языка. Кнопки имеют удобную зону нажатия минимум 44px. */
.site-header { position: sticky; top: 0; z-index: 30; background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-initials { display: none; }
.brand strong { display: block; font-size: 14px; line-height: 1.25; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.header-tools { display: flex; align-items: center; gap: 5px; }
.languages { display: flex; }
.languages button { padding: 0; width: 38px; min-height: 44px; background: none; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.languages button[aria-pressed="true"] { color: var(--action); text-decoration: underline; text-underline-offset: 7px; text-decoration-thickness: 2px; }
.navigation { order: 3; flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 18px; }
.navigation a { padding: 9px 0; font-size: 14px; font-weight: 600; text-decoration: none; }
.navigation a:hover { color: var(--action); }
.menu-toggle { display: none; width: 44px; height: 44px; padding: 12px; background: none; border: 0; }
.menu-toggle span { display: block; height: 2px; margin: 6px 0; background: var(--navy); transition: transform .18s; }
/* Без JavaScript ссылки остаются видимыми; .js добавляется только после запуска script.js. */
.js .menu-toggle { display: block; }
.js .navigation { display: none; max-height: calc(100dvh - 90px); overflow-y: auto; }
.js .navigation.is-open { display: grid; grid-template-columns: 1fr 1fr; padding: 8px 0; }
.menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

/* 04. Первый экран: нормальный поток элементов предотвращает наложения на маленьких экранах. */
.hero { background: var(--paper); padding: 38px 0 36px; }
.hero-grid { display: grid; gap: 34px; align-items: center; }
.hero h1 { font-size: clamp(39px, 9.8vw, 74px); font-weight: 650; line-height: 1.08; margin: 0 0 24px; text-wrap: balance; }
.hero h1 em { color: var(--action); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero-lead { font-size: 17px; line-height: 1.75; color: var(--muted); max-width: 630px; }
.hero-actions { display: flex; flex-direction: column; align-items: stretch; gap: 20px; margin-top: 27px; }
.hero-actions .text-link { align-self: center; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 5px 20px; margin-top: 25px; color: var(--muted); font-size: 12px; }
.hero-facts span::before { content: "•"; color: var(--blue); margin-right: 7px; }
.hero-portrait { position: relative; width: 100%; max-width: 490px; justify-self: center; border-radius: var(--radius); overflow: hidden; background: #e5e7e4; }
.hero-portrait > img { width: 100%; height: 355px; object-fit: cover; object-position: 50% 28%; }
.hero-portrait figcaption { position: absolute; bottom: 14px; left: 14px; right: 14px; display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: rgb(255 255 255 / 94%); line-height: 1.5; }
.hero-portrait figcaption strong { font-size: 16px; }
.hero-portrait figcaption span { color: var(--muted); font-size: 12px; }
.qualification-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--soft); }
.qualification-strip .container { display: grid; gap: 10px; padding-block: 22px; }
.qualification-strip p { margin: 0; font-size: 12px; font-weight: 650; line-height: 1.5; }

/* 05. Обо мне и темы консультаций. */
.about-grid { display: grid; gap: 32px; align-items: start; }
.about-grid h2 { margin-bottom: 25px; }
.profile-note { padding: 27px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.profile-note dl { margin: 0 0 24px; }
.profile-note dl > div { display: grid; grid-template-columns: 50px 1fr; gap: 17px; padding-block: 15px; border-bottom: 1px solid var(--line); }
.profile-note dt { font-weight: 700; color: var(--action); font-size: 14px; }
.profile-note dd { margin: 0; font-size: 14px; line-height: 1.65; }
.help-grid { display: grid; gap: 15px; }
.help-card { padding: 25px; background: var(--white); border: 1px solid var(--line); border-radius: 15px; }
.number { display: block; font-size: 12px; color: var(--action); font-weight: 700; letter-spacing: .06em; margin-bottom: 23px; }
.help-card h3 { margin-bottom: 13px; }
.help-card p { font-size: 15px; color: var(--muted); }

/* 06. Документы. object-fit: contain показывает диплом целиком без обрезки. */
.certificate-grid { display: grid; gap: 20px; }
.certificate { border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--white); min-width: 0; }
.certificate-image { display: block; position: relative; padding: 16px; background: #f4f6f8; }
.certificate-image img { width: 100%; height: 220px; object-fit: contain; }
.certificate-image > span { position: absolute; right: 13px; bottom: 13px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--white); color: var(--action); box-shadow: 0 3px 10px rgb(0 0 0 / 8%); }
.certificate-image:hover { background: #e9f3fb; }
.certificate-copy { padding: 20px; }
.document-meta { color: var(--muted); font-size: 12px; line-height: 1.6; margin-bottom: 9px; }
.certificate h3 { font-size: 19px; line-height: 1.4; }
.more-certificates { margin-top: 26px; }
.more-certificates > summary { padding: 17px 22px; border: 1px solid var(--line); border-radius: 10px; color: var(--action); font-size: 15px; font-weight: 650; background: var(--soft); }
.more-certificates[open] > summary { margin-bottom: 24px; }
summary::marker { color: var(--action); }

/* 07. Подход и шаги. */
.approach-section { background: var(--paper); }
.approach-grid { display: grid; gap: 22px; }
.approach-grid article { padding: 27px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
.method-label { display: inline-block; border: 1px solid #c0dff6; padding: 4px 13px; border-radius: 30px; font-size: 13px; font-weight: 700; color: var(--action); margin-bottom: 24px; }
.approach-grid h3 { margin-bottom: 15px; font-size: 23px; }
.approach-grid p { color: var(--muted); }
.steps { display: grid; gap: 24px; margin-top: 44px; }
.step { border-top: 1px solid var(--line); padding-top: 24px; }
.step .number { margin-bottom: 12px; }
.step h3 { margin-bottom: 10px; font-size: 19px; }
.step p { color: var(--muted); font-size: 15px; }

/* 08. Отзывы: короткие фрагменты и ссылка на оригинал. */
.review-grid { display: grid; gap: 20px; }
.review-card { display: flex; flex-direction: column; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.quote-mark { height: 40px; color: var(--blue); font-family: Georgia, serif; font-size: 60px; line-height: 1; }
.review-card blockquote { font-family: Georgia, "Times New Roman", serif; font-size: 23px; line-height: 1.5; margin-block: 14px 28px; }
.review-card figcaption { margin-top: auto; font-size: 12px; color: var(--muted); }
.review-card figcaption p { margin-bottom: 8px; }
.review-card .text-link { font-size: 13px; }
.source-link { display: inline-block; margin-top: 27px; color: var(--action); font-size: 14px; }

/* 09. Раскрывающиеся материалы и ответы. Нативный details работает даже без скриптов. */
.resource-layout, .faq-layout { display: grid; gap: 30px; }
.resource-layout h2, .faq-layout h2 { margin-bottom: 20px; }
.articles { border-top: 1px solid var(--line); min-width: 0; }
.articles details { border-bottom: 1px solid var(--line); }
.articles summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 76px; padding-block: 21px; list-style: none; font-size: 17px; font-weight: 650; line-height: 1.5; }
.articles summary::-webkit-details-marker { display: none; }
.articles summary::after { content: "+"; flex: 0 0 24px; font-size: 25px; color: var(--action); text-align: center; font-weight: 400; }
.articles details[open] > summary::after { content: "−"; }
.article-body { padding: 0 0 27px; color: var(--muted); font-size: 15px; }
.article-body .text-link { display: inline-block; margin-top: 17px; font-size: 13px; }

/* 10. Контакты и подвал. Длинная почта переносится, не растягивая мобильную страницу. */
.contact-section { padding-block: 58px; background: var(--action); color: var(--white); }
.contact-grid { display: grid; gap: 34px; }
.contact-section .eyebrow { color: #d7ebff; }
.contact-section h2 { margin-bottom: 22px; }
.contact-section p { max-width: 540px; color: #ebf5ff; }
.contact-options { display: grid; gap: 14px; align-content: center; }
.contact-primary { background: var(--white); color: var(--action); }
.contact-primary:hover { background: #e1f1ff; }
.contact-secondary { border-color: #b2d8fc; color: var(--white); background: transparent; }
.contact-secondary:hover { background: rgb(255 255 255 / 10%); }
.contact-line { display: block; font-size: 17px; overflow-wrap: anywhere; }
.contact-options .contact-note { font-size: 12px; margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 25px; padding-block: 35px; }
.footer-inner strong { font-size: 15px; }
.footer-inner p { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* 11. Просмотр изображения. Фотография не масштабируется сверх доступной области.
   Отдельная ссылка позволяет открыть оригинал и приблизить его средствами браузера. */
dialog { width: min(940px, calc(100% - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: 18px; color: var(--navy); background: var(--white); box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(9 29 45 / 78%); }
.dialog-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.dialog-toolbar h2 { font-size: 17px; letter-spacing: 0; line-height: 1.4; }
#dialog-close { flex: 0 0 44px; width: 44px; height: 44px; font-size: 30px; border: 0; border-radius: 50%; background: var(--soft); line-height: 1; }
.dialog-scroll { max-height: calc(100dvh - 195px); overflow: auto; background: #f3f5f7; }
#dialog-image { margin: auto; width: auto; max-width: 100%; height: auto; max-height: calc(100dvh - 195px); object-fit: contain; }
#dialog-original { display: inline-block; margin-top: 15px; font-size: 13px; }

/* 12. Планшет от 640px: две колонки там, где карточкам хватает места. */
@media (min-width: 640px) {
  :root { --gutter: 30px; /* Боковые отступы планшета; например 36px. */ }
  .brand-initials { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; color: var(--action); font: 17px Georgia, serif; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 11px; }
  .hero-actions { flex-direction: row; align-items: center; }
  .hero-actions .text-link { align-self: auto; }
  .help-grid, .certificate-grid, .approach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qualification-strip .container { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; }
  .hero-portrait > img { height: 480px; }
}

/* 13. Компьютер от 900px: широкие композиции без фиксированных высот текста. */
@media (min-width: 900px) {
  .section { padding-block: 96px; }
  .hero { padding-block: 55px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 70px; }
  .hero h1 { font-size: clamp(55px, 5.5vw, 74px); }
  .hero-portrait > img { height: 570px; }
  .hero-portrait figcaption { left: 22px; right: 22px; bottom: 22px; padding: 16px 22px; }
  .hero-facts { margin-top: 34px; }
  .about-grid { grid-template-columns: 1.3fr .8fr; gap: 75px; }
  .help-grid, .certificate-grid, .review-grid, .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .certificate-image img { height: 200px; }
  .resource-layout, .faq-layout { grid-template-columns: .8fr 1.2fr; gap: 80px; }
  .contact-grid { grid-template-columns: 1.2fr .8fr; gap: 100px; }
  .contact-section { padding-block: 76px; }
}

/* 14. Полное меню появляется, когда названия действительно помещаются. */
@media (min-width: 1150px) {
  .header-inner { flex-wrap: nowrap; min-height: 88px; gap: 22px; }
  .navigation, .js .navigation, .js .navigation.is-open { display: flex; order: 0; flex-basis: auto; gap: 18px; overflow: visible; padding: 0; }
  .navigation a { font-size: 13px; white-space: nowrap; }
  .menu-toggle, .js .menu-toggle { display: none; }
}

/* 15. Небольшие телефоны: сохраняем читаемый текст, уменьшаем только отступы. */
@media (max-width: 359px) {
  :root { --gutter: 14px; /* Отступ для экрана 320px; например 12px. */ }
  .brand strong { font-size: 12px; }
  .brand small { font-size: 9px; }
  .languages button { width: 33px; }
  .header-inner { gap: 6px; }
  .hero h1 { font-size: 36px; }
  .hero-portrait > img { height: 310px; }
}

/* 16. Отдельные страницы. Одна таблица стилей кэшируется браузером для всего сайта. */
.page-intro { padding: 32px 0 44px; background: var(--paper); border-bottom: 1px solid var(--line); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 11px; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.breadcrumbs a:hover { color: var(--action); }
.page-intro h1 { max-width: 950px; font-size: clamp(34px, 5.3vw, 62px); font-weight: 650; line-height: 1.13; text-wrap: balance; }
.page-lead { max-width: 750px; margin-top: 22px; color: var(--muted); font-size: 17px; }
.page-content { padding-block: 45px 65px; }
.article-layout { display: grid; gap: 38px; align-items: start; }
.article-layout > div { min-width: 0; }
.reading-content { max-width: 70ch; }
.reading-content section + section { margin-top: 35px; padding-top: 30px; border-top: 1px solid var(--line); }
.reading-content h2, .session-faq > h2 { font-size: clamp(24px, 3vw, 31px); line-height: 1.3; margin-bottom: 16px; }
.reading-content p, .reading-content li { color: var(--muted); font-size: 17px; line-height: 1.85; }
.reading-content ul { padding-left: 23px; margin-block: 18px; }
.reading-content li + li { margin-top: 13px; }
.article-sidebar { padding: 25px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.article-sidebar h2 { font-size: 21px; margin-bottom: 17px; }
.article-sidebar nav { display: grid; gap: 4px; }
.article-sidebar a { font-size: 14px; line-height: 1.55; padding: 10px 0; text-decoration: none; border-bottom: 1px solid var(--line); }
.article-sidebar a:last-child { border-bottom: 0; }
.article-sidebar a[aria-current="page"], .navigation a[aria-current="page"] { color: var(--action); font-weight: 750; }
.article-sidebar a[aria-current="page"]::before { content: "→ "; }
.article-cta { margin-top: 50px; padding: 27px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--radius); }
.article-cta h2 { font-size: 28px; margin-bottom: 17px; }
.article-cta p { color: var(--muted); margin-bottom: 23px; }
.resource-grid { display: grid; gap: 19px; }
.resource-card { display: flex; flex-direction: column; min-width: 0; padding: 27px; background: var(--white); border: 1px solid var(--line); border-radius: 15px; text-decoration: none; transition: border-color .18s, box-shadow .18s; }
.resource-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.resource-card h2, .resource-card h3 { font-size: 23px; line-height: 1.35; margin-bottom: 15px; }
.resource-card p { font-size: 15px; color: var(--muted); margin-bottom: 25px; }
.resource-card .text-link { margin-top: auto; }
.heading-link { text-decoration: none; }
.heading-link:hover { color: var(--action); }
.section-button { margin-top: 24px; }
.session-teaser { display: grid; gap: 25px; align-items: center; }
.session-teaser h2 { margin-bottom: 18px; }
.session-teaser p:not(.eyebrow) { color: var(--muted); }
.session-teaser > .button { justify-self: start; }
.session-faq { margin-top: 42px; }
.review-intro { margin: 0 0 32px; }
.review-preview { display: block; padding: 10px; margin-bottom: 23px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; }
.review-preview img { width: 100%; height: 180px; object-fit: contain; }
@media (min-width: 640px) {
  .resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .page-intro { padding-block: 40px 58px; }
  .page-content { padding-block: 60px 90px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 65px; }
  .article-sidebar { position: sticky; top: 116px; }
  .session-teaser { grid-template-columns: minmax(0, 1fr) auto; gap: 70px; }
  .resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Уважаем системную настройку уменьшения движения. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

/* 16. Обновление ImTT: подписи первого экрана и локальные иллюстрации. */
.hero-credentials { display: grid; gap: 4px; margin: 20px 0 12px; font-size: 18px; }
.hero-contact { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 14px; margin-bottom: 22px; }
.hero-contact a { overflow-wrap: anywhere; }
.article-banner { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: 16px; margin-bottom: 32px; }
.article-media-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 22px; }
.article-media { margin: 0; min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.article-media img { width: 100%; height: 260px; object-fit: contain; background: white; }
.article-media figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }
.certificate-copy .text-link { display: inline-block; margin-top: 12px; }
@media (min-width: 640px) { .article-media-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (min-width: 1100px) { .approach-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
