/* ===========================================================================
   Depot — design system
   Tokens are Klembyte's, read off klembyte.com, so the product and the company
   site stay one house style instead of two that drift apart.
   =========================================================================== */

:root {
    /* Brand */
    --ink: #111214;
    --ink-2: #191b1e;
    --ink-3: #23262a;
    --line: #2c2f34;
    --paper: #F4F3EF;
    --muted: #9a9ca1;
    --signal: #FF5B1F;
    --signal-deep: #E8490F;

    /* Scale */
    --radius: 14px;
    --radius-sm: 10px;
    --wrap: 1120px;

    /* Type */
    --hand: 'Caveat', cursive;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --sans: 'Inter', system-ui, sans-serif;

    /* Feedback */
    --ok: #3fb950;
    --warn: #d29922;
    --bad: #f85149;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--paper); text-decoration: none; }
a:hover { color: var(--signal); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }

p { margin: 0 0 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }

/* ---- The bracketed mono eyebrow: Klembyte's signature ------------------- */

.eyebrow {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--signal);
    margin: 0 0 0.9rem;
}

.hand { font-family: var(--hand); font-size: 1.3em; color: var(--signal); }
.muted { color: var(--muted); }

/* ---- Shell -------------------------------------------------------------- */

.app { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--ink) 88%, transparent);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 60px;
}

.brand { display: flex; align-items: baseline; gap: 0.55rem; }

.brand .mark {
    font-family: var(--mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--signal);
    letter-spacing: -0.05em;
}

.brand .name {
    font-size: 1.15rem;
    font-weight: 600;
    font-style: italic;
    letter-spacing: -0.02em;
}

.topnav { display: flex; gap: 1.3rem; margin-left: auto; }

.topnav a {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
}

.topnav a:hover { color: var(--paper); }
.topnav a.active { color: var(--paper); border-bottom-color: var(--signal); }

main { flex: 1; padding: 2.2rem 0 3rem; }

.foot {
    border-top: 1px solid var(--line);
    padding: 1.1rem 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---- Surfaces ----------------------------------------------------------- */

.card {
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ---- Controls ----------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--signal);
    color: var(--ink);
    border: 1px solid var(--signal);
    border-radius: var(--radius-sm);
    padding: 0.55rem 1.05rem;
    font-family: var(--mono);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover:not(:disabled) { background: var(--signal-deep); border-color: var(--signal-deep); color: var(--ink); }
.btn:disabled { opacity: 0.35; cursor: default; }

.btn.ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--ink-3); border-color: var(--muted); color: var(--paper); }

input[type=text], input[type=email], input[type=password], select, textarea {
    width: 100%;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.7rem;
    font: inherit;
    font-size: 0.9rem;
}

input:focus, select:focus, textarea:focus { outline: none; border-color: var(--signal); }

/* ---- Readouts ----------------------------------------------------------- */

pre, code { font-family: var(--mono); }

pre {
    margin: 0;
    padding: 0.85rem 1rem;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    line-height: 1.65;
    color: var(--muted);
    white-space: pre-wrap;
}

.badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.68rem;
    padding: 0.12rem 0.45rem;
    border-radius: 5px;
    background: color-mix(in srgb, var(--signal) 18%, transparent);
    color: var(--signal);
}

/* ---- Blazor's own error strip ------------------------------------------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 100;
    padding: 0.75rem 1.3rem;
    background: var(--signal);
    color: var(--ink);
    font-family: var(--mono);
    font-size: 0.84rem;
    font-weight: 500;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

/* ---- Boot screen (plain HTML, shown before the runtime starts) ----------- */

.boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    height: 100vh;
}

.boot-mark {
    font-family: var(--mono);
    font-size: 2.6rem;
    font-weight: 700;
    color: var(--signal);
    letter-spacing: -0.05em;
}

.boot-line {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
    animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* ---- Home ---------------------------------------------------------------- */

.lede { max-width: 54ch; margin-top: 0.7rem; font-size: 1rem; }

.eyebrow.stack { margin-top: 2.6rem; }

.tools { margin-top: 1.8rem; }

.tool {
    display: block;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.tool .glyph { font-size: 1.35rem; line-height: 1; }
.tool h2 { margin: 0.55rem 0 0.3rem; display: flex; align-items: center; gap: 0.5rem; }
.tool p { margin: 0; font-size: 0.88rem; }

a.tool:hover { border-color: var(--signal); background: var(--ink-3); color: var(--paper); }

/* A planned tool is visible but inert, so the roadmap is honest rather than a
   list of links that go nowhere. */
.tool.soon { opacity: 0.5; }
.tool.soon h2 { font-weight: 500; }

/* ---- Tool chrome --------------------------------------------------------- */

.tool-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.tool-actions { display: flex; align-items: center; gap: 0.5rem; }
.tool-actions select { width: auto; font-family: var(--mono); font-size: 0.78rem; }

.sub { margin: 0.3rem 0 0; font-family: var(--mono); font-size: 0.78rem; }

.open-row { display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem; }

.note { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.note.ok { color: var(--ok); }
.note.bad { color: var(--bad); }

/* ---- Siren Lab: the lightbar -------------------------------------------- */

.bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 1.5rem 0 0.2rem; }

.bulb {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--c);
    box-shadow: 0 0 14px -2px var(--c);
    cursor: pointer;
    /* Each bulb's pattern is a generated keyframe; holding the value between
       steps is what makes it read as a flash rather than a fade. */
    animation-timing-function: step-end;
    animation-iteration-count: infinite;
}

.bar.paused .bulb { animation-play-state: paused; }
.bulb.sel { outline: 2px solid var(--paper); outline-offset: 2px; }

/* ---- Siren Lab: the sequencer ------------------------------------------- */

.lab {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 1.1rem;
    margin-top: 0.9rem;
    align-items: start;
}

.seq {
    --pad: 0.85rem;
    --label-w: 58px;
    --gap: 0.5rem;
    --track: calc(100% - var(--pad) * 2 - var(--label-w) - var(--gap));

    position: relative;
    padding: var(--pad);
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    user-select: none;
}

.seq-head, .seq-row {
    display: grid;
    grid-template-columns: var(--label-w) 1fr;
    align-items: center;
    gap: var(--gap);
}

.seq-head { height: 18px; margin-bottom: 6px; }

/* No gap between cells: the playhead steps in exact 1/32 jumps, and any gap
   here would make it drift further out of line with every column. */
.seq-cells, .seq-ruler { display: grid; grid-template-columns: repeat(32, 1fr); }

.seq-ruler span { font-family: var(--mono); font-size: 0.56rem; color: var(--muted); }

.seq-label {
    display: flex;
    align-items: center;
    padding: 0;
    background: none;
    border: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    cursor: pointer;
}

.seq-row.sel .seq-label { color: var(--paper); }

.dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; flex: none; }

.cell {
    height: 17px;
    padding: 0;
    border: 1px solid transparent;
    background: var(--ink-3);
    background-clip: padding-box;
    border-radius: 3px;
    cursor: pointer;
}

.cell.beat:not(.on) { background: #2b3036; }
.cell.on { background: var(--c); box-shadow: 0 0 7px -2px var(--c); }

.playhead {
    position: absolute;
    top: calc(var(--pad) + 24px);
    bottom: var(--pad);
    left: calc(var(--pad) + var(--label-w) + var(--gap));
    width: calc(var(--track) / 32);
    background: rgb(255 255 255 / 9%);
    border-left: 1px solid var(--signal);
    pointer-events: none;
    animation-name: playhead;
    animation-timing-function: steps(32);
    animation-iteration-count: infinite;
}

.playhead.paused { animation-play-state: paused; }

@keyframes playhead {
    from { transform: translateX(0); }
    to   { transform: translateX(3200%); }
}

/* ---- Siren Lab: the side rail ------------------------------------------- */

.rail {
    padding: 1rem 1.1rem;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.rail .eyebrow { margin-bottom: 0.7rem; }

.field {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    font-size: 0.82rem;
}

.field input { width: 104px; }
.field input[type=color] { width: 56px; height: 30px; padding: 2px; cursor: pointer; }

.seq-readout {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.25rem 0.6rem;
    margin: 0.8rem 0;
    font-size: 0.68rem;
}

.seq-readout code { font-size: 0.62rem; color: var(--paper); word-break: break-all; }

.row-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin-bottom: 0.9rem; }
.row-tools .btn { padding: 0.3rem 0.6rem; font-size: 0.71rem; }

.cycle { font-size: 0.71rem; }

@media (max-width: 900px) {
    .lab { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Landing ------------------------------------------------------------ */

.hero { padding: 1.5rem 0 0.5rem; }
.hero h1 { max-width: 20ch; font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; }
.hero .lede { margin-top: 1rem; }

section + section { margin-top: 1rem; }

.closer { padding-bottom: 1rem; }
.big { font-size: clamp(1.2rem, 2.5vw, 1.7rem); margin-bottom: 0.5rem; }

.narrow { max-width: 62ch; }

/* ---- Pricing ------------------------------------------------------------ */

.plans { margin: 1.6rem 0 0.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 320px)); }

.plan .price { margin: 0.4rem 0 0.2rem; font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; }
.plan .per { font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.plan .btn { margin-top: 0.9rem; }
.plan.best { border-color: var(--signal); }

.ticks { max-width: 62ch; margin: 0.9rem 0 0; padding: 0; list-style: none; }

.ticks li {
    position: relative;
    margin-bottom: 0.45rem;
    padding-left: 1.4rem;
    color: var(--muted);
}

.ticks li::before {
    content: "+";
    position: absolute;
    left: 0;
    color: var(--signal);
    font-family: var(--mono);
}

/* ---- Legal pages -------------------------------------------------------- */

.legal { max-width: 70ch; }
.legal .updated { font-family: var(--mono); font-size: 0.74rem; margin: 0.4rem 0 2rem; }
.legal h2 { margin: 2.2rem 0 0.6rem; font-size: 1.05rem; }
.legal h3 { margin: 1.3rem 0 0.4rem; font-size: 0.92rem; color: var(--muted); }
.legal p { color: var(--muted); }
.legal strong { color: var(--paper); font-weight: 600; }
.legal a { color: var(--signal); }
.legal a:hover { text-decoration: underline; }
.legal ul { margin: 0.6rem 0 1rem; padding-left: 1.2rem; color: var(--muted); }
.legal li { margin-bottom: 0.35rem; }

/* ---- Footer nav --------------------------------------------------------- */

.footnav { display: flex; flex-wrap: wrap; gap: 1rem; }
.footnav a { color: var(--muted); }
.footnav a:hover { color: var(--signal); }

/* ---- Siren Lab: the 3D preview ------------------------------------------ */

.lab-main { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }

.viewport {
    position: relative;
    height: 380px;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.viewport canvas { display: block; width: 100%; height: 100%; }
.viewport.empty canvas { opacity: 0; }

.viewport-hint {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem;
    text-align: center;
}

.viewport-hint p { max-width: 34ch; margin: 0; font-size: 0.86rem; }

.viewport-note {
    position: absolute;
    left: 0.8rem;
    bottom: 0.7rem;
    margin: 0;
    padding: 0.25rem 0.55rem;
    border-radius: 6px;
    background: rgb(17 18 20 / 72%);
    font-family: var(--mono);
    font-size: 0.67rem;
    color: var(--muted);
}

/* ---- Account, sign-in, admin -------------------------------------------- */

.narrow-page { max-width: 62ch; }
.small { font-size: 0.82rem; }
.block { display: block; }
.right { text-align: right; }

.inline-form { display: inline; }

.linkish {
    padding: 0.3rem 0;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.82rem;
    cursor: pointer;
}

.linkish:hover { color: var(--paper); }

.stacked { display: block; margin-bottom: 0.9rem; }
.stacked > span {
    display: block;
    margin-bottom: 0.3rem;
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--muted);
}

.signin { max-width: 380px; margin-top: 1.4rem; }
.signin .btn { width: 100%; justify-content: center; }
.signin .note { margin-bottom: 0.9rem; }

.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.84rem; align-self: end; padding-bottom: 0.5rem; }
.checkbox input { width: auto; }

.facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
    margin: 0.8rem 0 0;
    font-size: 0.86rem;
}

.facts dt { font-family: var(--mono); font-size: 0.73rem; color: var(--muted); }
.facts dd { margin: 0; }

/* ---- Admin table -------------------------------------------------------- */

.add-user { margin: 1.2rem 0; }

.add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0 1rem;
    margin: 0.8rem 0 0.4rem;
}

.table-card { margin-top: 1.2rem; padding: 0.4rem 0.6rem; overflow-x: auto; }

.users { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

.users th {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--muted);
    text-align: left;
}

.users th.right { text-align: right; }
.users td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--ink-3); vertical-align: top; }
.users tr:last-child td { border-bottom: 0; }

.users .block { margin-top: 0.15rem; font-size: 0.76rem; }

.pill {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 0.68rem;
}

.pill.on { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.pill.off { background: var(--ink-3); color: var(--muted); }

.actions { white-space: nowrap; }
.actions .btn { padding: 0.25rem 0.5rem; font-size: 0.7rem; }

.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }

.empty { padding: 1rem 0.6rem; }

.btn.danger.solid {
    background: var(--bad);
    border-color: var(--bad);
    color: var(--ink);
}

.btn.danger.solid:hover:not(:disabled) {
    background: color-mix(in srgb, var(--bad) 85%, black);
    border-color: color-mix(in srgb, var(--bad) 85%, black);
    color: var(--ink);
}

/* ---- Chevron Builder ---------------------------------------------------- */

.strip {
    display: flex;
    gap: 0.5rem;
    margin: 1.2rem 0 0.2rem;
    padding-bottom: 0.5rem;
    overflow-x: auto;
}

.chip {
    flex: none;
    min-width: 150px;
    max-width: 210px;
    padding: 0.5rem 0.65rem;
    background: var(--ink-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--paper);
    text-align: left;
    cursor: pointer;
}

.chip:hover { border-color: var(--muted); }
.chip.sel { border-color: var(--signal); background: var(--ink-3); }
.chip.done { box-shadow: inset 3px 0 0 var(--ok); }

.chip-name {
    display: block;
    overflow: hidden;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-meta { display: block; margin-top: 0.15rem; font-family: var(--mono); font-size: 0.63rem; color: var(--muted); }

.tick {
    display: inline-block;
    margin-bottom: 0.2rem;
    padding: 0.05rem 0.35rem;
    border-radius: 4px;
    background: color-mix(in srgb, var(--signal) 18%, transparent);
    color: var(--signal);
    font-family: var(--mono);
    font-size: 0.6rem;
}

/* A checkerboard behind the sheet, so transparency in a texture is obvious. */
.sheet {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 0.8rem;
    background: var(--ink-2);
    background-image:
        linear-gradient(45deg, #1b1d20 25%, transparent 25%),
        linear-gradient(-45deg, #1b1d20 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1b1d20 75%),
        linear-gradient(-45deg, transparent 75%, #1b1d20 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.sheet canvas { max-width: 100%; max-height: 62vh; object-fit: contain; }
.sheet.empty canvas { display: none; }

.readout {
    margin: -0.3rem 0 0.6rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    color: var(--muted);
    text-align: right;
}

.rail input[type=range] { width: 130px; padding: 0; }

.forgot { margin: 0.8rem 0 0; text-align: center; }
.forgot a { color: var(--muted); }
.forgot a:hover { color: var(--signal); }

/* ---- Meta Fixer --------------------------------------------------------- */

.finding { margin-bottom: 0.8rem; }
.finding h3 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.finding pre { font-size: 0.76rem; }
.finding.error { border-left: 3px solid var(--bad); }
.finding.warning { border-left: 3px solid var(--warn); }

.pill.bad { background: color-mix(in srgb, var(--bad) 20%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }

.btn.ghost.on { border-color: var(--signal); color: var(--signal); }

.users tr.off-row td { opacity: 0.45; }
.users tr.off-row .pill { opacity: 1; }

/* ---- Account ------------------------------------------------------------ */

.warn-card { border-left: 3px solid var(--warn); }
.danger-card { border-left: 3px solid var(--bad); }

.card + .card { margin-top: 0.8rem; }
.card .field { margin-bottom: 0.8rem; }
.card .field input { width: 220px; }
.card .stacked input { max-width: 320px; }

/* ---- Admin: flags and closing accounts ---------------------------------- */

.flag { margin-right: 0.3rem; color: var(--warn); }
.flag-note { margin-top: 0.3rem; font-size: 0.74rem; font-style: italic; }
.flag-input { width: 150px; padding: 0.25rem 0.45rem; font-size: 0.74rem; }
.block-pill { display: inline-block; margin-top: 0.3rem; }

.users tr:has(.flag) { background: color-mix(in srgb, var(--warn) 5%, transparent); }
