/* ============================================================
   homepage.css — app shell, header, import overlay, transport
   console and shared controls. Instrument-agnostic styling.
   ============================================================ */
:root {
    --ink: #16130f;
    --line: #3a3127;
    --parch: #f7f1e3;
    --gold: #e0a458;
    --gold-dim: #a8783c;
    --txt: #f1e8d6;
    --txt-dim: #b6a888;
    --txt-faint: #7d715c;
    --shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.7);
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
html,
body {
    height: 100%;
}
body {
    font-family: "Spline Sans", sans-serif;
    color: var(--txt);
    background:
        radial-gradient(1200px 600px at 50% -10%, #2c251c 0%, transparent 60%),
        radial-gradient(900px 500px at 100% 110%, #241d14 0%, transparent 55%),
        linear-gradient(180deg, #16130f 0%, #110e0a 100%);
    background-attachment: fixed;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
}
header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 22px 12px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(
        180deg,
        rgba(42, 36, 28, 0.55),
        rgba(42, 36, 28, 0)
    );
}
.brand {
    display: flex;
    flex-direction: column;
    line-height: 1;
    min-width: 0;
}
.brand .kick {
    font:
        600 11px/1 "Spline Sans Mono",
        monospace;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 7px;
}
.brand h1 {
    font-family: "Fraunces", serif;
    font-weight: 900;
    font-size: 28px;
    letter-spacing: -0.01em;
    color: var(--parch);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--txt-dim);
}
.meta {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}
.chip {
    font:
        500 11px/1 "Spline Sans Mono",
        monospace;
    color: var(--txt-dim);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 13px;
    background: rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}
.chip b {
    color: var(--parch);
    font-weight: 600;
}
.btn {
    font:
        600 12px/1 "Spline Sans",
        sans-serif;
    color: var(--parch);
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.25);
    border-radius: 9px;
    padding: 9px 14px;
    cursor: pointer;
    transition: 0.15s;
}
.btn:hover {
    border-color: var(--gold-dim);
}

/* import overlay */
#import {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(
        900px 500px at 50% 0%,
        #221c14 0%,
        #100d09 70%
    );
}
#import.hide {
    display: none;
}
.drop {
    width: min(560px, 92vw);
    border: 1.5px dashed #4a3f2e;
    border-radius: 20px;
    padding: 46px 32px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.18s;
}
.drop.over {
    border-color: var(--gold);
    background: rgba(224, 164, 88, 0.06);
}
.drop .ic {
    font-family: "Fraunces", serif;
    font-size: 46px;
    color: var(--gold);
    margin-bottom: 10px;
}
.drop h2 {
    font-family: "Fraunces", serif;
    font-weight: 900;
    font-size: 26px;
    color: var(--parch);
    margin-bottom: 8px;
}
.drop p {
    color: var(--txt-dim);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.drop .pick {
    display: inline-block;
    font: 600 14px/1 "Spline Sans";
    color: #1a140c;
    background: var(--gold);
    padding: 12px 22px;
    border-radius: 11px;
    cursor: pointer;
}
.drop small {
    display: block;
    margin-top: 16px;
    color: var(--txt-faint);
    font-size: 12px;
}
#err {
    color: #e89090;
    font-size: 13px;
    margin-top: 14px;
    min-height: 16px;
}

/* main player (hidden until loaded) */
#player {
    display: none;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}
#player.show {
    display: flex;
}

/* mode toggle segmented control */
.seg {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.25);
}
.seg button {
    font: 600 12px/1 "Spline Sans";
    color: var(--txt-dim);
    background: transparent;
    border: 0;
    padding: 9px 14px;
    cursor: pointer;
    transition: 0.15s;
}
.seg button.on {
    background: var(--gold);
    color: #1a140c;
}
.seg button:not(.on):hover {
    color: var(--parch);
}

/* transport console */
.console {
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(
        0deg,
        rgba(42, 36, 28, 0.6),
        rgba(42, 36, 28, 0.1)
    );
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.progress i {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold));
}
.row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.transport {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tbtn {
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: rgba(0, 0, 0, 0.25);
    color: var(--parch);
    border-radius: 11px;
    cursor: pointer;
    transition: 0.15s;
}
.tbtn:hover {
    border-color: var(--gold-dim);
}
.tbtn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}
#playBtn {
    width: 58px;
    height: 50px;
    background: var(--gold);
    color: #1a140c;
    border-color: var(--gold);
}
#stopBtn {
    width: 46px;
    height: 50px;
}
.readout {
    font: 600 13px/1.2 "Spline Sans Mono";
    color: var(--txt-dim);
    display: flex;
    gap: 14px;
}
.readout b {
    color: var(--parch);
    font-weight: 600;
}
.ctrl {
    display: flex;
    align-items: center;
    gap: 9px;
}
.ctrl label {
    font: 500 11px/1 "Spline Sans Mono";
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--txt-faint);
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    outline: none;
    cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    border: 2px solid #1a140c;
}
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 2px solid #1a140c;
    border-radius: 50%;
    background: var(--gold);
}
#tempo {
    width: 130px;
}
#vol {
    width: 90px;
}
.val {
    font: 600 13px/1 "Spline Sans Mono";
    color: var(--parch);
    min-width: 30px;
}
.switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.switch .box {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--line);
    position: relative;
    transition: 0.18s;
}
.switch .box::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--txt-faint);
    transition: 0.18s;
}
.switch.on .box {
    background: var(--gold-dim);
    border-color: var(--gold);
}
.switch.on .box::after {
    left: 18px;
    background: var(--parch);
}
.switch span {
    font: 500 12px/1 "Spline Sans";
    color: var(--txt-dim);
}
.spacer {
    flex: 1;
}
.hint {
    font: 400 11px/1.4 "Spline Sans";
    color: var(--txt-faint);
}

@media (max-width: 720px) {
    .brand h1 {
        font-size: 20px;
    }
    .meta .chip {
        display: none;
    }
    #tempo {
        width: 96px;
    }
}
