:root {
    color-scheme: dark;
    --header-height: 74px;
    --bg: #0d0d0d;
    --surface: #161616;
    --surface-2: #1e1e1e;
    --surface-3: #252525;
    --text: #e0e0e0;
    --heading: #f5f5f5;
    --muted: #a0a0a0;
    --border: #2e2e2e;
    --border-strong: #414141;
    --green: #76b900;
    --green-dim: rgba(118, 185, 0, 0.14);
    --green-glow: rgba(118, 185, 0, 0.35);
    --blue: #4da3ff;
    --blue-dim: rgba(77, 163, 255, 0.16);
    --amber: #f2c14e;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 64px);
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg);
    color: var(--text);
    font-family: "Google Sans", Arial, sans-serif;
    font-size: 16px;
    letter-spacing: 0;
}

button,
select,
input {
    font: inherit;
}

button,
select,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 13, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.header-inner {
    width: min(1560px, calc(100% - 48px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 700;
}

.brand img {
    width: auto;
    height: 46px;
    flex: 0 0 auto;
}

.brand span {
    white-space: nowrap;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.header-nav a {
    position: relative;
    padding: 8px 0;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.94rem;
    font-weight: 600;
    transition: color 160ms ease;
}

.header-nav a:hover,
.header-nav a:focus-visible,
.header-nav a.active {
    color: #fff;
}

.brand:focus-visible,
.header-nav a:focus-visible,
.site-footer a:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 4px;
}

.header-nav a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 1px;
    left: 0;
    height: 2px;
    background: var(--green);
}

main {
    padding-top: var(--header-height);
}

.gallery-intro {
    width: min(1560px, calc(100% - 48px));
    margin: 0 auto;
    padding: 42px 0 0;
}

.intro-copy {
    display: grid;
    grid-template-columns: 1fr;
    align-items: end;
    gap: 56px;
    padding-bottom: 32px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

h1,
h2,
h3,
p {
    letter-spacing: 0;
}

h1 {
    margin: 0;
    color: var(--heading);
    font-size: 4.2rem;
    line-height: 1.02;
    font-weight: 700;
}

h1 span {
    color: var(--green);
}

.intro-summary {
    max-width: 520px;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 1.03rem;
    line-height: 1.65;
}

.intro-points {
    display: grid;
    gap: 7px;
    margin-top: 18px;
    padding-left: 1.25rem;
}

.intro-points li {
    padding-left: 3px;
}

.intro-points li::marker {
    color: var(--green);
}

.model-jump {
    position: sticky;
    top: var(--header-height);
    z-index: 100;
    width: min(1560px, calc(100% - 48px));
    margin: 0 auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(13, 13, 13, 0.94);
    scrollbar-width: none;
}

.model-jump::-webkit-scrollbar {
    display: none;
}

.model-jump a {
    flex: 0 0 auto;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.model-jump a:hover,
.model-jump a:focus-visible {
    color: #fff;
    border-color: var(--border-strong);
}

.model-jump a.active {
    border-color: rgba(118, 185, 0, 0.5);
    background: var(--green-dim);
    color: var(--green);
}

.model-sections {
    width: min(1560px, calc(100% - 48px));
    margin: 0 auto;
}

.model-section {
    min-height: 720px;
    padding: 58px 0 64px;
    border-bottom: 1px solid var(--border);
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
}

.model-identity {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.model-index {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--green);
    font-size: 0.8rem;
    font-weight: 700;
}

.model-title {
    margin: 0;
    color: var(--heading);
    font-size: 2rem;
    line-height: 1.1;
    text-align: left;
}

.model-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.icon-button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
    border-color: var(--green);
    background: var(--green-dim);
    color: var(--green);
    outline: none;
}

.sample-position {
    display: flex;
    min-height: 40px;
    min-width: 0;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.sample-position .sample-id {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 500;
}

.filter-bar {
    display: flex;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.filter-field {
    display: grid;
    gap: 7px;
    min-width: 190px;
}

.filter-label {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.filter-options {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(max-content, 1fr);
    gap: 3px;
    min-height: 40px;
    padding: 3px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background-color: var(--surface-2);
}

.filter-option {
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    outline: none;
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.filter-option:hover,
.filter-option:focus-visible {
    border-color: var(--green);
    color: var(--green);
}

.filter-option.active {
    border-color: var(--green);
    background: var(--green);
    color: #000;
}

.filter-meta {
    margin: 0 0 10px auto;
    color: var(--muted);
    font-size: 0.78rem;
}

.filter-meta strong {
    color: var(--green);
    font-weight: 700;
}

.sample-stage {
    --carousel-gutter: 64px;
    position: relative;
    padding-inline: var(--carousel-gutter);
    outline: none;
    touch-action: pan-y;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 30;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    border-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: rgba(22, 22, 22, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.carousel-prev {
    left: 9px;
}

.carousel-next {
    right: 9px;
}

.sample-stage:hover .carousel-arrow,
.sample-stage:focus-within .carousel-arrow,
.carousel-arrow:focus-visible {
    opacity: 1;
    pointer-events: auto;
}

.sample-stage:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 5px;
    border-radius: 6px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    transition: opacity 180ms ease;
}

.sample-stage.is-loading .comparison-grid,
.sample-stage.is-changing .comparison-grid {
    opacity: 0.5;
}

.result-panel {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.panel-header {
    display: flex;
    min-height: 50px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.panel-title {
    margin: 0;
    color: var(--heading);
    font-size: 0.92rem;
    font-weight: 700;
}

.panel-title .step-number {
    color: var(--blue);
}

.result-panel:last-child .panel-title .step-number {
    color: var(--amber);
}

.resolution-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.image-frame,
.version-compare {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #090909;
}

.image-frame img,
.version-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.version-compare {
    --split: 50%;
}

.version-v1 {
    z-index: 2;
    clip-path: polygon(0 0, var(--split) 0, var(--split) 100%, 0 100%);
}

.version-v15 {
    z-index: 1;
}

.version-range {
    position: absolute;
    inset: 0;
    z-index: 5;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
}

.version-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split);
    z-index: 4;
    width: 2px;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.72);
    pointer-events: none;
}

.version-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    background: #fff;
    color: #202020;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.55);
    font-size: 0.95rem;
    font-weight: 700;
}

.version-range:focus-visible ~ .version-divider .version-knob {
    outline: 3px solid var(--green);
    outline-offset: 3px;
}

.version-label {
    position: absolute;
    top: 10px;
    z-index: 3;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 5px;
    background: rgba(8, 8, 8, 0.74);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.version-label.v1 {
    left: 10px;
    color: #d4d4d4;
}

.version-label.v15 {
    right: 10px;
    border-color: rgba(118, 185, 0, 0.42);
    color: #c9f08c;
}

.panel-footer {
    min-height: 39px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.7rem;
}

.panel-footer strong {
    color: var(--text);
    font-weight: 600;
}

.fullres-links {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.fullres-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.fullres-link:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.fullres-link:focus-visible {
    color: #fff;
    outline: 2px solid var(--green);
    outline-offset: 2px;
    border-radius: 2px;
}

.fullres-link:not([href]) {
    opacity: 0.35;
    pointer-events: none;
}

.sample-progress {
    height: 3px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 2px;
    background: var(--surface-3);
}

.sample-progress-bar {
    width: var(--progress, 0%);
    height: 100%;
    background: var(--green);
    transition: width 220ms ease;
}

.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    display: none;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.16);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.sample-stage.is-loading .loading-indicator {
    display: block;
}

.stage-error {
    display: none;
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 11;
    transform: translate(-50%, -50%);
    padding: 8px 12px;
    border: 1px solid #8f4a4a;
    border-radius: 5px;
    background: #241414;
    color: #ffb5b5;
    font-size: 0.8rem;
}

.sample-stage.has-error .stage-error {
    display: block;
}

.noscript-message {
    width: min(1560px, calc(100% - 48px));
    margin: 32px auto;
    color: var(--muted);
}

.site-footer {
    width: min(1560px, calc(100% - 48px));
    margin: 0 auto;
    padding: 26px 0 34px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    color: var(--muted);
    font-size: 0.8rem;
}

.site-footer a {
    color: var(--green);
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #fff;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@media (max-width: 1000px) {
    .intro-copy {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    h1 {
        font-size: 3.2rem;
    }

    .intro-summary {
        max-width: 680px;
    }

    .section-heading {
        align-items: center;
    }
}

@media (max-width: 760px) {
    :root {
        --header-height: 60px;
    }

    .header-inner,
    .gallery-intro,
    .model-sections,
    .site-footer,
    .noscript-message {
        width: min(100% - 28px, 1560px);
    }

    .brand img {
        height: 34px;
    }

    .brand {
        font-size: 0.9rem;
    }

    .header-nav {
        gap: 16px;
    }

    .gallery-intro {
        padding-top: 30px;
    }

    h1 {
        font-size: 2.5rem;
    }

    .model-jump {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        padding-right: 14px;
        padding-left: 14px;
    }

    .model-section {
        min-height: 0;
        padding: 42px 0 48px;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .sample-position {
        align-self: flex-end;
    }

    .sample-stage {
        --carousel-gutter: 48px;
    }

    .filter-bar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .filter-field {
        flex: 1 1 180px;
    }

    .filter-meta {
        width: 100%;
        margin: 2px 0 0;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .carousel-arrow {
        top: calc(50px + (100vw - 28px - var(--carousel-gutter) - var(--carousel-gutter)) / 2);
        width: 40px;
        height: 40px;
    }

    .carousel-prev {
        left: 4px;
    }

    .carousel-next {
        right: 4px;
    }

    .model-title {
        font-size: 1.65rem;
    }
}

@media (max-width: 520px) {
    :root {
        --header-height: 54px;
    }

    .brand span {
        display: none;
    }

    .brand img {
        height: 28px;
    }

    .header-nav a {
        font-size: 0.82rem;
    }

    .intro-copy {
        padding-bottom: 24px;
    }

    h1 {
        font-size: 2.05rem;
    }

    .intro-summary {
        font-size: 0.94rem;
    }

    .model-jump a {
        padding: 8px 11px;
        font-size: 0.78rem;
    }

    .filter-field {
        min-width: 100%;
    }

    .panel-header {
        min-height: 46px;
    }

    .site-footer {
        flex-direction: column;
    }
}

@media (hover: none) {
    .carousel-arrow {
        opacity: 1;
        pointer-events: auto;
    }
}

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

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
