/* About page, part 3: the three values (about.html, "What we stand for"). */
/* ---------- What we stand for ---------- */
/* The heading stays pinned on the left while the three words scroll past on the right.
   about.js adds .is-js to the section and marks the word in the middle of the screen
   .is-active; the others wait faint. Without it (or with reduced motion) all three show. */
.ab-values {
    padding: 5rem 0 5.5rem;
    background: #F9FAFB;
}

@media (min-width: 900px) {
    .ab-values {
        padding: 7rem 0;
    }
}

.ab-values__inner {
    display: grid;
    gap: 2.5rem;
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .ab-values__inner {
        padding: 0 1.5rem;
    }
}

@media (min-width: 900px) {
    .ab-values__inner {
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: 4rem;
    }

    /* Centred on the screen; with the emblem the column is about 28rem tall. */
    .ab-values__pin {
        position: sticky;
        top: max(6rem, calc(50vh - 14rem));
    }
}

/* ---------- The emblem (main/static/js/about-values/) ---------- */
/* Desktop only, beside the words. Until the 3D emblem draws (or without it) the flat logo
   shows in its place, in brand blue. */
.ab-values__stage {
    display: none;
}

@media (min-width: 900px) {
    .ab-values__stage {
        position: relative;
        display: block;
        width: min(100%, 26rem);
        aspect-ratio: 5 / 4;
        margin-top: 1.5rem;
    }

    .ab-values__stage::before {
        content: "";
        position: absolute;
        inset: 22% 26%;
        background: var(--kd-brand);
        -webkit-mask: url("../images/logo/emblem-white.svg") center / contain no-repeat;
        mask: url("../images/logo/emblem-white.svg") center / contain no-repeat;
        transition: opacity 0.5s ease;
    }

    .ab-values__stage canvas {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        opacity: 0;
        transition: opacity 0.8s ease;
    }

    .ab-values__stage.has-3d::before {
        opacity: 0;
    }

    .ab-values__stage.has-3d canvas {
        opacity: 1;
    }

    /* The emblem already shows which value is lit, so the dashes step aside. */
    .ab-values.is-js .ab-values__pin:has(.has-3d) .ab-values__dots {
        display: none;
    }
}

/* Three dashes under the heading: which word is lit. */
.ab-values__dots {
    display: none;
    gap: 0.35rem;
    margin: 1.75rem 0 0;
    padding: 0;
    list-style: none;
}

.ab-values.is-js .ab-values__dots {
    display: flex;
}

.ab-values__dots li {
    width: 1.75rem;
    height: 3px;
    border-radius: 3px;
    background: var(--kd-line-strong);
    transition: background-color 0.4s ease, width 0.4s var(--ab-ease);
}

.ab-values__dots li.is-active {
    width: 2.75rem;
    background: var(--kd-mint);
}

.ab-values__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ab-value {
    padding: 1.5rem 0;
    border-top: 1px solid var(--kd-line);
}

.ab-value:last-child {
    border-bottom: 1px solid var(--kd-line);
}

@media (min-width: 900px) {
    .ab-value {
        padding: 3rem 0;
    }
}

.ab-value__num {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--kd-faint);
    font-size: 0.85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* A short mint line grows in front of the number of the lit word. */
.ab-value__num::before {
    content: "";
    width: 0;
    height: 2px;
    background: var(--kd-mint);
    transition: width 0.5s var(--ab-ease);
}

.ab-value__name {
    margin: 0.6rem 0 0;
    color: var(--ab-ink);
    font-size: clamp(2.6rem, 6vw, 4.5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.045em;
}

.ab-value__text {
    max-width: 28rem;
    margin: 1rem 0 0;
    font-size: 1.075rem;
    line-height: 1.65;
}

/* ---------- Scroll states (with JavaScript) ---------- */
.ab-values.is-js .ab-value__name {
    color: var(--kd-line-strong);
    transition: color 0.5s ease;
}

.ab-values.is-js .ab-value__text {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease, transform 0.6s var(--ab-ease);
}

.ab-values.is-js .ab-value.is-active .ab-value__name {
    color: var(--ab-ink);
}

.ab-values.is-js .ab-value.is-active .ab-value__text {
    opacity: 1;
    transform: none;
}

.ab-values.is-js .ab-value.is-active .ab-value__num {
    color: var(--kd-mint-ink);
}

.ab-values.is-js .ab-value.is-active .ab-value__num::before {
    width: 1.75rem;
}
