/* Главная страница — только index.html
 * Иерархия: раздел → блок → элементы; вложенные @media задают изменения на экранах разной ширины.
 * Меняйте значения свойств внутри нужного блока. Порядок правил сохранён: более поздние уточнения имеют приоритет.
 * Цвета и шрифты: :root. Размеры: padding, margin, gap, font-size.
 */

/* 01. Палитра, шрифты и переменные — основные настройки оформления */
:root {
    /* Палитра «Глубина» — из согласованного примера */
    --g1: #031A2A;
    --g2: #0B3149;
    --g3: #1E597A;
    --g4: #255F81;
    --g5: #8CB8CF;
    --grad: linear-gradient(90deg, var(--g1) 0%, var(--g2) 18%, var(--g3) 42%, var(--g4) 72%, var(--g5) 100%);
    --ink: #0B3149;
    --blue: #1E597A;
    --sky: #255F81;
    --gold: #8CB8CF;
    --mist: #8CB8CF;
    --paper: #FAFCFD;
    --pale: #E2EEF4;
    --body-c: #34495A;
    --muted: #6A8193;
    --serif: 'Spectral', Georgia, serif;
    --sans: 'Manrope', -apple-system, sans-serif;
    /* Совместимость с перенесёнными секциями */
    --navy: var(--ink);
    --blue-mid: var(--gold);
    --blue-pale: var(--pale);
    --bg: var(--paper);
    --white: #FFFFFF;
}

/* 02. Базовые стили и общие блоки */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--sans);
    color: var(--body-c);
    background: var(--paper);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1,h2,h3 {
    font-family: var(--serif);
    color: var(--ink);
    font-weight: 500;
    line-height: 1.15;
}

a {
    color: var(--sky);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ================= НАВИГАЦИЯ ================= */
/* 03. Шапка → логотип и навигация */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(11,49,73,.1);
}

/* 04. Базовые стили и общие блоки */
.wrap {
    width: min(1120px,calc(100% - 48px));
    margin-inline: auto;
}

/* 05. Шапка → логотип и навигация */
.nav {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .14em;
    white-space: nowrap;
}

.brand-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--g1), var(--g3) 55%, var(--g5));
    flex: 0 0 auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    font-size: 14px;
    color: var(--ink);
    opacity: .76;
    transition: opacity .2s;
}

.nav-links a:hover,.nav-links a[aria-current="page"] {
    opacity: 1;
}

/* 06. Пожертвования → реквизиты и поддержка */
.donate-link {
    padding: 10px 18px;
    border: 1px solid var(--ink);
    border-radius: 99px;
}

/* 07. Шапка → логотип и навигация */
.menu-toggle {
    display: none;
    border: 0;
    background: none;
    color: var(--ink);
    padding: 8px;
    cursor: pointer;
}

/* ================= HERO / ШАПКА ================= */
/* 08. Первый экран страницы */
.hero {
    position: relative;
    padding: 48px 24px 36px;
    text-align: center;
    overflow: hidden;
    background: var(--paper);
}

.eyebrow {
    font-size: 13px;
    letter-spacing: 0.32em;
    color: var(--sky);
    font-weight: 600;
}

.hero .eyebrow {
    display: block;
    margin-bottom: 28px;
}

.hero-title {
    font-size: clamp(40px, 7vw, 64px);
    letter-spacing: 0.01em;
}

/* 09. Базовые стили и общие блоки */
.waterline {
    height: 2px;
    width: min(260px, 60%);
    margin: 16px auto 0;
    background: var(--grad);
    border-radius: 2px;
}

/* 10. Материалы → видео */
.hero-video {
    max-width: 560px;
    margin: 26px auto 0;
}

.video-shell {
    position: relative;
    aspect-ratio: 16/9;
    background: linear-gradient(155deg,#E2EEF4 0%,#CFE2EC 100%);
    border: 1px solid rgba(11,49,73,0.12);
    /* нейтральная заглушка: iframe с видео закроет её целиком */
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow .3s;
}

.video-shell:hover {
    box-shadow: 0 12px 40px rgba(11,49,73,0.16);
}

.video-shell iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 11. Первый экран страницы */
.hero-play {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid rgba(30,89,122,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s;
}

/* 12. Материалы → видео */
.video-shell:hover .hero-play {
    transform: scale(1.07);
}

/* 13. Первый экран страницы */
.hero-play svg {
    margin-left: 4px;
}

/* 14. Материалы → видео */
.video-label {
    font-size: 12px;
    letter-spacing: 0.18em;
    color: var(--muted);
    font-weight: 600;
}

/* 15. Первый экран страницы */
.hero-word {
    max-width: 520px;
    margin: 38px auto 0;
}

.hero-word .lead {
    font-family: var(--serif);
    font-size: 22px;
    color: var(--blue);
    margin-bottom: 12px;
    line-height: 1.45;
}

.hero-word p:last-child {
    font-size: 16px;
}

.hero-cta {
    margin-top: 34px;
}

/* 16. Общие компоненты → кнопки и состояния */
.btn {
    display: inline-block;
    background: var(--grad);
    color: #fff;
    border: none;
    padding: 16px 42px;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background-position .5s ease, transform .2s, box-shadow .3s;
    background-size: 140% 100%;
}

.btn:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(11,49,73,0.3);
}

/* 17. Первый экран страницы */
.hero-meta {
    margin-top: 18px;
    font-size: 13px;
    color: var(--muted);
    letter-spacing: 0.04em;
}

/* 18. Базовые стили и общие блоки */
.rise {
    opacity: 0;
    transform: translateY(14px);
    animation: rise .9s ease-out forwards;
}

.d1 {
    animation-delay: .2s;
}

.d2 {
    animation-delay: .5s;
}

.d3 {
    animation-delay: 1.3s;
}

.d4 {
    animation-delay: 1.8s;
}

.d5 {
    animation-delay: 2.3s;
}

/* 19. Анимации → @keyframes rise */
@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= ДУГИ СВЕТА (сквозной мотив) ================= */
/* 20. Базовые стили и общие блоки */
.rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1400px;
    height: 1400px;
    transform: translate(-50%, -46%);
    pointer-events: none;
}

.rays svg {
    width: 100%;
    height: 100%;
}

.ray-arc {
    fill: none;
    stroke-width: 1;
    opacity: 0;
    animation: rayIn 1.6s ease forwards;
}

/* 21. Анимации → @keyframes rayIn */
@keyframes rayIn {
    from {
        opacity: 0;
    }
    to {
        opacity: var(--target-opacity, 0.35);
    }
}

/* ================= ОБЩИЕ СТИЛИ СЕКЦИЙ ================= */
/* 22. Базовые стили и общие блоки */
.section-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: clamp(30px, 4vw, 44px);
    text-align: center;
    color: var(--navy);
    letter-spacing: -0.01em;
}

.section-sub {
    text-align: center;
    color: var(--blue);
    opacity: 0.75;
    margin-top: 14px;
    font-size: 15.5px;
    line-height: 1.6;
}

.divider {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding-top: 8px;
    opacity: 0.8;
}

.divider svg {
    width: 100%;
    height: 28px;
    display: block;
}

/* ================= ДЕТАЛИ КУРСА ================= */
.details {
    background: var(--bg);
    padding: 12px 24px 48px;
}

.format-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.format-list li {
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--body-c);
    padding-left: 16px;
    position: relative;
}

.format-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--blue-mid);
}

.format-list strong {
    color: var(--blue);
    font-weight: 600;
}

/* Карточки деталей курса */
.details-card-grid {
    max-width: 920px;
    margin: 48px auto 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--white);
    border: 1px solid var(--blue-pale);
    border-radius: 8px;
    padding: 20px 18px;
    transition: border-color 0.25s ease;
}

.detail-card:hover {
    border-color: var(--blue-mid);
}

.detail-card-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--grad);
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-card-icon svg {
    stroke: #fff;
}

.detail-card-icon svg circle[r="0.9"] {
    fill: #fff;
}

.detail-card-text h3 {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 5px;
}

.detail-card-text p {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--muted);
}

.details-format {
    max-width: 920px;
    margin: 28px auto 0;
    background: var(--white);
    border: 1px solid var(--blue-pale);
    border-radius: 8px;
    padding: 22px 24px;
}

.details-format h3 {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 23. Адаптивность → @media (max-width: 760px) */
@media (max-width: 760px) {
    .details-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= ПРЕПОДАВАТЕЛИ ================= */
/* 24. Базовые стили и общие блоки */
.teachers {
    background: var(--white);
    padding: 52px 24px;
}

.teachers-card-grid {
    max-width: 820px;
    margin: 32px auto 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.teacher-card-bordered {
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--blue-pale);
    border-radius: 12px;
    padding: 16px;
    transition: border-color 0.25s ease;
}

.teacher-card-bordered:hover {
    border-color: var(--blue-mid);
}

.teacher-photo-sq {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 12px;
    background: var(--pale);
    overflow: hidden;
}

.teacher-photo-sq img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.teacher-card-text h3 {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 5px;
}

.teacher-card-text p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}

/* 25. Адаптивность → @media (max-width: 640px) */
@media (max-width: 640px) {
    .teachers-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= ВИДЕО-КАРТОЧКИ (свидетельства) ================= */
/* 26. Материалы → видео */
.video-frame {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(155deg, #1E597A 0%, #0B3149 100%);
    /* синяя заглушка: сюда встанет превью реального видео */
    border: 1px solid rgba(11,49,73,0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 22px;
    text-align: left;
}

.video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-badge {
    align-self: flex-start;
    background: rgba(255,255,255,0.12);
    color: var(--white);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

/* 27. Базовые стили и общие блоки */
.play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    transition: transform 0.25s ease;
}

.play-btn:hover {
    transform: translate(-50%, -50%) scale(1.06);
}

/* 28. Общие компоненты → кнопки и состояния */
.play-btn:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 4px;
}

/* 29. Материалы → видео */
.video-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.video-title {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    max-width: 90%;
}

.video-author {
    color: var(--blue-mid);
    font-size: 12.5px;
}

.video-yt {
    align-self: flex-end;
    color: var(--white);
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
    background: rgba(255,255,255,0.1);
    padding: 7px 14px;
    border-radius: 100px;
    transition: background 0.25s ease;
}

.video-yt:hover {
    background: rgba(255,255,255,0.2);
}

.video-yt:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* ================= СВИДЕТЕЛЬСТВА ================= */
/* 30. Базовые стили и общие блоки */
.vt {
    position: relative;
    background: var(--pale);
    padding: 52px 24px 56px;
    overflow: hidden;
}

.vt-rays {
    width: 1200px;
    height: 1200px;
}

.vt-title {
    position: relative;
    color: var(--ink);
}

.vt-sub {
    position: relative;
    color: var(--sky);
    opacity: 1;
}

.vt-list {
    position: relative;
    max-width: 980px;
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    gap: 72px;
}

.vt-list .vt-grid:not(:last-child) {
    padding-bottom: 72px;
    border-bottom: 1px solid rgba(11,49,73,0.12);
}

.vt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

/* Видео центрируется по абзацам текста (без кавычки и подписи автора) */
.vt-text {
    display: contents;
}

.vt-grid {
    grid-template-rows: auto auto auto;
    row-gap: 0;
}

/* 31. Материалы → видео */
.vt-video {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
}

/* 32. О нас → команда и свидетельства */
.vt-text .quote-mark,.vt-text .vt-body,.vt-text .vt-footer {
    grid-column: 2;
}

.vt-text .quote-mark {
    grid-row: 1;
}

/* 33. Базовые стили и общие блоки */
.vt-text .vt-body {
    grid-row: 2;
}

.vt-text .vt-footer {
    grid-row: 3;
}

/* 34. Материалы → видео */
.vt-reverse .vt-video {
    grid-column: 2;
}

/* 35. О нас → команда и свидетельства */
.vt-reverse .vt-text .quote-mark,.vt-reverse .vt-text .vt-body,.vt-reverse .vt-text .vt-footer {
    grid-column: 1;
}

.quote-mark {
    font-family: var(--serif);
    font-size: 56px;
    line-height: 1;
    font-weight: 500;
    margin-bottom: 4px;
    display: block;
}

.vt-quote {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 36. Базовые стили и общие блоки */
.vt-text p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--body-c);
}

.review-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
}

.review-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--pale);
    overflow: hidden;
}

.review-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
}

.review-name {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
}

.vt-footer {
    border-top: 1px solid rgba(11,49,73,0.12);
}

.vt-name {
    color: var(--ink);
}

/* 37. Адаптивность → @media (max-width: 780px) */
@media (max-width: 780px) {
    .vt-grid, .vt-reverse {
        grid-template-columns: 1fr;
    }
    .vt-video,.vt-reverse .vt-video {
        grid-column: 1;
        grid-row: 1;
    }
    .vt-text .quote-mark,.vt-reverse .vt-text .quote-mark {
        grid-column: 1;
        grid-row: 2;
    }
    .vt-text .vt-body,.vt-reverse .vt-text .vt-body {
        grid-column: 1;
        grid-row: 3;
    }
    .vt-text .vt-footer,.vt-reverse .vt-text .vt-footer {
        grid-column: 1;
        grid-row: 4;
    }
    .vt-video {
        margin-bottom: 16px;
    }
    .vt-list {
        gap: 56px;
    }
    .vt-list .vt-grid:not(:last-child) {
        padding-bottom: 56px;
    }
}

/* ================= FAQ ================= */
/* 38. Базовые стили и общие блоки */
.faq {
    background: var(--white);
    padding: 32px 24px 56px;
}

.faq-list {
    max-width: 760px;
    margin: 32px auto 0;
}

.faq-item {
    border-top: 1px solid var(--blue-pale);
}

.faq-list .faq-item:last-child {
    border-bottom: 1px solid var(--blue-pale);
}

.faq-summary {
    width: 100%;
    background: none;
    border: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 16px;
    cursor: pointer;
    font-family: var(--sans);
    font-size: 15.5px;
    font-weight: 600;
    color: var(--navy);
    text-align: left;
    transition: color 0.25s ease, transform 0.25s ease;
}

.faq-summary:hover {
    color: var(--blue);
    transform: translateX(4px);
}

.faq-summary:hover .faq-chevron path {
    stroke: var(--blue-mid);
}

/* 39. Общие компоненты → кнопки и состояния */
.faq-summary:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

/* 40. Базовые стили и общие блоки */
.faq-chevron {
    flex-shrink: 0;
    margin-left: 20px;
    transition: transform 0.3s ease;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.faq-item.open .faq-panel {
    grid-template-rows: 1fr;
}

.faq-panel-inner {
    overflow: hidden;
}

.faq-answer {
    padding: 0 16px 22px;
    font-size: 14.5px;
    line-height: 1.7;
    color: var(--muted);
    font-style: italic;
}

/* ================= FOOTER ================= */
/* 41. Подвал сайта */
.site-footer {
    background: var(--pale);
    border-top: 1px solid rgba(11,49,73,0.1);
    padding: 36px 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-logo {
    font-family: var(--serif);
    font-size: 16px;
    color: var(--ink);
    font-weight: 500;
}

.footer-copy {
    font-size: 13px;
    color: var(--sky);
}

.footer-social {
    display: flex;
    gap: 14px;
}

.footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--white);
    border: 1px solid rgba(11,49,73,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
}

.footer-social a:hover {
    transform: translateY(-2px);
}

.footer-social a:focus-visible {
    outline: 2px solid var(--sky);
    outline-offset: 2px;
}

/* 42. Адаптивность → @media (max-width: 640px) */
@media (max-width: 640px) {
    .site-footer {
        padding: 32px 24px;
        justify-content: center;
        text-align: center;
    }
}

/* ================= ДОСТУПНОСТЬ И МОБИЛЬНЫЕ ================= */
/* 43. Адаптивность → @media (prefers-reduced-motion: reduce) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .rise {
        opacity: 1;
        transform: none;
    }
    .ray-arc {
        animation: none;
        opacity: var(--target-opacity, 0.35);
    }
}

/* 44. Адаптивность → @media (max-width: 640px) */
@media (max-width: 640px) {
    .wrap {
        width: min(100% - 32px,1120px);
    }
    .nav {
        height: 68px;
    }
    .menu-toggle {
        display: block;
    }
    .nav-links {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 68px;
        background: #fff;
        border-bottom: 1px solid rgba(61,74,92,.1);
        padding: 12px 16px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 12px;
    }
    .donate-link {
        border: 0;
    }
    .hero {
        padding: 40px 20px 28px;
    }
}
