/* Case Studies listing page. Consumes theme.css tokens only — no root block, no hard-coded hex. */

/* ── Hero ─────────────────────────────────────────────── */
/* Blue, not green, and centred rather than bottom-aligned — this mirrors the
   design source's .software-hero.case-study (package/styles.css). The gradient
   itself is --surface-case-hero in theme.css; the two radial washes layered
   over it here are what give it depth rather than reading as a flat fill.
   Top padding clears the fixed header, and the page sets body.has-dark-hero so
   the header sits transparent over this until scrolled. The contextual subnav is
   switched off here (ViewData["ShowSubnav"]), so only the header needs clearing. */
.case-index-hero {
    position: relative;
    display: flex;
    min-height: 780px;
    align-items: center;
    overflow: hidden;
    padding: 162px 0 112px;
    color: var(--on-dark);
    background:
        radial-gradient(circle at 78% 36%, color-mix(in srgb, var(--blue-400) 26%, transparent), transparent 28%),
        radial-gradient(circle at 12% 92%, color-mix(in srgb, var(--blue-600) 42%, transparent), transparent 34%),
        var(--surface-case-hero);
}

.case-index-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
    background-size: 88px 88px;
    mask-image: linear-gradient(90deg, rgb(0, 0, 0), transparent 88%);
}

.case-index-hero::after {
    content: "";
    position: absolute;
    right: -210px;
    bottom: -310px;
    width: 720px;
    height: 720px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 50%;
    box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.025), 0 0 0 200px rgba(255, 255, 255, 0.018);
}

/* Single left-hand column, matching the design source. It was previously a
   two-column grid with the intro copy pushed into a right-hand column, which
   is why the headline and its own supporting sentence read as unrelated
   blocks sitting on opposite sides of the hero. */
.case-index-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    /* The max-width belongs on the inner column, NOT here: this element also
       carries .container, whose `margin: 0 auto` then centred the narrowed box
       inside the viewport instead of leaving it flush with every other section's
       left edge. Constrain the column and the container keeps its own geometry. */
    grid-template-columns: minmax(0, 940px);
}

.case-index-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    padding-left: 4px;
    color: var(--on-dark);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.case-index-hero h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(54px, 6.2vw, 92px);
    line-height: 0.96;
    letter-spacing: -0.035em;
    color: var(--on-dark);
    text-wrap: balance;
}

.case-index-hero-grid p {
    max-width: 620px;
    margin-top: var(--space-6);
    color: color-mix(in srgb, var(--on-dark) 82%, transparent);
    font-size: clamp(16px, 1.2vw, 18px);
    line-height: 1.75;
}

.case-index-hero-actions {
    margin-top: var(--space-7);
}

/* The shared .btn-secondary in chrome.css is built for a green surface, so on
   this blue hero it is re-skinned as a translucent white pill — the same
   treatment the design source gives the "Discuss a project" button. */
.case-index-hero-actions .btn {
    border-color: color-mix(in srgb, var(--on-dark) 46%, transparent);
    background: color-mix(in srgb, var(--on-dark) 16%, transparent);
    color: var(--on-dark);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.case-index-hero-actions .btn:hover,
.case-index-hero-actions .btn:focus-visible {
    border-color: var(--on-dark);
    background: color-mix(in srgb, var(--on-dark) 26%, transparent);
    color: var(--on-dark);
}

/* ── Grid / cards ─────────────────────────────────────── */
.case-index-intro {
    padding: 88px 0 96px;
    background: var(--bg);
}

.case-index-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
}

.case-index-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    box-shadow: var(--shadow);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.case-index-card:hover,
.case-index-card:focus-within {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.case-index-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9.6;
    overflow: hidden;
    background: var(--surface);
}

.case-index-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.62));
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.case-index-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.case-index-card:hover .case-index-image img,
.case-index-card:focus-within .case-index-image img {
    transform: scale(1.025);
}

.case-index-card:hover .case-index-image::after,
.case-index-card:focus-within .case-index-image::after {
    opacity: 1;
}

.case-index-image > span {
    position: absolute;
    z-index: 2;
    right: 24px;
    bottom: 21px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--on-dark);
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.case-index-card:hover .case-index-image > span,
.case-index-card:focus-within .case-index-image > span {
    opacity: 1;
    transform: none;
}

.case-index-image i {
    font-size: 17px;
    font-style: normal;
}

.case-index-copy {
    padding: 29px 31px 34px;
}

.case-index-meta {
    display: flex;
    min-height: 35px;
    justify-content: space-between;
    gap: var(--space-5);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.case-index-meta span:first-child {
    max-width: 78%;
}

.case-index-meta span:last-child {
    color: var(--fg-muted);
}

.case-index-copy h2 {
    margin-top: var(--space-3);
    font-family: var(--font-display);
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.12;
}

.case-index-copy h2 a {
    color: inherit;
    text-decoration: none;
}

.case-index-copy h2 a:hover {
    color: var(--accent-strong);
}

.case-index-copy > p {
    min-height: 70px;
    margin-top: var(--space-4);
    color: var(--fg-muted);
    font-size: 14px;
    line-height: 1.75;
}

.case-index-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.case-index-tags span {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--fg-muted);
    background: var(--surface);
    font-size: 10px;
    font-weight: 750;
}

/* ── CTA band (shared visual language with detail page) ── */
.case-cta-section {
    padding: 20px 0 88px;
    background: var(--bg);
}

.case-cta-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-6);
    align-items: end;
    overflow: hidden;
    padding: clamp(32px, 5.5vw, 64px);
    border-radius: var(--radius-lg);
    color: var(--on-brand);
    background: radial-gradient(circle at 90% 12%, rgba(255, 255, 255, 0.16), transparent 25%), linear-gradient(135deg, var(--surface-brand), var(--green-800));
    box-shadow: var(--shadow-lg);
}

.case-cta-card span {
    display: block;
    margin-bottom: var(--space-3);
    color: color-mix(in srgb, var(--on-brand) 72%, transparent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.case-cta-card h2 {
    max-width: 760px;
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.case-cta-card .btn {
    background: var(--bg-elevated);
    color: var(--green-800);
}

.case-cta-card .btn:hover {
    background: var(--surface);
}

.cs-empty {
    background: var(--bg-elevated);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    color: var(--fg-muted);
}

@media (max-width: 900px) {
    .case-index-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .case-index-hero {
        min-height: auto;
        padding-top: 7.5rem;
    }

    .case-index-hero-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .case-cta-card {
        grid-template-columns: 1fr;
    }
}
