/* ==========================================================================
   Case study components (cs-*).
   Every rule here is opt-in: it only applies to markup that uses a cs- class,
   either in a case study's Raw Html block or on the Case Studies list page.
   Colors and type come from the hp-* variables in home.css.
   ========================================================================== */

html:has(.cs-page) {
    overflow-x: clip;
}

/* The Raw Html block sits inside .container, so the page breaks back out to full width. */
.cs-fullbleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
}

.cs-wrap {
    width: calc(100vw - 40px);
    max-width: 1240px;
    margin: 0 auto;
}

.cs-page h1,
.cs-page h2,
.cs-page h3 {
    text-transform: none;
    letter-spacing: 0;
    margin: 0;
    font-family: "Archivo";
    font-weight: 800;
}

.cs-page h2 {
    font-variation-settings: 'wdth' 110, 'wght' 800;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.12;
}

.cs-page h3 {
    font-variation-settings: 'wdth' 110, 'wght' 800;
    font-size: 1.25rem;
    line-height: 1.25;
}

/* ---------- Hero ---------- */

.cs-hero {
    position: relative;
    overflow: hidden;
    background: var(--hp-dark);
    color: #fff;
}

.cs-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3rem;
    align-items: center;
    padding: 4rem 0;
}

.cs-hero-inner > * {
    min-width: 0;
}

.cs-hero .cs-logo {
    display: block;
    width: 130px;
    height: auto;
    margin: 0 0 1.5rem;
    filter: brightness(0) invert(1);
}

/* Sized from its own column, so the longest word (SPECIFICATIONS.) always fits on one line. */
.cs-hero-inner > div:first-child {
    container-type: inline-size;
}

.cs-page .cs-hero h1 {
    font-variation-settings: 'wdth' 125, 'wght' 800;
    text-transform: uppercase;
    font-size: clamp(1.3rem, 7.6cqi, 3.9rem);
    line-height: 1.04;
    color: #fff;
}

.cs-hero .hp-bar {
    margin: 1.75rem 0;
}

.cs-hero p {
    max-width: 38rem;
    margin: 0 0 2rem;
    font-size: 1.2rem;
    line-height: 1.55;
    color: #e9e9ea;
}

.cs-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.cs-hero-image {
    position: relative;
}

.cs-hero-image img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

/* For a logo with a small tagline that needs extra width to stay readable. */
.cs-hero .cs-logo-wide {
    width: 180px;
}

/* A wide photo shown whole, at its own shape. */
.cs-hero-image-full img {
    aspect-ratio: auto;
    height: auto;
}

/* Slanted panel behind the hero image, echoing the site's diagonal. */
.cs-hero::after {
    content: "";
    position: absolute;
    top: 0;
    right: -10%;
    width: 52%;
    height: 100%;
    background: var(--hp-darker);
    transform: skewX(-12deg);
    transform-origin: top;
}

/* A monitor built in CSS, so the whole screenshot shows at any width. */
.cs-device {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    filter: drop-shadow(0 24px 34px rgba(0, 0, 0, .5));
}

.cs-device-screen {
    padding: 10px 10px 12px;
    background: #0b0909;
    border: 1px solid #575152;
    border-radius: 12px;
}

.cs-device-screen img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    border-radius: 3px;
    background: #fff;
}

.cs-device-neck {
    width: 17%;
    height: 44px;
    margin: 0 auto;
    background: linear-gradient(90deg, #77716f, #d9d7d6 45%, #8b8583);
    clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

.cs-device-base {
    width: 32%;
    height: 7px;
    margin: 0 auto;
    background: linear-gradient(90deg, #8b8583, #eeeded 50%, #8b8583);
    border-radius: 3px 3px 5px 5px;
}

/* ---------- Stat band ---------- */

.cs-stats {
    background: var(--hp-orange);
    color: #fff;
}

.cs-stats-grid {
    display: grid;
    gap: 2rem;
    padding: 2.5rem 0;
}

.cs-stat-value {
    font-family: "Archivo";
    font-weight: 800;
    font-variation-settings: 'wdth' 125, 'wght' 800;
    font-size: clamp(2rem, 3.4vw, 3rem);
    line-height: 1.05;
    margin-bottom: .5rem;
}

.cs-stat-label {
    font-size: 1.02rem;
    line-height: 1.4;
}

/* ---------- Story ---------- */

.cs-story {
    background: #fff;
    color: var(--hp-dark);
    padding: 4.5rem 0;
}

.cs-story-grid {
    display: grid;
    gap: 3rem;
}

.cs-section + .cs-section {
    margin-top: 4rem;
}

.cs-section .hp-label {
    display: block;
    margin-bottom: .75rem;
    color: var(--hp-orange);
}

.cs-section h2 {
    margin-bottom: 1.25rem;
}

.cs-section p {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.cs-snapshot {
    align-self: start;
    padding: 1.75rem;
    background: var(--hp-light);
    border-top: 6px solid var(--hp-orange);
}

.cs-snapshot dl {
    margin: 0;
}

.cs-snapshot dt {
    margin: 1.25rem 0 .25rem;
    font-family: "Archivo";
    font-weight: 700;
    font-variation-settings: 'wdth' 125, 'wght' 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .72rem;
    color: #5d5859;
}

.cs-snapshot dt:first-child {
    margin-top: 0;
}

.cs-snapshot dd {
    margin: 0;
    line-height: 1.45;
}

.cs-snapshot a {
    color: var(--hp-dark);
    border-bottom: 2px solid var(--hp-orange);
}

.cs-quote {
    margin: 2rem 0;
    padding: 0 0 0 1.5rem;
    border-left: 6px solid var(--hp-orange);
    font-family: "Archivo";
    font-weight: 700;
    font-variation-settings: 'wdth' 105, 'wght' 700;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    line-height: 1.3;
}

/* Steps */

.cs-steps {
    display: grid;
    gap: 1.75rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

.cs-steps li {
    display: grid;
    grid-template-columns: 3.25rem 1fr;
    gap: 1rem;
}

.cs-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    background: var(--hp-dark);
    color: #fff;
    font-family: "Archivo";
    font-weight: 800;
    font-size: 1.15rem;
}

.cs-steps h3 {
    margin-bottom: .35rem;
}

.cs-steps p {
    margin: 0;
    font-size: 1.05rem;
}

/* Result charts. Bar heights are set inline as --cs-h and grow in when scrolled into view. */

.cs-charts {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.cs-chart {
    padding: 1.5rem;
    background: var(--hp-dark);
    color: #fff;
}

.cs-chart h3 {
    color: #fff;
    font-size: 1.05rem;
}

.cs-bars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
    height: 230px;
    margin-top: 1.25rem;
}

.cs-bar {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
}

.cs-bar-value {
    margin-bottom: .4rem;
    font-family: "Archivo";
    font-weight: 800;
    font-size: 1.02rem;
    line-height: 1.15;
}

.cs-bar-fill {
    height: var(--cs-h);
    background: #6d6768;
    transition: height 1.2s cubic-bezier(.2, .8, .2, 1);
}

.cs-bar-after .cs-bar-fill {
    background: var(--hp-orange);
    transition-delay: .25s;
}

.cs-bar-name {
    margin-top: .5rem;
    font-size: .88rem;
    line-height: 1.3;
    color: #d6d5d5;
    min-height: 2.3em;
}

.js .cs-charts:not(.is-in) .cs-bar-fill {
    height: 0;
}

.cs-result-list {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1.1rem;
    line-height: 1.55;
}

/* Before and after panels. Items fade in when scrolled into view. */

.cs-compare {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.cs-compare-panel {
    padding: 1.5rem;
    background: var(--hp-light);
    border-top: 6px solid #6d6768;
}

.cs-compare-after {
    background: var(--hp-dark);
    border-top-color: var(--hp-orange);
    color: #fff;
}

.cs-page .cs-compare-after h3 {
    color: #fff;
}

.cs-compare ul {
    display: grid;
    gap: .75rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
    line-height: 1.45;
}

.cs-compare li {
    transition: opacity .5s ease, transform .5s ease;
}

.cs-compare li:nth-child(2) { transition-delay: .12s; }
.cs-compare li:nth-child(3) { transition-delay: .24s; }
.cs-compare li:nth-child(4) { transition-delay: .36s; }
.cs-compare li:nth-child(5) { transition-delay: .48s; }

.js .cs-compare:not(.is-in) li {
    opacity: 0;
    transform: translateY(10px);
}

.cs-section .cs-compare-note {
    margin: 1rem 0 0;
    font-size: .95rem;
    line-height: 1.5;
}

/* Brands dropping into one platform. */

.cs-merge {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--hp-dark);
    color: #fff;
}

.cs-merge-brands {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
}

.cs-merge-brands span {
    padding: .75rem .5rem;
    background: #4b4546;
    text-align: center;
    font-size: .95rem;
    line-height: 1.25;
    transition: transform .8s cubic-bezier(.2, .8, .2, 1), opacity .8s ease;
}

.js .cs-merge:not(.is-in) .cs-merge-brands span {
    opacity: 0;
    transform: translateY(-18px);
}

.cs-merge-platform {
    margin-top: .75rem;
    padding: 1rem;
    background: var(--hp-orange);
    text-align: center;
    font-family: "Archivo";
    font-weight: 800;
    font-size: 1.1rem;
    line-height: 1.25;
}

/* Feature lists. */

.cs-features {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0 2rem;
    padding: 0;
    list-style: none;
}

.cs-features li {
    padding: 1.1rem 1.25rem;
    background: var(--hp-light);
    border-left: 4px solid var(--hp-orange);
    line-height: 1.45;
}

.cs-features li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

.cs-features strong {
    display: block;
    margin-bottom: .2rem;
}

/* A customer moment worth stopping for. */

.cs-callout {
    margin: 2rem 0;
    padding: 1.75rem;
    background: var(--hp-orange);
    color: #fff;
}

.cs-page .cs-callout h3 {
    margin-bottom: .5rem;
    color: #fff;
}

.cs-section .cs-callout p {
    margin: 0;
}

/* ---------- Dark quote band ---------- */

.cs-band {
    background: var(--hp-darker);
    color: #fff;
    padding: 4.5rem 0;
}

.cs-band blockquote {
    max-width: 58rem;
    margin: 0;
    font-family: "Archivo";
    font-weight: 800;
    font-variation-settings: 'wdth' 110, 'wght' 800;
    font-size: clamp(1.6rem, 3.1vw, 2.75rem);
    line-height: 1.16;
}

.cs-band em {
    color: var(--hp-orange);
    font-style: normal;
}

.cs-attribution {
    margin-top: 1.5rem;
    font-size: 1.02rem;
    line-height: 1.4;
    color: #d6d5d5;
}

.cs-attribution strong {
    display: block;
    color: #fff;
}

/* ---------- Closing call to action ---------- */

.cs-next {
    background: var(--hp-light);
    color: var(--hp-dark);
    padding: 4rem 0;
}

.cs-next-grid {
    display: grid;
    gap: 3rem;
}

.cs-next p {
    margin: 1rem 0 1.75rem;
    font-size: 1.15rem;
    line-height: 1.55;
}

.cs-related a {
    display: block;
    padding: 1rem 0;
    border-top: 1px solid #c9c8c9;
    color: var(--hp-dark);
    font-size: 1.05rem;
    line-height: 1.4;
}

.cs-related a strong {
    display: block;
    font-family: "Archivo";
    font-weight: 800;
}

.cs-related a:hover strong {
    color: var(--hp-orange);
}

/* ---------- List page ---------- */

.cs-list-hero {
    background: var(--hp-dark);
    color: #fff;
    padding: 3.5rem 0;
}

.cs-page .cs-list-hero h1 {
    font-variation-settings: 'wdth' 125, 'wght' 800;
    text-transform: uppercase;
    font-size: clamp(2.2rem, 4.4vw, 3.9rem);
    line-height: 1.04;
    color: #fff;
}

.cs-list-hero .hp-bar {
    margin: 1.5rem 0;
}

.cs-list-hero p {
    max-width: 44rem;
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.5;
}

.cs-list {
    background: var(--hp-light);
    padding: 3rem 0 4.5rem;
}

.cs-feature {
    display: grid;
    margin-bottom: 2.5rem;
    background: var(--hp-darker);
    color: #fff;
    border: 0;
}

.cs-feature:hover {
    color: #fff;
}

.cs-feature img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.cs-feature-copy {
    padding: 2.25rem;
}

.cs-feature .hp-label {
    display: block;
    margin-bottom: 1rem;
    color: var(--hp-orange);
}

.cs-feature h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.cs-feature p {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    line-height: 1.5;
}

.cs-more {
    font-family: "Archivo";
    font-weight: 700;
    border-bottom: 2px solid var(--hp-orange);
}

html:not(.js) .cs-filters {
    display: none;
}

.cs-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 2rem;
}

.cs-filters button {
    padding: .5rem .9rem;
    background: #fff;
    border: 1px solid #c9c8c9;
    color: var(--hp-dark);
    font-size: .95rem;
    line-height: 1.2;
    cursor: pointer;
}

.cs-filters button:hover {
    border-color: var(--hp-orange);
}

.cs-filters button[aria-pressed="true"] {
    background: var(--hp-dark);
    border-color: var(--hp-dark);
    color: #fff;
}

.cs-grid {
    display: grid;
    gap: 1.5rem;
}

.cs-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--hp-dark);
    border: 0;
    transition: transform .2s ease, box-shadow .2s ease;
}

.cs-card[hidden] {
    display: none;
}

.cs-card:hover {
    color: var(--hp-dark);
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(23, 19, 20, .16);
}

.cs-card img {
    display: block;
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.cs-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.5rem;
}

.cs-card .hp-label {
    margin-bottom: .75rem;
    color: #5d5859;
}

.cs-card-stat {
    font-family: "Archivo";
    font-weight: 800;
    font-variation-settings: 'wdth' 125, 'wght' 800;
    font-size: 2.6rem;
    line-height: 1;
    color: var(--hp-orange);
}

.cs-card-headline {
    margin: .5rem 0 .75rem;
    font-family: "Archivo";
    font-weight: 800;
    font-variation-settings: 'wdth' 105, 'wght' 800;
    font-size: 1.15rem;
    line-height: 1.25;
}

.cs-card-dek {
    margin: 0;
    line-height: 1.45;
}

/* ---------- Larger screens ---------- */

@media (min-width: 768px) {
    .cs-stats-grid,
    .cs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-charts,
    .cs-compare,
    .cs-features {
        grid-template-columns: 1fr 1fr;
    }

    .cs-merge-brands {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .cs-hero-inner {
        grid-template-columns: 1.15fr 1fr;
        padding: 5rem 0;
    }

    .cs-hero-inner:has(.cs-hero-image-full) {
        grid-template-columns: 1fr 1.25fr;
    }

    .cs-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cs-stats-grid.cs-stats-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .cs-story-grid {
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: 4.5rem;
    }

    .cs-snapshot {
        position: sticky;
        top: 110px;
    }

    .cs-next-grid {
        grid-template-columns: 1.2fr 1fr;
        align-items: center;
    }

    .cs-feature {
        grid-template-columns: 1.1fr 1fr;
    }

    .cs-feature-copy {
        padding: 3rem;
    }

    .cs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cs-bar-fill,
    .cs-compare li,
    .cs-merge-brands span,
    .cs-card {
        transition: none;
    }
}
