/* About page, part 4: "How Kanidata works" (about.html). One panel in two halves: clients on
   the wider left (the two ways to work), engineers on the right, with Kanidata on the seam
   between them. */
.ab-model {
    padding: 5rem 0 5.5rem;
    background: radial-gradient(70% 60% at 50% 0%, #FFFFFF, #EEF2F9);
}

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

.ab-model__inner {
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.ab-model__head {
    max-width: 44rem;
    margin: 0 auto;
    text-align: center;
}

.ab-model__lede {
    margin: 1.1rem 0 0;
    font-size: 1.075rem;
    line-height: 1.65;
}

/* ---------- The panel ---------- */
.ab-panel {
    position: relative;
    display: grid;
    margin-top: 3rem;
    overflow: hidden;
    border-radius: 1.75rem;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px var(--kd-line), 0 30px 60px -42px rgba(15, 23, 42, 0.5);
}

/* The clients' half takes two thirds: its two ways sit side by side. */
@media (min-width: 900px) {
    .ab-panel {
        --seam: 64%;
        grid-template-columns: var(--seam) 1fr;
        margin-top: 4rem;
    }
}

.ab-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 2.25rem 1.5rem;
}

@media (min-width: 640px) {
    .ab-side {
        padding: 3rem 3rem 2.75rem;
    }
}

/* Each half carries a faint wash of its colour from its outer corner. Stacked on phones,
   each half keeps extra room by the seam for the hub sitting on it. */
.ab-side--clients {
    order: 1;
    padding-bottom: 3.5rem;
    background: linear-gradient(160deg, var(--kd-brand-soft), #FFFFFF 55%);
}

.ab-side--talent {
    order: 3;
    padding-top: 3.5rem;
    border-top: 1px solid var(--kd-line);
    background: linear-gradient(200deg, var(--kd-mint-wash), #FFFFFF 55%);
}

/* Side by side, each half keeps room by the seam for the hub. */
@media (min-width: 900px) {
    .ab-side--clients {
        padding: 3.5rem 3.75rem 3.25rem 3.5rem;
    }

    .ab-side--talent {
        padding: 3.5rem 3.25rem 3.25rem 3.75rem;
        border-top: 0;
        border-left: 1px solid var(--kd-line);
    }
}

.ab-side__label {
    margin: 0;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: #DCE6F7;
    color: var(--kd-brand-deep);
    font-size: 0.8rem;
    font-weight: 700;
}

.ab-side--talent .ab-side__label {
    background: #D1FAE5;
    color: var(--kd-mint-ink);
}

.ab-side__title {
    margin: 1.1rem 0 0;
    color: var(--ab-ink);
    font-size: clamp(1.5rem, 2.2vw, 1.7rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.ab-side__text {
    margin: 1.25rem 0 0;
    font-size: 1rem;
    line-height: 1.7;
}

.ab-side__link {
    margin-top: auto;
    padding-top: 2.5rem;
    color: var(--ab-brand);
    font-weight: 700;
    text-decoration: none;
}

.ab-side__link span {
    display: inline-block;
    transition: transform 0.25s ease;
}

.ab-side__link:hover span {
    transform: translateX(4px);
}

.ab-side__link:focus-visible {
    outline: 2px solid var(--ab-brand);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- The two ways to work ---------- */
.ab-ways {
    align-self: stretch;
    display: grid;
    gap: 1rem;
    margin: 2.25rem 0 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 560px) {
    .ab-ways {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 900px) {
    .ab-ways {
        margin-top: 2.75rem;
    }
}

.ab-ways li {
    display: grid;
    align-content: start;
    gap: 0.4rem;
    padding: 1.5rem 1.4rem 1.6rem;
    border-radius: 1.1rem;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px var(--kd-line);
    transition: transform 0.3s var(--ab-ease), box-shadow 0.3s ease;
}

.ab-ways li:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 0 1px var(--kd-line-strong), 0 16px 30px -22px rgba(15, 23, 42, 0.45);
}

.ab-ways__icon {
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-bottom: 0.6rem;
    border-radius: 0.8rem;
    background: var(--kd-brand-soft);
    color: var(--ab-brand);
}

.ab-ways__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.ab-ways strong {
    color: var(--ab-ink);
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.3;
}

.ab-ways span:not(.ab-ways__icon) {
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ---------- Kanidata on the seam ---------- */
/* Between the halves: in the flow on phones (overlapping the seam), centred on desktop. */
.ab-panel__hub {
    position: relative;
    z-index: 1;
    order: 2;
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    margin: -2.25rem auto;
    border-radius: 50%;
    background: var(--kd-brand);
    /* A white collar parts the seam line around it. */
    box-shadow: 0 0 0 6px #FFFFFF, 0 16px 30px -12px rgba(42, 64, 115, 0.6);
}

@media (min-width: 900px) {
    .ab-panel__hub {
        position: absolute;
        top: 50%;
        left: var(--seam);
        margin: 0;
        transform: translate(-50%, -50%);
    }
}

.ab-panel__hub img {
    width: 2.4rem;
    height: auto;
}

/* ---------- Reveals ---------- */
/* Once the panel is well into view (about.js, data-reveal="late"): the two halves slide in
   and meet at the seam, the logo turns onto it, then the two ways rise in.
   The hidden state below is set without transitions, so hiding is instant and only the
   entrance (the .is-in rules) animates. */
.about.is-js .ab-side {
    opacity: 0;
}

.about.is-js .ab-side--clients {
    translate: -48px 0;
}

.about.is-js .ab-side--talent {
    translate: 48px 0;
}

@media (max-width: 899px) {
    .about.is-js .ab-side--talent,
    .about.is-js .ab-side--clients {
        translate: 0 32px;
    }
}

.about.is-js .ab-panel__hub {
    opacity: 0;
    scale: 0.4;
    rotate: -120deg;
}

.about.is-js .ab-ways li {
    opacity: 0;
    transform: translateY(18px);
}

/* ---------- The entrance ---------- */
.about.is-js .ab-panel.is-in .ab-side {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.8s var(--ab-ease), translate 0.9s var(--ab-ease);
}

.about.is-js .ab-panel.is-in .ab-side--talent {
    transition-delay: 0.08s;
}

.about.is-js .ab-panel.is-in .ab-panel__hub {
    opacity: 1;
    scale: 1;
    rotate: 0deg;
    transition:
        opacity 0.4s ease 0.6s,
        scale 0.7s cubic-bezier(0.34, 1.5, 0.6, 1) 0.6s,
        rotate 0.8s var(--ab-ease) 0.6s;
}

.about.is-js .ab-panel.is-in .ab-ways li {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s var(--ab-ease), transform 0.7s var(--ab-ease), box-shadow 0.3s ease;
    transition-delay: calc(0.75s + var(--i) * 0.2s);
}

.about.is-js .ab-panel.is-in .ab-ways li:hover {
    transform: translateY(-3px);
    transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
    .about.is-js .ab-side,
    .about.is-js .ab-panel__hub,
    .about.is-js .ab-ways li,
    .about.is-js .ab-panel.is-in .ab-side,
    .about.is-js .ab-panel.is-in .ab-panel__hub,
    .about.is-js .ab-panel.is-in .ab-ways li {
        opacity: 1;
        transform: none;
        translate: 0 0;
        scale: 1;
        rotate: 0deg;
        transition: none;
    }
}
