@import url("ai-agent-workflow-repair-foundation.css");

/* Page-specific semantic scanner and evidence-led case archive */
.nm-agent-paradox {
    position: relative;
    min-height: 520px;
    margin: 0;
    padding: 34px;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(5,6,10,.78);
    box-shadow: 0 32px 90px rgba(0,0,0,.5);
}
.nm-agent-paradox::before {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(225,29,51,.16);
    pointer-events: none;
}
.nm-agent-paradox-score {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    min-height: 230px;
    margin-top: 28px;
    border-bottom: 1px solid var(--repair-line);
}
.nm-agent-paradox-word {
    color: var(--repair-ink);
    font: 800 clamp(34px, 3vw, 44px)/.9 var(--nm-font-display);
    letter-spacing: -.05em;
    text-transform: uppercase;
}
.nm-agent-paradox-word.danger { color: var(--repair-red-hi); text-align: right; }
.nm-agent-paradox-mark { color: #5a5b63; font: 400 58px/1 var(--nm-font-mono); }
.nm-agent-paradox-trace {
    display: grid;
    grid-template-columns: auto 1fr auto auto 1fr auto auto 1.4fr;
    gap: 10px 14px;
    align-items: baseline;
    padding: 34px 0 26px;
    font: 400 10px/1.35 var(--nm-font-mono);
    text-transform: uppercase;
}
.nm-agent-paradox-trace span { color: #777985; }
.nm-agent-paradox-trace b { color: var(--repair-ink); font-weight: 400; }
.nm-agent-paradox-trace b:last-child { color: var(--repair-red-hi); }
.nm-agent-paradox-trace i { color: #5a5b63; font-style: normal; }
.nm-agent-paradox-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #747680;
    font: 400 10px var(--nm-font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nm-agent-paradox-foot span:last-child { color: #7cc7c0; }

.nm-agent-case-stage { min-height: 0; }
.nm-agent-case-panel {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr);
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 48px 0;
    gap: 0;
}
.nm-agent-case-visual {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin: 0;
    padding-right: 44px;
    border-right: 1px solid var(--repair-line);
}
.nm-agent-case-visual img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid rgba(255,255,255,.13);
    box-shadow: 0 24px 60px rgba(0,0,0,.38);
}
.nm-agent-case-visual figcaption {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-top: 18px;
    color: #777985;
    font: 400 10px/1.5 var(--nm-font-mono);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.nm-agent-case-visual a { color: var(--repair-red-hi); }
.nm-agent-case-copy {
    padding: 0 0 38px 44px;
    border-right: 0;
}
.nm-agent-case-copy h3 { font-size: clamp(34px, 3.8vw, 58px); }
.nm-agent-case-proof {
    grid-column: 2;
    padding: 30px 0 0 44px;
    border-top: 1px solid var(--repair-line);
    background: transparent;
}
.nm-agent-case-proof ul { margin-top: 18px; }
.nm-agent-case-proof li { padding-block: 13px; }

.nm-agent-story-ledger {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 1px;
    align-items: stretch;
    border: 1px solid var(--repair-line);
    background: var(--repair-line);
}
.nm-agent-story-row {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(153, 0, 1, .10), #08090d 42%);
    transition: background 260ms cubic-bezier(.16,1,.3,1);
}
.nm-agent-story-row:nth-child(1) { grid-column: span 7; }
.nm-agent-story-row:nth-child(2) { grid-column: span 5; }
.nm-agent-story-row:nth-child(3) { grid-column: span 4; }
.nm-agent-story-row:nth-child(4) { grid-column: span 8; }
.nm-agent-story-row:nth-child(5) { grid-column: span 5; }
.nm-agent-story-row:nth-child(6) { grid-column: span 3; }
.nm-agent-story-row:nth-child(7) { grid-column: span 4; }
.nm-agent-story-row:hover { background: linear-gradient(155deg, rgba(153, 0, 1, .18), #0c090d 48%); }
.nm-agent-story-row figure,
.nm-agent-story-row:nth-child(even) figure {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 12 / 7;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-bottom: 1px solid var(--repair-line);
}
.nm-agent-story-row:nth-child(1) figure,
.nm-agent-story-row:nth-child(4) figure { aspect-ratio: 16 / 7; }
.nm-agent-story-row img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 500ms cubic-bezier(.16,1,.3,1);
}
.nm-agent-story-row:hover img { transform: scale(1.025); }
.nm-agent-story-index {
    position: absolute;
    z-index: 1;
    top: 16px;
    left: 16px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.16);
    background: rgba(5,6,10,.88);
    color: var(--repair-ink);
    font: 800 24px/1 var(--nm-font-display);
}
.nm-agent-story-copy,
.nm-agent-story-row:nth-child(even) .nm-agent-story-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    grid-column: auto;
    grid-row: auto;
    min-width: 0;
    padding: 28px;
}
.nm-agent-story-copy > span {
    color: var(--repair-red-hi);
    font: 400 10px var(--nm-font-mono);
    letter-spacing: .14em;
    text-transform: uppercase;
}
.nm-agent-story-copy h3 {
    max-width: none;
    margin: 16px 0 18px;
    color: var(--repair-ink);
    font: 800 clamp(28px, 2.4vw, 38px)/.96 var(--nm-font-display);
    letter-spacing: -.025em;
    text-transform: uppercase;
}
.nm-agent-story-copy p {
    max-width: 48ch;
    margin: 0 0 22px;
    color: #aaa6a6;
    font-size: 15px;
    line-height: 1.6;
}
.nm-agent-story-copy .nm-agent-story-proof { min-width: 0; margin-top: auto; overflow-wrap: anywhere; }
.nm-agent-story-copy a {
    display: inline-block;
    margin-top: 22px;
    color: var(--repair-red-hi);
    font: 400 11px var(--nm-font-mono);
    letter-spacing: .12em;
    text-transform: uppercase;
}
.nm-agent-outcome {
    padding-block: var(--repair-section-space);
    border-block: 1px solid var(--repair-line);
    background: linear-gradient(125deg, #07080c, #110407 72%, #07080c);
}
.nm-agent-outcome-head {
    display: grid;
    grid-template-columns: 1.25fr .75fr;
    gap: clamp(48px, 6vw, 80px);
    align-items: end;
    margin-bottom: var(--repair-content-gap);
}
.nm-agent-outcome-head > p { max-width: 540px; margin: 0; font-size: 18px; line-height: 1.7; }
.nm-agent-outcome-sequence { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--repair-line); }
.nm-agent-outcome-step { position: relative; min-height: 270px; padding: 28px; border-right: 1px solid var(--repair-line); }
.nm-agent-outcome-step:last-child { border-right: 0; }
.nm-agent-outcome-step > span { color: #666873; font: 400 11px var(--nm-font-mono); }
.nm-agent-outcome-step strong { display: block; margin: 74px 0 18px; color: var(--repair-ink); font: 800 clamp(34px, 4vw, 56px)/1 var(--nm-font-display); }
.nm-agent-outcome-step p { max-width: 23ch; margin: 0; line-height: 1.55; }
.nm-agent-outcome-step.danger strong { color: var(--repair-red-hi); }
.nm-agent-outcome-step.success strong { color: #7cc7c0; }

@media (max-width: 980px) {
    .nm-agent-case-panel { grid-template-columns: 1fr; }
    .nm-agent-case-visual, .nm-agent-case-copy, .nm-agent-case-proof { grid-column: 1; grid-row: auto; }
    .nm-agent-case-visual { padding: 0 0 38px; border: 0; border-bottom: 1px solid var(--repair-line); }
    .nm-agent-case-copy { padding: 38px 0; }
    .nm-agent-case-proof { padding: 32px 0; }
    .nm-agent-story-ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nm-agent-story-row,
    .nm-agent-story-row:nth-child(n) { grid-column: span 1; gap: 0; }
    .nm-agent-story-row:nth-child(1),
    .nm-agent-story-row:nth-child(4),
    .nm-agent-story-row:nth-child(7) { grid-column: 1 / -1; }
    .nm-agent-outcome-head { grid-template-columns: 1fr; gap: 28px; }
    .nm-agent-outcome-sequence { grid-template-columns: 1fr 1fr; }
    .nm-agent-outcome-step:nth-child(2) { border-right: 0; }
    .nm-agent-outcome-step:nth-child(-n+2) { border-bottom: 1px solid var(--repair-line); }
}

@media (max-width: 640px) {
    .nm-agent-paradox { min-height: 0; padding: 22px; }
    .nm-agent-paradox-score { grid-template-columns: 1fr; gap: 12px; padding: 34px 0; text-align: center; }
    .nm-agent-paradox-word, .nm-agent-paradox-word.danger { font-size: 48px; text-align: center; }
    .nm-agent-paradox-mark { font-size: 38px; }
    .nm-agent-paradox-trace { grid-template-columns: 1fr 1fr; padding-block: 26px; }
    .nm-agent-paradox-trace i { display: none; }
    .nm-agent-paradox-foot { flex-direction: column; }
    .nm-agent-case-panel { padding: 38px 0; }
    .nm-agent-case-visual figcaption { flex-direction: column; }
    .nm-agent-case-copy h3 { font-size: 38px; }
    .nm-agent-story-ledger { grid-template-columns: 1fr; }
    .nm-agent-story-row:nth-child(n) { grid-column: 1; }
    .nm-agent-story-row {
        display: flex;
        gap: 0;
        min-height: 0;
        padding: 0;
    }
    .nm-agent-story-index { font-size: 22px; }
    .nm-agent-story-copy { padding: 24px; }
    .nm-agent-story-copy h3 { font-size: clamp(25px, 7vw, 30px); overflow-wrap: anywhere; }
    .nm-agent-outcome { padding: 92px 0; }
    .nm-agent-outcome-sequence { grid-template-columns: 1fr; }
    .nm-agent-outcome-step { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--repair-line); }
    .nm-agent-outcome-step:last-child { border-bottom: 0; }
    .nm-agent-outcome-step strong { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .nm-agent-repair-page *, .nm-agent-repair-page *::before, .nm-agent-repair-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
    }
}
