/* ===== Hex Color Clock Theme ===== */

.hx-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(6px);
}

.hx-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted, #6b7280);
    letter-spacing: 0.02em;
    user-select: none;
}

.hx-switch {
    position: relative;
    width: 38px;
    height: 20px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hx-switch:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.4);
    outline-offset: 2px;
}

.hx-switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #94a3b8;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
}

.hx-switch[aria-pressed="true"] {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.hx-switch[aria-pressed="true"] .hx-switch-thumb {
    transform: translateX(18px);
    background: #f5f5f5;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
}

/* ===== Stage ===== */
.hx-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 24px;
    width: 100%;
    max-width: 720px;
}

.hx-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 60vh;
    border-radius: 18px;
    overflow: hidden;
    background: #000;
    box-shadow:
        0 30px 70px -22px rgba(0, 0, 0, 0.75),
        0 12px 24px -10px rgba(0, 0, 0, 0.45);
    transition: background-color 0.6s ease;
}

.hx-swatch {
    position: absolute;
    inset: 0;
    background-color: #000;
    transition: background-color 0.6s ease;
}

.hx-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    padding: 24px 32px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Make text adapt to the swatch brightness via mix-blend */
.hx-overlay > * {
    mix-blend-mode: difference;
    color: #ffffff;
}

.hx-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hx-label {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(10px, 1.1vw, 12px);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    opacity: 0.85;
}

.hx-time-now {
    font-family: "Menlo", "Monaco", "Consolas", monospace;
    font-weight: 600;
    font-size: clamp(13px, 1.4vw, 16px);
    letter-spacing: 0.18em;
    opacity: 0.85;
}

.hx-hex-block {
    align-self: center;
    justify-self: center;
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: "Menlo", "Monaco", "Consolas", monospace;
    font-weight: 700;
    line-height: 1;
    font-size: clamp(56px, 11vw, 132px);
    letter-spacing: 0.04em;
    transition: letter-spacing 0.6s ease;
}

.hx-hash {
    opacity: 0.55;
    font-size: 0.7em;
}

.hx-bytes {
    display: flex;
    justify-content: space-between;
    font-family: "Menlo", "Monaco", "Consolas", monospace;
    font-size: clamp(11px, 1.2vw, 13px);
    letter-spacing: 0.18em;
    opacity: 0.85;
}

.hx-byte {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.hx-byte-key {
    opacity: 0.55;
    font-weight: 600;
}

/* ===== Timeline (gradient strip of last N colors) ===== */
.hx-timeline {
    width: 100%;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    display: flex;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hx-timeline.hidden {
    display: none;
}

.hx-timeline-cell {
    flex: 1;
    height: 100%;
}

@media (max-width: 640px) {
    .hx-overlay { padding: 16px 18px; }
    .hx-toolbar { gap: 6px 12px; padding: 5px 10px; }
    .hx-toggle-label { font-size: 11px; }
}