/* ===================================
   04 // CLIENTS — section styles
   =================================== */

.section-clients {
    padding-top: var(--spacing-4xl);
    padding-bottom: 0;
    position: relative;
}

.clients-intro {
    text-align: center;
    font-size: var(--font-size-2xl);
    font-weight: 400;
    line-height: 1.2;
    letter-spacing: -0.5px;
    max-width: 1040px;
    margin: calc(var(--spacing-3xl) * -0.5) auto var(--spacing-3xl);
}

/* ===================================
   Logo Kit
   Shared styles used by both featured rows and the cascade.
   Each `.lk-sN` is a distinct visual treatment so the placeholder
   wordmarks read as distinct "brands". Replace with real logos later.
   =================================== */

.lk {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono);
    color: var(--color-text);
    line-height: 1;
    white-space: nowrap;
}

.lk-word { font-weight: 700; }
.lk-s0  { font-weight: 800; text-transform: uppercase; letter-spacing: 2.5px; }
.lk-s1  { font-weight: 300; text-transform: uppercase; letter-spacing: 4px; }
.lk-s2  { font-weight: 800; letter-spacing: -1.5px; }
.lk-s3  { font-style: italic; font-weight: 500; letter-spacing: -0.5px; text-transform: lowercase; }
.lk-s4  { font-weight: 600; letter-spacing: 0.4px; }
.lk-s4::before { content: '['; opacity: 0.45; margin-right: 4px; font-weight: 400; }
.lk-s4::after  { content: ']'; opacity: 0.45; margin-left: 4px;  font-weight: 400; }
.lk-s5  { font-weight: 700; letter-spacing: 0.3px; }
.lk-s5::before { content: '· '; opacity: 0.55; font-weight: 800; }
.lk-s6  { font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.lk-s6::after  { content: ' /'; opacity: 0.45; font-weight: 300; letter-spacing: 0; }
.lk-s7  { font-weight: 700; letter-spacing: 0.3px; }
.lk-s7::after  { content: ' & co.'; opacity: 0.45; font-weight: 400; font-size: 0.7em; margin-left: 4px; }

/* SickKids — Helvetica lockup: bold wordmark over a matched-width subline */
.lk-sickkids {
    flex-direction: column;
    align-items: flex-start;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 700;
}
.lk-sickkids-name {
    font-size: 1.5em;
    line-height: 1;
    letter-spacing: -0.02em;
}
.lk-sickkids-sub {
    font-size: 0.658em;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

/* Monograms: square / circle, filled / outlined */
.lk-mono {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1;
    padding: 0 0.45em;
    min-width: 1.95em;
    min-height: 1.95em;
    letter-spacing: 0.2px;
}
.lk-s8  { border-radius: 50%; background: var(--color-text); color: var(--color-bg); }
.lk-s9  { border-radius: 50%; border: 1.4px solid var(--color-text); color: var(--color-text); }
.lk-s10 { border-radius: 3px; background: var(--color-text); color: var(--color-bg); }
.lk-s11 { border-radius: 3px; border: 1.4px solid var(--color-text); color: var(--color-text); }

/* Shape + wordmark combo */
.lk-combo { gap: 0.45em; font-weight: 700; letter-spacing: 0.3px; }
.lk-combo .lk-shape {
    display: inline-block;
    width: 0; height: 0;
    border-left: 0.5em solid transparent;
    border-right: 0.5em solid transparent;
    border-bottom: 0.85em solid var(--color-text);
}

/* ===================================
   Featured rows — alternating left / right
   =================================== */

.clients-featured {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.client-row {
    min-height: 240px;
    padding: var(--spacing-2xl) 0;
    display: flex;
    align-items: center;
}
.client-row + .client-row {
    border-top: 1px solid rgba(212, 207, 196, 0.55);
}

.client-row-inner {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-2xl);
    align-items: center;
    width: 100%;
}
.client-row[data-side="right"] .client-row-inner {
    grid-template-columns: 1fr 280px;
}
.client-row[data-side="right"] .client-logo-cell { order: 2; }
.client-row[data-side="right"] .client-desc-cell { order: 1; }

.client-logo-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}
.client-logo-cell .lk {
    font-size: 32px;
}
.client-row[data-side="right"] .client-logo-cell {
    justify-content: center;
}

.client-desc-cell {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 640px;
}
.client-row[data-side="right"] .client-desc-cell {
    justify-self: end;
    text-align: right;
    align-items: flex-end;
}

.client-kicker {
    font-size: 11px;
    letter-spacing: 1.6px;
    font-weight: 700;
    opacity: 0.55;
}
.client-name-big {
    font-size: var(--font-size-xl);
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.3;
}
.client-desc-text {
    font-size: var(--font-size-base);
    line-height: 1.7;
    opacity: 0.85;
}

/* ===================================
   Pinned cascade
   .clients-scrolly is a tall scroll-track containing a sticky stage.
   Scroll progress through the track drives logo reveal.
   =================================== */

/* Total track height. Cascade fill + overlay rise occupy roughly the
   first 65% of progress; the remaining 35% is a HOLD ZONE where the
   stage stays pinned with "200+" fully visible — this is what creates
   the natural "pause to read" beat before the section releases. */
.clients-scrolly {
    position: relative;
    height: 560vh;
    margin-top: var(--spacing-2xl);
}

.clients-stage {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
}

.clients-stage::before {
    /* Top fade so cascade dissolves into the featured-rows space above */
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 80px;
    background: linear-gradient(to bottom, var(--color-bg), rgba(245, 241, 232, 0));
    z-index: 3;
    pointer-events: none;
}

.clients-canvas {
    position: relative;
    width: 100%;
    max-width: 1320px;
    height: 84vh;
    margin: 0 auto;
}

.cascade-logo {
    position: absolute;
    opacity: 0;
    transform: translate(-50%, calc(-50% + 32px));
    transition:
        opacity 0.55s ease,
        transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
    pointer-events: none;
    will-change: opacity, transform;
}
.cascade-logo.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* Dim the cascade once the overlay text takes over */
.clients-canvas {
    transition: opacity 0.5s ease, filter 0.5s ease;
}
.clients-stage.is-dimmed .clients-canvas {
    opacity: 0.55;
}

/* ===================================
   Overlay: "200+ clients" headline
   Fades in over the densely-packed logos.
   =================================== */

.clients-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: var(--overlay-opacity, 0);
    z-index: 2;
}

.clients-overlay-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse 60% 50% at center,
        rgba(245, 241, 232, 0.92) 0%,
        rgba(245, 241, 232, 0.75) 35%,
        rgba(245, 241, 232, 0) 70%
    );
}

.clients-overlay-inner {
    position: relative;
    text-align: center;
    padding: var(--spacing-2xl);
    transform: translateY(calc((1 - var(--overlay-opacity, 0)) * 24px));
    transition: transform 0.05s linear;
}

/* Sentence-style overlay: "I've worked with / 200+ / clients" — the
   top and bottom lines share .clients-overlay-line, with the giant
   number sandwiched between them. */
.clients-overlay-line {
    display: block;
    font-size: clamp(22px, 3.4vw, 40px);
    font-weight: 500;
    letter-spacing: -0.4px;
    opacity: 0.88;
    line-height: 1.15;
}
.clients-overlay-line-top    { margin-bottom: clamp(8px, 1.2vh, 18px); }
.clients-overlay-line-bottom { margin-top:    clamp(8px, 1.2vh, 18px); }

.clients-overlay-num {
    display: block;
    font-family: 'Azeret Mono', var(--font-mono);
    font-size: clamp(120px, 22vw, 280px);
    font-weight: 600;
    letter-spacing: -10px;
    line-height: 0.9;
    font-variant-numeric: tabular-nums;
}
.clients-overlay-num .plus {
    color: var(--color-text);
    margin-left: 6px;
    letter-spacing: -4px;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 1024px) {
    .clients-canvas { height: 78vh; }
    .client-row-inner { grid-template-columns: 220px 1fr; gap: var(--spacing-xl); }
    .client-row[data-side="right"] .client-row-inner { grid-template-columns: 1fr 220px; }
    .client-logo-cell .lk { font-size: 26px; }
}

@media (max-width: 768px) {
    .section-clients { padding-top: var(--spacing-3xl); }
    .clients-featured { padding: 0 var(--spacing-md); }

    .client-row { min-height: 180px; padding: var(--spacing-xl) 0; }
    .client-row-inner,
    .client-row[data-side="right"] .client-row-inner {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    .client-row[data-side="right"] .client-logo-cell { order: 0; justify-content: flex-start; }
    .client-row[data-side="right"] .client-desc-cell { order: 0; text-align: left; align-items: flex-start; justify-self: stretch; }
    .client-logo-cell { justify-content: flex-start; }
    .client-logo-cell .lk { font-size: 24px; }
    .client-name-big { font-size: var(--font-size-xl); }

    /* Short track: touch scrolling makes long pins feel stuck, so the
       stage only holds for about one screen-height on mobile */
    .clients-scrolly { height: 180vh; }
    .clients-stage { top: var(--nav-height); height: calc(100vh - var(--nav-height)); }
    .clients-canvas { height: 70vh; }

    .clients-overlay-num { letter-spacing: -4px; }
    .clients-overlay-num .plus { letter-spacing: -2px; }
    .clients-overlay-line { padding: 0 var(--spacing-md); }
}

@media (prefers-reduced-motion: reduce) {
    .cascade-logo { transition: none !important; }
}
