/* ==========================================================================
   Homepage — A Word From Our Partners (assets/js/home/partners.js).
   A row of testimonial excerpts that scrolls sideways (swipe, trackpad or
   the arrows). Each card's full review opens in a reading window;
   without JavaScript it opens inline (native <details>).
   Continues the dark chapter of Our Work above it.
   ========================================================================== */

.pt {
    --pt-ink: #f6f4fb;
    --pt-muted: rgba(226, 224, 236, 0.66);
    --pt-gutter: clamp(1.25rem, 4.2vw, 3.5rem);
    --pt-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow-x: clip;
    padding: clamp(1rem, 3vw, 2rem) 0 clamp(5.5rem, 11vw, 9rem);
    color: var(--pt-ink);
    background:
        radial-gradient(56rem 30rem at 12% 40%, rgba(124, 58, 237, 0.1), transparent 65%),
        #050817;
    font-family: "Manrope", sans-serif;
}

.pt-shell {
    max-width: 82rem;
    margin: 0 auto;
    padding: 0 var(--pt-gutter);
}

/* ---------- Heading and controls ---------- */

.pt-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    margin-bottom: clamp(2rem, 4.5vw, 3.25rem);
}

.pt-label {
    margin-bottom: 1.2rem;
}

.pt-title {
    margin: 0;
    font-size: clamp(2.2rem, 4.6vw, 4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
}

.pt-nav {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pt-nav[hidden] {
    display: none;
}

.pt-count {
    margin-right: 0.5rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
}

.pt-btn {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    background: transparent;
    color: var(--pt-ink);
    cursor: pointer;
    transition: border-color 0.4s var(--pt-ease), background-color 0.4s var(--pt-ease), scale 0.4s var(--pt-ease), opacity 0.3s ease;
}

.pt-btn svg {
    width: 1rem;
    height: 1rem;
}

.pt-btn:hover:not(:disabled) {
    border-color: rgba(124, 58, 237, 0.85);
    background: rgba(124, 58, 237, 0.22);
    scale: 1.05;
}

.pt-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.pt-btn:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 3px;
}

/* ---------- The row of cards ---------- */

.pt-track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: min(31rem, 84%);
    gap: clamp(1rem, 2vw, 1.5rem);
    margin: 0 calc(-1 * var(--pt-gutter));
    padding: 0.5rem var(--pt-gutter) 1.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--pt-gutter);
    scrollbar-width: none;
    list-style: none;
}

.pt-track::-webkit-scrollbar {
    display: none;
}

.pt-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(1.5rem, 2.6vw, 2.1rem);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.5rem;
    background:
        radial-gradient(120% 70% at 0% 0%, rgba(var(--pt-a), 0.1), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    scroll-snap-align: start;
    transition: border-color 0.5s var(--pt-ease), box-shadow 0.5s var(--pt-ease);
}

/* A large opening quote mark in the partner's colour. */
.pt-card::before {
    content: "“";
    display: block;
    height: 2.4rem;
    margin-bottom: 0.4rem;
    font-size: 4.4rem;
    font-weight: 800;
    line-height: 1;
    color: rgb(var(--pt-a));
    opacity: 0.9;
}

@media (hover: hover) and (pointer: fine) {
    .pt-card:hover {
        border-color: rgba(var(--pt-a), 0.4);
        box-shadow: 0 30px 60px -40px rgba(var(--pt-a), 0.55);
    }
}

.pt-figure {
    display: flex;
    flex: 1;
    flex-direction: column;
    margin: 0;
}

.pt-excerpt {
    flex: 1;
    margin: 0;
}

.pt-excerpt p {
    margin: 0;
    font-size: clamp(1.08rem, 1.45vw, 1.3rem);
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.01em;
    color: var(--pt-ink);
}

.pt-by {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: clamp(1.5rem, 3vw, 2.1rem);
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pt-logo {
    flex: none;
    width: auto;
    height: 1.9rem;
    max-width: 6.5rem;
    object-fit: contain;
    opacity: 0.9;
}

.pt-avatar {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(var(--pt-a), 0.85), rgba(var(--pt-a), 0.35));
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
}

.pt-who {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.pt-name {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.pt-role {
    font-size: 0.86rem;
    color: var(--pt-muted);
}

/* ---------- "Read the full review" ---------- */

.pt-full {
    margin-top: 1.4rem;
}

.pt-read {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 2.75rem;
    padding: 0;
    border: 0;
    background: none;
    list-style: none;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--pt-ink);
    cursor: pointer;
    transform-origin: left center;
    transition: scale 0.45s var(--pt-ease);
}

.pt-read::-webkit-details-marker {
    display: none;
}

.pt-read-arrow {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.375rem;
    transition: border-color 0.45s var(--pt-ease), background-color 0.45s var(--pt-ease), color 0.45s var(--pt-ease);
}

.pt-read-arrow svg {
    width: 0.95rem;
    height: 0.95rem;
}

@media (hover: hover) and (pointer: fine) {
    .pt-read:hover {
        scale: 1.04;
    }

    .pt-read:hover .pt-read-arrow,
    .pt-card.is-openable:hover .pt-read-arrow {
        border-color: transparent;
        background: rgb(var(--pt-a));
        color: #fff;
    }
}

/* The whole card opens the full review. */
.pt-card.is-openable {
    cursor: pointer;
}

.pt-read:focus-visible {
    outline: 2px solid #7dd3fc;
    outline-offset: 4px;
    border-radius: 0.25rem;
}

/* Inline reading (no JavaScript only). */
.pt-full-body {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.pt-full-body p {
    margin: 0 0 0.9rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: rgba(230, 231, 242, 0.84);
}

/* ---------- Progress along the row ---------- */

.pt-progress {
    position: relative;
    height: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
}

.pt-progress span {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #7c3aed, #0ea5e9 55%, #f472b6);
    transform: scaleX(var(--pt-progress, 0.2));
    transform-origin: left;
    transition: transform 0.35s var(--pt-ease);
}

/* ==========================================================================
   The full review (a reading window): a light panel, so it stands out from
   the dark page behind it.
   ========================================================================== */

.pt-dialog {
    --pt-paper: #fbf9fc;
    --pt-text: #0c0b1d;
    width: min(46rem, calc(100% - 2rem));
    max-width: none;
    max-height: min(86vh, 56rem);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 0.6rem;
    overflow: clip;
    color: var(--pt-text);
    background:
        radial-gradient(36rem 18rem at 100% 0%, rgba(var(--pt-a, 124, 58, 237), 0.14), transparent 65%),
        var(--pt-paper);
    box-shadow:
        0 0 0 1px rgba(var(--pt-a, 124, 58, 237), 0.35),
        0 50px 120px -30px rgba(0, 0, 0, 0.7),
        0 0 90px -20px rgba(var(--pt-a, 124, 58, 237), 0.35);
    font-family: "Manrope", sans-serif;
    opacity: 0;
    transform: translate3d(0, 14px, 0) scale(0.98);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.pt-dialog.is-open {
    opacity: 1;
    transform: none;
}

.pt-dialog::backdrop {
    background: rgba(2, 6, 23, 0.74);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pt-dialog.is-open::backdrop {
    opacity: 1;
}

.pt-dialog-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: inherit;
}

/* The partner's colour runs along the top edge. */
.pt-dialog-inner::before {
    content: "";
    height: 4px;
    flex: none;
    background: linear-gradient(90deg, rgb(var(--pt-a, 124, 58, 237)), rgba(var(--pt-a, 124, 58, 237), 0.35));
}

.pt-dialog-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: clamp(1.15rem, 3vw, 1.6rem) clamp(1.25rem, 3.5vw, 2.25rem);
}

/* The partner logos are white; here they print dark on the light paper. */
.pt-dialog-head .pt-logo {
    height: 2.1rem;
    max-width: 7rem;
    filter: brightness(0);
    opacity: 0.85;
}

/* The SAFE badge is a white field with black type, so brightness(0) would
   flatten the whole thing to a black blob. Inverting it instead gives a
   black badge with white lettering, which is what this light dialog wants. */
.pt-dialog-head .pt-logo--badge {
    filter: invert(1);
    opacity: 0.9;
}

.pt-dialog-who {
    flex: 1;
    min-width: 0;
}

.pt-dialog-kicker {
    margin: 0 0 0.3rem;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6d28d9;
}

.pt-dialog-title {
    margin: 0;
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--pt-text);
    outline: none;
}

.pt-dialog-role {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    color: #5d5b70;
}

.pt-dialog-close {
    display: inline-grid;
    flex: none;
    place-items: center;
    align-self: flex-start;
    width: 2.6rem;
    height: 2.6rem;
    padding: 0;
    border: 1px solid rgba(12, 11, 29, 0.16);
    border-radius: 0.375rem;
    background: rgba(12, 11, 29, 0.03);
    color: var(--pt-text);
    cursor: pointer;
    transition: border-color 0.35s ease, background-color 0.35s ease, scale 0.35s ease;
}

.pt-dialog-close svg {
    width: 1rem;
    height: 1rem;
}

.pt-dialog-close:hover {
    border-color: rgba(124, 58, 237, 0.6);
    background: rgba(124, 58, 237, 0.1);
    scale: 1.05;
}

.pt-dialog-close:focus-visible,
.pt-dialog-more-btn:focus-visible,
.pt-dialog-body:focus-visible {
    outline: 2px solid #6d28d9;
    outline-offset: 3px;
}

/* How far through the review the reader is. */
.pt-dialog-progress {
    position: relative;
    flex: none;
    height: 2px;
    margin: 0 clamp(1.25rem, 3.5vw, 2.25rem);
    background: rgba(12, 11, 29, 0.1);
}

.pt-dialog-progress span {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #7c3aed, #0ea5e9 55%, #f472b6);
    transform: scaleX(0);
    transform-origin: left;
}

.pt-dialog-body {
    padding: clamp(1.25rem, 3.5vw, 2rem) clamp(1.25rem, 3.5vw, 2.25rem) clamp(1.5rem, 4vw, 2.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.pt-dialog.has-more .pt-dialog-body {
    /* Room for the "Scroll to read more" cue at the very end. */
    padding-bottom: 4.5rem;
}

.pt-dialog-body p {
    margin: 0 0 1.1rem;
    font-size: clamp(1rem, 1.25vw, 1.08rem);
    line-height: 1.75;
    color: #3d3b52;
}

.pt-dialog-body p:first-child {
    font-size: clamp(1.15rem, 1.6vw, 1.3rem);
    font-weight: 700;
    line-height: 1.55;
    color: var(--pt-text);
}

.pt-dialog-body p:last-child {
    margin-bottom: 0;
}

/* "Scroll to read more": a fade over the last lines and a gentle nudge,
   shown until the reader reaches the end. */
.pt-dialog-more {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 7rem;
    padding-bottom: 1.1rem;
    background: linear-gradient(180deg, rgba(251, 249, 252, 0) 0%, rgba(251, 249, 252, 0.92) 55%, var(--pt-paper) 85%);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.pt-dialog.has-more:not(.is-end) .pt-dialog-more {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.35s ease;
}

.pt-dialog-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    height: 2.5rem;
    padding: 0 0.85rem 0 1.1rem;
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 0.375rem;
    background: #fff;
    box-shadow: 0 10px 24px -14px rgba(12, 11, 29, 0.45);
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #4c1d95;
    cursor: pointer;
    pointer-events: auto;
    transition: scale 0.35s ease, border-color 0.35s ease;
}

.pt-dialog-more-btn svg {
    width: 0.95rem;
    height: 0.95rem;
}

.pt-dialog-more-btn:hover {
    scale: 1.04;
    border-color: rgba(124, 58, 237, 0.6);
}

@media (prefers-reduced-motion: no-preference) {
    .pt-dialog.has-more:not(.is-end) .pt-dialog-more-btn svg {
        animation: pt-nudge 1.6s ease-in-out infinite;
    }
}

@keyframes pt-nudge {
    0%, 100% { transform: translateY(-1px); }
    50% { transform: translateY(3px); }
}

.pt-locked {
    overflow: hidden;
    scrollbar-gutter: stable;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .pt-card,
    .pt-btn,
    .pt-read,
    .pt-read-arrow,
    .pt-progress span,
    .pt-dialog,
    .pt-dialog::backdrop,
    .pt-dialog-more,
    .pt-dialog-more-btn {
        transition: none !important;
    }

    .pt-dialog {
        transform: none;
    }
}
