.detail-page {
    background: var(--paper-bright);
    color: var(--ink);
}

.detail-page .site-header {
    background: rgba(11, 16, 32, 0.96);
}

.detail-header .header-inner {
    grid-template-columns: 1fr auto;
}

.detail-back {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border: 1px solid var(--border-dark);
    border-radius: 999px;
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
}

.detail-back:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.case-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(58px, 7vw, 98px) 0 0;
    background:
        radial-gradient(circle at 78% 6%, rgba(94, 124, 255, 0.18), transparent 34rem),
        var(--ink);
    color: var(--white);
}

.case-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.026) 1px, transparent 1px);
    background-size: 72px 72px;
}

.case-hero-grid,
.case-facts {
    position: relative;
}

.case-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1.18fr);
    align-items: center;
    gap: clamp(40px, 5vw, 64px);
}

.case-kicker {
    margin: 0 0 18px;
    color: var(--gold);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.case-hero h1 {
    max-width: 11ch;
    margin: 0;
    font-size: clamp(3.4rem, 6vw, 5.3rem);
    line-height: 0.94;
    letter-spacing: -0.065em;
}

.case-summary {
    max-width: 58ch;
    margin: 24px 0 0;
    color: #c6cddd;
    font-size: clamp(1.02rem, 1.45vw, 1.18rem);
    line-height: 1.75;
}

.case-scope-callout {
    display: grid;
    gap: 5px;
    max-width: 62ch;
    margin-top: 24px;
    padding: 16px 18px;
    border: 1px solid rgba(231, 194, 101, 0.35);
    border-left: 4px solid var(--gold);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
}

.case-scope-callout strong {
    color: var(--white);
    font-size: 0.94rem;
}

.case-scope-callout span {
    color: #b8c1d4;
    font-size: 0.82rem;
    line-height: 1.55;
}

.case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 30px;
}

.case-status-note {
    max-width: 62ch;
    margin: 20px 0 0;
    color: #9ca6bb;
    font-size: 0.82rem;
}

.case-figure {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--border-dark);
    border-radius: 24px;
    background: #151d31;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.28);
}

.case-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    object-fit: cover;
}

.case-figure.is-logo {
    background: #ffffff;
}

.case-figure.is-logo img {
    padding: clamp(34px, 6vw, 72px);
    object-fit: contain;
}

.case-figure.is-logo figcaption {
    background: var(--ink-soft);
}

.case-figure figcaption {
    padding: 13px 16px;
    border-top: 1px solid var(--border-dark);
    color: #9ca6bb;
    font-size: 0.74rem;
}

.case-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: clamp(48px, 7vw, 78px) auto 0;
    border-top: 1px solid var(--border-dark);
}

.case-facts > div {
    min-width: 0;
    padding: 24px 22px 28px;
    border-right: 1px solid var(--border-dark);
}

.case-facts > div:first-child {
    border-left: 1px solid var(--border-dark);
}

.case-facts dt {
    margin-bottom: 6px;
    color: #7f899f;
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.case-facts dd {
    margin: 0;
    color: #e9ecf4;
    font-size: 0.86rem;
    font-weight: 700;
}

.case-main {
    padding-block: clamp(64px, 8vw, 108px);
    background: var(--paper-bright);
}

.case-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 780px);
    justify-content: center;
    gap: clamp(48px, 7vw, 100px);
}

.case-nav {
    align-self: start;
    position: sticky;
    top: 108px;
    padding: 20px;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background: #f7f5ef;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
}

.case-nav strong {
    display: block;
    margin-bottom: 12px;
    color: #5263bd;
    font-size: 0.67rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.case-nav a {
    display: block;
    padding: 8px 0;
    color: #505969;
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.case-nav a + a {
    border-top: 1px solid rgba(11, 16, 32, 0.08);
}

.case-nav a:hover {
    color: var(--ink);
}

.case-nav a:focus-visible {
    outline-color: var(--blue-dark);
}

.case-content {
    min-width: 0;
}

.case-section {
    scroll-margin-top: 106px;
}

.case-section + .case-section {
    margin-top: clamp(54px, 6vw, 72px);
    padding-top: clamp(46px, 5vw, 60px);
    border-top: 1px solid var(--border-light);
}

.case-section-label {
    margin: 0 0 12px;
    color: #5263bd;
    font-size: 0.69rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.case-section h2 {
    max-width: 18ch;
    margin: 0;
    font-size: clamp(2.25rem, 3.9vw, 3.25rem);
    line-height: 1;
    letter-spacing: -0.052em;
}

.case-section h3 {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.case-section > p,
.case-section li {
    color: #4f5868;
}

.case-section > p {
    max-width: 67ch;
    margin: 20px 0 0;
    font-size: 1rem;
    line-height: 1.8;
}

.case-section .case-lead {
    color: #2e3747;
    font-size: 1.12rem;
}

.case-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.case-card {
    padding: 20px 0 0;
    border-top: 1px solid var(--border-light);
    background: transparent;
}

.case-card p {
    margin: 10px 0 0;
    color: #596170;
    font-size: 0.9rem;
}

.case-card ul {
    margin: 13px 0 0;
    padding-left: 19px;
}

.case-card li + li {
    margin-top: 7px;
}

.decision-list {
    display: grid;
    gap: 12px;
    margin: 30px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: decisions;
}

.decision-list li {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 16px;
    padding: 22px 0;
    border-top: 1px solid var(--border-light);
    background: transparent;
    counter-increment: decisions;
}

.decision-list li::before {
    content: counter(decisions, decimal-leading-zero);
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--ink);
    color: var(--white);
    font-size: 0.72rem;
    font-weight: 900;
}

.decision-list strong {
    display: block;
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 1rem;
}

.workflow {
    margin-top: 30px;
    padding: 28px;
    border-radius: 20px;
    background: var(--ink);
    color: var(--white);
}

.workflow + .workflow {
    margin-top: 14px;
}

.workflow h3 {
    color: var(--gold);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.flow-list {
    display: grid;
    grid-template-columns: repeat(var(--flow-count, 5), minmax(0, 1fr));
    gap: 28px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.flow-list.flow-4 {
    --flow-count: 4;
}

.flow-list.flow-5 {
    --flow-count: 5;
}

.flow-list.flow-6 {
    --flow-count: 6;
}

.flow-list li {
    position: relative;
    display: flex;
    min-height: 92px;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
    color: #e8ebf4;
    font-size: 0.77rem;
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.flow-list li:not(:last-child)::after {
    content: "→";
    position: absolute;
    top: 50%;
    right: -22px;
    color: var(--gold);
    font-size: 1.1rem;
    transform: translateY(-50%);
}

.case-note {
    margin-top: 24px;
    padding: 18px 20px;
    border-left: 4px solid var(--gold);
    background: #f4eee1;
    color: #4d4a42;
    font-size: 0.9rem;
}

.quality-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

.quality-grid article {
    padding: 20px 0 0;
    border-top: 1px solid var(--border-light);
}

.quality-grid p {
    margin: 9px 0 0;
    color: #596170;
    font-size: 0.89rem;
}

.case-outcome {
    padding: 34px;
    border-radius: 22px;
    background: var(--ink);
    color: var(--white);
}

.case-outcome h2 {
    color: var(--white);
}

.case-outcome > p {
    color: #bcc4d5;
}

.case-outcome .case-section-label {
    color: var(--gold);
}

.case-next {
    padding: 0 0 clamp(66px, 8vw, 100px);
    background: var(--paper-bright);
}

.case-next-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.case-next a {
    display: flex;
    min-height: 104px;
    justify-content: space-between;
    flex-direction: column;
    padding: 22px;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background: #f7f5ef;
    text-decoration: none;
}

.case-next a:hover {
    background: #eeece5;
}

.case-next span {
    color: #5263bd;
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.case-next strong {
    font-size: 1.2rem;
}

.detail-page .site-footer {
    background: var(--ink);
    color: var(--white);
}

/* Resume version library */
.resume-page {
    background: var(--paper-bright);
}

.resume-library-hero {
    position: relative;
    overflow: hidden;
    padding-block: clamp(58px, 6vw, 86px);
    background:
        radial-gradient(circle at 80% 8%, rgba(102, 124, 255, 0.22), transparent 30rem),
        radial-gradient(circle at 10% 92%, rgba(234, 191, 102, 0.09), transparent 26rem),
        var(--ink);
    color: var(--white);
}

.resume-library-hero::before {
    position: absolute;
    inset: 0;
    opacity: 0.17;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(to bottom, black, transparent 92%);
    content: "";
    pointer-events: none;
}

.resume-library-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(350px, 0.82fr);
    align-items: center;
    gap: clamp(30px, 5vw, 68px);
}

.resume-library-intro h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(3.4rem, 6vw, 5.9rem);
    letter-spacing: -0.062em;
    line-height: 0.94;
}

.resume-library-intro > p:not(.eyebrow) {
    max-width: 64ch;
    margin: 24px 0 0;
    color: #c4ccdb;
    font-size: 1rem;
    line-height: 1.72;
}

.primary-resume-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

.primary-resume-strip span {
    color: var(--gold);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.primary-resume-strip h2 {
    margin: 5px 0 0;
    font-size: 1.18rem;
    letter-spacing: -0.025em;
}

.primary-resume-strip p {
    margin: 4px 0 0;
    color: #aeb8ca;
    font-size: 0.78rem;
}

.primary-resume-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.resume-hero-file {
    color: #d9deea;
    white-space: nowrap;
}

.resume-foundation {
    display: flex;
    flex-direction: column;
    padding: clamp(28px, 3.5vw, 42px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-top: 4px solid var(--gold);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(29, 39, 64, 0.94), rgba(18, 25, 43, 0.94));
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.25);
}

.resume-foundation .card-label {
    color: var(--gold);
}

.resume-foundation h2 {
    max-width: 12ch;
    margin: 0;
    color: var(--white);
    font-size: clamp(2rem, 3vw, 2.8rem);
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.resume-foundation dl {
    display: grid;
    gap: 0;
    margin: 28px 0 0;
}

.resume-foundation dl > div {
    padding: 17px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.resume-foundation dt {
    color: var(--blue-bright);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resume-foundation dd {
    margin: 5px 0 0;
    color: #d6dbea;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.45;
}

.resume-choices-section {
    padding-block: clamp(58px, 6vw, 84px);
    background: var(--paper-bright);
    color: var(--ink);
}

.resume-choices-heading {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.7fr);
    align-items: end;
    gap: clamp(30px, 6vw, 90px);
}

.resume-choices-heading h2 {
    max-width: 15ch;
    margin: 0;
    font-size: clamp(2.7rem, 5vw, 4.5rem);
    letter-spacing: -0.06em;
    line-height: 0.96;
}

.resume-choices-heading > p {
    max-width: 46ch;
    margin: 0;
    color: #596273;
    line-height: 1.7;
}

.resume-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 36px;
}

.resume-choice {
    --choice-accent: var(--blue);
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    padding: clamp(26px, 3.2vw, 38px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background:
        radial-gradient(circle at 92% 4%, color-mix(in srgb, var(--choice-accent) 14%, transparent), transparent 17rem),
        #f4f2ec;
    box-shadow: 0 18px 48px rgba(11, 16, 32, 0.08);
}

.resume-choice::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--choice-accent);
    content: "";
}

.resume-choice-security {
    --choice-accent: var(--gold);
}

.resume-choice-number {
    margin: 0;
    color: var(--blue-dark);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.resume-choice-security .resume-choice-number {
    color: #8a671f;
}

.resume-choice h3 {
    max-width: 14ch;
    margin: 10px 0 0;
    font-size: clamp(2rem, 3.5vw, 3rem);
    letter-spacing: -0.052em;
    line-height: 1;
}

.resume-choice-role {
    margin: 12px 0 0;
    color: #4f5b70;
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.resume-choice-use {
    margin: 24px 0 0;
    padding: 16px 18px;
    border-left: 3px solid var(--choice-accent);
    background: rgba(255, 255, 255, 0.56);
    color: #465164;
    font-size: 0.88rem;
    line-height: 1.62;
}

.resume-choice-evidence {
    margin-top: 26px;
}

.resume-choice-evidence h4 {
    margin: 0;
    color: var(--ink);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resume-choice-evidence ul {
    display: grid;
    gap: 12px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.resume-choice-evidence li {
    position: relative;
    padding-left: 20px;
    color: #535e6e;
    font-size: 0.84rem;
    line-height: 1.55;
}

.resume-choice-evidence li::before {
    position: absolute;
    top: 0.5em;
    left: 0;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--choice-accent);
    content: "";
}

.resume-choice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: auto;
    padding-top: 30px;
}

.resume-decision-section {
    padding-block: clamp(34px, 4vw, 48px);
    background: var(--paper-muted);
    color: var(--ink);
}

.resume-decision {
    display: grid;
    grid-template-columns: minmax(250px, 0.9fr) minmax(0, 1.15fr) auto;
    align-items: center;
    gap: clamp(28px, 5vw, 70px);
    padding-block: 20px;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.resume-decision h2 {
    max-width: 16ch;
    margin: 0;
    font-size: clamp(2rem, 3vw, 2.7rem);
    letter-spacing: -0.045em;
    line-height: 1.02;
}

.resume-decision > p {
    margin: 0;
    color: #596273;
    line-height: 1.7;
}

@media (max-width: 860px) {
    .case-hero-grid {
        grid-template-columns: 1fr;
    }

    .case-hero-copy {
        max-width: 720px;
    }

    .case-hero h1 {
        max-width: 14ch;
    }

    .case-figure {
        max-width: 720px;
    }

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

    .case-facts > div:nth-child(3) {
        border-left: 1px solid var(--border-dark);
    }

    .case-facts > div:nth-child(n + 3) {
        border-top: 1px solid var(--border-dark);
    }

    .case-layout {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .case-nav {
        position: static;
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding: 10px;
    }

    .case-nav strong {
        display: none;
    }

    .case-nav a,
    .case-nav a + a {
        flex: 0 0 auto;
        padding: 8px 11px;
        border: 0;
        border-radius: 8px;
        background: #ebe8df;
    }

    .resume-library-hero-grid,
    .resume-choices-heading,
    .resume-choice-grid,
    .resume-decision {
        grid-template-columns: 1fr;
    }

    .resume-library-intro {
        max-width: 720px;
    }

    .resume-choices-heading > p {
        max-width: 64ch;
    }

    .resume-decision {
        align-items: start;
        gap: 22px;
    }

    .resume-decision .button {
        justify-self: start;
    }
}

@media (max-width: 640px) {
    .detail-header .header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .detail-header .brand > span:last-child {
        display: inline;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .detail-back {
        padding-inline: 12px;
        font-size: 0.72rem;
    }

    .case-hero {
        padding-top: 48px;
    }

    .case-hero h1 {
        font-size: clamp(3rem, 16vw, 4.25rem);
    }

    .case-actions {
        display: grid;
    }

    .case-grid,
    .quality-grid,
    .case-next-inner {
        grid-template-columns: 1fr;
    }

    .flow-list {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .flow-list li {
        min-height: 70px;
    }

    .flow-list li:not(:last-child)::after {
        content: "↓";
        top: auto;
        right: 50%;
        bottom: -24px;
        transform: translateX(50%);
    }

    .workflow,
    .case-outcome {
        padding: 22px;
    }

    .resume-library-hero {
        padding-block: 48px;
    }

    .resume-library-intro h1 {
        max-width: none;
        font-size: clamp(3rem, 13.5vw, 4.4rem);
    }

    .primary-resume-strip {
        grid-template-columns: 1fr;
        align-items: start;
        padding: 20px;
    }

    .primary-resume-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .resume-choice {
        padding: 24px;
    }

    .resume-choice h3 {
        max-width: none;
    }

    .resume-choice-actions {
        display: grid;
    }

    .resume-choice-actions .button,
    .resume-decision .button {
        width: 100%;
    }
}

@media (max-width: 340px) {
    .case-facts {
        grid-template-columns: 1fr;
    }

    .case-facts > div,
    .case-facts > div:first-child,
    .case-facts > div:nth-child(3) {
        border-left: 1px solid var(--border-dark);
    }

    .case-facts > div + div {
        border-top: 1px solid var(--border-dark);
    }
}

@media (max-width: 360px) {
    .detail-header .brand > span:last-child {
        display: none;
    }
}

@media (max-width: 300px) {
    .detail-header .brand > span:last-child {
        display: none;
    }

    .case-hero h1,
    .no-wrap {
        white-space: normal;
    }

    .decision-list li {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 0.45in;
    }

    .resume-page {
        background: #fff;
    }

    .resume-page .site-header,
    .resume-page .site-footer,
    .primary-resume-actions,
    .resume-choice-actions,
    .resume-decision-section {
        display: none !important;
    }

    .resume-page .shell {
        width: 100%;
    }

    .resume-library-hero,
    .resume-choices-section {
        padding-block: 28px;
    }

    .resume-library-hero {
        background: #fff;
        color: #101827;
    }

    .resume-library-intro > p:not(.eyebrow),
    .primary-resume-strip p {
        color: #3f4858;
    }

    .primary-resume-strip,
    .resume-foundation,
    .resume-choice {
        break-inside: avoid;
        box-shadow: none;
    }

    .resume-foundation {
        background: #eef0f4;
        color: #101827;
    }

    .resume-foundation h2,
    .resume-foundation dd {
        color: #101827;
    }

    a {
        color: inherit;
    }
}
