/* Three-scene emergency repair preview. Native scroll only. */
html {
    --er3-header: 4.25rem;
    --er3-stage-h: calc(100vh - var(--er3-header));
    --er3-stage-h: calc(100svh - var(--er3-header));
    --er3-travel: 260vh;
}

.er3-story {
    position: relative;
    background: var(--color-canvas);
    color: var(--color-ink);
}

.er3-track {
    height: auto;
}

.er3-stage {
    position: relative;
}

.er3-skip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0.75rem 1.25rem 0;
    color: var(--color-brand);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.er3-skip:focus-visible,
.er3-button:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 3px;
}

.er3-frame {
    display: none;
}

.er3-card {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.25rem 1.25rem 2.5rem;
}

.er3-card + .er3-card {
    border-top: 1px solid var(--color-hairline);
}

.er3-card-poster img,
.er3-visual img,
.er3-visual video {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.er3-card-poster {
    display: block;
    margin-bottom: 1rem;
}

.er3-card h1,
.er3-card h2 {
    margin: 0;
    max-width: 22ch;
    color: var(--color-ink);
    font-size: clamp(1.7rem, 2.6vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.er3-card p {
    max-width: 38rem;
    margin: 0.75rem 0 0;
    color: var(--color-ink-2);
    font-size: 1.0625rem;
    line-height: 1.5;
}

.er3-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.er3-actions--motion {
    display: none;
}

.er3-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm, 4px);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.er3-button--primary {
    background: var(--color-brand);
    color: #fff;
}

.er3-button--primary:hover {
    background: var(--color-brand-ink);
}

.er3-button--secondary {
    border: 1px solid var(--color-hairline);
    background: var(--color-canvas);
    color: var(--color-ink);
}

.er3-button--secondary:hover {
    border-color: var(--color-brand);
    color: var(--color-brand);
}

.er3-cue,
.er3-progress {
    display: none;
}

html.er3-motion .er3-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    max-width: 22rem;
    margin-top: 1.5rem;
}

.er3-progress-track {
    display: block;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(17, 24, 39, 0.14);
}

.er3-progress-fill {
    display: block;
    height: 100%;
    background: var(--color-brand);
    transform: scaleX(var(--er3-fill, 0));
    transform-origin: left center;
}

.er3-progress-label {
    display: block;
    margin-top: 0.45rem;
    color: var(--color-ink-2);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 180ms linear;
}

.er3-progress-step.is-active .er3-progress-label {
    color: var(--color-brand);
    font-weight: 700;
}

#er3-after,
#contact-section {
    scroll-margin-top: calc(var(--er3-header) + 0.75rem);
}

#er3-after:focus {
    outline: none;
}

#er3-after:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 4px;
}

html.er3-motion {
    --er3-stage-h: calc(100vh - var(--er3-header));
    --er3-stage-h: calc(100svh - var(--er3-header));
}

html.er3-motion .er3-track {
    height: calc(var(--er3-stage-h) + var(--er3-travel));
}

html.er3-motion .er3-stage {
    position: sticky;
    top: var(--er3-header);
    height: var(--er3-stage-h);
    overflow: hidden;
    background: var(--color-canvas);
}

html.er3-motion .er3-skip {
    position: absolute;
    z-index: 3;
    margin: 0;
    left: var(--er3-copy-left, 4%);
    top: max(0.75rem, calc(var(--er3-copy-top, 14%) - 2.25rem));
}

/* Fills the stage edge to edge. The focus point keeps the monitor, keyboard,
   mouse and tower in view; only the empty wall and some floor are cropped. */
html.er3-motion .er3-frame {
    display: block;
    position: absolute;
    inset: 0;
    overflow: hidden;
}

html.er3-motion .er3-visual {
    position: absolute;
    inset: 0;
}

html.er3-motion .er3-visual picture,
html.er3-motion .er3-visual img,
html.er3-motion .er3-visual video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--er3-focus-x, 88%) var(--er3-focus-y, 48%);
}

html.er3-motion .er3-visual video {
    opacity: 0;
}

html.er3-motion .er3-visual video.is-shown {
    opacity: 1;
}

html.er3-motion .er3-visual.is-frame-ready picture {
    opacity: 0;
}

html.er3-motion .er3-copy {
    position: absolute;
    z-index: 2;
    left: var(--er3-copy-left, 4%);
    top: var(--er3-copy-top, 14%);
    width: var(--er3-copy-width, min(32%, 24rem));
}

html.er3-motion .er3-cards {
    display: grid;
}

html.er3-motion .er3-card {
    grid-area: 1 / 1;
    max-width: none;
    margin: 0;
    padding: 0;
    border-top: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms linear;
}

html.er3-motion .er3-card.is-active {
    opacity: 1;
    pointer-events: auto;
}

html.er3-motion .er3-card-poster {
    display: none;
}

html.er3-motion .er3-card h1,
html.er3-motion .er3-card h2,
html.er3-motion .er3-card p {
    max-width: none;
}

html.er3-motion .er3-actions--static {
    display: none;
}

html.er3-motion .er3-actions--motion {
    display: flex;
}

html.er3-motion .er3-cue {
    position: absolute;
    z-index: 2;
    left: var(--er3-copy-left, 4%);
    bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    color: var(--color-ink-2);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: opacity 180ms linear;
}

.er3-story[data-er3-moved] .er3-cue {
    opacity: 0;
}

.er3-cue-mouse {
    position: relative;
    width: 16px;
    height: 24px;
    border: 1.5px solid currentColor;
    border-radius: 8px;
}

.er3-cue-wheel {
    position: absolute;
    left: 6px;
    top: 4px;
    width: 2px;
    height: 5px;
    background: currentColor;
    animation: er3-wheel 1.4s ease-in infinite;
}

@keyframes er3-wheel {
    0% { transform: translateY(0); opacity: 1; }
    100% { transform: translateY(6px); opacity: 0; }
}

@media (max-width: 959.98px) {
    html.er3-motion .er3-stage {
        display: flex;
        flex-direction: column;
    }

    html.er3-motion .er3-skip {
        position: static;
        order: 1;
        margin: 0.75rem 1.25rem 0;
    }

    html.er3-motion .er3-copy {
        position: relative;
        order: 2;
        left: auto;
        top: auto;
        width: auto;
        padding: 0.35rem 1.25rem 0.25rem;
    }

    html.er3-motion .er3-progress {
        margin-top: 0.9rem;
    }

    html.er3-motion .er3-cue {
        position: static;
        order: 3;
        margin: 0.35rem 1.25rem 0.5rem;
    }

    html.er3-motion .er3-frame {
        position: relative;
        order: 4;
        left: auto;
        top: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto;
        flex: 1 1 auto;
        min-height: 0;
        aspect-ratio: auto;
        transform: none;
        overflow: hidden;
    }

    html.er3-motion .er3-visual {
        position: relative;
        width: 100%;
        height: 100%;
        inset: auto;
    }

    html.er3-motion .er3-visual picture,
    html.er3-motion .er3-visual img,
    html.er3-motion .er3-visual video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: 50% 48%;
    }
}

@media (max-width: 767.98px) {
    html.er3-motion {
        --er3-stage-h: calc(100vh - var(--er3-header) - 76px);
        --er3-stage-h: calc(100svh - var(--er3-header) - 76px);
    }
}

@media (prefers-reduced-motion: reduce), (max-height: 560px), (max-width: 959.98px) and (max-height: 699px) {
    html.er3-motion .er3-track {
        height: auto;
    }

    html.er3-motion .er3-stage {
        position: static;
        display: block;
        height: auto;
        overflow: visible;
    }

    html.er3-motion .er3-skip,
    html.er3-motion .er3-copy,
    html.er3-motion .er3-cue,
    html.er3-motion .er3-frame {
        position: static;
        order: 0;
        left: auto;
        top: auto;
        width: auto;
        transform: none;
    }

    html.er3-motion .er3-frame,
    html.er3-motion .er3-cue,
    html.er3-motion .er3-progress,
    html.er3-motion .er3-actions--motion {
        display: none;
    }

    html.er3-motion .er3-cards {
        display: block;
    }

    html.er3-motion .er3-card {
        display: block;
        grid-area: auto;
        max-width: 72rem;
        margin: 0 auto;
        padding: 1.25rem 1.25rem 2.5rem;
        opacity: 1;
        pointer-events: auto;
    }

    html.er3-motion .er3-card + .er3-card {
        border-top: 1px solid var(--color-hairline);
    }

    html.er3-motion .er3-card-poster,
    html.er3-motion .er3-actions--static {
        display: block;
    }

    html.er3-motion .er3-actions--static {
        display: flex;
    }

    html.er3-motion .er3-skip {
        display: inline-flex;
        margin: 0.75rem 1.25rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .er3-cue-wheel,
    html.er3-motion .er3-card {
        animation: none;
        transition: none;
    }
}
