/* ============================================================
   AKNB PLAYER — a terminal instrument panel wrapped around film.
   Two rows: full-width timeline, then transport. Controls use
   hard resets (all: unset) so sitewide form styles can't inflate
   them. Progressive enhancement: without JS the native controls
   remain and none of this applies beyond the frame itself.
   ============================================================ */

.thought-video video {
    display: block;
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #000;
}

.thought-video.aknb-enhanced video {
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    cursor: pointer;
}

.aknb-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem 0.5rem;
    border: 1px solid var(--border-strong);
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--bg-raised);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--ink-soft);
}

/* ---- Row 1: the timeline ---- */

.aknb-timeline {
    position: relative;
    width: 100%;
}

.aknb-controls input[type="range"] {
    all: unset;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    display: block;
    margin: 0;
    cursor: pointer;
}

.aknb-controls input[type="range"].aknb-seek {
    --p: 0;
    width: 100%;
    height: 6px;
    border-radius: var(--radius);
    background: linear-gradient(90deg,
        var(--accent) calc(var(--p) * 1%),
        var(--border) calc(var(--p) * 1%));
}

.aknb-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 8px;
    height: 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
}

.aknb-controls input[type="range"]::-moz-range-thumb {
    width: 8px;
    height: 16px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
}

.aknb-controls input[type="range"]:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

/* movement ticks over the track, under the pointer */
.aknb-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.aknb-ticks span {
    position: absolute;
    top: 0;
    width: 1px;
    height: 6px;
    background: var(--border-strong);
}

/* ---- Row 2: transport ---- */

.aknb-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.aknb-controls button {
    all: unset;
    box-sizing: border-box;
    padding: 0.15rem 0.3rem;
    border-radius: var(--radius);
    font: inherit;
    letter-spacing: inherit;
    color: var(--ink-soft);
    cursor: pointer;
    text-align: center;
    transition: color 150ms ease, background-color 150ms ease;
}

.aknb-controls button:hover {
    color: var(--accent-hover);
}

.aknb-controls button:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 1px;
}

.aknb-controls button.active {
    background: var(--accent);
    color: var(--accent-ink);
}

.aknb-play {
    min-width: 1.6em;
    color: var(--accent);
}

.aknb-time {
    white-space: nowrap;
    color: var(--ink-faint);
}

.aknb-time .aknb-cur {
    color: var(--ink);
}

/* current movement readout — takes the slack space */
.aknb-chapter {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    color: var(--ink-faint);
}

.aknb-controls input[type="range"].aknb-vol {
    --p: 100;
    width: 4.5rem;
    height: 4px;
    border-radius: var(--radius);
    background: linear-gradient(90deg,
        var(--ink-soft) calc(var(--p) * 1%),
        var(--border) calc(var(--p) * 1%));
}

.aknb-vol::-webkit-slider-thumb {
    width: 6px;
    height: 12px;
}

.aknb-vol::-moz-range-thumb {
    width: 6px;
    height: 12px;
}

/* ---- Theater — break out of the reading column. Instant:
   no motion on the critical path. ---- */
.thought-video.aknb-theater {
    width: min(92vw, var(--container-max));
    margin-left: calc(50% - min(46vw, var(--container-max) / 2));
}

/* ---- Fullscreen on the figure keeps the instrument panel ---- */
.thought-video:fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #000;
    margin: 0;
    padding: 0 max(2vw, env(safe-area-inset-left));
}

.thought-video:fullscreen video {
    min-height: 0;
    flex: 0 1 auto;
    max-height: calc(100vh - 7rem);
}

.thought-video:fullscreen figcaption {
    display: none;
}

@media (max-width: 640px) {
    .aknb-controls {
        font-size: 0.68rem;
    }

    .aknb-row {
        gap: 0.5rem;
    }

    .aknb-chapter,
    .aknb-theater-btn {
        display: none;   /* nothing to break out of on a phone */
    }

    .aknb-vol {
        width: 3.2rem;
    }
}
