/* Company page — CompanyPage / О компании */

.company {
    position: relative;
    z-index: 1;
    background: transparent;
    color: var(--color-heading);
}

/* ===== Hero ===== */
.company-hero {
    position: relative;
    overflow: hidden;
    padding: 36px 0 48px;
    background: var(--color-white);
}

.company-hero__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
}

.company-hero__head {
    width: 100%;
}

.company-hero__title {
    color: var(--color-heading);
}

.company-hero__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
}

.company-hero__lead {
    margin: 0;
    max-width: 575px;
    font-size: var(--text-md);
    line-height: 1.3;
    font-weight: 400;
    color: var(--color-section-desc);
}

.company-hero__cta {
    text-decoration: none;
}

/* ===== Ticker ===== */
.company-ticker-wrap {
    background: var(--color-white);
}

.company-ticker.trust-marquee {
    width: 100%;
    max-width: none;
    height: 48px;
}

.company-ticker__track {
    gap: 0;
}

.company-ticker__group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 40px;
    padding-right: 40px;
}

.company-ticker__item {
    flex-shrink: 0;
    font-size: var(--text-md);
    line-height: 1.2;
    font-weight: 500;
    color: var(--color-section-desc);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .company-ticker__track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        gap: 16px 24px;
    }

    .company-ticker__group {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px 24px;
        padding-right: 0;
    }

    .company-ticker__group[aria-hidden="true"] {
        display: none;
    }
}

/* ===== Principles (dark window) ===== */
.company-principles .section__title {
    margin-bottom: 48px;
}

/* Номер вне потока — заголовок встаёт с ним в одну линию при подъёме */
.company-principles .industry-tile {
    position: relative;
    gap: 0;
}

.company-principles .industry-tile__num {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
    align-self: auto;
}

.company-principles .industry-tile__body {
    padding-right: 2.5em;
}

/* Распорка по-прежнему сжимается через flex-grow — анимация сохраняется */
.company-principles .industry-tile:hover .industry-tile__intro,
.company-principles .industry-tile:focus-visible .industry-tile__intro {
    max-height: 20em;
    -webkit-line-clamp: 16;
}

@media (min-width: 768px) {
    .company-principles .industry-tile__num {
        top: 18px;
        right: 18px;
    }
}

@media (hover: none) {
    .company-principles .industry-tile::before {
        flex-grow: 0;
    }

    .company-principles .industry-tile__intro {
        max-height: 20em;
        -webkit-line-clamp: 16;
    }
}

/* ===== Advantages ===== */
.company-advantages {
    background: var(--color-white);
}

.company-advantages .section__title {
    margin-bottom: 32px;
}

.company-advantages__grid {
    grid-template-columns: 1fr;
}

.company-advantages .about-card {
    justify-content: flex-start;
}

.company-advantages .about-card:focus,
.company-advantages .about-card:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: 2px;
    background: linear-gradient(339.06deg, var(--color-green-soft) 4.43%, var(--color-white) 50.07%);
    filter: none;
}

/* ===== Team accordion (как отрасли на главной) ===== */
.company-people {
    background: var(--color-white);
}

.company-people__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.company-people__intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.company-people__header .section__title {
    margin-bottom: 0;
}

.company-people__lead {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.5;
    color: var(--color-section-desc);
}

.company-people__cta {
    text-decoration: none;
    flex-shrink: 0;
}

.company-roles .industries-row {
    cursor: default;
}

.company-roles .industries-row__num {
    width: 48px;
}

.company-roles .industries-row__action {
    flex: 0 0 40px;
    width: 40px;
}

.company-roles .industries-row.is-active .industries-row__chevron {
    opacity: 1;
}

.company-roles .industries-row__chevron::after {
    transition: transform 0.35s ease;
}

.company-roles .industries-row.is-active .industries-row__chevron::after {
    transform: rotate(45deg);
}

.company-roles .industries-row:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: -2px;
}

@media (max-width: 767px) {
    .company-roles .industries-row__num {
        width: 40px;
    }
}

/* ===== Technologies preview ===== */
.company-tech {
    background: var(--color-white);
}

.company-tech__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 32px;
}

.company-tech__header .section__title {
    margin-bottom: 0;
}

.company-tech__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.company-tech__card {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    min-height: 220px;
    padding: 24px;
    background: var(--color-bg-card);
    border-radius: 0;
    text-decoration: none;
    color: inherit;
}

.company-tech__card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background: linear-gradient(339.06deg, var(--color-green-soft) 4.43%, var(--color-white) 50.07%);
    opacity: 0;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.company-tech__card.is-featured::before,
.company-tech__card:hover::before,
.company-tech__card:focus-visible::before {
    opacity: 1;
}

.company-tech__title {
    margin: 0;
    font-size: var(--text-lg);
    line-height: 1.15;
    font-weight: 500;
    color: var(--color-heading);
    transition: font-size 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.company-tech__card.is-featured .company-tech__title,
.company-tech__card:hover .company-tech__title,
.company-tech__card:focus-visible .company-tech__title {
    font-size: var(--text-xl);
}

.company-tech__text {
    margin: 0;
    font-size: var(--text-sm);
    line-height: 1.4;
    color: var(--color-section-desc);
}

@media (prefers-reduced-motion: reduce) {
    .company-tech__card::before,
    .company-tech__title {
        transition: none;
    }
}

/* ===== Certificates (dark window) ===== */
.company-certs {
    position: relative;
    background: transparent;
}

.company-certs .section__title {
    margin-bottom: 16px;
}

.company-certs__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 40px;
}

.company-certs__intro {
    min-width: 0;
}

.company-certs__lead {
    margin: 16px 0 0;
    max-width: 720px;
    font-size: var(--text-md);
    line-height: 1.4;
    color: var(--color-text-on-dark);
}

.company-certs__controls {
    display: none;
    align-items: center;
    gap: 16px;
}

.company-certs__controls .carousel-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.company-certs__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.company-certs__viewport {
    position: relative;
}

.company-certs__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.company-certs__track::-webkit-scrollbar {
    display: none;
}

.company-certs__track .company-cert {
    flex: 0 0 min(220px, 70vw);
    width: min(220px, 70vw);
    scroll-snap-align: start;
}

.company-cert {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    aspect-ratio: 1;
    min-height: 0;
    padding: 16px;
    overflow: hidden;
    background: color-mix(in srgb, var(--color-white) 15%, transparent);
    backdrop-filter: blur(12px);
    color: var(--color-white);
    cursor: pointer;
    transition:
        background-color 0.35s ease,
        color 0.35s ease,
        box-shadow 0.35s ease,
        backdrop-filter 0.35s ease;
}

.company-cert__num {
    font-size: var(--text-sm);
    line-height: 1;
    font-weight: 500;
}

.company-cert__title {
    margin: 0;
    font-size: var(--text-md);
    line-height: 1.2;
    font-weight: 500;
}

.company-cert.is-featured,
.company-cert:hover,
.company-cert:focus-visible {
    background: var(--color-green);
    color: var(--color-white);
    backdrop-filter: blur(0);
    box-shadow: 0 0 36px color-mix(in srgb, var(--color-green) 55%, transparent);
}

.company-cert:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 4px;
}

.company-cert[data-cert-src] {
    cursor: zoom-in;
}

.cert-modal {
    inset: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: auto;
}

.cert-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 24px 24px;
}

.cert-modal::backdrop {
    background: color-mix(in srgb, var(--color-black) 78%, transparent);
}

.cert-modal__frame {
    position: relative;
    max-width: min(1100px, calc(100vw - 48px));
}

.cert-modal__bar {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
}

.cert-modal__close {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: color-mix(in srgb, var(--color-black) 55%, transparent);
    color: var(--color-white);
    cursor: pointer;
}

.cert-modal__close::before,
.cert-modal__close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: currentColor;
}

.cert-modal__close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cert-modal__close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.cert-modal__close:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 4px;
}

.cert-modal__image {
    display: block;
    max-width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 96px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: var(--color-white);
}

.cert-modal__image:not([src]) {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .company-cert {
        transition: none;
    }
}

@media (max-width: 767px) {
    .company-certs__track {
        gap: 0;
    }

    .company-certs__track .company-cert {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        scroll-snap-stop: always;
    }
}

/* ===== Thanks letters — квадратные плитки ===== */
.company-thanks {
    background: var(--color-white);
}

.company-thanks .section__title {
    margin-bottom: 0;
    color: var(--color-heading);
}

.company-thanks__header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 32px;
}

.company-thanks__controls {
    display: none;
    align-items: center;
    gap: 16px;
}

.company-thanks__controls .carousel-btn:disabled {
    opacity: 0.35;
    pointer-events: none;
}

.company-thanks__viewport {
    position: relative;
}

.company-thanks__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.company-thanks__track::-webkit-scrollbar {
    display: none;
}

.thanks-card {
    /* ширина — как у .company-certs__track .company-cert */
    flex: 0 0 min(220px, 70vw);
    width: min(220px, 70vw);
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-white);
    scroll-snap-align: start;
    text-decoration: none;
    transition:
        background-color 0.3s ease,
        border-color 0.3s ease;
}

.thanks-card__num {
    font-size: var(--text-sm);
    line-height: 1.2;
    color: var(--color-gray-mid);
    transition: color 0.3s ease;
}

.thanks-card__meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.thanks-card__name {
    font-size: var(--text-lg);
    line-height: 1.15;
    font-weight: 500;
    color: var(--color-heading);
    hyphens: auto;
    overflow-wrap: anywhere;
    transition: color 0.3s ease;
}

.thanks-card__action {
    font-size: var(--text-sm);
    line-height: 1.2;
    color: var(--color-green);
    transition: color 0.3s ease;
}

.thanks-card:hover,
.thanks-card:focus-visible {
    background: var(--color-green);
    border-color: var(--color-green);
}

.thanks-card:hover .thanks-card__num,
.thanks-card:hover .thanks-card__name,
.thanks-card:hover .thanks-card__action,
.thanks-card:focus-visible .thanks-card__num,
.thanks-card:focus-visible .thanks-card__name,
.thanks-card:focus-visible .thanks-card__action {
    color: var(--color-white);
}

.thanks-card:focus-visible {
    outline: 2px solid var(--color-heading);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .company-thanks__track {
        scroll-behavior: auto;
    }

    .thanks-card,
    .thanks-card__num,
    .thanks-card__name,
    .thanks-card__action {
        transition: none;
    }
}

@media (max-width: 767px) {
    .thanks-card {
        padding: 16px;
    }

    .thanks-card__name {
        font-size: var(--text-md);
    }
}

/* ===== Results ===== */
.company-results {
    background: var(--color-white);
}

.company-results .section__title {
    margin-bottom: 40px;
}

.company-results__cols {
    display: grid;
    gap: 24px;
    margin: 0 0 24px;
}

.company-results__col,
.company-results__col p {
    font-size: var(--text-md);
    line-height: 1.45;
    font-weight: 400;
    color: var(--color-text-secondary);
}

.company-results__col p {
    margin: 0;
}

.company-results__col p + p {
    margin-top: 1em;
}

.company-results__body {
    position: relative;
    overflow: hidden;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.company-results__body.is-clamped {
    max-height: calc(1.6em * 4);
}

.company-results__body::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.2em;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        var(--color-white)
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.company-results__body.is-clamped::after {
    opacity: 1;
}

.company-results__more {
    display: inline-block;
    margin: 14px 0 0;
    padding: 0;
    border: none;
    border-bottom: 1px solid currentColor;
    background: none;
    font: inherit;
    font-size: var(--text-md);
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-green);
    cursor: pointer;
}

.company-results__more:hover {
    color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
    .company-results__body,
    .company-results__body::after {
        transition: none;
    }
}

.company-results__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 24px 0;
    text-align: center;
}

.company-results__image {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.company-results__image:focus-visible {
    outline: 2px solid var(--color-green);
    outline-offset: 4px;
}

.company-results__image img,
.company-results__figure .company-results__image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 280px;
    height: auto;
    margin-inline: auto;
    object-fit: contain;
}

/* ===== Tablet ===== */
@media (min-width: 768px) {
    .company-hero {
        padding: 36px 0 56px;
    }

    .company-hero__inner {
        min-height: 400px;
    }

    .company-hero__title {
        max-width: 790px;
    }

    .company-results__image img,
    .company-results__figure .company-results__image img {
        max-height: 420px;
    }

    .company-advantages__grid,
    .company-tech__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .company-thanks__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 32px;
    }

    .company-thanks__controls {
        display: flex;
    }

    .company-thanks__track {
        gap: 12px;
    }

    /* три плитки в ряд — столько же, сколько сертификатов */
    .thanks-card {
        flex: 0 0 calc((100% - 24px) / 3);
        width: calc((100% - 24px) / 3);
    }

    .company-certs__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px;
    }

    .company-certs__header {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 32px;
    }

    .company-certs__controls {
        display: flex;
    }

    .company-certs__track {
        gap: 12px;
    }

    .company-certs__track .company-cert {
        flex: 0 0 calc((100% - 24px) / 3);
        width: calc((100% - 24px) / 3);
    }

    .company-cert {
        padding: 18px;
    }

    .company-people__header,
    .company-tech__header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 32px;
    }

}

/* ===== Desktop ===== */
@media (min-width: 1280px) {
    .company-hero {
        display: flex;
        flex-direction: column;
        min-height: 570px;
        padding: 36px 0 64px;
    }

    .company-hero__inner {
        flex: 1 1 auto;
        min-height: 454px;
    }

    .company-results__cols {
        grid-template-columns: 1fr 1fr;
        gap: 65px;
        align-items: start;
    }

    .company-advantages__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .company-tech__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .company-certs__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 12px;
    }

    .company-certs__track {
        gap: 12px;
    }

    .company-certs__track .company-cert {
        flex: 0 0 calc((100% - 60px) / 6);
        width: calc((100% - 60px) / 6);
    }

    /* шесть плиток в ряд — ровно колонка сертификатов над этим блоком */
    .thanks-card {
        flex: 0 0 calc((100% - 60px) / 6);
        width: calc((100% - 60px) / 6);
    }

    .company-cert__num {
        font-size: var(--text-md);
    }
}
