/* =========================================================
   Coloreth — Modern Stylesheet (no Bootstrap, no animations)
   ========================================================= */

/* ---------- Reset & tokens ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --bg: #eef1f6;
    --panel-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.5);
    --border-soft: #efefef;
    --border-strong: #929292;
    --muted: #7b8497;
    --text: #1a1a1a;
    --accent: #4a5cf0;
    --accent-2: #8b5cf6;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .07);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, .08);

    --swatch-cell-height: 170px;
    --swatch-cells: 12;

    /* My-collection strip height */
    --collection-height: 70px;
    --collection-reserve: 140px; /* space so page content isn't hidden behind it */
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Clarity City", system-ui, -apple-system, Segoe UI, sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    color: var(--text);
    background-color: var(--bg);
    min-height: 100vh;
    /* Reserve room at the bottom so fixed collection bar never hides content */
    padding-bottom: var(--collection-reserve);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =====================================================================
   TOAST
   ===================================================================== */
.toast {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #111;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: .3px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .12);
    border-bottom: 1px solid #eaeaea;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms linear;
}

.toast.is-visible {
    opacity: 1;
}

/* =====================================================================
   HERO HEADER
   ===================================================================== */
.hero {
    background-color: rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid var(--border-soft);
    padding: 44px 20px 40px;
    text-align: center;
}

.hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

/* Animated SVG logo — the <object> wrapper applies the color animation
   via CSS `filter`. Subtle gray gradients cycle continuously. */
.hero-title {
    display: block;
    width: 250px;
    height: auto;
    margin: 0 auto 20px;
    opacity: 0.30;
    /* Subtle continuous gray tint cycling — GPU-composited, cheap */
    animation: logoGrayCycle 8s ease-in-out infinite;
}

.hero-input::placeholder {
    color: #818181;
    opacity: 0.5; /* 50% transparent → looks 50% lighter */
}

@keyframes logoGrayCycle {
    0% {
        filter: grayscale(100%) brightness(0.45) contrast(1.0);
    }
    25% {
        filter: grayscale(100%) brightness(0.65) contrast(1.1);
    }
    50% {
        filter: grayscale(100%) brightness(0.90) contrast(1.2);
    }
    75% {
        filter: grayscale(100%) brightness(0.70) contrast(1.1);
    }
    100% {
        filter: grayscale(100%) brightness(0.45) contrast(1.0);
    }
}

.hero-subtitle {
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 0.98rem;
}

.hero-input-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 18px;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--border-soft);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
}

.hero-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 6px rgba(74, 92, 240, .12), var(--shadow-lg);
}

.hero-hash {
    font-size: 2rem;
    font-weight: 700;
    color: var(--muted);
    user-select: none;
}

.hero-input {
    font: inherit;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: none;
    outline: none;
    background: transparent;
    width: 240px;
    padding: 6px 4px;
    color: var(--text);
    text-align: left;
}

/* =====================================================================
   NAVBAR
   ===================================================================== */
.navbar-2026 {
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-inner {
    width: 100%;
    padding: 10px 16px;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: .3px;
    color: #333;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-btn:hover {
    background: rgba(74, 92, 240, .09);
    color: var(--accent);
}

.nav-btn--reset {
    background: #f3f4f8;
    border-color: #e3e5ee;
}

.nav-btn--reset:hover {
    background: #e8eaf3;
}

.nav-btn--close {
    background: #fff1f1;
    color: #b42318;
}

.nav-btn--close:hover {
    background: #ffe4e2;
    color: #8e1a11;
}

.nav-btn--brand {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(74, 92, 240, .28);
    opacity: 0.6;
}

.nav-btn--brand:hover {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 22px rgba(74, 92, 240, .38);
    opacity: 1;
}

.bg-group {
    display: inline-flex;
    background: #f3f4f8;
    border: 1px solid #e3e5ee;
    border-radius: 999px;
    padding: 2px;
    gap: 2px;
}

.bg-group .bg-btn {
    padding: 6px 11px;
    font-size: 0.8rem;
    border-radius: 999px;
    background: transparent;
    border: none;
}

.bg-group .bg-btn:hover {
    background: #fff;
    color: var(--accent);
}

.divider {
    width: 1px;
    height: 22px;
    background: #dcdfe8;
    margin: 0 6px;
}

.spacer {
    flex: 1 1 auto;
}

/* =====================================================================
   CONTAINER + SWATCH STACK
   ===================================================================== */
.container {
    width: 100%;
    margin: 0;
    padding: 0 0 40px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.swatch-block {
    width: 100%;
    padding: 18px 20px 0;
    margin-bottom: 22px;
}

/* Title bar ABOVE the row, left-justified, full width */
.swatch-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px 14px;
    padding: 0;
    line-height: 1.3;
    width: 100%;
    text-align: left;
}

.titlesample {
    display: inline-block;
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .10);
    flex: 0 0 auto;
}

.swatch-title-text {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: .4px;
    color: #333;
}

/* Action buttons inside title (CLOSE / COPY / DOWNLOAD) */
span.closelink {
    display: inline-block;
    border: 1px solid #d9dce5;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: .5px;
    margin-left: 4px;
    color: #555;
    background: transparent;
    cursor: pointer;
    user-select: none;
}

span.closelink:hover {
    background: #fff;
    border-color: #b9bfd1;
    color: #111;
}

/* The swatch row itself */
.swatch-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    background: none;
    border: 3px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
}

/* =====================================================================
   COLOR CELLS
   ===================================================================== */
.colorcell2 {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    flex: 0 0 calc(100% / var(--swatch-cells));
    max-width: calc(100% / var(--swatch-cells));
    height: var(--swatch-cell-height);
    padding: 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hexlabel,
span.hexlabel,
a.hexlabel {
    display: inline-block;
    opacity: 1;
    font-size: 0.62rem;
    font-weight: 600;
    color: #fff;
    background: rgba(0, 0, 0, .28);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
    margin-bottom: 4px;
    text-decoration: none;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.hexlabel:hover {
    background: rgba(0, 0, 0, .5);
}

.colorcell2 > .hexlabel.action-label {
    opacity: 0.1;
}

.swatch-row:hover .colorcell2 > .hexlabel.action-label {
    opacity: 1;
}

footer {
    margin: 0 auto;
    text-align: center;
    display: block;
    padding-top: 450px;
    opacity: 0.6;
}

/* =====================================================================
   MY COLLECTION — fixed bar at the bottom of the viewport
   ===================================================================== */
.mycollection {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid #e2e6ee;
    box-shadow: 0 -6px 22px rgba(0, 0, 0, .06);
    z-index: 500;
    padding: 8px 16px 10px;
}

.mycollection-header {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.mycollection-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #333;
    margin-right: 6px;
}

.mycollection-strip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 6px;
    height: var(--collection-height);
    overflow-x: auto;
    overflow-y: hidden;
    /* Hide scrollbar visually but keep it functional */
    scrollbar-width: thin;
}

.mycollection-strip::-webkit-scrollbar {
    height: 6px;
}

.mycollection-strip::-webkit-scrollbar-thumb {
    background: #cfd4e0;
    border-radius: 4px;
}

/* Small square collection chips */
.collection-chip {
    flex: 0 0 auto;
    width: var(--collection-height);
    height: var(--collection-height);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .10);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    padding-bottom: 4px;
    cursor: pointer;
    user-select: none;
}

.collection-chip:hover {
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.collection-empty {
    color: var(--muted);
    font-size: 0.75rem;
    font-style: italic;
    padding-left: 4px;
}

/* =====================================================================
   MISC
   ===================================================================== */
#currentbgno {
    display: none;
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1200px) {
    :root {
        --swatch-cells: 6;
    }
}

@media (max-width: 767px) {
    :root {
        --swatch-cells: 4;
        --swatch-cell-height: 150px;
    }

    .hero {
        padding: 30px 16px 28px;
    }

    .hero-input {
        width: 180px;
        font-size: 1.6rem;
    }

    .hero-hash {
        font-size: 1.6rem;
    }

    .nav-btn {
        padding: 7px 11px;
        font-size: 0.78rem;
    }

    .divider {
        display: none;
    }

    .swatch-block {
        padding: 14px 10px 0;
    }

    .swatch-row {
        padding: 8px;
    }
}