:root {
    --surface: #f8f9fa;
    --surface-low: #f3f4f5;
    --surface-high: #e7e8e9;
    --surface-strong: #dfe3e6;
    --ink: #111316;
    --muted: #5d646c;
    --accent: #b72301;
    --border: #111316;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--surface);
    color: var(--ink);
}

.editorial-grid {
    background-image: radial-gradient(rgba(17, 19, 22, 0.16) 0.5px, transparent 0.5px);
    background-size: 24px 24px;
    opacity: 0.08;
}

.brutal-shadow {
    box-shadow: 6px 6px 0 var(--border);
}

.brutal-shadow-soft {
    box-shadow: 10px 10px 0 rgba(17, 19, 22, 0.12);
}

.soft-metal {
    background: linear-gradient(135deg, #0f1112 0%, #20252a 100%);
}

.ink-gradient {
    background: linear-gradient(135deg, #101214 0%, #2b3035 100%);
}

.button-lift {
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.button-lift:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--border);
}

.button-lift:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--border);
}

.pixel-button {
    border: 2px solid var(--border);
    background: var(--accent);
    color: #ffffff;
    box-shadow: 6px 6px 0 var(--border);
    transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.pixel-button:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--border);
}

.pixel-button:active {
    transform: translate(2px, 2px);
    box-shadow: 3px 3px 0 var(--border);
}

.ghost-button {
    border: 2px solid var(--border);
    background: transparent;
    color: var(--ink);
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.ghost-button:hover {
    background: var(--surface-low);
    transform: translate(-2px, -2px);
}

.eyebrow {
    letter-spacing: 0.32em;
}

.poster-heading {
    letter-spacing: -0.06em;
    line-height: 0.88;
}

.muted-copy {
    color: var(--muted);
}

.info-panel {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(20px);
}

.noise-panel {
    background-image:
        radial-gradient(circle at 1px 1px, rgba(17, 19, 22, 0.08) 1px, transparent 0),
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(243, 244, 245, 0.92));
    background-size: 24px 24px, cover;
}

[data-comparison-slider] {
    position: relative;
    overflow: hidden;
    user-select: none;
    touch-action: none;
}

[data-comparison-slider] img {
    pointer-events: none;
}

.comparison-pane {
    position: relative;
    overflow: hidden;
    background: #ffffff;
}

[data-slider-overlay] {
    position: absolute;
    inset: 0;
    overflow: hidden;
    clip-path: inset(0 50% 0 0);
    will-change: clip-path;
}

[data-slider-overlay] img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

[data-slider-handle] {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: var(--accent);
    z-index: 20;
    will-change: left;
}

[data-slider-handle]::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 52px;
    height: 34px;
    transform: translate(-50%, -50%);
    background: var(--accent);
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0 var(--border);
    background-image: url("../assets/hero-arrow-right.svg"), url("../assets/hero-arrow-left.svg");
    background-repeat: no-repeat, no-repeat;
    background-position: 10px center, calc(100% - 10px) center;
    background-size: 18px auto, 18px auto;
}

[data-slider-handle]::before {
    content: "";
}

[data-comparison-slider][data-slider-style="hero"] .hero-media {
    display: block;
    position: relative;
    z-index: 1;
    inset: auto;
    width: 100%;
    height: 100%;
    padding: 0;
    object-fit: cover;
    object-position: center center;
    transform: none;
}

.hero-gallery-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 2px solid var(--border);
    background: #000000;
    color: #ffffff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px auto;
    transition: background-color 180ms ease, transform 180ms ease;
}

.hero-gallery-button-prev {
    background-image: url("../assets/hero-arrow-right.svg");
}

.hero-gallery-button-next {
    background-image: url("../assets/hero-arrow-left.svg");
}

.hero-gallery-button:hover {
    background-color: var(--accent);
}

.hero-gallery-button:active {
    transform: translateY(1px);
}

.hero-gallery-button:disabled,
.hero-gallery-button[aria-disabled="true"] {
    cursor: default;
    opacity: 0.35;
    background-color: #000000;
    transform: none;
}

.hero-iteration-dots {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 54px;
    justify-content: center;
}

.hero-iteration-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(183, 35, 1, 0.22);
    transition: transform 180ms ease, background-color 180ms ease;
}

.hero-iteration-dot.is-active {
    background: var(--accent);
    transform: scale(1.1);
}

.hero-group-strip {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.hero-group-thumbs {
    display: flex;
    flex: 0 1 auto;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0;
    scroll-behavior: auto;
    scroll-snap-type: none;
    scrollbar-width: none;
    cursor: grab;
    user-select: none;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    -webkit-overflow-scrolling: touch;
}

.hero-group-thumbs.hero-group-thumbs-fit {
    flex: 0 1 auto;
    justify-content: end;
    overflow-x: auto;
    cursor: grab;
    scroll-snap-type: none;
}

.hero-group-thumbs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.hero-group-thumb {
    display: inline-flex;
    width: 52px;
    height: 40px;
    flex: 0 0 52px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid rgba(17, 19, 22, 0.7);
    background: #ffffff;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.hero-group-thumb.is-active {
    border-color: var(--accent);
    box-shadow: 4px 4px 0 var(--border);
}

.hero-group-thumb:hover {
    transform: translateY(-1px);
}

.hero-group-thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-group-thumbs::-webkit-scrollbar {
    display: none;
}

.hero-group-scrubber {
    --scrubber-progress: 0%;
    width: 100%;
    height: 12px;
    margin: 0;
    appearance: none;
    background: transparent;
    cursor: ew-resize;
}

.hero-group-scrubber[disabled] {
    opacity: 0;
    pointer-events: none;
}

.hero-group-scrubber::-webkit-slider-runnable-track {
    height: 2px;
    border: 0;
    background:
        linear-gradient(
            to right,
            var(--accent) 0 var(--scrubber-progress),
            rgba(17, 19, 22, 0.95) var(--scrubber-progress) 100%
        );
}

.hero-group-scrubber::-webkit-slider-thumb {
    width: 18px;
    height: 8px;
    margin-top: -3px;
    appearance: none;
    border: 0;
    border-radius: 0;
    background: var(--accent);
    box-shadow: 3px 3px 0 rgba(17, 19, 22, 0.18);
}

.hero-group-scrubber::-moz-range-track {
    height: 2px;
    border: 0;
    background:
        linear-gradient(
            to right,
            var(--accent) 0 var(--scrubber-progress),
            rgba(17, 19, 22, 0.95) var(--scrubber-progress) 100%
        );
}

.hero-group-scrubber::-moz-range-thumb {
    width: 18px;
    height: 8px;
    border: 0;
    border-radius: 0;
    background: var(--accent);
    box-shadow: 3px 3px 0 rgba(17, 19, 22, 0.18);
}

.comparison-chip {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(17, 19, 22, 0.88);
    color: #ffffff;
}

.comparison-chip-light {
    border: 1px solid rgba(17, 19, 22, 0.14);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
}

.manifesto-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.9rem 2.4rem;
}

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 640ms ease, transform 640ms ease;
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.asset-row {
    transition: background-color 180ms ease, transform 180ms ease;
}

.asset-row:hover {
    background: #ffffff;
    transform: translateX(4px);
}

.nav-glass {
    background: rgba(248, 249, 250, 0.88);
    backdrop-filter: blur(18px);
}

.mobile-nav-strip {
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav-strip::-webkit-scrollbar {
    display: none;
}

.mobile-nav-link {
    flex: 0 0 auto;
    white-space: nowrap;
    border: 2px solid rgba(17, 19, 22, 0.18);
    background: #ffffff;
    padding: 0.65rem 0.9rem;
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.cart-rail {
    background: linear-gradient(180deg, rgba(248, 249, 250, 0.98), rgba(243, 244, 245, 0.98));
}

.status-dot {
    display: inline-flex;
    width: 10px;
    height: 10px;
    background: var(--accent);
}

.lab-shell-frame {
    border: 2px solid var(--border);
    background: #ffffff;
    box-shadow: 10px 10px 0 rgba(17, 19, 22, 0.12);
    overflow: hidden;
}

.lab-shell-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 2px solid var(--border);
    background: var(--surface-low);
}

.lab-shell-toolbar-kicker {
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--accent);
}

.lab-shell-toolbar-copy {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.lab-shell-toolbar-status {
    flex: 0 0 auto;
    font-family: "Inter", sans-serif;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink);
}

body.lab-page #root {
    --font-sans: "Inter", sans-serif;
    --font-mono: "Work Sans", sans-serif;
    --color-surface: #f8f9fa;
    --color-surface-low: #f3f4f5;
    --color-brand-accent: #b72301;
    --color-on-surface: #111316;
}

body.lab-page #root > div {
    min-height: 0 !important;
    background: transparent !important;
    color: var(--ink) !important;
}

body.lab-page #root .tech-grid,
body.lab-page #root .tech-grid-fine {
    background-image: none !important;
}

body.lab-page #root .glass-panel {
    background: #ffffff !important;
    backdrop-filter: none !important;
    border: 2px solid var(--border) !important;
    box-shadow: 6px 6px 0 rgba(17, 19, 22, 0.08) !important;
    border-radius: 0 !important;
}

body.lab-page #root .rounded-3xl {
    border-radius: 0 !important;
}

body.lab-page #root > div > header {
    display: none !important;
}

body.lab-page #root > div > main {
    max-width: none !important;
}

body.lab-page #root .altera-button,
body.lab-page #root .formas-button {
    box-shadow: 4px 4px 0 var(--border);
}

body.lab-page #root .altera-button:hover,
body.lab-page #root .formas-button:hover {
    transform: translate(-2px, -2px);
}

body.lab-page #root img {
    image-rendering: auto;
}

.workflow-graph-frame {
    display: block;
    overflow: hidden;
    border: 2px solid var(--border);
    background: #ffffff;
}

.workflow-graph-image {
    display: block;
    width: 100%;
    height: auto;
    background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button-lift,
    .pixel-button,
    .ghost-button,
    .asset-row,
    .reveal-up {
        transition: none !important;
    }
}

@media (pointer: fine) {
    html,
    body,
    a,
    button,
    input,
    textarea,
    select,
    summary,
    label,
    [role="button"] {
        cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Crect x='0.5' y='0.5' width='11' height='11' fill='%23b72301' stroke='%23111316'/%3E%3C/svg%3E") 6 6, auto;
    }

    .has-pixel-cursor,
    .has-pixel-cursor * {
        cursor: none !important;
    }

    #custom-pixel-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 12px;
        height: 12px;
        background: var(--accent);
        pointer-events: none;
        z-index: 10000;
        transform: translate(-50%, -50%);
        box-shadow: 1px 1px 0 var(--border);
    }
}

@media (max-width: 768px) {
    .brutal-shadow,
    .brutal-shadow-soft {
        box-shadow: 5px 5px 0 rgba(17, 19, 22, 0.12);
    }

    .button-lift:hover,
    .pixel-button:hover,
    .ghost-button:hover {
        transform: none;
    }

    [data-slider-handle]::after {
        width: 46px;
        height: 30px;
        background-position: 8px center, calc(100% - 8px) center;
        background-size: 15px auto, 15px auto;
    }

    .hero-gallery-button {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        background-size: 16px auto;
    }

    .hero-group-strip {
        width: 100%;
        gap: 8px;
    }

    .hero-group-thumbs {
        gap: 6px;
    }

    .hero-group-thumb {
        width: 48px;
        height: 36px;
        flex-basis: 48px;
    }

    #hero [data-comparison-slider] {
        height: min(58svh, 27rem);
    }

    #hero > div:last-child {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-inline: 1rem;
    }

    #hero-gallery-nav {
        justify-content: space-between;
        width: 100%;
    }

    #flow-rail {
        align-items: stretch;
    }

    #flow-rail > div {
        width: 100%;
    }

    #account-library article,
    #account-orders article {
        max-width: none;
    }

    #account-library article .flex-row {
        flex-direction: column;
    }

    #account-library article a {
        width: 100%;
        min-width: 0;
    }

    .lab-shell-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .lab-shell-toolbar-status {
        letter-spacing: 0.18em;
    }
}

@media (max-width: 640px) {
    nav.nav-glass > div {
        padding-inline: 1rem;
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .poster-heading {
        font-size: 3.1rem;
        line-height: 0.9;
    }

    #detail-root > section:first-child {
        padding-inline: 0.75rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }

    #hero-heading {
        max-width: none;
        font-size: 2.5rem;
        line-height: 0.9;
    }

    #hero-title {
        font-size: 0.95rem;
    }

    #hero-price {
        font-size: 3rem;
        line-height: 0.95;
    }

    #detail-root section:not(:first-child),
    #checkout-root,
    #success-root,
    body > main {
        padding-inline: 1rem !important;
    }

    #why,
    #workflow,
    #workflow-graph,
    #setup + section,
    #setup,
    #detail-root main > section,
    #checkout-root,
    #success-root,
    #account-page-header,
    .cart-rail {
        scroll-margin-top: 6rem;
    }

    #detail-root section:not(:first-child) {
        padding-top: 3.5rem !important;
        padding-bottom: 3.5rem !important;
    }

    #why h2,
    #workflow h2,
    #detail-root section h2.text-5xl,
    #detail-root section h2.text-4xl,
    #success-root h1,
    #checkout-root h1,
    #account-page-header h1,
    body main article h1.text-5xl {
        font-size: 2.75rem !important;
        line-height: 0.92;
    }

    .manifesto-strip {
        justify-content: flex-start;
        gap: 0.6rem 1rem;
    }

    .manifesto-strip .h-2.w-2 {
        display: none;
    }

    #account-signed-out,
    #account-signed-in,
    #checkout-root > div,
    #success-root > div {
        gap: 1.25rem;
    }

    #account-signed-out > div,
    #account-signed-in > div > section,
    #account-signed-in aside > section,
    #checkout-root section,
    #success-root section,
    #success-root aside,
    body main article.brutal-shadow {
        padding: 1rem;
    }

    #account-signed-in .grid.grid-cols-\[minmax\(0\,1fr\)_132px\] {
        grid-template-columns: 1fr;
    }

    #account-library article img {
        height: 10rem;
        width: 100%;
    }

    #account-library article h3 {
        white-space: normal;
        font-size: 2rem;
    }

    #checkout-root .mt-12.grid.gap-10.lg\:grid-cols-\[minmax\(0\,0\.9fr\)_minmax\(0\,1\.1fr\)\] > section:last-child {
        order: -1;
    }

    .cart-rail {
        position: static !important;
    }
}
