/* ---- Fonts ---- */
@font-face {
    font-family: 'Bricolage Grotesque';
    src: url('../assets/fonts/Bricolage_Grotesque/BricolageGrotesque-VariableFont_opsz,wdth,wght.ttf') format('truetype-variations');
    font-weight: 200 800;
    font-style: normal;
    font-display: swap;
}

/* ---- Design tokens ----
   Shared by style.css and category.css (both load on category.html).
   Only values reused 2+ times live here — one-off colors stay inline. */
:root {
    --nav-h: 5rem; /* fallback before js/nav.js measures the real nav height */

    --c-border: oklch(0.15 0 0);       /* tile border, nav bottom border */
    --c-border-hover: oklch(0.35 0 0); /* tile hover border, about-portrait border */
    --c-dim: oklch(0.45 0 0);          /* quietest text: empty states, nav category label */
    --c-muted: oklch(0.5 0 0);         /* secondary text: meta lines, credits, colophon */
    --c-muted-soft: oklch(0.55 0 0);   /* subtitle-weight text */
    --c-bright: oklch(0.85 0 0);       /* emphasized text: site name, content links */

    --radius-sm: 0.2rem;
    --ease-fast: 150ms ease;

    --measure: 36rem;      /* reading-width cap for body copy */
    --inset-desktop: 15%;  /* left/right inset shared by item + prose pages */
    --inset-mobile: 1.25rem;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
}

body {
    min-height: 100vh;
    font-family: system-ui, sans-serif;
    background: #000;
    color: #fff;
}

/* ---- Home view ---- */
.home-view {
    display: flex;
    min-height: 100vh;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    padding-top: calc(var(--nav-h) + -5.0rem);
}

/* ---- Object grid ---- */
.object-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    row-gap: 0.5em;
    column-gap: 2em;
    padding: 3em;
    background-color: #000;
    background-image: radial-gradient(oklch(1 0 0 / 0.1) 1px, transparent 1px);
    background-size: 5em 5em;
    background-position: center;
    border-radius: 1.8em;
    width: clamp(34rem, 78vw, 96rem);
    font-size: clamp(0.34rem, 0.95vw, 1.05rem);
}

/* ---- Objects ---- */
.object-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5em;
    border-radius: 0.9em;
    text-decoration: none;
    color: inherit;
    user-select: none;
    transition: scale 100ms ease-in-out;
}

.object-item:active { scale: 0.97; }

.object-item:focus-visible {
    outline: max(1px, 0.2em) solid oklch(var(--item-color));
    outline-offset: max(1px, 0.2em);
}

.object-art-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 19em;
    width: 100%;
}

.object-art {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    filter: invert(1);
    transition: transform 150ms ease-in-out, filter 150ms ease-in-out;
}

/* Per-object scale tweaks — the shared bounding box doesn't read as equal size across every silhouette */
.object-item[data-id="works"] .object-art {
    max-width: 70%;
    max-height: 70%;
    margin-bottom: 1.6em;
}

.object-item[data-id="about"] .object-art {
    max-width: 60%;
    max-height: 60%;
    margin-bottom: 1.6em;
}

.object-item[data-id="pedagogy"] .object-art {
    max-width: 65%;
    max-height: 65%;
    margin-bottom: 1.6em;
}

.object-item[data-id="moonmist"] .object-art {
    max-width: 62%;
    max-height: 62%;
    margin-bottom: 1.6em;
}

.object-item[data-id="experiments"] .object-art {
    max-width: 70%;
    max-height: 70%;
    margin-bottom: 1.6em;
}

.object-item[data-id="archive"] .object-art {
    max-width: 70%;
    max-height: 70%;
    margin-bottom: 1.6em;
}

.object-tape {
    height: 2.6em;
    width: auto;
    flex-shrink: 0;
    filter: invert(1);
}

/* Reached state: set by JS on hover, tap, and idle-arm-reach alike, so all three read the same */
.object-item.is-reaching .object-art {
    transform: scale(1.05) rotate(-1deg);
    filter: invert(1) drop-shadow(0 0 0.4em oklch(var(--item-color) / 0.55));
}

/* ---- Arm ---- */
.arm {
    position: absolute;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translate(-50%, -100%) translate(var(--arm-tx, 0px), var(--arm-ty, -5%));
    z-index: 3;
    pointer-events: none;
    user-select: none;
    transition: transform 300ms ease-in-out;
    transition-delay: 300ms;
}

/* ---- Content views (gallery / item / prose) ---- */
.content-view {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: calc(var(--nav-h) + 2rem) 2rem 4rem;
}

.content {
    max-width: 60rem;
    margin: 0 auto;
    width: 100%;
}

/* Shared left/right inset for prose (about) and item-detail (category.js) articles —
   the one rule both .prose-article and .project-article opt into via this class. */
.inset-content {
    padding-left: var(--inset-desktop);
    padding-right: var(--inset-desktop);
}

.about-portrait {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--c-border-hover);
    margin: 0 auto 1.5rem;
}

.content h1 {
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.content a {
    color: var(--c-bright);
    font-weight: 700;
    text-decoration: underline;
    transition: color var(--ease-fast);
}

.content a:hover {
    color: #fff;
}

/* ---- Site nav (persistent across all pages) ---- */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 1.2rem 1.5rem 1rem;
}

/* Solid backdrop: only on pages that scroll content underneath the nav (category.html) */
.site-nav--solid {
    background: #000;
    border-bottom: 1px solid var(--c-border);
}

.site-name {
    color: var(--c-bright);
    text-decoration: none;
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: color var(--ease-fast);
}

.site-name:hover {
    color: #fff;
}

.category-label {
    color: var(--c-dim);
    text-decoration: none;
    font-family: 'Bricolage Grotesque', system-ui, sans-serif;
    font-size: 2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: color var(--ease-fast);
}

.category-label:hover {
    color: oklch(0.8 0 0);
}

.category-label--static {
    cursor: default;
}

.category-label--static:hover {
    color: var(--c-dim);
}

.category-label[hidden] {
    display: none;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
    /* Home: 2x3 layout, sized to fit one screen without scrolling */
    .home-view {
        min-height: 100dvh;
        padding-top: calc(var(--nav-h) + -2.0rem);
    }

    .object-grid {
        grid-template-columns: repeat(2, 1fr);
        width: clamp(18rem, 94vw, 30rem);
        font-size: clamp(0.5rem, 2.8vw, 0.78rem);
        row-gap: 0.6em;
        column-gap: 1.5em;
        padding: 1em;
    }

    .object-art-wrap {
        height: 14.0em;
    }

    .object-tape {
        height: 2.4em;
    }

    /* Same specificity as the per-item overrides above, wins on source order — scales the desktop art-to-tape gap down for mobile */
    .object-item[data-id] .object-art {
        margin-bottom: 0.8em;
    }

    /* Content: tighten the shared inset so it doesn't crush narrow screens */
    .inset-content {
        padding-left: var(--inset-mobile);
        padding-right: var(--inset-mobile);
    }
}
