/* Color hub — color.martinifrancesco.it */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.body-color-hub {
    --color-hub-ink: #141414;
    --color-hub-muted: rgba(20, 20, 20, 0.62);
    --color-hub-surface: #ffffff;
    --color-hub-bg: #f5f5f5;
    --color-hub-border: rgba(0, 0, 0, 0.08);
}

body.body-color-hub .section-navbar-link--active {
    color: var(--color-primary-500, #136ef5);
    font-weight: 600;
}

body.body-color-hub #stage-main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 0;
}

body.body-color-explore #stage-main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: 0;
}

body.body-color-explore .section-navbar-link--active {
    color: var(--color-primary-500, #136ef5);
    font-weight: 600;
}

body.body-color-create {
    background: #fff;
    --color-create-main-offset: clamp(1.25rem, 3vw, 2rem);
}

body.body-color-create #stage-main {
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding: calc(var(--stage-navbar-height, 4.25rem) + var(--color-create-main-offset)) 0 0;
    box-sizing: border-box;
}

body.body-color-create .section-navbar-link--active {
    color: var(--color-primary-500, #136ef5);
    font-weight: 600;
}

body.body-color-create .color-studio {
    padding-top: 0;
    min-height: calc(100vh - var(--stage-navbar-height, 4.25rem) - var(--color-create-main-offset));
    box-sizing: border-box;
}

@media (min-width: 64rem) {
    body.body-color-create {
        --color-create-main-offset: 64px;
    }
}

.color-studio-faq {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.body-color-hub .stage-palette-hero {
    padding-top: calc(var(--stage-navbar-height, 4.25rem) + clamp(1.25rem, 3vw, 2rem));
}

/* ── Hub shell ── */
.color-hub {
    color: var(--color-hub-ink);
}

.color-hub__section-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
}

/* ── Hero (centered, Adobe-style) ── */
.color-hub__hero {
    padding-top: calc(var(--stage-navbar-height, 4.25rem) + clamp(2.5rem, 6vw, 4.5rem));
    padding-bottom: clamp(3rem, 7vw, 5rem);
    background: var(--color-hub-surface);
    border-bottom: 1px solid var(--color-hub-border);
}

.color-hub__hero-inner {
    display: flex;
    justify-content: center;
}

body.body-color-hub .color-hub__hero-copy.stage-copy-flow {
    align-items: center;
    text-align: center;
}

body.body-color-hub .color-hub__hero-copy .stage-copy-cta {
    justify-content: center;
}

.color-hub__brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-hub-ink);
}

.color-hub__brand-mark {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.color-hub__title {
    margin: 0;
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
    font-weight: 700;
    text-wrap: balance;
}

.color-hub__lede {
    margin: 0;
    max-width: 52ch;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.55;
    color: var(--color-hub-muted);
}

body.body-color-hub .color-hub__hero-cta {
    padding: 0.85rem 1.65rem;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Tools row ── */
.color-hub__tools {
    padding: clamp(2.75rem, 6vw, 4rem) 0;
    background: var(--color-hub-bg);
}

.color-hub__tools .color-hub__section-title {
    margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.color-hub__tool-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.75rem, 1.5vw, 1.25rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.color-hub__tool-item {
    min-width: 0;
}

.color-hub__tool-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    color: var(--color-hub-ink);
    text-decoration: none;
}

a.color-hub__tool-card:hover,
a.color-hub__tool-card:focus-visible {
    color: var(--color-hub-ink);
    text-decoration: none;
}

body.body-color-hub.body-color-app #stage-main a.color-hub__tool-card,
body.body-color-hub.body-color-app #stage-main a.color-hub__tool-card:hover,
body.body-color-hub.body-color-app #stage-main a.color-hub__tool-card:focus-visible {
    color: var(--color-hub-ink);
    text-decoration: none;
}

.color-hub__tool-card--soon {
    cursor: default;
    opacity: 0.72;
}

.color-hub__tool-thumb {
    position: relative;
    display: block;
    aspect-ratio: 1.05;
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.color-hub__tool-thumb--contrast {
    background: linear-gradient(90deg, #136ef5 0 50%, #22c55e 50% 100%);
}

.color-hub__tool-thumb--contrast::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0, transparent 42%),
        conic-gradient(from 210deg, #13dff5, #136ef5, #2913f5, #13dff5);
    clip-path: polygon(38% 18%, 62% 18%, 72% 38%, 62% 58%, 50% 82%, 38% 58%, 28% 38%);
    opacity: 0.55;
}

.color-hub__tool-badge {
    position: absolute;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.color-hub__tool-badge--ok {
    top: 0.55rem;
    left: 0.55rem;
    background: #22c55e;
}

.color-hub__tool-badge--ok::after {
    content: '';
    position: absolute;
    left: 0.38rem;
    top: 0.22rem;
    width: 0.35rem;
    height: 0.6rem;
    border: 2px solid #fff;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
}

.color-hub__tool-badge--fail {
    right: 0.55rem;
    bottom: 0.55rem;
    background: #ef4444;
}

.color-hub__tool-badge--fail::before,
.color-hub__tool-badge--fail::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0.55rem;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

.color-hub__tool-badge--fail::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.color-hub__tool-badge--fail::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.color-hub__tool-thumb--gradient {
    background:
        linear-gradient(180deg, #f97316 0%, #fb7185 35%, transparent 35%),
        linear-gradient(180deg, #136ef5 0%, #22d3ee 45%, #fbbf24 100%);
}

.color-hub__tool-icon {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.color-hub__tool-icon--dropper::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0.55rem;
    width: 0.55rem;
    height: 1rem;
    border: 2px solid #141414;
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    transform: translateX(-50%);
}

.color-hub__tool-icon--dropper::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0.55rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: #136ef5;
    transform: translateX(-50%);
}

.color-hub__tool-thumb--extract {
    background:
        linear-gradient(180deg, #78716c 0%, #a8a29e 28%, #57534e 55%, #292524 100%);
}

.color-hub__tool-thumb--extract::after {
    content: '';
    position: absolute;
    inset: 0 0 0 52%;
    background: linear-gradient(180deg, #7dd3fc 0%, #0891b2 35%, #312e81 70%, #d97706 100%);
}

.color-hub__tool-marker {
    position: absolute;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.color-hub__tool-marker--1 {
    left: 18%;
    top: 22%;
    background: #7dd3fc;
}

.color-hub__tool-marker--2 {
    left: 32%;
    top: 48%;
    background: #0891b2;
}

.color-hub__tool-marker--3 {
    left: 22%;
    top: 68%;
    background: #d97706;
}

.color-hub__tool-thumb--explore {
    background: #3f3f46;
}

.color-hub__tool-explore-grid {
    position: absolute;
    inset: 0.45rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.35rem;
}

.color-hub__tool-explore-grid span {
    display: block;
    border-radius: 0.25rem;
    min-height: 100%;
}

.color-hub__tool-explore-grid span:first-child {
    grid-row: span 2;
}

.color-hub__tool-thumb--wheel {
    background:
        radial-gradient(circle at 50% 50%, #fff 0 18%, transparent 19%),
        conic-gradient(from 0deg, #ef4444, #f97316, #fbbf24, #22c55e, #136ef5, #a78bfa, #ef4444);
}

.color-hub__tool-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    padding: 1rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    transition: opacity 0.2s ease;
}

a.color-hub__tool-card:hover .color-hub__tool-hover,
a.color-hub__tool-card:focus-visible .color-hub__tool-hover {
    opacity: 1;
}

.color-hub__tool-hover-desc {
    margin: 0;
    max-width: 16rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.color-hub__tool-hover-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.35rem;
    border-radius: 999px;
    background: #fff;
    color: #141414;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .color-hub__tool-hover {
        transition: none;
    }
}

.color-hub__tool-label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    text-align: center;
    color: var(--color-hub-ink, #141414);
}

.color-hub__tool-soon {
    display: block;
    margin-top: -0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    color: var(--color-hub-muted);
}

/* ── Featured palettes ── */
.color-hub__featured {
    padding: clamp(2.75rem, 6vw, 4rem) 0 clamp(3rem, 6vw, 4.5rem);
    background: var(--color-hub-surface);
    border-top: 1px solid var(--color-hub-border);
}

.color-hub__featured-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.color-hub__link-more {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary-500, #136ef5);
    text-decoration: none;
}

.color-hub__link-more:hover {
    text-decoration: underline;
}

.color-hub__sample-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 1.5vw, 1rem);
}

.color-hub__sample {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    color: inherit;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.color-hub__sample:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.color-hub__sample-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: clamp(5rem, 12vw, 7.5rem);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.15s ease;
}

.color-hub__sample:hover .color-hub__sample-strip {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.color-hub__sample-strip span {
    display: block;
    min-height: 100%;
}

.color-hub__sample-name {
    font-size: 0.9375rem;
    font-weight: 600;
    padding-inline: 0.15rem;
    color: var(--color-hub-ink, #141414);
}

/* ── Explore page (Adobe-style) ── */
.color-explore {
    color: var(--color-hub-ink);
}

.color-explore__hero {
    padding-top: calc(var(--stage-navbar-height, 4.25rem) + clamp(2.5rem, 6vw, 4rem));
    padding-bottom: clamp(2.5rem, 5vw, 3.5rem);
    background: var(--color-hub-surface);
    border-bottom: 1px solid var(--color-hub-border);
}

.color-explore__hero-inner {
    display: flex;
    justify-content: center;
}

body.body-color-explore .color-explore__hero-copy.stage-copy-flow {
    align-items: center;
    text-align: center;
    width: 100%;
}

body.body-color-explore .color-explore__hero-copy .stage-copy-head-body,
body.body-color-explore .color-explore__hero-copy .stage-copy-desc {
    align-items: center;
    width: 100%;
    text-align: center;
}

.color-explore__brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.color-explore__brand-mark {
    display: inline-flex;
    width: 1.35rem;
    height: 1.35rem;
    flex-shrink: 0;
}

.color-explore__title {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    font-weight: 700;
    text-wrap: balance;
}

.color-explore__lede {
    margin: 0;
    max-width: 52ch;
    margin-inline: auto;
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.55;
    color: var(--color-hub-muted);
}

.color-explore__search-wrap {
    position: relative;
    width: min(100%, 42rem);
    margin-inline: auto;
}

.color-explore__search-icon {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    width: 1.125rem;
    height: 1.125rem;
    transform: translateY(-50%);
    opacity: 0.55;
    pointer-events: none;
}

.color-explore__search {
    width: 100%;
    padding: 0.9rem 1.25rem 0.9rem 2.85rem;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 999px;
    background: #fff;
    color: var(--color-hub-ink);
    font: inherit;
    font-size: 1rem;
    line-height: 1.3;
}

.color-explore__search::placeholder {
    color: rgba(20, 20, 20, 0.45);
}

.color-explore__search:focus {
    outline: 2px solid rgba(19, 110, 245, 0.35);
    outline-offset: 2px;
    border-color: rgba(19, 110, 245, 0.35);
}

.color-explore__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    width: min(100%, 56rem);
    margin-inline: auto;
}

.color-explore__tag {
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.45rem;
    background: #fff;
    color: var(--color-hub-ink);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.color-explore__tag:hover,
.color-explore__tag.is-active {
    border-color: rgba(19, 110, 245, 0.35);
    background: rgba(19, 110, 245, 0.06);
}

.color-explore__catalog {
    padding: clamp(2rem, 4vw, 2.75rem) 0 clamp(3rem, 6vw, 4.5rem);
    background: var(--color-hub-bg);
}

.color-explore__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
}

.color-explore__catalog-title {
    margin: 0;
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.color-explore__filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.color-explore__select-wrap {
    position: relative;
    min-width: 9.5rem;
}

.color-explore__select-wrap.is-disabled {
    opacity: 0.72;
}

.color-explore__select-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.45rem;
    background: #fff;
    color: var(--color-hub-ink);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-explore__select-trigger:hover:not(:disabled) {
    border-color: rgba(0, 0, 0, 0.2);
}

.color-explore__select-wrap.is-open .color-explore__select-trigger,
.color-explore__select-trigger:focus-visible {
    outline: none;
    border-color: rgba(19, 110, 245, 0.35);
    box-shadow: 0 0 0 3px rgba(19, 110, 245, 0.12);
}

.color-explore__select-trigger:disabled {
    cursor: default;
}

.color-explore__select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.color-explore__select-icon {
    display: inline-flex;
    width: 0.8rem;
    height: 0.8rem;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.color-explore__select-wrap.is-open .color-explore__select-icon {
    transform: rotate(180deg);
}

.color-explore__select-panel {
    position: absolute;
    z-index: 12;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.55rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.color-explore__select-panel[hidden] {
    display: none;
}

.color-explore__select-option-item {
    margin: 0;
}

.color-explore__select-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--color-hub-ink);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.12s ease;
}

.color-explore__select-option:hover,
.color-explore__select-option:focus-visible {
    outline: none;
    background: rgba(19, 110, 245, 0.08);
}

.color-explore__select-option.is-active {
    background: rgba(19, 110, 245, 0.1);
    font-weight: 600;
}

.color-explore__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(1rem, 2vw, 1.35rem);
}

.color-explore__card {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
}

.color-explore__card[hidden] {
    display: none;
}

.color-explore__card-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: clamp(5.5rem, 11vw, 7rem);
    border-radius: 0.65rem;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.15s ease;
}

.color-explore__card-strip span {
    display: block;
    min-height: 100%;
}

.color-explore__card-strip:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.color-explore__card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.color-explore__card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-hub-ink, #141414);
}

.color-explore__card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.color-explore__card-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.35rem;
    color: var(--color-hub-ink, #141414);
    text-decoration: none;
    transition: background-color 0.15s ease;
}

.color-explore__card-action svg {
    width: 1rem;
    height: 1rem;
}

.color-explore__card-action:hover {
    background: rgba(0, 0, 0, 0.06);
    text-decoration: none;
}

.color-explore__empty {
    margin: 2rem 0 0;
    text-align: center;
    color: var(--color-hub-muted);
}

body.body-color-explore #stage-main a.color-explore__card-strip,
body.body-color-explore #stage-main a.color-explore__card-action,
body.body-color-explore #stage-main a.color-explore__card-strip:hover,
body.body-color-explore #stage-main a.color-explore__card-action:hover {
    color: var(--color-hub-ink, #141414);
    text-decoration: none;
}

.color-hub__empty {
    max-width: 28rem;
    margin: 2rem auto;
    text-align: center;
}

.color-hub__empty-title {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.color-hub__empty-text {
    margin: 0 0 1.25rem;
    color: var(--color-hub-muted);
}

@media (max-width: 1100px) {
    .color-explore__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .color-hub__tool-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .color-explore__toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .color-explore__filters {
        width: 100%;
        justify-content: flex-start;
    }

    .color-explore__grid {
        grid-template-columns: 1fr;
    }

    .color-hub__tool-row {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0.85rem;
        padding-bottom: 0.35rem;
        -webkit-overflow-scrolling: touch;
    }

    .color-hub__tool-item {
        flex: 0 0 min(72vw, 11.5rem);
        scroll-snap-align: start;
    }

    .color-hub__sample-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .color-hub__hero {
        padding-top: calc(var(--stage-navbar-height, 4.25rem) + 1.75rem);
    }
}
