/* Paradigms 2026 — Typographic Treatment */

/* Set in Instrument Sans (SIL OFL), standing in for ABC Diatype; loaded by js/text-renderer.js */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background:
        repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
}

/* --- Canvas layer --- */
#glcanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    display: block;
}

/* --- Text overlay layer --- */
#text-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;

    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: pre-wrap;
    word-break: break-word;

    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    color: transparent;
    caret-color: #fff;

    outline: none;
    cursor: text;
    padding: 2rem;

    -webkit-user-select: text;
    user-select: text;
}

#text-overlay::selection {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}

#text-overlay *::selection {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}

/* --- lil-gui: dark glass theme + positioning --- */
.paradigms-gui {
    z-index: 2;
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    --background-color: rgba(0, 0, 0, 0.55);
    --widget-color: rgba(255, 255, 255, 0.08);
    --focus-color: rgba(255, 255, 255, 0.15);
    --hover-color: rgba(255, 255, 255, 0.12);
    --number-color: rgba(255, 255, 255, 0.7);
    --string-color: rgba(255, 255, 255, 0.7);
    --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-size: 11px;
    --text-color: rgba(255, 255, 255, 0.85);
    --title-background-color: rgba(0, 0, 0, 0.3);
    --title-text-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.paradigms-gui .children {
    overflow-y: auto;
    max-height: calc(100vh - 120px);
}

.paradigms-gui input,
.paradigms-gui select {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
}

.paradigms-gui .slider {
    background: rgba(255, 255, 255, 0.06);
}

.paradigms-gui.is-hidden {
    display: none;
}

/* --- Timeline bar (QuickTime-style) --- */
.timeline-bar {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 640px;
    z-index: 2;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 10px 16px 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    color: #fff;
    font-size: 11px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    min-height: 66px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Auto-hide when idle */
.timeline-bar.is-idle {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
    pointer-events: none;
}

/* Hide cursor when idle */
body.cursor-hidden {
    cursor: none;
}

/* --- Scrub area (padded hit target) --- */
.timeline-scrub {
    position: relative;
    padding: 6px 0;
    cursor: pointer;
    margin-bottom: 10px;
    min-height: 10px;
}

/* --- Track (thin bar, expands on hover) --- */
.timeline-track {
    height: 3px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    transition: height 0.15s ease;
}

.timeline-scrub:hover .timeline-track {
    height: 3px;
}

.timeline-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: inherit;
    pointer-events: none;
}

/* --- Playhead (circle) --- */
.timeline-playhead {
    position: absolute;
    top: 50%;
    left: 0;
    width: 13px;
    height: 13px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease;
    opacity: 0;
}

.timeline-scrub:hover .timeline-playhead,
.timeline-bar.is-playing .timeline-playhead,
.timeline-bar.is-scrubbing .timeline-playhead {
    opacity: 1;
}

.timeline-scrub:hover .timeline-playhead {
    transform: translate(-50%, -50%) scale(1.1);
}

/* --- Controls row --- */
.timeline-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-spacer {
    flex: 1;
}

/* --- Play button (borderless) --- */
.timeline-play {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.1s;
}

.timeline-play:hover {
    color: #fff;
}

/* --- Animation toggles --- */
.timeline-toggles {
    display: flex;
    align-items: center;
    gap: 4px;
}

.timeline-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    width: 26px;
    height: 26px;
    padding: 0;
    cursor: pointer;
    transition: all 0.15s;
}

.timeline-toggle-pro{
    margin-right: 6px;
}

.timeline-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.timeline-toggle.is-active {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

.timeline-toggle.is-active:hover {
    background: #fff;
}

.timeline-toggle svg {
    display: block;
    shape-rendering: geometricPrecision;
}

/* Force controls-row content onto its own compositing layer
   so backdrop-filter blur doesn't soften icons and text */
.timeline-controls-row {
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Vertical slider popup --- */
.timeline-vslider {
    position: fixed;
    transform: translate(-50%, -100%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.timeline-vslider-track {
    width: 4px;
    height: 100px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.timeline-vslider-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
    border-radius: inherit;
    transition: none;
}

.timeline-vslider-label {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.6);
    white-space: nowrap;
}

/* --- Time display --- */
.timeline-time {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.5;
    font-size: 11px;
}

.timeline-total {
    cursor: pointer;
    border-radius: 3px;
    padding: 1px 3px;
    margin: -1px -3px;
    transition: background 0.15s;
}

.timeline-total:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* --- Inline duration edit --- */
.timeline-duration-edit {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.9);
    border-radius: 3px;
    padding: 1px 4px;
    width: 48px;
    font-size: 11px;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    text-align: center;
    outline: none;
}

/* --- Preset toggle strip — goo blob group --- */
.timeline-preset-group {
    position: relative;
    isolation: isolate;
}

/* Goo-filtered background: full-alpha circles for shape detection,
   #goo-light replaces the visual with a subtle tint + white border */
.timeline-preset-blob-bg {
    position: absolute;
    inset: -12px;
    padding: 12px;
    display: flex;
    align-items: center;
    filter: url(#goo-light);
    pointer-events: none;
    overflow: visible;
    opacity: 0.4;
    padding-left: 7px;
    padding-right: 7px;
}

.timeline-preset-blob-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #000;
    flex: 1 0 0%;
}

/* Content layer — buttons sit on top, unfiltered */
.timeline-preset-strip {
    position: relative;
    display: flex;
    align-items: center;
    background: none;
    border: none;
    height: 26px;
    z-index: 1;
}

.timeline-preset-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.timeline-preset-btn {
    position: relative;
    z-index: 1;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s;
}

.timeline-preset-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

.timeline-preset-btn.is-active {
    color: rgba(255, 255, 255, 0.95);
}

/* --- Color pickers --- */
.timeline-colors {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.timeline-color {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    background: none;
    transition: border-color 0.15s;
}

.timeline-color:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.timeline-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.timeline-color::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.timeline-color::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

/* --- Color wrap (checkerboard behind swatch for alpha preview) --- */
.timeline-color-wrap {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: repeating-conic-gradient(#999 0% 25%, #666 0% 50%) 0 0 / 6px 6px;
    cursor: pointer;
    overflow: hidden;
}

.timeline-color-wrap .timeline-color {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 50%;
    pointer-events: none;
}

/* --- Keyframe SVG arc layer --- */
.timeline-kf-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

.timeline-kf-svg path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.8;
}

/* --- Keyframe dots --- */
.timeline-kf-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--kf-color);
    transform: translate(-50%, -50%);
    z-index: 2;
    cursor: grab;
    pointer-events: auto;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Large invisible hit area via pseudo-element */
.timeline-kf-dot::before {
    content: '';
    position: absolute;
    top: -14px;
    left: -14px;
    right: -14px;
    bottom: -14px;
    border-radius: 50%;
}

.timeline-kf-dot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 0 8px var(--kf-color);
}

.timeline-kf-dot.is-selected {
    transform: translate(-50%, -50%) scale(1.4);
    box-shadow: 0 0 12px var(--kf-color), 0 0 4px var(--kf-color);
}

/* --- Keyframe picker popup --- */
.timeline-kf-picker {
    position: fixed;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.timeline-kf-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.timeline-kf-picker-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timeline-kf-picker-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.timeline-kf-picker-val {
    margin-left: auto;
    opacity: 0.4;
    font-variant-numeric: tabular-nums;
}

/* --- Easing picker popup --- */
.timeline-easing-picker {
    position: fixed;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 130px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.timeline-easing-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.1s;
}

.timeline-easing-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timeline-easing-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.timeline-easing-preview {
    flex-shrink: 0;
    opacity: 0.6;
}

.timeline-easing-item.is-active .timeline-easing-preview {
    opacity: 1;
}

/* --- Action buttons — blobby group architecture --- */
.timeline-actions {
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
}

.timeline-actions-left {
    right: auto;
    left: -80px;
}

.timeline-actions-left .timeline-blob-bg,
.timeline-actions-left .timeline-blob-content {
    direction: rtl;
}

/* Blob group wrapper — isolate goo filter */
.timeline-blob-group {
    isolation: isolate;
}

/* Background blob layer — grid mirrors the content layout.
   Negative inset + matching padding gives the goo blur room to extend
   while keeping circle grid cells aligned with button grid cells.
   Explicit 32px columns prevent 50px circles from inflating the grid —
   circles overflow their cells and the goo blur merges the overlap. */
.timeline-blob-bg {
    position: absolute;
    inset: -16px;
    padding: 16px;
    display: grid;
    grid-template-rows: repeat(2, 32px);
    grid-template-columns: repeat(2, 32px);
    grid-auto-flow: column;
    row-gap: 6px;
    column-gap: 4px;
    filter: url(#goo);
    pointer-events: none;
    overflow: visible;
    opacity: 0.6;
    
}

.timeline-blob-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    place-self: center;
    border: 20px solid rgba(0, 0, 0, 0.55);
}

/* Content layer — 2-row grid, column-first fill.
   Same explicit column sizing as blob-bg so cells align. */
.timeline-blob-content {
    position: relative;
    display: grid;
    grid-template-rows: repeat(2, 32px);
    grid-template-columns: repeat(2, 32px);
    grid-auto-flow: column;
    row-gap: 6px;
    column-gap: 4px;
    z-index: 1;
}

/* Col 2 offset — nudge down for organic asymmetry.
   Right group: item 3 (font) is alone in col 2. */
.timeline-actions:not(.timeline-actions-left) .timeline-blob-content .timeline-action:nth-child(3) {
    transform: translateY(8px);
}
.timeline-actions:not(.timeline-actions-left) .timeline-blob-circle:nth-child(3) {
    transform: translateY(8px);
}

.timeline-actions:not(.timeline-actions-right) .timeline-blob-content .timeline-action:nth-child(3) {
    transform: translateY(8px);
}
.timeline-actions:not(.timeline-actions-right) .timeline-blob-circle:nth-child(3) {
    transform: translateY(8px);
}


.timeline-action {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    background: radial-gradient(rgba(255,255,255,0.15), transparent);
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: all 0.15s;
}

.timeline-action:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.7);
}

.timeline-action svg {
    display: block;
    shape-rendering: geometricPrecision;
}

/* Record button — recording state (matches toggle .is-active style) */
.timeline-action.is-recording {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    animation: recording-pulse 1.2s ease-in-out infinite;
}

@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3); }
    50% { box-shadow: 0 0 12px 4px rgba(255, 255, 255, 0.15); }
}

/* Font generation button — generating state (matches toggle .is-active) */
.timeline-action-font.is-generating {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    animation: font-pulse 1.5s ease-in-out infinite;
}

@keyframes font-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* --- Resolution label on record button --- */
.timeline-rec-label {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translate(-50%, 100%);
    font-size: 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    pointer-events: none;
    line-height: 1;
    opacity: 0;
}

/* --- Resolution picker popup --- */
.timeline-res-picker {
    position: fixed;
    z-index: 20;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 4px 0;
    min-width: 80px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.timeline-res-picker-item {
    padding: 5px 14px;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s;
    white-space: nowrap;
}

.timeline-res-picker-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.timeline-res-picker-item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* --- Embedded (case study / home strip): a text box sets the word --- */
body.embedded #text-overlay { display: none; }
body.embedded .timeline-action-font { display: none; } /* font export needs the real font file */
.copy-ui {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}
.copy-ui.is-right { left: auto; right: 16px; align-items: flex-end; }
.copy-box {
    width: 268px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.55);
    font: 11px/22px 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.copy-box textarea {
    flex: 1;
    min-width: 0;
    height: 22px;
    resize: none;
    overflow: hidden;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: 15px/22px 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
    caret-color: #fff;
}
.copy-box textarea::selection { background: rgba(255, 255, 255, 0.3); }
/* the dock: text box and key under the timeline bar (?maker=1) */
body.has-dock .timeline-bar { bottom: calc(var(--dock-h, 48px) + 24px); }
.dock {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    max-width: 640px;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}
.dock-row { display: flex; align-items: center; gap: 8px; }
.dock .copy-box { flex: 1 1 auto; width: auto; min-width: 0; box-sizing: border-box; min-height: 38px; padding: 7px 16px; border-radius: 20px; } /* a pill like the tags, filling the row */
.dock-row.has-open .copy-box { flex: 0 1 200px; }
/* the key: one row, never wider than the play bar. A tag's dot slides open into
   its range; the others fold down to their dots */
.key-chips { flex: 0 1 auto; min-width: 0; display: flex; gap: 6px; }
.key-chips.has-open { flex-grow: 1; }
.key-chip {
    --ease: cubic-bezier(0.3, 0.7, 0.2, 1);
    flex: 0 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    color: rgba(255, 255, 255, 0.8);
    font: 11px 'Helvetica Neue', Helvetica, Arial, sans-serif;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    outline: 0;
    overflow: hidden; /* clips the name and readout while the tag resizes */
    transition: border-color 0.2s;
}
.key-chip:focus-visible { border-color: rgba(255, 255, 255, 0.5); }
.key-chip.is-open { flex: 1 1 0; color: #fff; padding-left: 14px; border-color: color-mix(in srgb, var(--c) 55%, transparent); cursor: default; }
.key-name { flex: none; }
.key-chip.is-open .key-name { cursor: pointer; }
/* with one open, the rest are just their balls */
.key-chips.has-open .key-chip:not(.is-open):not(.is-sizing) .key-name { display: none; }
/* closed: the range is just the 10px ball (every keyframe's ball stacked in one
   place). Open: the tag grows and the balls slide out along a thin track to
   their values, a thin line in the track colour joining them */
.key-range {
    position: relative;
    flex: 0 0 10px;
    height: 10px;
    touch-action: none;
}
.key-range::before { content: ''; position: absolute; left: 0; right: 0; top: 4px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, 0.14); opacity: 0; transition: opacity 0.3s; }
.key-chip.is-open .key-range { flex-grow: 1; }
.key-chip.is-open .key-range::before { opacity: 1; }
.key-span {
    position: absolute; top: 4px; height: 2px; left: 5px; width: 0;
    border-radius: 1px;
    background: var(--c);
    transition: left 0.4s var(--ease), width 0.4s var(--ease);
}
.key-span::after { content: ''; position: absolute; inset: -8px 0; } /* easier to grab than 2px */
.key-chip.is-open .key-span { left: var(--lo); width: var(--w); cursor: grab; }
.key-chip.is-dragging .key-span { transition: none; cursor: grabbing; }
.key-heads b {
    position: absolute; top: 0; left: 5px;
    width: 10px; height: 10px; margin-left: -5px;
    border-radius: 50%;
    background: var(--c);
    pointer-events: none;
    cursor: ew-resize;
    transition: left 0.4s var(--ease), transform 0.2s;
}
.key-heads b::after { content: ''; position: absolute; inset: -9px -6px; } /* a finger-sized hit area */
.key-chip:not(.is-open):hover .key-heads b { transform: scale(1.3); }
.key-chip.is-open .key-heads b { left: var(--x); pointer-events: auto; }
.key-chip.is-open .key-heads b:hover, .key-chip.is-dragging .key-heads b { transform: scale(1.2); }
.key-chip.is-dragging .key-heads b { transition: transform 0.2s; }
.key-heads b.is-picked { background: #fff; box-shadow: 0 0 0 2px var(--c); }
.key-now { position: absolute; top: 1px; height: 8px; width: 2px; margin-left: -1px; border-radius: 1px; background: #fff; pointer-events: none; opacity: 0; }
.key-chip.is-open .key-now { opacity: 0.9; transition: opacity 0.2s 0.3s; }
.key-readout { display: none; flex: none; color: rgba(255, 255, 255, 0.6); text-transform: none; font-variant-numeric: tabular-nums; }
.key-chip.is-open .key-readout, .key-chip.was-open .key-readout { display: block; }
@keyframes key-text-out { to { opacity: 0; } }
@keyframes key-text-in { from { opacity: 0; } }
.key-chip.is-shrinking .key-name, .key-chip.is-shrinking .key-readout { animation: key-text-out 0.06s forwards; }
.key-chip.is-shrinking.is-open .key-name { animation: none; } /* an open tag keeps its name */
.key-chip.is-growing .key-readout, .key-chip.is-growing.was-folded .key-name { animation: key-text-in 0.2s 0.3s backwards; }
@media (max-width: 600px) {
    .copy-box { width: 200px; }
    .key-chips { flex: none; }
    .key-chip .key-name { display: none; }
    /* an open range takes the row from the text box */
    .dock-row.has-open .copy-box { display: none; }
    .dock-row.has-open .key-chips { flex: 1 1 auto; }
    .key-readout { display: none !important; }
}
}
