/* =========================================================
   THE VAULT V13
   Mobile-first music console. The selected record is the page.
========================================================= */

.vault-v13 {
    --vault-accent-rgb: 201, 106, 71;
    --vault-accent: rgb(var(--vault-accent-rgb));
    --vault-bg: #08090a;
    --vault-surface: #0f1113;
    --vault-text: var(--brand-text);
    --vault-soft: var(--brand-text-soft);
    --vault-muted: var(--brand-muted);
    --vault-line: rgba(238, 233, 225, .14);
}

.vault-v13 .page {
    overflow: clip;
    background: var(--vault-bg);
}

.vault-v13 button {
    font: inherit;
}

.vault-stage {
    position: relative;
    isolation: isolate;
    color: var(--vault-text);
    background: var(--vault-bg);
}

.vault-atmosphere {
    position: absolute;
    inset: 0;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 72% 28%, rgba(var(--vault-accent-rgb), .12), transparent 38%),
        #08090a;
}

.vault-atmosphere::before,
.vault-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vault-atmosphere::before {
    z-index: 2;
    background:
        linear-gradient(180deg, rgba(8,9,10,.26), #08090a 94%),
        linear-gradient(90deg, rgba(8,9,10,.90), rgba(8,9,10,.28) 58%, rgba(8,9,10,.76));
}

.vault-atmosphere::after {
    z-index: 3;
    opacity: .14;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,.04) 0,
        rgba(255,255,255,.04) 1px,
        transparent 1px,
        transparent 4px
    );
}

.vault-atmosphere img {
    position: absolute;
    inset: -12%;
    width: 124%;
    height: 124%;
    object-fit: cover;
    opacity: .28;
    filter: blur(54px) saturate(1.25);
    transform: scale(1.05);
    transition: opacity .35s ease, filter .35s ease;
}

.vault-stage__layout {
    width: min(94vw, 1760px) !important;
    height: calc(100% - 30px);
    display: grid;
    grid-template-rows: minmax(0, 43%) minmax(0, 57%);
    gap: 8px;
    align-items: stretch;
    padding: 10px 0 30px;
}

.vault-index--desktop {
    display: none;
}

/* ---------- artwork ---------- */

.vault-art-panel {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px;
    justify-items: center;
    touch-action: pan-y;
    user-select: none;
}

.vault-art-panel__frame {
    position: relative;
    min-height: 0;
    aspect-ratio: 1;
    height: 100%;
    max-width: min(78vw, 360px);
    overflow: hidden;
    background: #050505;
    border: 1px solid var(--vault-line);
    box-shadow: 0 24px 70px rgba(0,0,0,.36);
}

.vault-art-panel__frame::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
}

#vault-artwork {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .18s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}

.vault-art-panel.is-switching #vault-artwork {
    opacity: .45;
    transform: scale(.985);
}

.vault-art-panel__signal {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--vault-accent);
    box-shadow: 0 0 24px rgba(var(--vault-accent-rgb), .46);
}

.vault-art-panel__caption {
    width: min(78vw, 360px);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--vault-muted);
    font: 500 .56rem/1.3 var(--brand-mono);
    text-transform: uppercase;
    letter-spacing: .03em;
}

.vault-art-panel__caption span:last-child {
    text-align: right;
}

/* ---------- console ---------- */

.vault-console {
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.vault-console__eyebrow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: var(--vault-muted);
    font: 500 .56rem/1.2 var(--brand-mono);
    text-transform: uppercase;
}

#vault-status {
    color: rgb(var(--vault-accent-rgb));
}

.vault-console__title {
    min-width: 0;
}

.vault-console h1 {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    color: var(--vault-text);
    font-size: clamp(2.45rem, 13vw, 4.8rem);
    line-height: .82;
    letter-spacing: -.075em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#vault-meta {
    margin-top: 6px;
    overflow: hidden;
    color: var(--vault-soft);
    font: 500 .6rem/1.35 var(--brand-mono);
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-badges {
    min-height: 19px;
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.vault-badges::-webkit-scrollbar { display: none; }

.vault-badges span {
    flex: 0 0 auto;
    padding: 3px 7px;
    color: var(--vault-soft);
    border: 1px solid var(--vault-line);
    font: 500 .5rem/1 var(--brand-mono);
    text-transform: uppercase;
}

.vault-wave-shell {
    margin-top: 8px;
    padding: 7px 0 4px;
    border-top: 1px solid var(--vault-line);
    border-bottom: 1px solid var(--vault-line);
}

.vault-waveform {
    position: relative;
    width: 100%;
    height: 52px;
    cursor: ew-resize;
}

.vault-waveform:focus-visible {
    outline: 2px solid var(--vault-accent);
    outline-offset: 3px;
}

#vault-waveform-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#vault-audio {
    display: none;
}

.vault-waveform::before {
    content: "Loading waveform…";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--vault-muted);
    font: 500 .52rem/1 var(--brand-mono);
    letter-spacing: .04em;
    text-transform: uppercase;
    pointer-events: none;
}

.vault-waveform.is-ready::before {
    display: none;
}

.vault-waveform ::part(cursor) {
    background: var(--vault-text);
}

.vault-wave-shell__time {
    display: flex;
    justify-content: space-between;
    margin-top: 1px;
    color: var(--vault-muted);
    font: 500 .52rem/1.2 var(--brand-mono);
}

.vault-transport {
    display: grid;
    grid-template-columns: 1fr minmax(94px, 1.45fr) 1fr;
    gap: 6px;
    align-items: stretch;
    margin-top: 8px;
}

.vault-play,
.vault-skip {
    appearance: none;
    min-width: 0;
    min-height: 42px;
    border: 1px solid var(--vault-line);
    border-radius: 0;
    color: var(--vault-text);
    background: rgba(15,17,19,.72);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.vault-play {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 9px;
    color: #090a0b;
    background: var(--vault-accent);
    border-color: transparent;
}

.vault-play:disabled {
    opacity: .4;
    cursor: wait;
}

.vault-play__icon {
    position: relative;
    width: 12px;
    height: 15px;
}

.vault-play__icon::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
}

.vault-play.is-playing .vault-play__icon::before {
    width: 11px;
    height: 14px;
    border: 0;
    background:
        linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px, currentColor 7px 11px);
}

.vault-play__label {
    font: 700 .65rem/1 var(--brand-mono);
    text-transform: uppercase;
}

.vault-skip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--vault-soft);
}

.vault-skip span {
    font-size: 1rem;
}

.vault-skip small {
    font: 600 .56rem/1 var(--brand-mono);
    text-transform: uppercase;
}

.vault-quick-links {
    min-height: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 7px;
}

.vault-quick-links a {
    padding-bottom: 2px;
    border-bottom: 1px solid var(--vault-line);
    color: var(--vault-soft);
    font: 600 .54rem/1.2 var(--brand-mono);
    text-transform: uppercase;
}

.vault-quick-links [hidden] {
    display: none !important;
}

.vault-stage__browse {
    position: absolute;
    left: 50%;
    bottom: 7px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--vault-muted);
    font: 500 .55rem/1 var(--brand-mono);
    text-transform: uppercase;
    transform: translateX(-50%);
}

.vault-stage__browse span {
    color: var(--vault-accent);
}

/* ---------- mobile archive ---------- */

.vault-mobile-archive {
    padding: 62px 0 72px;
    background: #0d0f11;
    border-top: 1px solid var(--vault-line);
}

.vault-section-head {
    display: grid;
    gap: 8px;
    margin-bottom: 26px;
}

.vault-section-head p,
.vault-notes__kicker {
    color: var(--vault-muted);
    font: 500 .62rem/1.3 var(--brand-mono);
    text-transform: uppercase;
}

.vault-section-head h2,
.vault-notes h2 {
    color: var(--vault-text);
    font-size: clamp(2.4rem, 11vw, 5.8rem);
    line-height: .9;
    letter-spacing: -.065em;
}

.vault-filter-line {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    overflow-x: auto;
    border-bottom: 1px solid var(--vault-line);
    scrollbar-width: none;
}

.vault-filter-line::-webkit-scrollbar { display: none; }

.vault-filter {
    appearance: none;
    flex: 0 0 auto;
    padding: 0 0 5px;
    border: 0;
    border-bottom: 1px solid transparent;
    color: var(--vault-muted);
    background: transparent;
    font: 600 .58rem/1 var(--brand-mono);
    text-transform: uppercase;
    cursor: pointer;
}

.vault-filter.is-active {
    color: var(--vault-text);
    border-color: var(--vault-accent);
}

.vault-mobile-list {
    border-top: 1px solid var(--vault-line);
}

.vault-mobile-record {
    appearance: none;
    width: 100%;
    display: grid;
    grid-template-columns: 26px 72px minmax(0, 1fr) 22px;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--vault-line);
    border-radius: 0;
    color: var(--vault-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.vault-mobile-record[hidden] {
    display: none !important;
}

.vault-mobile-record.is-active {
    color: var(--vault-accent);
}

.vault-mobile-record__number,
.vault-mobile-record__copy small {
    color: var(--vault-muted);
    font: 500 .52rem/1.3 var(--brand-mono);
    text-transform: uppercase;
}

.vault-mobile-record img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    background: #050505;
}

.vault-mobile-record__copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.vault-mobile-record__copy strong {
    overflow: hidden;
    font-size: 1.05rem;
    line-height: 1;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-mobile-record__copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vault-mobile-record__arrow {
    justify-self: end;
    color: var(--vault-soft);
}

.vault-filter-empty {
    margin-top: 24px;
    color: var(--vault-muted);
    font: 500 .7rem/1.5 var(--brand-mono);
}

/* ---------- notes ---------- */

.vault-notes {
    padding: 70px 0 82px;
    background: #090a0b;
    border-top: 1px solid var(--vault-line);
}

.vault-notes__layout {
    display: grid;
    gap: 28px;
}

.vault-notes__body {
    display: grid;
    gap: 22px;
}

#vault-description {
    max-width: 760px;
    color: var(--vault-soft);
    font-size: clamp(1rem, 4.2vw, 1.35rem);
    line-height: 1.65;
}

.vault-notes__links {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.vault-notes__links a {
    padding-bottom: 4px;
    border-bottom: 1px solid var(--vault-line);
    color: var(--vault-text);
    font: 600 .62rem/1.2 var(--brand-mono);
    text-transform: uppercase;
}

.vault-notes__links [hidden] {
    display: none !important;
}

.vault-empty {
    display: grid;
    place-items: center;
    padding: 30px;
    text-align: center;
}

.vault-empty .container {
    display: grid;
    gap: 14px;
}

.vault-empty h1 {
    font-size: clamp(2.8rem, 12vw, 7rem);
    line-height: .9;
    letter-spacing: -.07em;
}

/* ---------- touch/short viewport tuning ---------- */

@media (max-width: 979px) {
    html.brand-mobile-h700 .vault-stage__layout {
        grid-template-rows: minmax(0, 39%) minmax(0, 61%);
        padding-top: 6px;
    }

    html.brand-mobile-h700 .vault-art-panel__caption {
        display: none;
    }

    html.brand-mobile-h700 .vault-console h1 {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }

    html.brand-mobile-h700 .vault-waveform {
        height: 38px;
    }

    html.brand-mobile-h700 .vault-console__eyebrow,
    html.brand-mobile-h700 .vault-badges {
        margin-bottom: 0;
    }

    html.brand-mobile-h700 .vault-transport {
        margin-top: 6px;
    }

    html.brand-mobile-h700 .vault-quick-links {
        margin-top: 5px;
    }
}

@media (max-width: 360px) {
    .vault-stage__layout {
        width: calc(100% - 22px) !important;
    }

    .vault-console h1 {
        font-size: 2.35rem;
    }

    .vault-art-panel__frame,
    .vault-art-panel__caption {
        max-width: 74vw;
    }

    .vault-quick-links {
        gap: 8px;
    }
}

/* ---------- desktop / TV ---------- */

@media (min-width: 980px) {
    .vault-stage__layout {
        width: min(91vw, 1760px) !important;
        height: 100%;
        grid-template-columns: minmax(190px, .46fr) minmax(360px, 1.05fr) minmax(340px, .84fr);
        grid-template-rows: 1fr;
        gap: clamp(28px, 3vw, 64px);
        align-items: center;
        padding: clamp(24px, 4vh, 52px) 0;
    }

    .vault-index--desktop {
        min-height: 0;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        justify-content: center;
    }

    .vault-index__header {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--vault-line);
        color: var(--vault-muted);
        font: 500 .58rem/1 var(--brand-mono);
        text-transform: uppercase;
    }

    .vault-index__list {
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(var(--vault-accent-rgb), .4) transparent;
    }

    .vault-index__item {
        appearance: none;
        width: 100%;
        display: grid;
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
        padding: 13px 0;
        border: 0;
        border-bottom: 1px solid var(--vault-line);
        border-radius: 0;
        color: var(--vault-soft);
        background: transparent;
        text-align: left;
        cursor: pointer;
    }

    .vault-index__item > span,
    .vault-index__item > small {
        color: var(--vault-muted);
        font: 500 .5rem/1.2 var(--brand-mono);
        text-transform: uppercase;
    }

    .vault-index__item > strong {
        min-width: 0;
        overflow: hidden;
        font-size: .92rem;
        letter-spacing: -.025em;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .vault-index__item.is-active,
    .vault-index__item:hover,
    .vault-index__item:focus-visible {
        color: var(--vault-accent);
    }

    .vault-art-panel {
        max-height: min(76vh, 790px);
    }

    .vault-art-panel__frame {
        width: min(100%, 760px);
        max-width: none;
        height: auto;
        aspect-ratio: 1;
    }

    .vault-art-panel__caption {
        width: min(100%, 760px);
        max-width: none;
        font-size: .6rem;
    }

    .vault-console {
        max-width: 520px;
    }

    .vault-console h1 {
        font-size: clamp(4.6rem, 6.4vw, 8.8rem);
        white-space: normal;
    }

    #vault-meta {
        font-size: .67rem;
    }

    .vault-waveform {
        height: 78px;
    }

    .vault-play,
    .vault-skip {
        min-height: 52px;
    }

    .vault-mobile-archive {
        display: none;
    }

    .vault-notes__layout {
        grid-template-columns: minmax(280px, .65fr) minmax(0, 1.35fr);
        align-items: start;
    }

    .vault-notes {
        padding: 110px 0 130px;
    }

    #vault-description {
        font-size: clamp(1.15rem, 1.5vw, 1.55rem);
    }
}

@media (min-width: 1600px) and (min-height: 850px) {
    .vault-stage__layout {
        grid-template-columns: 260px minmax(520px, 780px) minmax(380px, 560px);
    }

    .vault-index__item {
        padding: 17px 0;
    }

    .vault-console h1 {
        font-size: clamp(6rem, 6vw, 9.6rem);
    }
}

/* ---------- input states ---------- */

@media (hover: hover) and (pointer: fine) {
    .vault-play:hover,
    .vault-skip:hover,
    .vault-quick-links a:hover,
    .vault-notes__links a:hover {
        filter: brightness(1.08);
    }

    .vault-art-panel__frame:hover #vault-artwork {
        transform: scale(1.012);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vault-atmosphere img,
    #vault-artwork {
        transition: none;
    }
}
