/* Work archive: image-led case-study index in the SH Digital Labs system. */

.work-archive {
    overflow: hidden;
    background: var(--night-950);
}

.work-archive h1,
.work-archive h2,
.work-archive h3 {
    text-wrap: balance;
}

.work-kicker {
    margin: 0;
    color: var(--ice-300);
    font: 500 .75rem/1.5 var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.work-button {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 52px;
    padding: 14px 23px;
    overflow: hidden;
    border: 1px solid rgba(179, 208, 255, .32);
    border-radius: 999px;
    background: rgba(5, 12, 26, .22);
    color: var(--white);
    font: 500 .9375rem/1.25 var(--font-sans);
    text-decoration: none;
    transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

.work-button:hover,
.work-button:focus-visible {
    border-color: var(--ice-300);
    background: rgba(36, 118, 255, .18);
    color: var(--ice-300);
}

.work-button .icon,
.work-gallery-card__action .icon,
.work-gallery .nav-links .icon {
    width: 15px;
    height: 15px;
    transition: transform .25s var(--ease);
}

.work-button:hover .icon,
.work-button:focus-visible .icon,
.work-gallery-card__link:hover .work-gallery-card__action .icon,
.work-gallery-card__link:focus-visible .work-gallery-card__action .icon,
.work-gallery .nav-links a:hover .icon,
.work-gallery .nav-links a:focus-visible .icon {
    transform: translate(3px, -3px);
}

/* 01 — notched, image-led archive opening. */
.work-hero {
    padding: 122px 0 0;
    background: var(--night-950);
}

.work-hero__shell {
    position: relative;
}

.work-hero__clip-defs {
    position: absolute;
}

.work-hero__visual {
    position: relative;
    display: grid;
    place-items: center;
    min-height: clamp(430px, 39vw, 560px);
    overflow: hidden;
    border-radius: var(--radius-lg);
    clip-path: polygon(7% 0, 100% 0, 100% 70%, 96% 70%, 96% 100%, 19% 100%, 19% 87%, 0 87%, 0 12%, 5% 12%);
    clip-path: url(#work-hero-clip);
    background: var(--slate-850);
}

.work-hero__visual > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 55% 52%;
    transform: scale(1.015);
}

.work-hero__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(circle at 70% 45%, rgba(36, 118, 255, .14), transparent 32%),
        linear-gradient(90deg, rgba(3, 7, 15, .64), rgba(3, 7, 15, .18) 54%, rgba(3, 7, 15, .54));
}

.work-hero__title-wrap {
    position: relative;
    z-index: 2;
    display: grid;
    justify-items: center;
    gap: 18px;
    max-width: min(78%, 1040px);
    text-align: center;
}

.work-hero h1 {
    max-width: 15ch;
    margin: 0;
    color: var(--white);
    font-size: clamp(3.4rem, 6vw, 6.35rem);
    font-weight: 500;
    letter-spacing: -.06em;
    line-height: .96;
}

.work-hero__vertical {
    position: absolute;
    z-index: 2;
    right: 7%;
    bottom: 7%;
    color: transparent;
    font-size: clamp(2.8rem, 4.6vw, 5rem);
    font-weight: 600;
    letter-spacing: -.06em;
    line-height: 1;
    text-orientation: mixed;
    white-space: nowrap;
    writing-mode: vertical-rl;
    -webkit-text-stroke: 1px rgba(255, 255, 255, .64);
}

.work-hero__breadcrumb {
    position: absolute;
    z-index: 3;
    bottom: 12px;
    left: var(--margin);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: calc(19% - 22px);
    color: var(--mist-300);
    font-size: .75rem;
    white-space: nowrap;
}

.work-hero__breadcrumb a {
    color: var(--white);
    text-decoration: none;
}

.work-hero__breadcrumb a:hover,
.work-hero__breadcrumb a:focus-visible {
    color: var(--ice-300);
}

.work-hero__breadcrumb > span:not([aria-current]) {
    color: var(--ice-300);
}

/* 02 — the project index. */
.work-gallery {
    position: relative;
    padding: 126px 0 140px;
    overflow: hidden;
    border-bottom: 1px solid var(--rule);
    background:
        radial-gradient(circle at 88% 42%, rgba(36, 118, 255, .16), transparent 27%),
        radial-gradient(circle at 42% 96%, rgba(110, 72, 255, .15), transparent 33%),
        var(--night-950);
}

.work-gallery::after {
    position: absolute;
    right: -10%;
    bottom: -1%;
    width: min(82vw, 1260px);
    aspect-ratio: 16 / 9;
    background: url("../pattern-sh.webp") right center / auto 110% no-repeat;
    content: "";
    opacity: .055;
    pointer-events: none;
}

.work-gallery > .container {
    position: relative;
    z-index: 1;
}

.work-gallery__intro {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr);
    gap: clamp(48px, 8vw, 130px);
    align-items: end;
    margin-bottom: 70px;
}

.work-gallery__intro h2 {
    max-width: 12ch;
    margin: 22px 0 0;
    color: var(--white);
    font-size: clamp(3.1rem, 5.3vw, 6rem);
    font-weight: 500;
    letter-spacing: -.058em;
    line-height: .98;
}

.work-gallery__summary {
    display: grid;
    gap: 26px;
    padding-bottom: 8px;
}

.work-gallery__summary p {
    margin: 0;
    color: var(--mist-300);
    font-size: clamp(1rem, 1.25vw, 1.18rem);
    line-height: 1.7;
}

.work-gallery__summary > span {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--ice-300);
    font: 500 .75rem/1.5 var(--font-mono);
    letter-spacing: .07em;
    text-transform: uppercase;
}

.work-gallery__summary > span::before {
    width: 30px;
    height: 1px;
    background: currentColor;
    content: "";
}

.work-gallery__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.work-gallery-card {
    position: relative;
    min-width: 0;
    aspect-ratio: .78;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(169, 199, 255, .18);
    border-radius: var(--radius-product);
    background: var(--slate-850);
    box-shadow: 0 26px 70px rgba(0, 5, 18, .18);
    transition: border-color .35s var(--ease), box-shadow .35s var(--ease), transform .35s var(--ease);
}

.work-gallery-card__link {
    position: absolute;
    inset: 0;
    display: block;
    color: var(--white);
    text-decoration: none;
}

.work-gallery-card__link:focus-visible {
    outline: 2px solid var(--ice-300);
    outline-offset: -4px;
}

.work-gallery-card__media,
.work-gallery-card__image,
.work-gallery-card__fallback,
.work-gallery-card__veil {
    position: absolute;
    inset: 0;
}

.work-gallery-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.01);
    transition: filter .55s var(--ease), transform .65s var(--ease);
}

.work-gallery-card__fallback {
    background:
        linear-gradient(145deg, rgba(5, 7, 11, .04), rgba(5, 7, 11, .72)),
        url("../pillar-bg-growth-engine.webp") 65% 45% / cover no-repeat,
        var(--slate-850);
}

.work-gallery-card__veil {
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(3, 7, 15, .42), rgba(3, 7, 15, .04) 31%, rgba(3, 7, 15, .28) 54%, rgba(3, 7, 15, .94) 100%),
        linear-gradient(110deg, rgba(0, 18, 52, .15), transparent 60%);
    transition: background .4s var(--ease);
}

.work-gallery-card__topline {
    position: absolute;
    z-index: 2;
    top: 24px;
    right: 24px;
    left: 24px;
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.work-gallery-card__type {
    display: inline-flex;
    min-height: 29px;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid rgba(140, 215, 255, .46);
    border-radius: 999px;
    background: rgba(3, 10, 24, .42);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    color: var(--ice-100);
    font: 500 .7rem/1.3 var(--font-mono);
    letter-spacing: .03em;
    backdrop-filter: blur(12px);
}

.work-gallery-card__index {
    color: rgba(255, 255, 255, .76);
    font: 500 .75rem/1 var(--font-mono);
}

.work-gallery-card__body {
    position: absolute;
    z-index: 2;
    right: 28px;
    bottom: 28px;
    left: 28px;
    display: grid;
    gap: 12px;
}

.work-gallery-card__body > p {
    margin: 0;
    color: var(--ice-300);
    font: 500 .72rem/1.5 var(--font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.work-gallery-card__body h3 {
    max-width: 15ch;
    margin: 0;
    color: var(--white);
    font-size: clamp(1.45rem, 2.1vw, 2.05rem);
    font-weight: 500;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.work-gallery-card__excerpt {
    display: -webkit-box;
    max-width: 42ch;
    overflow: hidden;
    color: rgba(223, 232, 247, .82);
    font-size: .875rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.work-gallery-card__action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    max-height: 0;
    overflow: hidden;
    color: var(--ice-300);
    font-size: .875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(10px);
    transition: max-height .35s var(--ease), opacity .3s var(--ease), transform .35s var(--ease);
}

.work-gallery-card:hover,
.work-gallery-card:focus-within {
    border-color: rgba(140, 215, 255, .52);
    box-shadow: 0 32px 80px rgba(0, 14, 48, .34), var(--edge-glow);
    transform: translateY(-6px);
}

.work-gallery-card:hover .work-gallery-card__image,
.work-gallery-card:focus-within .work-gallery-card__image {
    filter: saturate(1.08) contrast(1.03);
    transform: scale(1.065);
}

.work-gallery-card:hover .work-gallery-card__action,
.work-gallery-card:focus-within .work-gallery-card__action {
    max-height: 28px;
    opacity: 1;
    transform: translateY(0);
}

.work-gallery-card:nth-child(3n + 2) .work-gallery-card__image {
    object-position: 58% center;
}

.work-gallery-card:nth-child(3n) .work-gallery-card__image {
    object-position: 44% center;
}

/* Pagination follows the compact controls used in the reference layout. */
.work-gallery .pagination {
    margin-top: 64px;
}

.work-gallery .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.work-gallery .nav-links .page-numbers {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(169, 199, 255, .2);
    border-radius: 10px;
    background: rgba(10, 18, 34, .64);
    color: var(--mist-300);
    font: 500 .75rem/1 var(--font-mono);
    text-decoration: none;
    backdrop-filter: blur(12px);
    transition: background .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
}

.work-gallery .nav-links .page-numbers.current,
.work-gallery .nav-links a:hover,
.work-gallery .nav-links a:focus-visible {
    border-color: rgba(140, 215, 255, .54);
    background: rgba(36, 118, 255, .18);
    color: var(--ice-300);
}

.work-gallery .nav-links .prev,
.work-gallery .nav-links .next {
    padding-inline: 17px;
}

.work-pagination__prev-icon {
    transform: rotate(180deg);
}

.work-gallery .nav-links .prev:hover .work-pagination__prev-icon,
.work-gallery .nav-links .prev:focus-visible .work-pagination__prev-icon {
    transform: translate(-3px, 3px) rotate(180deg);
}

/* 03 — quote CTA, with no embedded inquiry form. */
.work-cta {
    padding: 118px 0 126px;
    background:
        radial-gradient(circle at 84% 30%, rgba(36, 118, 255, .17), transparent 34%),
        var(--night-950);
}

.work-cta__inner {
    display: flex;
    gap: 54px;
    align-items: flex-end;
    justify-content: space-between;
}

.work-cta__inner h2 {
    max-width: 11ch;
    margin: 22px 0 20px;
    background: linear-gradient(95deg, var(--ice-300), var(--signal-500) 68%, var(--white));
    background-clip: text;
    color: transparent;
    font-size: clamp(3.4rem, 5.6vw, 6.1rem);
    font-weight: 500;
    letter-spacing: -.06em;
    line-height: .96;
}

.work-cta__inner p:not(.work-kicker) {
    max-width: 58ch;
    margin: 0;
    color: var(--mist-300);
    font-size: 1rem;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .work-gallery__intro {
        grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
        gap: 50px;
    }

    .work-gallery__grid {
        gap: 18px;
    }

    .work-gallery-card__body {
        right: 22px;
        bottom: 22px;
        left: 22px;
    }
}

@media (max-width: 900px) {
    .work-hero {
        padding-top: 104px;
    }

    .work-hero__visual {
        min-height: 500px;
    }

    .work-hero h1 {
        font-size: clamp(3rem, 8.5vw, 5rem);
    }

    .work-gallery {
        padding-block: 100px 112px;
    }

    .work-gallery__intro {
        grid-template-columns: 1fr;
        gap: 34px;
    }

    .work-gallery__intro h2 {
        max-width: 13ch;
    }

    .work-gallery__summary {
        max-width: 650px;
    }

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

    .work-gallery-card {
        aspect-ratio: .8;
    }

    .work-cta__inner {
        display: grid;
        align-items: start;
    }
}

@media (max-width: 640px) {
    .work-hero {
        padding: 94px 0 0;
    }

    .work-hero__visual {
        min-height: 510px;
        clip-path: polygon(10% 0, 100% 0, 100% 78%, 96% 78%, 96% 100%, 42% 100%, 42% 88%, 0 88%, 0 11%, 7% 11%);
        clip-path: url(#work-hero-clip-mobile);
    }

    .work-hero__visual > img {
        object-position: 66% center;
    }

    .work-hero__veil {
        background: linear-gradient(180deg, rgba(3, 7, 15, .35), rgba(3, 7, 15, .66));
    }

    .work-hero__title-wrap {
        max-width: 82%;
        transform: translateY(-8%);
    }

    .work-hero h1 {
        max-width: 9ch;
        font-size: clamp(2.8rem, 13vw, 4.1rem);
    }

    .work-hero__vertical {
        right: 5%;
        bottom: 6%;
        font-size: 2.75rem;
    }

    .work-hero__breadcrumb {
        bottom: 15px;
        left: 18px;
        max-width: calc(42% - 28px);
        font-size: .7rem;
    }

    .work-gallery {
        padding: 82px 0 92px;
    }

    .work-gallery__intro {
        margin-bottom: 46px;
    }

    .work-gallery__intro h2 {
        margin-top: 17px;
        font-size: clamp(2.75rem, 13vw, 4rem);
    }

    .work-gallery__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .work-gallery-card {
        min-height: 490px;
        aspect-ratio: auto;
    }

    .work-gallery-card__action {
        max-height: 28px;
        opacity: 1;
        transform: none;
    }

    .work-gallery .nav-links {
        justify-content: flex-start;
    }

    .work-gallery .nav-links .prev,
    .work-gallery .nav-links .next {
        font-size: 0;
    }

    .work-gallery .nav-links .prev .icon,
    .work-gallery .nav-links .next .icon {
        width: 16px;
        height: 16px;
    }

    .work-cta {
        padding: 88px 0 96px;
    }

    .work-cta__inner {
        gap: 36px;
    }

    .work-cta__inner h2 {
        font-size: clamp(3rem, 14vw, 4.4rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .work-gallery-card,
    .work-gallery-card__image,
    .work-gallery-card__action,
    .work-button,
    .work-button .icon,
    .work-gallery .nav-links .icon {
        transition: none;
    }

    .work-gallery-card:hover,
    .work-gallery-card:focus-within {
        transform: none;
    }

    .work-gallery-card:hover .work-gallery-card__image,
    .work-gallery-card:focus-within .work-gallery-card__image {
        transform: scale(1.01);
    }
}
