/* ============================================================
   Психологическая служба AYU — первый экран и базовая типографика.
   Фирменный цвет взят из логотипа: #009cb4.
   ============================================================ */

:root {
    --psy-brand: #009cb4;
    --psy-brand-dark: #00798c;
    --psy-brand-deep: #064a57;
    --psy-ink: #12323a;
    --psy-muted: #4d6b73;
    --psy-paper: #ffffff;
    --psy-soft: #f2fafc;
    --psy-line: rgba(0, 156, 180, .22);
    --psy-shadow-sm: 0 10px 30px rgba(6, 74, 87, .08);
    --psy-shadow-lg: 0 24px 70px rgba(6, 74, 87, .13);
    --psy-shell: min(1180px, 100% - 48px);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.psy-page {
    margin: 0;
    background: var(--psy-paper);
    color: var(--psy-ink);
    font-family: 'Jost', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

.psy-shell { width: var(--psy-shell); margin-inline: auto; }

.psy-sr {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.psy-skip {
    position: absolute; left: -9999px; top: 0; z-index: 100;
    padding: 12px 18px; background: var(--psy-brand-deep); color: #fff;
}
.psy-skip:focus { left: 12px; top: 12px; }

:focus-visible { outline: 3px solid var(--psy-brand); outline-offset: 3px; }

/* ---------- Служебная шапка ---------- */

.psy-topbar {
    position: relative; z-index: 20;
    background: var(--psy-brand-deep); color: #eaf7fa;
    font-size: 14px;
}
.psy-topbar__inner {
    width: var(--psy-shell); margin-inline: auto;
    display: flex; flex-wrap: wrap; gap: 10px 22px;
    align-items: center; justify-content: space-between;
    min-height: 44px; padding-block: 6px;
}
.psy-topbar a { color: inherit; text-decoration: none; }
.psy-topbar a:hover { text-decoration: underline; }
.psy-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.psy-crumbs span { opacity: .6; }
.psy-topbar__tools { display: flex; align-items: center; gap: 14px; }
.psy-langs { display: flex; gap: 10px; }
.psy-langs a[aria-current="true"] { color: #6fe3f6; font-weight: 700; }

.psy-motion {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px; border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px; background: transparent; color: inherit;
    font: inherit; font-size: 13px; cursor: pointer;
}
.psy-motion:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Навигация по длинной странице ---------- */

.psy-section-nav {
    position: sticky;
    top: 0;
    z-index: 18;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 156, 180, .14);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 30px rgba(6, 74, 87, .06);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.psy-section-nav__inner {
    width: var(--psy-shell);
    margin-inline: auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}
.psy-section-nav__inner::-webkit-scrollbar { display: none; }
.psy-section-nav a {
    flex: 0 0 auto;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--psy-muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.psy-section-nav a:hover {
    color: var(--psy-brand-deep);
    background: var(--psy-soft);
    border-color: var(--psy-line);
    transform: translateY(-1px);
}
.psy-section-nav a.is-active {
    color: #fff;
    background: linear-gradient(135deg, #008097, var(--psy-brand-deep));
    box-shadow: 0 7px 18px rgba(0, 156, 180, .22);
}

/* ============================================================
   Первый экран
   ============================================================ */

.psy-hero {
    position: relative;
    min-height: clamp(560px, 88vh, 860px);
    overflow: hidden;
    isolation: isolate;
    display: grid;
}

/* Слои занимают экран с запасом сверху и снизу: при сдвиге не должно
   обнажаться пустое место по краям. */
.psy-hero__layer {
    grid-area: 1 / 1;
    position: relative;
    will-change: transform;
}

.psy-hero__layer--back,
.psy-hero__layer--front {
    margin: -12% 0;
    pointer-events: none;
}

.psy-hero__sky,
.psy-hero__foliage {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block;
}

/* Текст и кнопки подняты над листвой: лист, перечёркивающий главную кнопку,
   выглядит небрежно. Слой всё равно едет со своей скоростью, поэтому
   ощущение глубины сохраняется — меняется только порядок перекрытия.
   Дочерний элемент поднять нельзя: translate3d на слое создаёт
   контекст наложения, из которого потомкам не выбраться. */
.psy-hero__layer--mid   { z-index: 4; display: grid; place-items: center; }
.psy-hero__layer--front { z-index: 3; }
.psy-hero__layer--back  { z-index: 1; }

.psy-hero__inner {
    width: var(--psy-shell);
    max-width: 760px;
    text-align: center;
    padding-block: 64px;
}

.psy-hero__logo {
    width: clamp(132px, 17vw, 196px);
    height: auto;
    margin: 0 auto 22px;
    display: block;
    filter: drop-shadow(0 10px 26px rgba(0, 121, 140, .28));
}

.psy-hero__eyebrow {
    margin: 0 0 10px;
    font-size: 13px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--psy-brand-dark);
}

.psy-hero__title {
    margin: 0 0 16px;
    font-size: clamp(28px, 4.1vw, 50px);
    line-height: 1.16;
    font-weight: 700;
    color: var(--psy-brand-deep);
    text-wrap: balance;
}

.psy-hero__tagline {
    margin: 0 auto 30px;
    max-width: 30em;
    font-size: clamp(16px, 1.5vw, 19px);
    color: var(--psy-muted);
}

.psy-hero__actions {
    display: flex; flex-wrap: wrap;
    gap: 12px; justify-content: center;
}

.psy-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 50px; padding: 0 28px;
    border-radius: 999px;
    font-weight: 600; font-size: 16px;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.psy-btn--primary {
    background: linear-gradient(135deg, #008097, var(--psy-brand-deep)); color: #fff;
    box-shadow: 0 12px 26px rgba(0, 156, 180, .32);
}
.psy-btn--primary:hover { background: var(--psy-brand-dark); transform: translateY(-2px); }
.psy-btn--ghost {
    background: rgba(255, 255, 255, .82);
    color: var(--psy-brand-deep);
    border: 2px solid var(--psy-brand);
}
.psy-btn--ghost:hover { background: #fff; transform: translateY(-2px); }

.psy-hero__scroll {
    position: absolute; left: 50%; bottom: 22px;
    z-index: 4;
    transform: translateX(-50%);
    display: inline-flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--psy-brand-deep); text-decoration: none;
    font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
}
.psy-hero__scroll svg { animation: psy-bob 2.1s ease-in-out infinite; }

@keyframes psy-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(5px); }
}

/* ---------- Покачивание листвы ----------
   Качаем ветвь целиком, а не каждый лист: 112 отдельных анимаций
   загрузили бы процессор без заметной разницы в картинке.
   transform-box: view-box позволяет задать точку вращения
   в координатах viewBox — ставим её в основание ветви,
   чтобы комель стоял, а вершина ходила. */

.psy-sway {
    transform-box: view-box;
    transform-origin: var(--psy-origin, 50% 100%);
    animation: psy-sway var(--psy-dur, 7s) ease-in-out var(--psy-delay, 0s) infinite alternate;
    will-change: transform;
}

@keyframes psy-sway {
    from { transform: rotate(calc(var(--psy-amp, 1.2deg) * -1)); }
    to   { transform: rotate(var(--psy-amp, 1.2deg)); }
}

/* ============================================================
   Заготовки разделов — чтобы было что прокручивать
   ============================================================ */

.psy-section {
    position: relative;
    padding-block: clamp(56px, 8vw, 104px);
    overflow: clip;
    scroll-margin-top: 76px;
}
.psy-section:nth-of-type(even) { background: var(--psy-soft); }
.psy-section:nth-of-type(even)::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    right: -240px;
    top: -230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(84, 190, 210, .16), rgba(84, 190, 210, 0) 70%);
    pointer-events: none;
}
.psy-section .psy-shell { position: relative; z-index: 1; }

.psy-section__label {
    margin: 0 0 8px;
    font-size: 13px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase;
    color: var(--psy-brand-dark);
}
.psy-section h2 {
    margin: 0 0 18px;
    font-size: clamp(23px, 3vw, 34px);
    line-height: 1.22;
    color: var(--psy-brand-deep);
}
.psy-placeholder {
    margin: 0;
    padding: 26px 28px;
    border: 2px dashed var(--psy-line);
    border-radius: 16px;
    color: var(--psy-muted);
    background: rgba(255, 255, 255, .6);
}

/* ---------- Содержимое из редактора ---------- */

.psy-rich { max-width: 76ch; }
.psy-rich > :first-child { margin-top: 0; }
.psy-rich > :last-child { margin-bottom: 0; }
.psy-rich p { margin: 0 0 1em; }
.psy-rich ul, .psy-rich ol { margin: 0 0 1.25em; padding-left: 0; list-style: none; }
.psy-rich li {
    position: relative;
    margin-bottom: .65em;
    padding-left: 1.55em;
}
.psy-rich li::before {
    content: '';
    position: absolute;
    left: .15em;
    top: .72em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--psy-brand), #6fd5e5);
    box-shadow: 0 0 0 4px rgba(0, 156, 180, .10);
}
.psy-rich a { color: var(--psy-brand-dark); }
.psy-rich a[href$=".pdf" i] {
    display: flex;
    width: min(100%, 680px);
    align-items: center;
    gap: 14px;
    margin: 12px 0;
    padding: 16px 18px;
    border: 1px solid var(--psy-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .84);
    box-shadow: var(--psy-shadow-sm);
    color: var(--psy-brand-deep);
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.psy-rich a[href$=".pdf" i]::before {
    content: 'PDF';
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: linear-gradient(145deg, #008097, var(--psy-brand-deep));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
}
.psy-rich a[href$=".pdf" i]:hover {
    transform: translateY(-2px);
    border-color: var(--psy-brand);
    box-shadow: var(--psy-shadow-lg);
}
.psy-rich img { max-width: 100%; height: auto; border-radius: 12px; }
.psy-rich table { width: 100%; border-collapse: collapse; }
.psy-rich td, .psy-rich th { border: 1px solid var(--psy-line); padding: 8px 10px; }

/* Широкое содержимое из редактора прокручивается внутри себя,
   а не растягивает страницу по горизонтали */
.psy-rich { overflow-x: auto; }

.psy-about-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
}
#psy-about .psy-rich { max-width: none; }
.psy-about-media {
    margin: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--psy-shadow-lg);
}
.psy-about-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#psy-services .psy-rich,
#psy-functions .psy-rich,
#psy-gallery .psy-rich {
    max-width: 900px;
    padding: clamp(22px, 4vw, 38px);
    border: 1px solid var(--psy-line);
    border-radius: 24px;
    background: rgba(255, 255, 255, .76);
    box-shadow: var(--psy-shadow-sm);
}

/* ---------- Запись на приём ---------- */

.psy-book {
    margin-top: 28px;
    padding: 28px 30px;
    background: #fff;
    border: 1px solid var(--psy-line);
    border-radius: 20px;
    box-shadow: var(--psy-shadow-sm);
}
.psy-book__title { margin: 0 0 8px; font-size: 22px; color: var(--psy-brand-deep); }
.psy-book__intro { margin: 0 0 20px; max-width: 62ch; color: var(--psy-muted); }

.psy-note {
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 12px;
    font-weight: 500;
}
.psy-note--ok  { background: #e4f7ec; color: #14683d; border: 1px solid #9ad9b7; }
.psy-note--bad { background: #fdecec; color: #8c1d1d; border: 1px solid #efb4b4; }

.psy-form {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.psy-field { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.psy-field--wide { grid-column: 1 / -1; }
.psy-field label { font-size: 14px; font-weight: 600; color: var(--psy-brand-deep); }
.psy-field label span {
    display: block;
    font-size: 12px; font-weight: 400;
    color: var(--psy-muted);
}
.psy-field input,
.psy-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--psy-line);
    border-radius: 12px;
    background: var(--psy-soft);
    font: inherit;
    color: var(--psy-ink);
}
.psy-field input:focus,
.psy-field textarea:focus {
    outline: 3px solid var(--psy-brand);
    outline-offset: 1px;
    background: #fff;
}
.psy-field textarea { resize: vertical; min-height: 110px; }

.psy-form__foot {
    flex-direction: row; flex-wrap: wrap;
    align-items: center; gap: 14px 18px;
}
.psy-form__foot small { color: var(--psy-muted); font-size: 13px; }

/* Ловушка: убираем из потока, но не через display:none —
   часть ботов такие поля пропускает */
.psy-trap {
    position: absolute;
    left: -9999px;
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ---------- Новости ---------- */

.psy-news { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; }
.psy-news a {
    display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--psy-line);
    border-radius: 14px;
    color: var(--psy-brand-deep);
    text-decoration: none;
    transition: border-color .15s ease, transform .15s ease;
}
.psy-news a:hover { border-color: var(--psy-brand); transform: translateX(3px); }
.psy-news time { flex: 0 0 auto; font-size: 13px; color: var(--psy-muted); font-variant-numeric: tabular-nums; }
.psy-news span { flex: 1 1 260px; font-weight: 500; }

/* ---------- Контакты и линии доверия ---------- */

.psy-contacts {
    margin-top: 26px;
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: start;
}
.psy-contacts__list { margin: 0; display: grid; gap: 14px; }
.psy-contacts__list div {
    padding: 16px 20px;
    background: #fff;
    border: 1px solid var(--psy-line);
    border-radius: 14px;
}
.psy-contacts__list dt {
    margin: 0 0 3px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--psy-brand-dark);
}
.psy-contacts__list dd { margin: 0; overflow-wrap: anywhere; }
.psy-contacts__list a { color: var(--psy-brand-deep); text-decoration: none; }
.psy-contacts__list a:hover { text-decoration: underline; }

.psy-hotline {
    padding: 22px 24px;
    border-radius: 18px;
    background: var(--psy-brand-deep);
    color: #eaf7fa;
}
.psy-hotline__title {
    margin: 0 0 14px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase;
    color: #8fe0ef;
}
.psy-hotline__item {
    display: flex; align-items: baseline; gap: 14px;
    padding: 10px 0;
    color: inherit; text-decoration: none;
    border-top: 1px solid rgba(255, 255, 255, .18);
}
.psy-hotline__item:first-of-type { border-top: 0; }
.psy-hotline__item strong { font-size: 26px; letter-spacing: .02em; }
.psy-hotline__item span { font-size: 14px; line-height: 1.35; opacity: .92; }
.psy-hotline__item:hover span { opacity: 1; text-decoration: underline; }

/* ---------- Нумерованные цели и задачи ---------- */

.psy-numbered {
    list-style: none;
    counter-reset: psy-num;
    margin: 26px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.psy-numbered li {
    counter-increment: psy-num;
    position: relative;
    padding: 20px 22px 20px 64px;
    background: #fff;
    border: 1px solid var(--psy-line);
    border-radius: 16px;
    line-height: 1.5;
    box-shadow: 0 8px 22px rgba(6, 74, 87, .04);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.psy-numbered li:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 156, 180, .45);
    box-shadow: var(--psy-shadow-sm);
}
.psy-numbered li::before {
    content: counter(psy-num);
    position: absolute;
    left: 20px; top: 18px;
    display: grid; place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--psy-brand-dark);
    color: #fff;
    font-size: 14px; font-weight: 700;
}

/* ---------- Сотрудники ---------- */

.psy-team {
    list-style: none;
    margin: 26px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}
.psy-person {
    flex: 1 1 205px;
    max-width: 270px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--psy-line);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 121, 140, .08);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.psy-person:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 156, 180, .45);
    box-shadow: var(--psy-shadow-lg);
}
.psy-person__photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--psy-soft);
}
.psy-person__initials {
    display: grid; place-items: center;
    background: linear-gradient(140deg, #d8f1f7, #a9dfea);
    color: var(--psy-brand-deep);
    font-size: 40px; font-weight: 700; letter-spacing: .04em;
}
.psy-person__body { padding: 16px 18px 18px; }
.psy-person__role {
    margin: 0 0 4px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase;
    color: var(--psy-brand-dark);
}
.psy-person__name {
    margin: 0 0 8px;
    font-size: 17px; font-weight: 600; line-height: 1.3;
    color: var(--psy-brand-deep);
}
.psy-person__link {
    display: block;
    font-size: 14px;
    color: var(--psy-muted);
    text-decoration: none;
    overflow-wrap: anywhere;
}
.psy-person__link:hover { color: var(--psy-brand-dark); text-decoration: underline; }

/* ---------- Галерея ---------- */

.psy-gallery {
    list-style: none;
    margin: 24px 0 0;
    padding: 0;
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.psy-gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    background: var(--psy-soft);
    box-shadow: 0 6px 18px rgba(0, 121, 140, .12);
    transition: transform .2s ease;
}
.psy-gallery img:hover { transform: scale(1.02); }

/* ---------- Завершение страницы ---------- */

.psy-footer {
    padding: 34px 0;
    background: var(--psy-brand-deep);
    color: rgba(234, 247, 250, .78);
    font-size: 14px;
}
.psy-footer__inner {
    width: var(--psy-shell);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px 30px;
}
.psy-footer__inner div { display: grid; gap: 2px; }
.psy-footer strong { color: #fff; font-size: 16px; }
.psy-footer a { color: #8fe0ef; text-decoration: none; }
.psy-footer a:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   Движение отключается системной настройкой или кнопкой в шапке.
   При выключении слои возвращаются на место — страница остаётся целой.
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .psy-hero__layer { transform: none !important; }
    .psy-hero__scroll svg { animation: none; }
    .psy-sway { animation: none; transform: none; }
    .psy-btn,
    .psy-section-nav a,
    .psy-numbered li,
    .psy-person,
    .psy-rich a[href$=".pdf" i] { transition: none; }
}

body.psy-motion-off .psy-hero__layer { transform: none !important; }
body.psy-motion-off .psy-hero__scroll svg { animation: none; }
body.psy-motion-off .psy-sway { animation: none; transform: none; }
body.psy-motion-off .psy-numbered li,
body.psy-motion-off .psy-person,
body.psy-motion-off .psy-rich a[href$=".pdf" i] { transform: none !important; transition: none; }

@media (max-width: 720px) {
    :root { --psy-shell: calc(100% - 32px); }
    .psy-hero { min-height: 78vh; }
    /* Кнопки встают в столбик, поэтому снизу нужен запас под подсказкой прокрутки */
    .psy-hero__inner { padding: 40px 0 104px; }
    .psy-hero__actions { flex-direction: column; align-items: stretch; }
    .psy-btn { width: 100%; }
    .psy-topbar__inner { justify-content: center; }
    .psy-section-nav { padding-block: 8px; }
    .psy-section-nav__inner { width: 100%; padding-inline: 16px; }
    .psy-about-layout { grid-template-columns: 1fr; gap: 28px; }
    .psy-about-media { width: 100%; }
    .psy-person { flex-basis: min(100%, 260px); }
    .psy-footer__inner { align-items: flex-start; flex-direction: column; }
}

/* На низком экране подсказка только мешает — там и так видно, что ниже есть контент */
@media (max-height: 640px) {
    .psy-hero__scroll { display: none; }
}
