:root {
    color-scheme: light;
    font-family: system-ui, sans-serif;
    background: #fff7fa;
    color: #4a3540;

    --rosa: #e88aae;
    --rosa-strong: #d46a93;
    --rosa-soft: #f8d7e4;
    --rosa-pale: #fdeef4;
    --line: #eedde4;
}

body {
    margin: 0;
    min-height: 100vh;
}

.top-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 4rem;
    align-items: center;
    padding: 0 clamp(0.75rem, 2.5vw, 1.75rem);
    border-bottom: 1px solid var(--rosa-soft);
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 6px 24px rgb(212 106 147 / 10%);
    backdrop-filter: blur(16px);
}

.site-name {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--rosa-strong);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-decoration: none;
}

.site-logo {
    display: block;
    width: 1.575rem;
    height: 1.4rem;
}

.layout {
    display: flex;
    min-height: calc(100vh - 4rem);
    align-items: stretch;
}

.sidebar {
    position: sticky;
    top: 4rem;
    z-index: 10;
    display: flex;
    box-sizing: border-box;
    flex-direction: column;
    align-self: flex-start;
    height: calc(100vh - 4rem);
    overflow-y: auto;
    padding: 1rem;
    border-right: 1px solid var(--rosa-soft);
    background: rgb(255 255 255 / 88%);
    transition: flex-basis 180ms ease, width 180ms ease;
}

.sidebar.expanded {
    width: 17rem;
    flex: 0 0 17rem;
}

.sidebar.collapsed {
    width: 4rem;
    flex: 0 0 4rem;
    padding: 0.75rem;
}

.sidebar-toggle {
    display: flex;
    width: 2.25rem;
    height: 2.25rem;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--rosa-soft);
    border-radius: 0.65rem;
    background: var(--rosa-pale);
    color: #7a5a68;
    font: inherit;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.sidebar.collapsed .sidebar-toggle {
    margin-inline: auto;
}

.sidebar-toggle:focus-visible {
    outline: 2px solid var(--rosa-strong);
    outline-offset: 3px;
}

.filter-bar {
    display: grid;
    gap: 1.5rem;
    padding-top: 1.5rem;
}

.sidebar-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: auto;
    padding-top: 1.5rem;
    font-size: 0.75rem;
}

.sidebar-footer a {
    color: #7a5a68;
    text-decoration: none;
}

.sidebar-footer a:hover {
    color: var(--rosa-strong);
    text-decoration: underline;
}

.sidebar-footer a:focus-visible {
    outline: 2px solid var(--rosa-strong);
    outline-offset: 3px;
}

.filter-bar[hidden] {
    display: none;
}

.filter-control {
    min-width: 0;
}

.filter-label {
    display: block;
    margin-bottom: 0.55rem;
    color: #7a5a68;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.range-control {
    position: relative;
    height: 1.5rem;
}

.range-track {
    position: absolute;
    top: 50%;
    right: 0;
    left: 0;
    height: 4px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: var(--line);
}

.range-track-fill {
    position: absolute;
    height: 100%;
    border-radius: inherit;
    background: var(--rosa);
}

.range-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    appearance: none;
    background: transparent;
    pointer-events: none;
}

.range-input-min {
    z-index: 1;
}

.range-input-max {
    z-index: 2;
}

.range-input-min-front {
    z-index: 3;
}

.range-input::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
}

.range-input::-moz-range-track {
    height: 4px;
    background: transparent;
}

.range-input::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    margin-top: -7px;
    appearance: none;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--rosa-strong);
    box-shadow: 0 1px 4px rgb(74 53 64 / 25%);
    pointer-events: auto;
    cursor: grab;
}

.range-input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--rosa-strong);
    box-shadow: 0 1px 4px rgb(74 53 64 / 25%);
    pointer-events: auto;
    cursor: grab;
}

.main-content {
    min-width: 0;
    flex: 1;
}

.page-content {
    max-width: 48rem;
    margin: 0 auto;
    padding: clamp(1.5rem, 5vw, 3rem);
}

@media (max-width: 700px) {
    .layout {
        flex-direction: column;
    }

    .sidebar,
    .sidebar.expanded,
    .sidebar.collapsed {
        position: relative;
        top: auto;
        width: 100%;
        height: auto;
        flex: 0 0 auto;
        border-right: 0;
        border-bottom: 1px solid var(--rosa-soft);
    }

    .sidebar.collapsed {
        padding: 0.75rem 1rem;
    }

    .sidebar.collapsed .sidebar-toggle {
        margin-inline: 0;
    }

    .filter-bar {
        gap: 0.75rem;
        padding-top: 0.9rem;
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
    padding: clamp(1rem, 3vw, 2.5rem);
}

@media (max-width: 1250px) {
    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

.model-card {
    display: flex;
    min-width: 0;
    aspect-ratio: 3 / 4;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    border: 2px solid var(--line);
    border-radius: 18px;
    background: #fff;
    color: #4a3540;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 10px rgb(74 53 64 / 6%);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.model-card:hover {
    transform: translateY(-4px);
    border-color: var(--rosa);
    box-shadow: 0 0 0 3px rgb(232 138 174 / 25%), 0 10px 24px rgb(212 106 147 / 18%);
}

.model-card:focus-visible {
    outline: 2px solid var(--rosa-strong);
    outline-offset: 4px;
}

.model-media {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: linear-gradient(160deg, var(--rosa-pale), #fff 80%);
}

.model-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Images that are not safe for work are blurred. */
.nsfw-image {
    filter: blur(24px);
    transform: scale(1.1);
}

.model-name {
    display: grid;
    gap: 0.6rem;
    padding: 1.25rem;
    border-top: 1px solid var(--line);
    color: #4a3540;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.model-detail-page {
    max-width: 76rem;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
}

.not-found-page {
    display: grid;
    min-height: calc(100vh - 4rem);
    align-content: center;
    justify-items: center;
    padding: 2rem;
    text-align: center;
}

.not-found-page p {
    margin: 0;
    color: var(--rosa-strong);
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 800;
    line-height: 1;
}

.not-found-page h1 {
    margin: 1rem 0;
}

.not-found-page a {
    color: var(--rosa-strong);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: #7a5a68;
    font-size: 0.95rem;
}

.breadcrumb a {
    color: var(--rosa-strong);
}

.customizations {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(0.75rem, 2vw, 1.5rem);
    margin-bottom: clamp(1.5rem, 4vw, 3rem);
}

.customizations h2 {
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.customizations h2,
.model-detail-info h1 {
    font-size: 1.5rem;
}

.folding-fan {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
}

.folding-fan-stack {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}

.folding-fan-layer {
    position: absolute;
    bottom: 12%;
    left: 11%;
    width: 78%;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 6px;
    background: var(--rosa-soft);
    box-shadow: 0 4px 12px rgb(212 106 147 / 18%);
    transform: rotate(var(--fan-closed-angle, 0deg)) scale(1);
    transform-origin: 50% 100%;
    transition: transform 240ms ease;
}

.folding-fan-layer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folding-fan-layer--0 {
    z-index: 3;
    --fan-closed-angle: -2deg;
    --fan-open-angle: 5.35deg;
    --fan-open-scale: 1.12;
}

.folding-fan-layer--1 {
    z-index: 2;
    --fan-closed-angle: -4deg;
    --fan-open-angle: 0.2deg;
    --fan-open-scale: 1.08;
}

.folding-fan-layer--2 {
    z-index: 1;
    --fan-closed-angle: -6deg;
    --fan-open-angle: -4.95deg;
    --fan-open-scale: 1.04;
}

.folding-fan-layer--empty {
    border-style: dashed;
    background: linear-gradient(145deg, #fff, var(--rosa-pale));
}

.folding-fan--expanded .folding-fan-layer,
.folding-fan:hover .folding-fan-layer,
.folding-fan-stack:focus-visible .folding-fan-layer {
    transform: rotate(var(--fan-open-angle, 0deg)) scale(var(--fan-open-scale, 1));
}

.folding-fan-stack:focus-visible {
    outline: 3px solid var(--rosa-strong);
    outline-offset: 3px;
}

.folding-fan-caption {
    overflow: hidden;
    color: #4a3540;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-detail {
    max-width: 46rem;
}

.model-detail-info h1 {
    margin-top: 0;
}

.model-values {
    display: grid;
    grid-template-columns: repeat(2, auto minmax(5rem, 1fr));
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.model-values dt,
.model-values dd {
    margin: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--line);
}

.model-values dt {
    font-weight: 700;
    white-space: nowrap;
}

.model-values dt:nth-of-type(even) {
    border-left: 1px solid var(--line);
}

.model-values dt:nth-last-of-type(-n + 2),
.model-values dd:nth-last-of-type(-n + 2) {
    border-bottom: 0;
}

.model-values dd {
    text-align: right;
}

.manufacturer-link {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 0.4rem;
    margin-top: 0.5rem;
    color: var(--rosa-strong);
    font-size: 1rem;
}

.manufacturer-link svg {
    width: 0.9rem;
    height: 0.9rem;
    fill: currentColor;
}

.customization-carousel {
    max-width: 56rem;
    margin: 0 0 1.25rem;
}

.carousel-stage {
    position: relative;
    display: grid;
    margin: 0;
    min-height: min(72vh, 48rem);
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.carousel-stage > img {
    display: block;
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.carousel-image-probe {
    display: none;
}

.carousel-placeholder {
    padding: 2rem;
    color: #7a5a68;
    text-align: center;
}

.carousel-control {
    position: absolute;
    top: 50%;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    padding: 0;
    border: 1px solid var(--rosa-soft);
    border-radius: 50%;
    background: rgb(255 255 255 / 90%);
    color: var(--rosa-strong);
    font: inherit;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.carousel-control--previous {
    left: 0.75rem;
}

.carousel-control--next {
    right: 0.75rem;
}

.carousel-control:focus-visible,
.carousel-thumbnail:focus-visible,
.customization-carousel:focus-visible {
    outline: 3px solid var(--rosa-strong);
    outline-offset: 3px;
}

.carousel-thumbnails {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.75rem 0.25rem 0.25rem;
}

.carousel-thumbnail {
    flex: 0 0 4.5rem;
    height: 4.5rem;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.carousel-thumbnail[aria-current="true"] {
    border-color: var(--rosa-strong);
}

.carousel-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.customization-detail > .manufacturer-link {
    margin-top: 0;
}

@media (max-width: 900px) {
    .customizations {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 500px) {
    .customizations {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .model-values {
        grid-template-columns: auto minmax(5rem, 1fr);
    }

    .model-values dt:nth-of-type(even) {
        border-left: 0;
    }

    .model-values dt:nth-last-of-type(2),
    .model-values dd:nth-last-of-type(2) {
        border-bottom: 1px solid var(--line);
    }
}

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