/* ============================================================================
   Case studies: /case-studies/ and its seven detail pages.
   Loads after service-page.css, so it reuses its .brx-* type, buttons, hero,
   FAQ and CTA band, and adds the case-study layer on top.

   Direction: Swiss industrial print inside the 360Kreations palette. Paper
   ground, carbon-teal ink, one red accent. Rigid hairline grids (gap: 1px on
   a tinted parent), square corners on everything case-specific, monospace
   micro-type for file numbers and metadata, and very large numerals for the
   results. Buttons stay pill-shaped because they are the site's shared
   buttons, not case-study components.
   ========================================================================== */

/* ------------------------------------------------------- listing hero ---- */
.cs-index-hero { min-height: min(86dvh, 800px); }
.cs-index-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 72px;
    align-items: center;
}
@media (max-width: 991px) { .cs-index-grid { grid-template-columns: 1fr; gap: 48px; } }

/* Index panel: the three lead results, each a link into its case file. */
.cs-board {
    border: 1px solid var(--ind-rule-light);
    background: rgba(4, 30, 41, 0.55);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
}
.cs-board-head {
    display: flex;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ind-rule-light);
    color: rgba(255, 255, 255, 0.6);
}
.cs-board-head .is-live { color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.cs-board-head .is-live::before {
    content: "";
    width: 7px;
    height: 7px;
    background: var(--ind-red);
    animation: cs-blink 1.6s steps(2, jump-none) infinite;
}
@keyframes cs-blink { 50% { opacity: 0.2; } }
.cs-board-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 6px 20px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--ind-rule-light);
    text-decoration: none;
    color: #fff;
    transition: background-color 200ms ease;
}
.cs-board-row:last-of-type { border-bottom: 0; }
.cs-board-v {
    grid-column: 1;
    font-size: clamp(34px, 3.4vw, 50px);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: -0.045em;
    color: #fff;
}
.cs-board-row:first-of-type .cs-board-v { color: var(--color-brand); }
.cs-board-l { grid-column: 1; color: rgba(255, 255, 255, 0.7); font-size: 14px; }
.cs-board-who {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.55);
    text-align: right;
}
.cs-board-who .brx-arrow { transition: transform 200ms var(--ind-ease); }
@media (hover: hover) and (pointer: fine) {
    .cs-board-row:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
    .cs-board-row:hover .cs-board-who { color: #fff; }
    .cs-board-row:hover .brx-arrow { transform: translateX(3px); }
}
.cs-board-foot {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--ind-rule-light);
}
.cs-board-foot div { padding: 14px 20px; color: rgba(255, 255, 255, 0.55); }
.cs-board-foot div + div { border-left: 1px solid var(--ind-rule-light); }
.cs-board-foot b { display: block; font-family: var(--font-sans); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: #fff; margin-bottom: 2px; }
@media (max-width: 575px) { .cs-board-who { display: none; } }

/* ------------------------------------------------------------ listing ---- */
.cs-listing { background: var(--ind-paper); }

/* Filter console: square chips, a live count, one hairline box. */
.cs-console {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-top: 56px;
    border: 1px solid var(--ind-rule);
    background: var(--color-surface);
}
.cs-console-rows { display: grid; }
.cs-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
}
.cs-filter + .cs-filter { border-top: 1px solid var(--ind-rule); }
.cs-filter-label { width: 96px; color: var(--color-body); }
.cs-chip {
    border: 1px solid var(--ind-rule);
    background: transparent;
    color: var(--ind-ink);
    border-radius: 0;
    padding: 8px 14px;
    font-family: var(--ind-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms var(--ind-ease);
}
.cs-chip:active { transform: scale(0.97); }
.cs-chip.is-active { background: var(--ind-deep); border-color: var(--ind-deep); color: #fff; }
@media (hover: hover) and (pointer: fine) {
    .cs-chip:not(.is-active):hover { border-color: var(--ind-deep); }
}
.cs-chip:focus-visible { outline: 2px solid var(--ind-red); outline-offset: 2px; }
.cs-count {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 4px;
    padding: 14px 24px;
    border-left: 1px solid var(--ind-rule);
    color: var(--color-body);
}
.cs-count output {
    font-family: var(--font-sans);
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ind-ink);
}
.cs-count output small { font-size: 18px; color: var(--color-muted); letter-spacing: 0; }
@media (max-width: 767px) {
    .cs-console { grid-template-columns: 1fr; }
    .cs-count { flex-direction: row; justify-content: space-between; align-items: center; border-left: 0; border-top: 1px solid var(--ind-rule); padding: 12px 18px; }
    .cs-count output { font-size: 28px; }
    .cs-filter-label { width: 100%; }
}

/* ------------------------------------------------------------- cards ----- */
/* A 12-column grid whose spans alternate by row, 7/5, 4/4/4, 5/7, so the
   page never settles into identical thirds. data-span is set in PHP for the
   first render and recomputed by case-studies.js after filtering, which is
   what keeps the rows full when some cards are hidden. */
.cs-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-top: 20px;
}
.cs-card { grid-column: span 4; }
.cs-card[data-span="5"]  { grid-column: span 5; }
.cs-card[data-span="6"]  { grid-column: span 6; }
.cs-card[data-span="7"]  { grid-column: span 7; }
.cs-card[data-span="12"] { grid-column: span 12; }
@media (max-width: 991px) {
    .cs-card, .cs-card[data-span] { grid-column: span 6; }
    .cs-card[data-span="12"] { grid-column: span 12; }
}
@media (max-width: 640px) {
    .cs-grid { grid-template-columns: 1fr; gap: 16px; }
    .cs-card, .cs-card[data-span] { grid-column: auto; }
}

.cs-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--ind-rule);
    text-decoration: none;
    color: inherit;
    transition: border-color 220ms ease, transform 260ms var(--ind-ease), box-shadow 260ms var(--ind-ease);
}
.cs-card[hidden] { display: none; }

.cs-card-img {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--color-surface-alt);
    overflow: hidden;
    border-bottom: 1px solid var(--ind-rule);
}
.cs-card[data-span="7"] .cs-card-img,
.cs-card[data-span="6"] .cs-card-img { aspect-ratio: 16 / 9.4; }
.cs-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 700ms var(--ind-ease);
}
/* Index chip, top-left over the image. */
.cs-card-no {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    padding: 8px 12px;
    background: var(--ind-deep);
    color: #fff;
}
/* Result plate: the one number that earns the click, sitting on the image
   edge like a label on a crate. */
.cs-card-plate {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    align-items: baseline;
    gap: 10px;
    max-width: calc(100% - 24px);
    padding: 12px 16px 11px;
    background: var(--ind-red);
    color: #fff;
}
.cs-card-plate strong { font-size: 30px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; color: #fff; }
.cs-card-plate span { font-size: 13px; line-height: 1.25; color: rgba(255, 255, 255, 0.92); }

.cs-card-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 0; }
.cs-card-tag { color: var(--ind-red); margin-bottom: 12px; }
.cs-card h3 {
    font-size: clamp(19px, 1.5vw, 23px);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--ind-ink);
    margin: 0 0 10px;
}
.cs-card p { font-size: 15px; line-height: 1.6; color: var(--color-body); margin: 0 0 22px; max-width: 46ch; }

/* The rest of the published results, as a hairline strip. */
.cs-card-stats {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 1px;
    margin: auto -24px 0;
    background: var(--ind-rule);
    border-top: 1px solid var(--ind-rule);
}
.cs-card-stats div { background: var(--color-surface); padding: 14px 24px; }
.cs-card-stats b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ind-ink); line-height: 1.1; }
.cs-card-stats span { display: block; font-size: 12px; line-height: 1.35; color: var(--color-body); margin-top: 4px; }
.cs-card-scope { margin: auto -24px 0; padding: 14px 24px; border-top: 1px solid var(--ind-rule); font-size: 14px; color: var(--color-body); }

.cs-card-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 -24px;
    padding: 15px 24px;
    border-top: 1px solid var(--ind-rule);
    color: var(--ind-ink);
    transition: background-color 220ms ease, color 220ms ease;
}
.cs-card-link .brx-arrow { transition: transform 200ms var(--ind-ease); }

@media (hover: hover) and (pointer: fine) {
    .cs-card:hover { border-color: var(--ind-rule-strong); transform: translateY(-3px); box-shadow: 0 24px 44px -28px rgba(7, 52, 71, 0.5); }
    .cs-card:hover .cs-card-img img { transform: scale(1.04); }
    .cs-card:hover .cs-card-link { background: var(--ind-deep); color: #fff; }
    .cs-card:hover .brx-arrow { transform: translateX(3px); }
}
.cs-card:active { transform: scale(0.99); }
.cs-card:focus-visible { outline: 2px solid var(--ind-red); outline-offset: 3px; }

/* Full-width card (a lone card at the end of a filtered row): image left. */
@media (min-width: 992px) {
    .cs-card[data-span="12"] { display: grid; grid-template-columns: 7fr 5fr; }
    .cs-card[data-span="12"] .cs-card-img { aspect-ratio: auto; min-height: 360px; border-bottom: 0; border-right: 1px solid var(--ind-rule); }
}

.cs-empty { padding: 64px 24px; border: 1px dashed var(--ind-rule); text-align: center; margin-top: 20px; }
.cs-empty[hidden] { display: none; }
.cs-empty p { font-size: 17px; color: var(--color-body); margin: 0 0 20px; }
.cs-empty .brx-btn { border: 0; cursor: pointer; }

/* ======================================================= detail page ===== */

/* Hero art: the image framed by crosshair registration marks, with the lead
   result plated over its bottom-left corner. */
.cs-hero-art {
    position: relative;
    margin: 0;
    padding: 14px;
}
.cs-hero-art::before,
.cs-hero-art::after {
    content: "";
    position: absolute;
    width: 26px;
    height: 26px;
    border-color: rgba(255, 255, 255, 0.55);
    border-style: solid;
    pointer-events: none;
}
.cs-hero-art::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.cs-hero-art::after  { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.cs-hero-img {
    position: relative;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 40px 80px -36px rgba(0, 0, 0, 0.75);
}
.cs-hero-img img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 10; object-fit: cover; }
.cs-hero-plate {
    position: absolute;
    left: -18px;
    bottom: -22px;
    z-index: 2;
    min-width: 220px;
    padding: 18px 22px 16px;
    background: var(--ind-red);
    color: #fff;
    box-shadow: 0 24px 40px -24px rgba(0, 0, 0, 0.6);
}
.cs-hero-plate .ind-mono { display: block; color: rgba(255, 255, 255, 0.78); margin-bottom: 8px; }
.cs-hero-plate strong { display: block; font-size: clamp(32px, 3vw, 46px); font-weight: 700; letter-spacing: -0.045em; line-height: 0.95; color: #fff; }
.cs-hero-plate span:last-child { display: block; font-size: 14px; margin-top: 6px; color: rgba(255, 255, 255, 0.92); }
@media (max-width: 991px) { .cs-hero-plate { left: 0; } }
@media (max-width: 575px) { .cs-hero-plate { position: relative; left: auto; bottom: auto; margin-top: -8px; } }

/* Facts strip (reuses .brx-proof; these are <dl>s). */
.cs-facts { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.cs-facts dt { font-family: var(--ind-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 10px; }
.cs-facts dd { margin: 0; font-size: 19px; line-height: 1.3; color: #fff; }
@media (max-width: 767px) { .cs-facts { grid-template-columns: 1fr; row-gap: 20px; } }

/* §01 The brief: two compartments on a hairline grid. */
.cs-brief { background: var(--ind-paper); }
.cs-brief-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--ind-rule);
    border: 1px solid var(--ind-rule);
}
.cs-brief-cell {
    position: relative;
    background: var(--ind-paper);
    padding: 44px 44px 52px;
    overflow: hidden;
}
.cs-brief-cell.is-challenge { background: var(--color-surface); box-shadow: inset 0 4px 0 var(--ind-red); }
.cs-brief-cell .ind-mono { display: block; color: var(--ind-red); margin-bottom: 28px; }
/* Oversized letter set into the corner. Structure, not content: aria-hidden. */
.cs-brief-mark {
    position: absolute;
    right: -6px;
    bottom: -34px;
    font-size: 180px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(7, 52, 71, 0.13);
    pointer-events: none;
    user-select: none;
}
.ind-statement {
    position: relative;
    font-size: clamp(21px, 1.9vw, 28px);
    line-height: 1.38;
    letter-spacing: -0.015em;
    color: var(--ind-ink);
    margin: 0;
    max-width: 30ch;
}
@media (max-width: 767px) {
    .cs-brief-grid { grid-template-columns: 1fr; }
    .cs-brief-cell { padding: 32px 24px 44px; }
    .cs-brief-mark { font-size: 130px; }
}

/* §03 Results: the climax. Deep ground, scoreboard of huge numerals. */
.cs-results { background: var(--ind-deep); position: relative; overflow: hidden; }
.cs-results::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(40% 60% at 90% 0%, rgba(232, 66, 66, 0.18), transparent 70%),
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 80px 80px;
    pointer-events: none;
}
.cs-results > .brx-shell { position: relative; }
.cs-results-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 56px;
    margin-top: 56px;
    align-items: start;
}
.cs-results-body.has-image { grid-template-columns: 1fr 1fr; }
@media (max-width: 991px) { .cs-results-body.has-image { grid-template-columns: 1fr; gap: 36px; } }
.cs-results-body .brx-lede { max-width: 56ch; }
.cs-support { margin: 0; border: 1px solid var(--ind-rule-light); background: #fff; padding: 0; }
.cs-support img { width: 100%; height: auto; display: block; }

.cs-provenance { margin: 18px 0 0; color: rgba(255, 255, 255, 0.45); }
.cs-results-held { padding: 64px 0; background: var(--ind-paper); }

/* Next case file: one big link, image revealed on the right. */
.cs-next { background: var(--ind-paper); padding: 0 0 110px; }
.cs-results + .cs-next,
.cs-results-held + .cs-next { padding-top: 90px; }
.cs-next-link {
    display: grid;
    grid-template-columns: 1fr 380px;
    align-items: stretch;
    border: 1px solid var(--ind-rule);
    background: var(--color-surface);
    text-decoration: none;
    color: var(--ind-ink);
    transition: border-color 220ms ease;
}
.cs-next-copy { padding: 36px 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.cs-next-copy .ind-mono { display: flex; justify-content: space-between; gap: 16px; color: var(--color-body); }
.cs-next-copy .ind-mono b { color: var(--ind-red); font-weight: 500; }
.cs-next-title {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: clamp(26px, 3vw, 44px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--ind-ink);
}
.cs-next-title .brx-arrow { flex: none; width: 0.6em; height: 0.6em; color: var(--ind-red); transition: transform 240ms var(--ind-ease); }
.cs-next-img { overflow: hidden; border-left: 1px solid var(--ind-rule); min-height: 220px; }
.cs-next-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 700ms var(--ind-ease); }
@media (hover: hover) and (pointer: fine) {
    .cs-next-link:hover { border-color: var(--ind-rule-strong); color: var(--ind-ink); }
    .cs-next-link:hover .brx-arrow { transform: translateX(6px); }
    .cs-next-link:hover .cs-next-img img { transform: scale(1.05); }
}
@media (max-width: 767px) {
    .cs-next { padding-bottom: 72px; }
    .cs-next-link { grid-template-columns: 1fr; }
    .cs-next-img { border-left: 0; border-top: 1px solid var(--ind-rule); aspect-ratio: 16 / 9; min-height: 0; }
    .cs-next-copy { padding: 26px 22px; }
}

/* ---------------------------------------------------- reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
    .ind-ticker-track { animation: none; }
    .ind-ticker { overflow-x: auto; }
    .cs-board-head .is-live::before { animation: none; }
    .cs-card, .cs-card-img img, .cs-card .brx-arrow, .cs-chip, .cs-next-img img, .cs-next-title .brx-arrow { transition: none; }
    .cs-card:hover, .cs-card:hover .cs-card-img img, .cs-next-link:hover .cs-next-img img { transform: none; }
    .ind-js .ind-reveal { clip-path: none; transition: none; }
    .ind-step-n { transition: none; }
    .ind-score-cell::after { transition: none; }
}
