/* ==========================================================================
   Страница "Обо мне" — текст из админки + фотографии
   ========================================================================== */

.ab-page {
    --ab-bg: #fcf0ea;
    --ab-card: #f8ece5;
    --ab-card-2: #f1ddd1;
    --ab-line: #e2cbbc;
    --ab-accent: #b28663;
    --ab-accent-dark: #96694a;
    --ab-ink: #1d1d1d;
    --ab-ink-soft: rgba(29, 29, 29, 0.82);
    --ab-ink-mute: rgba(29, 29, 29, 0.62);
    --ab-shadow: 0 26px 60px rgba(122, 78, 45, 0.13);
    --ab-shadow-soft: 0 16px 38px rgba(122, 78, 45, 0.10);

    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 2%, rgba(255, 255, 255, 0.9), transparent 32%),
        radial-gradient(circle at 94% 22%, rgba(178, 134, 99, 0.12), transparent 30%),
        radial-gradient(circle at 2% 82%, rgba(178, 134, 99, 0.10), transparent 28%),
        var(--ab-bg);
}

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

.ab-container {
    width: min(1260px, 100%);
    margin: 0 auto;
    padding: 0 20px;
}

.ab-section {
    position: relative;
    padding: clamp(48px, 6vw, 92px) 0;
}

.ab-stars {
    position: absolute;
    pointer-events: none;
    user-select: none;
    opacity: 0.18;
    width: clamp(180px, 22vw, 340px);
}

.ab-stars--right {
    top: 3%;
    right: -40px;
    transform: rotate(24deg);
}

/* ==========================================================================
   ЗАГОЛОВОК И ТЕКСТ
   ========================================================================== */

.ab-intro {
    padding-top: clamp(36px, 5vw, 70px);
}

.ab-intro__title {
    margin: 0 0 clamp(34px, 4vw, 58px);
    font-family: "Forum", serif;
    font-weight: 600;
    font-size: clamp(2.4rem, 4.6vw, 4.2rem) !important;
    line-height: 1.1;
    text-align: center;
    color: var(--ab-ink);
}

.ab-intro__title::after {
    content: "";
    display: block;
    width: 96px;
    height: 1px;
    margin: 26px auto 0;
    background: var(--ab-accent);
    opacity: 0.55;
}

.ab-intro__inner {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: clamp(30px, 4.5vw, 70px);
    align-items: start;
}

.ab-intro__card {
    position: relative;
    padding: clamp(30px, 3.4vw, 56px);
    border-radius: 36px;
    background: var(--ab-card);
    border: 1px solid rgba(226, 203, 188, 0.8);
    box-shadow: var(--ab-shadow-soft);
}

.ab-intro__quote {
    position: absolute;
    top: 10px;
    right: 32px;
    font-family: "Forum", serif;
    font-size: 8rem;
    line-height: 1;
    color: var(--ab-accent);
    opacity: 0.14;
    pointer-events: none;
}

.ab-intro__text {
    position: relative;
    font-family: "Spectral", serif;
    font-style: italic;
    font-size: clamp(1.05rem, 1.2vw, 1.24rem);
    line-height: 1.75;
    color: var(--ab-ink-soft);
}

.ab-intro__text p {
    font-size: inherit;
    line-height: inherit;
    margin: 0 0 18px;
}

.ab-intro__text p:last-child {
    margin-bottom: 0;
}

.ab-intro__text b,
.ab-intro__text strong {
    color: var(--ab-ink);
}

.ab-intro__actions {
    margin-top: clamp(28px, 3vw, 42px);
    padding-top: clamp(24px, 2.6vw, 34px);
    border-top: 1px solid var(--ab-line);
}

.ab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 62px;
    padding: 16px 38px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--ab-accent);
    color: #fff9f5;
    font-family: "Forum", serif;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 18px 34px rgba(150, 105, 74, 0.24);
    transition: transform .3s ease, box-shadow .3s ease, background-color .3s ease, color .3s ease;
}

.ab-btn:hover,
.ab-btn:focus-visible {
    background: var(--ab-accent-dark);
    color: #fff9f5;
    transform: translateY(-3px);
    box-shadow: 0 24px 42px rgba(150, 105, 74, 0.3);
}

.ab-btn__arrow {
    transition: transform .3s ease;
}

.ab-btn:hover .ab-btn__arrow {
    transform: translateX(5px);
}

/* ==========================================================================
   ПОРТРЕТ
   ========================================================================== */

.ab-intro__visual {
    position: relative;
    perspective: 1200px;
}

.ab-intro__frame {
    position: absolute;
    inset: 24px -24px -24px 24px;
    border: 1px solid var(--ab-accent);
    border-radius: 240px 240px 34px 34px;
    opacity: 0.45;
    pointer-events: none;
    transition: transform .6s cubic-bezier(.22, .61, .36, 1);
}

.ab-photo {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 240px 240px 34px 34px;
    background: var(--ab-card-2);
    box-shadow: var(--ab-shadow);
    aspect-ratio: 4 / 5;
    transform-style: preserve-3d;
    transform: rotateX(var(--ab-rx, 0deg)) rotateY(var(--ab-ry, 0deg));
    transition: transform .6s cubic-bezier(.22, .61, .36, 1), box-shadow .6s ease;
    will-change: transform;
}

.ab-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(.22, .61, .36, 1);
}

.ab-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 46%, rgba(122, 78, 45, 0.16) 100%);
    pointer-events: none;
}

.ab-intro__visual:hover .ab-photo img {
    transform: scale(1.05);
}

.ab-intro__visual:hover .ab-intro__frame {
    transform: translate(-12px, -12px);
}

/* ==========================================================================
   ФОТОГРАФИИ ПОД ПОРТРЕТОМ
   ========================================================================== */

.ab-under {
    column-count: 2;
    column-gap: 20px;
    margin-top: 34px;
}

.ab-under--single {
    column-count: 1;
}

.ab-under__item {
    display: block;
    position: relative;
    overflow: hidden;
    width: 100%;
    margin: 0 0 20px;
    border-radius: 24px;
    background: var(--ab-card-2);
    box-shadow: var(--ab-shadow-soft);
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    transition: transform .5s cubic-bezier(.22, .61, .36, 1), box-shadow .5s ease, opacity .8s cubic-bezier(.22, .61, .36, 1);
}

.ab-under__item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 1s cubic-bezier(.22, .61, .36, 1);
}

/* лёгкий разворот «как разложенные снимки» */
.ab-under__item:nth-child(odd) {
    transform: rotate(-1.2deg);
}

.ab-under__item:nth-child(even) {
    transform: rotate(1.2deg);
}

.ab-under__item:hover {
    transform: rotate(0deg) translateY(-6px);
    box-shadow: 0 28px 54px rgba(122, 78, 45, 0.2);
}

.ab-under__item:hover img {
    transform: scale(1.06);
}

/* ==========================================================================
   ПОЯВЛЕНИЕ ПРИ СКРОЛЛЕ (класс ab-anim ставит скрипт)
   ========================================================================== */

.ab-page.ab-anim .ab-reveal:not(.ab-under__item) {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s cubic-bezier(.22, .61, .36, 1), transform .8s cubic-bezier(.22, .61, .36, 1);
    will-change: opacity, transform;
}

.ab-page.ab-anim .ab-reveal:not(.ab-under__item).is-visible {
    opacity: 1;
    transform: none;
}

/* фото под портретом появляются без сдвига — их разворот задан отдельно */
.ab-page.ab-anim .ab-under__item.ab-reveal {
    opacity: 0;
}

.ab-page.ab-anim .ab-under__item.ab-reveal.is-visible {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .ab-page.ab-anim .ab-reveal,
    .ab-photo,
    .ab-under__item {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ==========================================================================
   АДАПТИВ
   ========================================================================== */

@media (min-width: 992px) {
    /* если под портретом нет фото — он «прилипает» к экрану при длинном тексте */
    .ab-intro__aside--sticky {
        position: sticky;
        top: 110px;
    }
}

@media (max-width: 991.98px) {
    /* порядок на узких экранах: портрет → текст → фотографии */
    .ab-intro__inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .ab-intro__aside {
        display: contents;
    }

    .ab-intro__visual {
        order: 1;
        width: 100%;
        max-width: 460px;
        margin: 0 auto;
    }

    .ab-intro__card {
        order: 2;
    }

    .ab-under {
        order: 3;
        margin-top: 0;
    }

    .ab-intro__frame {
        inset: 18px -18px -18px 18px;
    }
}

@media (max-width: 767.98px) {
    .ab-stars {
        display: none;
    }

    .ab-intro__quote {
        font-size: 5.4rem;
        right: 18px;
    }

    .ab-btn {
        width: 100%;
        min-height: 58px;
        padding: 14px 20px;
        font-size: 1.02rem;
        gap: 8px;
    }
}

@media (max-width: 575.98px) {
    /* на телефоне фото во всю ширину — так их лучше видно */
    .ab-under {
        column-count: 1;
    }
}
