@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    --ink: #F2F2F0;
    --ink-dim: #8C8C8A;
    --ground: #0E0E0F;
    --panel: #17171A;
    --line: #2A2A2E;
    --coral: #F56C58;
    --mono: 'IBM Plex Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

html {
    background-color: var(--ground);
    color: var(--ink);
    overflow-x: hidden;
}

/* -- navbar */
.navbar-frame {
    backdrop-filter: blur(0.1rem);
    background-color: hsl( 0 100% 100%/ 0.05);
}

.navbar-content > a { color: white; }

.navbar-content {
    color: white;
}

.brand-logo, .contact-icon { filter: invert(100%); }

@media (max-width: 60em) {
    .navbar-frame {
        backdrop-filter: blur(0.5rem);
        background-color: hsl( 0 100% 0%/ 0.8);
    }
}
/* navbar -- */

@keyframes slide-up {
    0% {opacity: 0; transform: translateY(50%);}
    100% {opacity: 1; transform: translateY(0);}
}

.pj-intro > p {
    color: var(--ink);
    animation: slide-up 1s ease-in-out both;
}

.pj-number {
    padding-top: 3rem;
}

.pj-name {
    letter-spacing: -0.05em;
    line-height: 1em;
    width: 60vw;
}

.pj-description {
    width: 60vw;
}

/* -- head */
.eyebrow,
.axis-label,
.readout,
.console h2 {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.press-head h1 {
    padding-top: 2vh;
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 600;
    line-height: 1.04;
    letter-spacing: -0.02em;
}

.lede {
    padding-top: 1.5em;
    font-size: 1.15rem;
    color: var(--ink-dim);
}

/* -- axes */
.axes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 0 6vw 6vh;
    background: var(--line);
    border: 1px solid var(--line);
}

.axis {
    padding: 1.25rem;
    background: var(--ground);
}

.axis p {
    padding-top: 0.75em;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ink-dim);
}

.axis-json {
    margin-top: 1rem;
}

.axis-json summary {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
    cursor: pointer;
}

.axis-json .json-scroll {
    margin-top: 0.65rem;
}

.json-editor {
    display: block;
    height: 10rem;
    max-height: 18rem;
    min-height: 7rem;
    padding: 0.55rem 0.6rem;
    resize: vertical;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--ink-dim);
    outline: none;
}

.json-editor:focus {
    color: var(--ink);
    border-color: hsl(0 0% 100% / 0.22);
}

.json-editor.is-invalid {
    border-color: var(--coral);
}

.json-status {
    min-height: 1.2em;
    padding-top: 0.4rem;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.4;
    color: var(--coral);
}

.json-status:empty {
    display: none;
}

/* -- app */
.app {
    display: flex;
    flex-direction: column;
    gap: 5vh;
    padding: 0 6vw 18rem 8vw;
}

body.console-collapsed .app {
    padding-bottom: 4.5rem;
}

.console {
    position: fixed;
    bottom: 0;
    left: 0;
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 0.75rem 6vw 1rem;
    border: 0;
    backdrop-filter: blur(0.1rem);
    -webkit-backdrop-filter: blur(0.1rem);
    background-color: hsl(0 100% 100% / 0.05);
}

.console-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.25rem;
    width: 100%;
}

.console-tabs {
    display: none;
    flex: 1;
    min-width: 0;
    align-items: center;
}

.console.is-collapsed .console-tabs {
    display: flex;
}

.console-tabs span {
    flex: 1;
    min-width: 0;
    padding: 0 1rem;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.console-tabs span + span {
    border-left: 1px solid var(--line);
}

.violation-count {
    font-style: normal;
    letter-spacing: 0.08em;
    color: var(--ink-dim);
}

.violation-count.has-violations {
    color: var(--coral);
}

.console-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    padding: 0 0 0.75rem;
    color: var(--ink-dim);
    background: none;
    border: 0;
    cursor: pointer;
}

.console.is-collapsed .console-bar,
.console.is-collapsed .console-toggle {
    padding-bottom: 0;
}

.console:not(.is-collapsed) .console-toggle {
    padding-bottom: 0.75rem;
}

.console-gear {
    width: 14px;
    height: 14px;
    display: block;
}

.console.is-collapsed {
    padding-bottom: 0.75rem;
}

.console.is-collapsed .console-body {
    display: none;
}

.console-body {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
}

.panel {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.5rem 5rem;
    width: auto;
    background: none;
    border: 0;
    border-radius: 0;
}

.panel + .panel {
    border-left: 1px solid var(--line);
}

.panel-ratio {
    flex: 0 1 auto;
    width: max-content;
}

.template-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr);
    gap: 1.25rem 1.5rem;
    align-items: start;
}

.template-col,
.template-json {
    min-width: 0;
}

.template-col .knob:last-child {
    padding-bottom: 0;
}

.panel h2 {
    padding-bottom: 1rem;
}

.inspector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
    align-items: start;
}

.inspector .field:nth-child(1),
.inspector .field:nth-child(2) {
    grid-column: 1;
}

.inspector .field:nth-child(3) {
    grid-column: 2;
    grid-row: 1 / 3;
}

.inspector .reset {
    grid-column: 1 / -1;
}

/* -- knobs */
.knob {
    display: block;
    padding-bottom: 0.9rem;
}

.knob span,
.field span {
    display: block;
    padding-bottom: 0.4rem;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--ink);
}

.knob input[type="range"] {
    width: 100%;
    min-width: 0;
    height: 2px;
    appearance: none;
    background: var(--line);
    cursor: pointer;
}

.knob input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--coral);
}

.knob-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.knob-toggle span {
    padding: 0;
}

.knob-toggle input {
    accent-color: var(--coral);
}

/* -- template json */
.json-label {
    display: block;
    padding-bottom: 0.4rem;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 400;
    color: var(--ink-dim);
}

.template-json pre,
.json-scroll {
    width: 100%;
    max-width: none;
    max-height: 6.5rem;
    overflow: auto;
    font-family: var(--mono);
    font-size: 10px;
    line-height: 1.6;
    color: var(--ink-dim);
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: hsl(0 0% 100% / 0.22) transparent;
}

.template-json pre::-webkit-scrollbar,
.json-scroll::-webkit-scrollbar {
    width: 3px;
}

.template-json pre::-webkit-scrollbar-track,
.json-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.template-json pre::-webkit-scrollbar-thumb,
.json-scroll::-webkit-scrollbar-thumb {
    background: hsl(0 0% 100% / 0.22);
    border-radius: 999px;
}

.template-json pre::-webkit-scrollbar-thumb:hover,
.json-scroll::-webkit-scrollbar-thumb:hover {
    background: hsl(0 0% 100% / 0.4);
}

/* -- ratio */
.ratio-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ratio-group button {
    min-width: 6.75rem;
    padding: 0.45rem 0.7rem;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-dim);
    background: var(--ground);
    border: 1px solid var(--line);
    cursor: pointer;
}

.ratio-group button.is-active {
    color: var(--ground);
    background: var(--ink);
    border-color: var(--ink);
}

/* -- inspector */
.field {
    display: block;
    padding-bottom: 0.9rem;
}

.field input[type="text"],
.field input[type="date"] {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.6rem;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink);
    background: var(--ground);
    border: 1px solid var(--line);
}

.palette {
    display: flex;
    gap: 6px;
}

.palette input[type="color"] {
    width: 100%;
    height: 28px;
    padding: 0;
    background: none;
    border: 1px solid var(--line);
    cursor: pointer;
}

.reset {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-dim);
    background: none;
    border: 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}

/* -- violations */
.violations {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.violations-empty {
    font-family: var(--mono);
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink-dim);
}

.violation {
    display: flex;
    gap: 0.6rem;
    padding: 0.6rem;
    text-align: left;
    background: var(--ground);
    border: 0;
    border-left: 2px solid var(--coral);
    cursor: pointer;
}

.violation-scope {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-dim);
}

.scope-render {
    color: var(--coral);
}

.violation-body {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.violation-body code {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink);
}

.violation-body span {
    font-size: 11px;
    line-height: 1.5;
    color: var(--ink-dim);
}

/* -- stage */
.stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
}

.deck {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4vw;
    align-items: center;
}

.hero {
    justify-self: start;
}

.wall {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    align-items: flex-start;
    gap: 1.25rem;
    align-self: stretch;
}

.tile {
    position: relative;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    text-align: center;
    transition: transform 0.25s ease;
}

.tile:hover {
    transform: translateY(-4px);
}

.tile-caption {
    display: block;
    padding-top: 0.5rem;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--ink-dim);
}

.tile.is-selected .poster {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
}

.tile.is-invalid .poster {
    outline: 2px solid var(--coral);
    outline-offset: 4px;
}

.tile.is-edited .tile-caption::after {
    content: " · edited";
    color: var(--coral);
}

/* -- poster */
.poster {
    position: relative;
    overflow: hidden;
}

.poster-el {
    position: absolute;
    overflow: hidden;
}

.poster-el-image img,
.poster-el-image canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.poster-kv {
    display: flex;
    justify-content: space-between;
}

@media (max-width: 60em) {
    .axes {
        grid-template-columns: 1fr;
    }

    .app {
        padding: 0 5vw 12vh;
        overflow-x: hidden;
    }

    .deck {
        grid-template-columns: 1fr;
        justify-items: center;
        width: 90vw;
        max-width: 90vw;
        margin: 0 auto;
        gap: 1.5rem;
    }

    .hero {
        width: 90vw;
        max-width: 90vw;
        display: flex;
        justify-content: center;
        align-self: center;
    }

    .wall {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: center;
        align-items: start;
        width: 90vw;
        max-width: 90vw;
        gap: 1.25rem;
    }

    .tile {
        width: 100%;
        max-width: 100%;
    }

    .console {
        position: static;
        z-index: auto;
        flex-direction: column;
        max-height: none;
        overflow: visible;
        box-sizing: border-box;
        width: 100vw;
        max-width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        padding: 1.5rem 0 1rem;
    }

    .console.is-collapsed {
        position: fixed;
        left: 0;
        bottom: 0;
        z-index: 998;
        margin: 0;
        padding: 0.75rem 0;
        border-top: 1px solid var(--line);
    }

    .console-bar {
        width: 100vw;
        max-width: 100vw;
        padding: 0 4vw;
        box-sizing: border-box;
    }

    .console-body {
        flex-direction: column;
        padding: 0 6vw;
        box-sizing: border-box;
    }

    body.console-collapsed .app {
        padding-bottom: 5.5rem;
    }

    @media (max-width: 50em) {
        .console.is-collapsed {
            bottom: 3rem;
        }

        body.console-collapsed .app {
            padding-bottom: calc(3rem + 5.5rem);
        }

        .app {
            padding-bottom: calc(3rem + 8vh);
        }
    }

    .panel,
    .panel-template,
    .panel-ratio,
    .panel-record,
    .panel-violations {
        flex: 1 1 auto;
        width: 100%;
    }

    .panel + .panel {
        border-left: 0;
        border-top: 1px solid var(--line);
        padding-top: 1rem;
    }

    .template-body {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .template-col,
    .template-json pre {
        min-width: 0;
        max-width: none;
    }

    .inspector {
        grid-template-columns: 1fr;
    }

    .inspector .field:nth-child(1),
    .inspector .field:nth-child(2),
    .inspector .field:nth-child(3),
    .inspector .reset {
        grid-column: 1;
        grid-row: auto;
    }

    .field input[type="text"],
    .field input[type="date"] {
        min-width: 0;
    }

}

@media (min-width: 60.01em) and (max-width: 80em) {
    .console-body {
        flex-wrap: wrap;
    }

    .panel {
        flex: 1 1 calc(50% - 0.4rem);
    }

    .panel-ratio {
        flex: 0 1 auto;
    }
}