/* ============================================================
   NAG TALLER — INMERSIÓN VISUAL v1.1
   Capa escénica pura: no contiene reglas de negocio ni resultados.
   ============================================================ */

:root {
    --nag-green: #00bfa5;
    --nag-cyan: #00d9e6;
    --nag-yellow: #f7c600;
    --nag-amber: #ff9f1a;
    --nag-red: #ff3b45;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    background: #020303;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.garage-world {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    isolation: isolate;
    background: #030506;
    color: #fff;
}

.garage-scene {
    position: absolute;
    inset: -1.5%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 700ms ease, transform 1000ms cubic-bezier(.2, .7, .2, 1), filter 500ms ease;
    filter: saturate(.86) brightness(.68) contrast(1.08);
}

.garage-scene-f150 {
    background-image: url("visual/bahia_f150_1987.webp");
}

.garage-scene-gt3rs {
    background-image: url("visual/bahia_gt3rs_2024.webp");
}

.garage-scene-f1 {
    background-image: url("visual/bahia_f1_2026.webp");
}

.garage-world[data-case="f150"] .garage-scene-f150,
.garage-world[data-case="gt3rs"] .garage-scene-gt3rs,
.garage-world[data-case="f1"] .garage-scene-f1 {
    opacity: 1;
}

.garage-atmosphere,
.garage-light-response {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.garage-atmosphere {
    z-index: 2;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .08) 0%, rgba(0, 0, 0, .12) 46%, rgba(0, 0, 0, .82) 100%),
        linear-gradient(180deg, rgba(2, 6, 7, .35), transparent 32%, rgba(1, 3, 4, .56) 100%);
}

.garage-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .22;
    background-image: repeating-linear-gradient(90deg, transparent 0 84px, rgba(255, 255, 255, .025) 85px, transparent 86px);
}

.garage-light-response {
    z-index: 3;
    opacity: 0;
    transition: opacity 380ms ease;
}

.garage-world[data-outcome="success"] .garage-light-response {
    opacity: 1;
    background:
        radial-gradient(circle at 42% 44%, rgba(0, 191, 165, .22), transparent 34%),
        linear-gradient(180deg, rgba(0, 191, 165, .04), rgba(0, 191, 165, .13));
}

.garage-world[data-outcome="retry"] .garage-light-response {
    opacity: 1;
    background:
        radial-gradient(circle at 42% 44%, rgba(255, 159, 26, .18), transparent 32%),
        linear-gradient(180deg, rgba(255, 159, 26, .02), rgba(71, 39, 0, .17));
}

.garage-world[data-outcome="critical"] .garage-light-response {
    opacity: 1;
    background:
        radial-gradient(circle at 42% 44%, rgba(255, 59, 69, .19), transparent 30%),
        linear-gradient(180deg, rgba(105, 0, 7, .08), rgba(255, 59, 69, .16));
}

.world-identity {
    position: absolute;
    z-index: 5;
    top: clamp(22px, 4vh, 52px);
    left: clamp(22px, 3.3vw, 58px);
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: 34vw;
    padding-left: 15px;
    border-left: 3px solid var(--nag-yellow);
    text-shadow: 0 2px 18px rgba(0, 0, 0, .9);
}

.world-eyebrow,
.world-identity > span:last-child {
    font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .17em;
    color: #b8c0c3;
}

.world-identity strong {
    font: 900 clamp(18px, 2vw, 32px)/.95 Inter, system-ui, sans-serif;
    letter-spacing: -.035em;
    color: #fff;
}

.world-identity > span:last-child {
    color: var(--nag-cyan);
}

.system-focus {
    position: absolute;
    z-index: 4;
    width: clamp(88px, 12vw, 176px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%) scale(.86);
    opacity: 0;
    transition: opacity 300ms ease, transform 450ms ease;
    pointer-events: none;
}

.garage-world[data-case="f150"] .system-focus {
    left: 57%;
    top: 43%;
}

.garage-world[data-case="gt3rs"] .system-focus {
    left: 40%;
    top: 59%;
}

.garage-world[data-case="f1"] .system-focus {
    left: 46%;
    top: 55%;
}

.garage-world:not([data-phase="landing"]) .system-focus {
    opacity: .9;
    transform: translate(-50%, -50%) scale(1);
}

.system-focus-core,
.system-focus-orbit {
    position: absolute;
    inset: 30%;
    border: 1px solid rgba(0, 217, 230, .9);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(0, 217, 230, .32), inset 0 0 18px rgba(0, 217, 230, .2);
}

.system-focus-orbit {
    inset: 0;
    border-style: dashed;
    opacity: .68;
    animation: nag-orbit 9s linear infinite;
}

.system-focus::before,
.system-focus::after {
    content: "";
    position: absolute;
    background: rgba(0, 217, 230, .72);
}

.system-focus::before {
    left: 50%;
    top: 14%;
    bottom: 14%;
    width: 1px;
}

.system-focus::after {
    top: 50%;
    left: 14%;
    right: 14%;
    height: 1px;
}

@keyframes nag-orbit {
    to { transform: rotate(360deg); }
}

.workshop-chief {
    position: absolute;
    z-index: 7;
    right: clamp(445px, 34vw, 590px);
    bottom: -2vh;
    width: clamp(200px, 19vw, 320px);
    height: min(71vh, 720px);
    margin: 0;
    pointer-events: none;
    transition: transform 420ms ease, filter 420ms ease, opacity 420ms ease;
    filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .66));
}

.workshop-chief img {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    max-width: none;
    object-fit: contain;
}

.workshop-chief figcaption {
    position: absolute;
    left: -54%;
    bottom: 6%;
    width: 225px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-left: 3px solid var(--nag-yellow);
    background: linear-gradient(135deg, rgba(5, 8, 10, .94), rgba(12, 16, 18, .78));
    box-shadow: 0 14px 30px rgba(0, 0, 0, .46);
    backdrop-filter: blur(8px);
}

.workshop-chief figcaption span,
.workshop-chief figcaption strong,
.workshop-chief figcaption small {
    display: block;
}

.workshop-chief figcaption span {
    color: #9aa4a8;
    font: 700 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .16em;
}

.workshop-chief figcaption strong {
    margin-top: 4px;
    color: #fff;
    font: 900 14px/1.1 Inter, system-ui, sans-serif;
}

.workshop-chief figcaption small {
    margin-top: 7px;
    color: #c9d0d2;
    font: 500 10px/1.35 Inter, system-ui, sans-serif;
}

.garage-world[data-phase="landing"] .workshop-chief {
    right: clamp(34px, 5vw, 82px);
    width: clamp(230px, 23vw, 365px);
    height: min(75vh, 760px);
}

.garage-world[data-phase="testing"] .workshop-chief {
    transform: translateX(-10px);
    filter: drop-shadow(0 20px 32px rgba(0, 0, 0, .8)) saturate(.78);
}

.garage-world[data-outcome="success"] .workshop-chief {
    transform: translateY(-4px);
}

.garage-world[data-outcome="critical"] .workshop-chief {
    transform: translateX(-8px);
}

.mechanical-test {
    position: absolute;
    z-index: 9;
    left: clamp(28px, 4vw, 68px);
    bottom: clamp(28px, 6vh, 66px);
    width: min(36vw, 470px);
    padding: 18px 20px;
    border: 1px solid rgba(247, 198, 0, .62);
    border-left: 4px solid var(--nag-yellow);
    background: rgba(3, 6, 8, .92);
    box-shadow: 0 20px 45px rgba(0, 0, 0, .58);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 220ms ease, transform 260ms ease;
}

.garage-world[data-phase="testing"] .mechanical-test {
    opacity: 1;
    transform: translateY(0);
}

.mechanical-test-kicker,
.mechanical-test-note {
    display: block;
    color: #9ea8ac;
    font: 700 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .14em;
}

.mechanical-test strong {
    display: block;
    margin: 6px 0 14px;
    font: 900 clamp(18px, 2vw, 27px)/1 Inter, system-ui, sans-serif;
    color: #fff;
}

.mechanical-test-track {
    display: block;
    height: 4px;
    margin-bottom: 11px;
    overflow: hidden;
    background: #303638;
}

.mechanical-test-track i {
    display: block;
    width: 100%;
    height: 100%;
    transform: translateX(-100%);
    background: linear-gradient(90deg, var(--nag-yellow), var(--nag-cyan));
}

.garage-world[data-phase="testing"] .mechanical-test-track i {
    animation: mechanical-test-progress 1150ms cubic-bezier(.22, .68, .2, 1) forwards;
}

@keyframes mechanical-test-progress {
    to { transform: translateX(0); }
}

.garage-world[data-phase="testing"] .garage-scene {
    transform: scale(1.025);
}

.garage-world[data-phase="testing"][data-case="f150"] .garage-scene-f150,
.garage-world[data-phase="testing"][data-case="f1"] .garage-scene-f1 {
    animation: contained-mechanical-vibration 150ms linear 4;
}

@keyframes contained-mechanical-vibration {
    0%, 100% { translate: 0 0; }
    50% { translate: 1px 0; }
}

.scene-outcome {
    position: absolute;
    z-index: 8;
    left: clamp(28px, 4vw, 68px);
    bottom: clamp(28px, 6vh, 66px);
    display: flex;
    align-items: center;
    gap: 13px;
    width: min(34vw, 430px);
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(3, 6, 8, .91);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .55);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 260ms ease, transform 300ms ease;
}

.garage-world[data-phase="result"] .scene-outcome,
.garage-world[data-phase="telemetry"] .scene-outcome {
    opacity: 1;
    transform: translateY(0);
}

.scene-outcome-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 2px solid #859094;
    color: #fff;
    font: 900 22px/1 Inter, system-ui, sans-serif;
}

.scene-outcome span,
.scene-outcome strong {
    display: block;
}

.scene-outcome div > span {
    color: #9ea8ac;
    font: 700 8px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    letter-spacing: .15em;
}

.scene-outcome strong {
    margin-top: 4px;
    color: #fff;
    font: 900 15px/1.12 Inter, system-ui, sans-serif;
}

.garage-world[data-outcome="success"] .scene-outcome {
    border-left: 4px solid var(--nag-green);
}

.garage-world[data-outcome="success"] .scene-outcome-mark {
    border-radius: 50%;
    border-color: var(--nag-green);
    color: var(--nag-green);
}

.garage-world[data-outcome="success"] .scene-outcome-mark::before {
    content: "✓";
}

.garage-world[data-outcome="retry"] .scene-outcome {
    border-left: 4px solid var(--nag-amber);
}

.garage-world[data-outcome="retry"] .scene-outcome-mark {
    border-color: var(--nag-amber);
    color: var(--nag-amber);
}

.garage-world[data-outcome="retry"] .scene-outcome-mark::before {
    content: "↺";
}

.garage-world[data-outcome="critical"] .scene-outcome {
    border-left: 4px solid var(--nag-red);
}

.garage-world[data-outcome="critical"] .scene-outcome-mark {
    border-color: var(--nag-red);
    color: var(--nag-red);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    padding-top: 9px;
}

.garage-world[data-outcome="critical"] .scene-outcome-mark::before {
    content: "!";
}

#view-landing.contract-bg {
    background:
        linear-gradient(90deg, rgba(1, 3, 4, .14), rgba(1, 3, 4, .16) 47%, rgba(1, 3, 4, .7)) !important;
}

.landing-contract-panel {
    max-width: 530px !important;
    max-height: calc(100svh - 56px);
    margin-left: clamp(20px, 4.5vw, 72px) !important;
    margin-right: auto !important;
    overflow-y: auto;
    background: rgba(250, 248, 243, .965) !important;
    border: 1px solid rgba(255, 255, 255, .38) !important;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .72) !important;
}

.immersive-device {
    left: auto !important;
    right: clamp(16px, 3vw, 52px) !important;
    top: 50%;
    width: min(31vw, 430px) !important;
    height: min(84svh, 800px) !important;
    margin: 0 !important;
    transform: translateY(-50%);
}

.immersive-device .obd-screen {
    background: rgba(8, 10, 12, .955);
    backdrop-filter: blur(5px);
}

.immersive-device.obd-case {
    box-shadow:
        0 28px 70px rgba(0, 0, 0, .84),
        0 0 0 1px rgba(255, 214, 0, .18),
        inset 0 5px 15px rgba(255, 255, 255, .32),
        inset 0 -10px 20px rgba(0, 0, 0, .3);
}

#garage-world[data-phase="testing"] ~ #view-device .obd-screen {
    filter: brightness(.55) saturate(.8);
}

.immersive-work-order {
    justify-content: flex-end !important;
    padding-right: clamp(16px, 4vw, 66px) !important;
    background: linear-gradient(90deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .28) 52%, rgba(0, 0, 0, .76)) !important;
    backdrop-filter: none !important;
}

.work-order-sheet {
    margin-left: auto !important;
    margin-right: 0 !important;
    max-height: 92svh;
    overflow-y: auto;
}

.immersive-report {
    align-items: flex-end !important;
    padding-right: clamp(16px, 4vw, 66px) !important;
    background: linear-gradient(90deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .34) 50%, rgba(0, 0, 0, .86)) !important;
}

.report-sheet {
    width: min(420px, 100%) !important;
    max-width: 420px !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}

@media (max-width: 1120px) and (min-width: 768px) {
    .immersive-device {
        width: min(39vw, 410px) !important;
        right: 18px !important;
    }

    .workshop-chief {
        right: min(41vw, 430px);
        width: 190px;
        height: 58vh;
    }

    .workshop-chief figcaption {
        left: -68%;
        width: 190px;
    }

    .scene-outcome,
    .mechanical-test {
        width: 35vw;
    }
}

@media (max-width: 767px) {
    .garage-scene {
        inset: 0;
        background-size: auto 44svh;
        background-position: 48% top;
        transform: none;
        filter: saturate(.88) brightness(.66) contrast(1.08);
    }

    .garage-world[data-case="f150"] .garage-scene-f150 {
        background-position: 56% top;
    }

    .garage-world[data-case="gt3rs"] .garage-scene-gt3rs {
        background-position: 44% top;
    }

    .garage-world[data-case="f1"] .garage-scene-f1 {
        background-position: 42% top;
    }

    .garage-atmosphere {
        background:
            linear-gradient(180deg, rgba(1, 3, 4, .08), rgba(1, 3, 4, .2) 26svh, rgba(1, 3, 4, .92) 43svh),
            linear-gradient(90deg, rgba(0, 0, 0, .2), transparent 65%, rgba(0, 0, 0, .36));
    }

    .world-identity {
        top: 12px;
        left: 12px;
        max-width: calc(100vw - 128px);
        padding: 8px 9px 8px 11px;
        border-left-width: 2px;
        background: rgba(1, 4, 5, .64);
        backdrop-filter: blur(5px);
    }

    .world-eyebrow,
    .world-identity > span:last-child {
        font-size: 7px;
    }

    .world-identity strong {
        font-size: 14px;
    }

    .workshop-chief,
    .garage-world[data-phase="landing"] .workshop-chief {
        top: 4px;
        right: 7px;
        bottom: auto;
        width: 93px;
        height: 25svh;
        filter: drop-shadow(0 9px 15px rgba(0, 0, 0, .72));
    }

    .workshop-chief figcaption {
        left: auto;
        right: 84px;
        bottom: 8px;
        width: 112px;
        padding: 6px 7px;
        border-left-width: 2px;
    }

    .workshop-chief figcaption span,
    .workshop-chief figcaption small {
        display: none;
    }

    .workshop-chief figcaption strong {
        margin: 0;
        font-size: 9px;
    }

    .system-focus {
        width: 80px;
    }

    .garage-world[data-case="f150"] .system-focus {
        left: 54%;
        top: 21svh;
    }

    .garage-world[data-case="gt3rs"] .system-focus {
        left: 37%;
        top: 23svh;
    }

    .garage-world[data-case="f1"] .system-focus {
        left: 42%;
        top: 22svh;
    }

    #view-landing.contract-bg {
        justify-content: flex-end !important;
        padding: 7px !important;
        background: linear-gradient(180deg, rgba(0, 0, 0, .02), rgba(0, 0, 0, .18) 26svh, rgba(0, 0, 0, .76) 40svh) !important;
    }

    .landing-contract-panel {
        width: 100% !important;
        max-width: none !important;
        max-height: 69svh;
        margin: 29svh 0 0 !important;
        padding: 20px 18px !important;
        border-radius: 12px 12px 0 0;
    }

    .landing-contract-panel .text-center.mb-8 {
        margin-bottom: 18px;
    }

    .landing-contract-panel .mt-10 {
        margin-top: 22px;
    }

    .immersive-device {
        top: auto;
        bottom: 6px;
        left: 6px !important;
        right: 6px !important;
        width: auto !important;
        max-width: none !important;
        height: 70svh !important;
        transform: none;
    }

    .immersive-device.obd-case {
        padding: 6px;
        border-radius: 16px;
    }

    .immersive-device .obd-screen {
        border-width: 3px;
        border-radius: 11px;
    }

    .mechanical-test,
    .scene-outcome {
        left: 10px;
        right: 10px;
        bottom: 72svh;
        width: auto;
        padding: 9px 11px;
    }

    .mechanical-test strong {
        margin: 3px 0 7px;
        font-size: 14px;
    }

    .mechanical-test-kicker,
    .mechanical-test-note {
        font-size: 7px;
    }

    .scene-outcome {
        max-width: calc(100vw - 132px);
        right: auto;
        gap: 8px;
    }

    .scene-outcome-mark {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
        font-size: 15px;
    }

    .scene-outcome strong {
        font-size: 10px;
    }

    .scene-outcome div > span {
        font-size: 6px;
    }

    .immersive-work-order {
        align-items: flex-end !important;
        padding: 6px !important;
        background: linear-gradient(180deg, rgba(0, 0, 0, .06), rgba(0, 0, 0, .18) 22svh, rgba(0, 0, 0, .82) 42svh) !important;
    }

    .work-order-sheet {
        width: 100% !important;
        max-width: none !important;
        max-height: 77svh;
        margin: 0 !important;
    }

    .immersive-report {
        align-items: stretch !important;
        justify-content: flex-end !important;
        padding: 6px !important;
        background: linear-gradient(180deg, rgba(0, 0, 0, .04), rgba(0, 0, 0, .22) 24svh, rgba(0, 0, 0, .88) 43svh) !important;
    }

    .report-sheet {
        max-height: 78svh;
        overflow-y: auto;
        margin: 20svh 0 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .garage-scene,
    .garage-light-response,
    .system-focus,
    .workshop-chief,
    .mechanical-test,
    .scene-outcome {
        transition: none !important;
        animation: none !important;
    }

    .system-focus-orbit,
    .mechanical-test-track i,
    .garage-world[data-phase="testing"] .garage-scene-f150,
    .garage-world[data-phase="testing"] .garage-scene-f1 {
        animation: none !important;
    }

    .garage-world[data-phase="testing"] .mechanical-test-track i {
        transform: translateX(0);
    }
}
