/* Color wheel landing (/color-wheel) */

.color-wheel-landing-app {
    align-items: start;
    gap: 12px 16px;
}

.color-wheel-landing-stage {
    position: relative;
    background:
        radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.7), transparent 42%),
        linear-gradient(160deg, #f4f6fb, #e8eef8);
    box-shadow: none;
    min-height: 0;
    overflow: visible;
    padding: clamp(12px, 2vw, 20px);
}

.dark .color-wheel-landing-stage {
    background:
        radial-gradient(circle at 12% 0%, rgba(80, 100, 140, 0.28), transparent 42%),
        linear-gradient(160deg, #121722, #0d1118);
}

.color-wheel-stage-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    width: 100%;
}

.color-wheel-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: min(100%, 520px);
    margin: 0 auto;
    touch-action: none;
}

.color-wheel-canvas {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border-radius: 50%;
    cursor: crosshair;
    box-shadow: 0 18px 42px rgba(25, 42, 69, 0.18);
}

.color-wheel-handles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.color-wheel-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(16, 24, 40, 0.35);
    pointer-events: auto;
    cursor: grab;
    padding: 0;
}

.color-wheel-handle.is-selected {
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    box-shadow: 0 0 0 2px #141820, 0 4px 14px rgba(16, 24, 40, 0.4);
    z-index: 1;
}

.color-wheel-handle:active {
    cursor: grabbing;
}

.color-wheel-value {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    min-height: 220px;
}

.color-wheel-value .filter-landing-controls-label {
    writing-mode: horizontal-tb;
}

.color-wheel-value input[type="range"] {
    writing-mode: vertical-lr;
    direction: rtl;
    width: 28px;
    height: min(280px, 42vw);
    accent-color: var(--wheel-value-top, var(--landing-accent, #2563eb));
}

.color-wheel-fullscreen-btn {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
}

.color-wheel-harmonies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
}

.color-wheel-harmony-select {
    display: none;
    width: 100%;
}

.color-wheel-harmonies .landing-cta {
    padding: 7px 12px;
    font-size: 0.9rem;
    min-height: 0;
    border-radius: 999px;
}

.color-wheel-count-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
}

.color-wheel-count-row .fractal-landing-select {
    width: auto;
    min-width: 4.25rem;
    padding: 4px 8px;
    font-size: 0.9rem;
    border-radius: 8px;
}

.color-wheel-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 8px;
}

.color-wheel-swatch {
    display: flex;
    align-items: flex-end;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.color-wheel-swatch.is-selected {
    border-color: #141820;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #141820;
}

.dark .color-wheel-swatch.is-selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px #141820, 0 0 0 4px #fff;
}

.color-wheel-preview {
    display: grid;
    gap: 8px;
}

.color-wheel-fields {
    display: grid;
    gap: 8px;
}

.color-wheel-field {
    display: grid;
    grid-template-columns: 3.1rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--landing-muted, #4b5568);
}

.color-wheel-field-row {
    display: contents;
}

.color-wheel-field input {
    width: 100%;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid rgba(16, 24, 40, 0.14);
    border-radius: 8px;
    background: #fff;
    color: var(--main-100);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.color-wheel-field input[readonly] {
    opacity: 0.88;
}

.dark .color-wheel-field input {
    border-color: rgba(255, 255, 255, 0.14);
    background: #171c26;
    color: #f5f5f5;
}

.color-wheel-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
}

.color-wheel-copy svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.color-wheel-copy.is-copied {
    color: var(--landing-accent, #2563eb);
}

.color-wheel-contrast-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 4px;
}

.color-wheel-contrast-chip {
    display: grid;
    gap: 2px;
    padding: 8px;
    border-radius: 8px;
    background: #fff;
    font-size: 0.8rem;
}

.color-wheel-contrast-chip.is-dark {
    background: #141820;
    color: #fff;
}

.color-wheel-contrast-chip strong {
    font-size: 0.9rem;
}

.color-wheel-landing-controls {
    gap: 18px;
}

.color-wheel-landing-controls .filter-landing-actions-2 {
    margin-top: 4px;
}

.color-wheel-landing-controls .filter-landing-actions-2 .landing-cta {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 0.9rem;
}

@media (max-width: 960px) {
    .color-wheel-landing-app {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .color-wheel-landing-controls {
        padding-inline-start: 0;
    }

    .color-wheel-stage-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .color-wheel-frame {
        max-width: none;
        width: 100%;
    }

    .color-wheel-landing-stage {
        padding: 8px;
    }

    .color-wheel-value {
        min-height: 0;
        flex-direction: row;
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }

    .color-wheel-value input[type="range"] {
        writing-mode: horizontal-tb;
        direction: ltr;
        width: 100%;
        height: 28px;
        flex: 1 1 auto;
    }
}

@media (max-width: 600px) {
    .seo-page:has(#seo-color-wheel) {
        width: 100%;
    }

    .seo-page:has(#seo-color-wheel) .seo-page-hero--filter-demo {
        padding: 12px 0 0;
        border-inline: 0;
        border-radius: 0;
        overflow: visible;
    }

    .seo-page:has(#seo-color-wheel) .seo-page-hero-copy,
    .seo-page:has(#seo-color-wheel) .color-wheel-landing-controls,
    .seo-page:has(#seo-color-wheel) .seo-page-section,
    .seo-page:has(#seo-color-wheel) .seo-page-cta-band {
        padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right));
    }

    .color-wheel-landing-stage {
        padding: 8px;
    }

    .color-wheel-handle,
    .color-wheel-handle.is-selected {
        width: 22px;
        height: 22px;
        margin: -11px 0 0 -11px;
    }

    .color-wheel-swatch {
        font-size: 0.8rem;
    }

    .color-wheel-harmonies {
        display: none;
    }

    .color-wheel-harmony-select {
        display: block;
    }
}

body.filter-app-mode .color-wheel-landing-app .color-wheel-frame {
    max-width: min(100%, 640px);
}

body.filter-app-mode .color-wheel-landing-stage {
    display: grid;
    place-items: center;
    height: 100%;
    min-height: 0;
}

@media (max-width: 960px) {
    body.filter-app-mode .color-wheel-landing-app {
        grid-template-rows: minmax(0, 1fr) auto;
        min-height: 0;
    }

    body.filter-app-mode .color-wheel-landing-app > .filter-landing-stage {
        min-height: 0;
        height: 100%;
        overflow: hidden;
    }

    body.filter-app-mode .color-wheel-landing-stage {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: stretch;
        height: 100%;
        min-height: 0;
        padding: 8px 8px 4px;
        place-items: unset;
        container-type: size;
    }

    body.filter-app-mode .color-wheel-stage-row {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    body.filter-app-mode .color-wheel-landing-app .color-wheel-frame {
        flex: 0 1 auto;
        width: min(100%, calc(100cqh - 40px));
        max-width: 100%;
        max-height: calc(100% - 36px);
        height: auto;
        aspect-ratio: 1;
    }

    body.filter-app-mode .color-wheel-value {
        flex: 0 0 auto;
        width: 100%;
        min-height: 0;
    }

    body.filter-app-mode .color-wheel-landing-app > .filter-landing-controls {
        z-index: 1;
        max-height: min(34vh, 220px);
        overflow: auto;
        min-height: 0;
        overscroll-behavior: contain;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    body.filter-app-mode .color-wheel-contrast {
        display: none;
    }
}

@media (max-width: 600px) {
    body.filter-app-mode .color-wheel-landing-app > .filter-landing-controls {
        max-height: min(32vh, 200px);
        gap: 8px;
    }

    body.filter-app-mode .color-wheel-field:not(:first-child) {
        display: none;
    }
}

