/* Shared reference treatment for case studies, blog and product pages. */
.content-reference-page {
    --cr-blue: #1c9fd0;
    --cr-blue-dark: #0e789f;
    --cr-cyan: #c6edf9;
    --cr-ink: #202a35;
    --cr-muted: #66727c;
    --cr-border: #d9e3e8;
    --cr-dark: #07111e;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    overflow: clip;
}

.cr-shell {
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
}

.cr-section {
    padding: clamp(56px, 7vw, 92px) 0;
}

.cr-section--compact {
    padding: clamp(42px, 5vw, 68px) 0;
}

.cr-hero {
    position: relative;
    isolation: isolate;
    width: min(1160px, calc(100% - 40px));
    margin-inline: auto;
    min-height: clamp(390px, 42vw, 520px);
    display: flex;
    align-items: center;
    background-color: var(--cr-dark);
    background-image:
        linear-gradient(90deg, rgba(0, 0, 0, .94) 0%, rgba(0, 0, 0, .82) 37%, rgba(2, 9, 16, .28) 72%, rgba(2, 9, 16, .08) 100%),
        var(--cr-hero-image);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.cr-hero--insights,
.cr-hero--portfolio {
    --cr-hero-image: url('../../assets/images/home-ai-hero.webp');
}

.cr-hero--products {
    --cr-hero-image: url('../../assets/images/seo-marketing-hero.png');
    width: 100%;
    background-position: center 45%;
}

.cr-hero--article {
    --cr-hero-image: var(--cr-article-hero-image);
}

.cr-hero::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(0deg, rgba(3, 12, 21, .46), transparent);
    pointer-events: none;
}

.cr-hero__content {
    width: min(520px, 58%);
    padding: 60px 0;
    color: #fff;
}

.cr-eyebrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    margin-bottom: 18px;
    padding: 4px 16px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 3px;
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.cr-eyebrow--light {
    color: var(--cr-blue-dark);
    border-color: rgba(28, 159, 208, .58);
    background: #fff;
}

.cr-hero h1 {
    max-width: 650px;
    margin: 0 0 20px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: clamp(2rem, 4.2vw, 3.55rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.cr-hero p {
    max-width: 500px;
    margin: 0;
    color: rgba(255, 255, 255, .88);
    font-size: clamp(.9rem, 1.25vw, 1.02rem);
    line-height: 1.72;
}

.cr-heading {
    margin: 0 0 14px;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    font-size: clamp(1.7rem, 3vw, 2.45rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.03em;
}

.cr-copy {
    color: var(--cr-muted);
    line-height: 1.75;
}

.cr-category-panel {
    width: min(830px, calc(100% - 40px));
    margin: clamp(44px, 6vw, 72px) auto 0;
    padding: clamp(20px, 3vw, 34px);
    border-radius: 14px;
    background: var(--cr-cyan);
    box-shadow: 0 14px 42px rgba(12, 109, 145, .09);
}

.cr-category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cr-category-link--last {
    grid-column: 1 / -1;
    width: 50%;
    justify-self: center;
}

.cr-category-link,
.cr-category-button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    border: 0;
    border-radius: 9px;
    color: var(--cr-blue-dark);
    background: #fff;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none !important;
    text-align: left;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.cr-category-link:hover,
.cr-category-link:focus,
.cr-category-link.is-active,
.cr-category-button:hover,
.cr-category-button:focus,
.cr-category-button.is-active {
    color: #fff;
    background: linear-gradient(90deg, #198dbd, #21a9d6);
    transform: translateY(-1px);
}

.cr-category-link i,
.cr-category-button i {
    flex: 0 0 auto;
    font-size: 1rem;
    transform: rotate(-45deg);
}

.cr-story-layout {
    display: grid;
    grid-template-columns: minmax(230px, .72fr) minmax(0, 1.6fr);
    align-items: start;
    gap: clamp(34px, 6vw, 78px);
}

.cr-story-intro {
    padding-top: 18px;
}

.cr-story-intro .cr-heading {
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
}

.case-study-listing-page .cr-hero h1,
.case-study-detail-page .cr-hero h1 {
    font-size: clamp(1.9rem, 2.65vw, 2.45rem);
}

.case-study-listing-page .cr-hero,
.case-study-detail-page .cr-hero {
    width: 100%;
}

.case-study-listing-page .cr-hero p,
.case-study-detail-page .cr-hero p {
    max-width: 505px;
    font-size: .72rem;
    line-height: 1.75;
}

.case-study-listing-page .cr-heading,
.case-study-detail-page .cr-heading {
    font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.case-study-listing-page .cr-story-intro .cr-heading {
    font-size: clamp(1.45rem, 2.2vw, 1.9rem);
}

/* Keep every portfolio category visually consistent with the landing page. */
.content-reference-page[data-portfolio-type] .cr-hero {
    width: 100%;
    min-height: 510px;
}

.content-reference-page[data-portfolio-type] .cr-eyebrow {
    min-height: 22px;
    margin-bottom: 11px;
    padding: 3px 13px;
    font-size: .54rem;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.content-reference-page[data-portfolio-type] .cr-hero h1 {
    margin-bottom: 14px;
    font-size: clamp(1.9rem, 2.65vw, 2.45rem);
    line-height: 1.12;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.content-reference-page[data-portfolio-type] .cr-hero p {
    max-width: 505px;
    font-size: .72rem;
    line-height: 1.7;
}

.content-reference-page[data-portfolio-type] .cr-section {
    padding: 68px 0;
}

.content-reference-page[data-portfolio-type] .cr-heading,
.content-reference-page[data-portfolio-type] .cr-story-intro .cr-heading {
    font-size: clamp(1.55rem, 2.4vw, 2rem);
    line-height: 1.17;
}

.content-reference-page[data-portfolio-type] .cr-copy {
    font-size: .72rem;
    line-height: 1.7;
}

.content-reference-page[data-portfolio-type] .cr-category-panel {
    padding: 24px;
    border-radius: 8px;
}

.content-reference-page[data-portfolio-type] .cr-category-grid {
    gap: 10px;
}

.content-reference-page[data-portfolio-type] .cr-category-link {
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 5px;
    font-size: .7rem;
}

.content-reference-page[data-portfolio-type] .cr-story-card h3 {
    font-size: .82rem;
    font-weight: 700;
}

.content-reference-page[data-portfolio-type] .cr-story-card p {
    font-size: .59rem;
    line-height: 1.46;
}

.content-reference-page[data-portfolio-type] .cr-story-card__category {
    font-size: .58rem;
}

.cr-case-study-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding-block: 32px;
}

.cr-case-study-card {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: var(--cr-dark);
    box-shadow: 0 10px 24px rgba(12, 39, 58, .14);
}

.cr-case-study-card:nth-child(3n + 2) {
    transform: translateY(-18px);
}

.cr-case-study-card:nth-child(3n) {
    transform: translateY(-36px);
}

.cr-case-study-card a,
.cr-case-study-card img,
.cr-case-study-card__shade {
    position: absolute;
    inset: 0;
}

.cr-case-study-card a {
    color: #fff;
    text-decoration: none;
}

.cr-case-study-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.cr-case-study-card__shade {
    background: linear-gradient(180deg, transparent 40%, rgba(3, 12, 21, .75));
}

.cr-case-study-card__content {
    position: absolute;
    right: 10px;
    bottom: 12px;
    left: 10px;
    display: grid;
    justify-items: center;
    gap: 7px;
    color: #fff;
    font-size: .62rem;
    text-align: center;
}

.cr-case-study-card__content strong {
    min-width: 92px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .52);
    border-radius: 4px;
    background: rgba(28, 159, 208, .9);
    font-size: .58rem;
}

.cr-case-study-card:hover img,
.cr-case-study-card:focus-within img {
    transform: scale(1.05);
}

.cr-story-intro__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.cr-story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cr-story-card {
    position: relative;
    min-height: 255px;
    overflow: hidden;
    border-radius: 12px;
    background: #102335;
    box-shadow: 0 12px 30px rgba(10, 35, 50, .14);
    isolation: isolate;
}

.cr-story-card::before {
    content: '';
    position: absolute;
    z-index: 1;
    inset: 0 0 auto;
    height: 3px;
    background: var(--cr-card-accent, var(--cr-blue));
}

.cr-story-card[hidden] {
    display: none !important;
}

.cr-story-card__image {
    position: absolute;
    z-index: -2;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.cr-story-card::after {
    content: '';
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(180deg, rgba(3, 12, 20, .04) 25%, rgba(3, 12, 20, .92) 100%);
}

.cr-story-card:hover .cr-story-card__image,
.cr-story-card:focus-within .cr-story-card__image {
    transform: scale(1.055);
}

.cr-story-card__body {
    min-height: 255px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    color: #fff;
}

.cr-story-card__category {
    width: fit-content;
    margin: 0 0 9px;
    padding: 3px 9px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    color: rgba(255, 255, 255, .92);
    font-size: .65rem;
    font-weight: 600;
}

.cr-story-card h2,
.cr-story-card h3 {
    margin: 0 0 8px;
    color: #fff;
    font-family: var(--font-sans);
    font-size: clamp(.95rem, 1.35vw, 1.1rem);
    font-weight: 750;
    line-height: 1.35;
}

.cr-story-card h2 a,
.cr-story-card h3 a {
    color: inherit;
    text-decoration: none;
}

.cr-story-card h2 small,
.cr-story-card h3 small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, .72);
    font-size: .68rem;
    font-weight: 500;
}

.cr-story-card p {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: rgba(255, 255, 255, .76);
    font-size: .72rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.cr-story-card__link {
    align-self: flex-start;
    color: #fff !important;
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none !important;
}

.cr-story-card__link::after {
    content: ' \2197';
    color: #6ee0ff;
}

.cr-empty {
    grid-column: 1 / -1;
    padding: 40px 20px;
    border: 1px dashed var(--cr-border);
    border-radius: 12px;
    color: var(--cr-muted);
    text-align: center;
}

.cr-pagination {
    display: flex;
    justify-content: center;
    margin-top: 36px;
}

.cr-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    padding: 36px 0;
}

.cr-meta__item {
    min-width: 0;
    text-align: center;
}

.cr-meta__label {
    display: block;
    margin-bottom: 5px;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    font-size: .9rem;
    font-weight: 750;
}

.cr-meta__value {
    display: block;
    overflow-wrap: anywhere;
    color: var(--cr-blue-dark);
    font-size: .82rem;
}

.cr-meta dt,
.cr-meta dd {
    margin: 0;
}

.cr-article {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 6px 0 clamp(52px, 6vw, 78px);
    color: #4f5962;
    font-size: .96rem;
    line-height: 1.82;
}

.cr-article__heading {
    max-width: 720px;
    margin: 0 auto 28px;
    text-align: center;
}

.cr-article__content {
    text-align: left;
}

.case-study-detail-page .cr-article__content {
    text-align: center;
}

.cr-article__content > :first-child {
    margin-top: 0;
}

.cr-article__cover {
    width: 100%;
    max-height: 520px;
    display: block;
    margin: 0 0 34px;
    border-radius: 12px;
    object-fit: cover;
}

.cr-article h2,
.cr-article h3,
.cr-article h4 {
    margin: 1.65em 0 .65em;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    font-weight: 750;
}

.cr-article img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.cr-article a {
    color: var(--cr-blue-dark);
}

.cr-insight-band {
    padding: clamp(52px, 6vw, 76px) 0;
    background:
        linear-gradient(rgba(3, 14, 24, .82), rgba(3, 14, 24, .88)),
        var(--cr-band-image);
    background-position: center;
    background-size: cover;
}

.cr-insight-stack {
    width: min(900px, 100%);
    display: grid;
    gap: 18px;
    margin: 0 auto;
}

.cr-insight-card {
    padding: clamp(28px, 4vw, 42px);
    border-radius: 12px;
    background: #fff;
    text-align: center;
}

.cr-insight-card:first-child {
    background: var(--cr-cyan);
}

.cr-insight-card__icon {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 8px;
    color: #fff;
    background: var(--cr-blue);
    font-size: 1.2rem;
}

.cr-insight-card h2 {
    margin: 0 0 10px;
    color: var(--cr-blue-dark);
    font-family: var(--font-sans);
    font-size: 1.08rem;
    font-weight: 750;
}

.cr-insight-card p {
    max-width: 760px;
    margin: auto;
    color: #58636c;
    font-size: .82rem;
    line-height: 1.68;
}

.cr-recent {
    background: #f7fbfd;
}

.cr-recent__heading {
    margin-bottom: 30px;
    text-align: center;
}

.cr-product-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.cr-products-heading {
    max-width: 720px;
    margin: 0 auto 38px;
    text-align: center;
}

.cr-product-card {
    flex: 0 1 calc(33.333% - 12px);
    min-width: 0;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(24px, 3vw, 36px) 26px 24px;
    border: 1px solid var(--cr-border);
    border-radius: 12px;
    background: #fff;
    text-align: center;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.cr-product-card:hover {
    border-color: rgba(28, 159, 208, .42);
    box-shadow: 0 16px 36px rgba(17, 83, 109, .1);
    transform: translateY(-3px);
}

.cr-product-card__visual {
    width: 100%;
    height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.cr-product-card__visual img {
    max-width: 82%;
    max-height: 125px;
    object-fit: contain;
}

.cr-product-card h2 {
    margin: 0 0 12px;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 750;
}

.cr-product-card p {
    margin: 0 0 20px;
    color: var(--cr-muted);
    font-size: .8rem;
    line-height: 1.65;
}

.cr-product-card__tagline {
    display: block;
    margin: -5px 0 11px;
    color: var(--cr-blue-dark);
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.45;
}

.cr-pagination:empty {
    display: none;
}

.cr-pagination .pagination {
    margin: 0;
}

.cr-pagination .page-link {
    color: var(--cr-blue-dark);
    border-color: var(--cr-border);
}

.cr-pagination .active > .page-link {
    color: #fff;
    background: var(--cr-blue);
    border-color: var(--cr-blue);
}

.cr-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 9px 22px;
    border: 1px solid var(--cr-blue);
    border-radius: 5px;
    color: #fff !important;
    background: linear-gradient(90deg, #178dbd, #23a9d5);
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color .2s ease, transform .2s ease;
}

.cr-button:hover,
.cr-button:focus {
    background: var(--cr-blue-dark);
    transform: translateY(-1px);
}

.cr-button--outline {
    color: var(--cr-blue-dark) !important;
    background: #fff;
}

.cr-button--outline:hover,
.cr-button--outline:focus {
    color: #fff !important;
    background: var(--cr-blue-dark);
}

.cr-cta {
    padding: 0 0 clamp(58px, 7vw, 88px);
}

.cr-cta__inner {
    padding: clamp(32px, 5vw, 48px) 22px;
    border: 1px solid rgba(28, 159, 208, .55);
    border-radius: 13px;
    background: #e6f7fd;
    text-align: center;
}

.cr-cta h2 {
    margin: 0 0 12px;
    color: var(--cr-ink);
    font-family: var(--font-sans);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 800;
}

.cr-cta p {
    max-width: 760px;
    margin: 0 auto 24px;
    color: var(--cr-muted);
    line-height: 1.65;
}

@media (max-width: 1050px) {
    .cr-story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cr-product-card {
        flex-basis: calc(50% - 9px);
    }
}

@media (max-width: 767.98px) {
    .cr-shell {
        width: min(100% - 28px, 1160px);
    }

    .cr-hero {
        width: min(100% - 24px, 1160px);
        min-height: 400px;
        background-image:
            linear-gradient(90deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .68)),
            var(--cr-hero-image);
        background-position: 66% center;
    }

    .cr-hero--products {
        width: 100%;
    }

    .case-study-listing-page .cr-hero,
    .case-study-detail-page .cr-hero {
        width: 100%;
    }

    .cr-hero__content {
        width: 100%;
        padding: 48px 0;
    }

    .cr-hero p {
        max-width: 90%;
    }

    .cr-category-panel {
        width: min(100% - 28px, 830px);
    }

    .cr-story-layout {
        grid-template-columns: 1fr;
    }

    .cr-case-study-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cr-case-study-card:nth-child(3n + 2),
    .cr-case-study-card:nth-child(3n) {
        transform: none;
    }

    .cr-category-link--last {
        width: 100%;
    }

    .cr-story-intro {
        padding-top: 0;
    }

    .cr-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .cr-category-grid,
    .cr-story-grid,
    .cr-meta {
        grid-template-columns: 1fr;
    }

    .cr-case-study-grid {
        grid-template-columns: 1fr;
    }

    .cr-category-link,
    .cr-category-button {
        min-height: 44px;
    }

    .cr-story-card,
    .cr-story-card__body {
        min-height: 280px;
    }

    .cr-product-card {
        flex-basis: 100%;
        min-height: 0;
    }

    .cr-meta {
        gap: 14px;
    }

    .cr-meta__item {
        padding-bottom: 13px;
        border-bottom: 1px solid var(--cr-border);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cr-story-card__image,
    .cr-product-card,
    .cr-button,
    .cr-category-link,
    .cr-category-button {
        transition: none;
    }
}
