/* knotCollective — typographic system
   ----------------------------------------------------------------
   Archivo        grotesque: structure, display, body (variable width)
   Newsreader     serif: the editorial accent / collage clash
   IBM Plex Mono  data: archive metadata, instrumentation, masthead

   Swiss-editorial grid, flush-left, collage treatment.
   A printed concert program for a dark room. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --paper: #000000;
    --ink: #f4f1ea;
    --muted: rgba(244, 241, 234, 0.86);
    --faint: rgba(244, 241, 234, 0.72);
    --rule: rgba(244, 241, 234, 0.16);
    --rule-strong: rgba(244, 241, 234, 0.55);

    /* release signals — one per knot record */
    --red: #e32c14;
    --violet: #9a64ff;
    --amber: #e99708;
    --azure: #0f91ff;
    --pink: #fe7eaf;
    --cyan: #4ec5ec;

    --grotesk: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
    --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

    --gutter: clamp(1.25rem, 5vw, 5rem);
    --measure: 68ch;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    position: relative;
    font-family: var(--grotesk);
    font-weight: 400;
    font-size: 1.0625rem;
    line-height: 1.65;
    background-color: var(--paper);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    caret-color: var(--red);
    overflow-x: hidden;
}

/* Backdrop is the starfield alone: a pure-black field where the only light is
   the sparse, slowly drifting point cloud painted by particles.js at z-index
   -2. No static grain, no noise tile — just the moving dots, so the page reads
   as depth (glass panes at -1) rather than texture. */

::selection {
    background: var(--ink);
    color: var(--paper);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--paper);
}

::-webkit-scrollbar-thumb {
    background: rgba(244, 241, 234, 0.22);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 241, 234, 0.42);
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---------- Masthead ---------- */

nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem var(--gutter);
    background: rgba(0, 0, 0, 0.44);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    border-bottom: 1px solid var(--rule);
}

.nav-left {
    display: flex;
    gap: clamp(1rem, 3.5vw, 3rem);
    align-items: baseline;
}

.nav-left a {
    text-decoration: none;
}

.nav-left .brand {
    font-weight: 800;
    font-stretch: 116%;
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

.nav-left a:not(.brand) {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.2s ease;
}

.nav-left a:not(.brand):hover,
.nav-left a[aria-current="page"]:not(.brand) {
    color: var(--ink);
}

.nav-right {
    display: flex;
    gap: 1.15rem;
    align-items: center;
}

.nav-right a {
    color: var(--ink);
    transition: opacity 0.2s ease;
}

.nav-right a:hover {
    opacity: 0.55;
}

.nav-right svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ---------- Type roles ---------- */

h1,
h2,
h3 {
    font-weight: 650;
    letter-spacing: -0.01em;
    line-height: 1.03;
}

.display {
    font-weight: 800;
    font-stretch: 116%;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 0.88;
    font-size: clamp(2.75rem, 11vw, 6rem);
}

.title {
    font-size: clamp(1.9rem, 5.6vw, 3.5rem);
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: -0.015em;
    line-height: 0.98;
}

.project-title {
    font-size: clamp(1.45rem, 3.4vw, 2.25rem);
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: -0.012em;
    line-height: 1.02;
}

.prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    font-weight: 400;
    color: var(--muted);
    max-width: var(--measure);
}

.prose + .prose {
    margin-top: 1.05em;
}

.label {
    font-family: var(--mono);
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}

.meta {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.serif {
    font-family: var(--serif);
    font-style: normal;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    font-size: 1.12em;
}

/* section running-head: mono label + hairline, a structural rule */
.section-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: clamp(1.75rem, 4vw, 3rem);
}

.section-head::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
}

/* ---------- Collage devices ---------- */

/* a small taped label set onto an image */
.tape {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    padding: 0.32em 0.7em;
    transform: rotate(-2.5deg);
}

/* release signal chip */
.chip {
    width: 0.72rem;
    height: 0.72rem;
    background: var(--c, var(--ink));
    display: inline-block;
    flex: none;
    align-self: center;
}

/* ---------- Motion (one authored moment) ---------- */

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.rise {
    animation: rise 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
    animation-delay: var(--d, 0s);
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    .rise {
        animation: none;
    }
    * {
        transition-duration: 0.001ms !important;
    }
}

@media (max-width: 720px) {
    .nav-left {
        gap: 1.1rem;
    }

    .nav-left .brand {
        font-size: 0.95rem;
    }

    .nav-left a:not(.brand) {
        font-size: 0.72rem;
        letter-spacing: 0.09em;
    }

    .nav-right {
        gap: 0.9rem;
    }
}

/* five links + brand: keep the masthead on one line on narrow phones */
@media (max-width: 440px) {
    .nav-left {
        gap: 0.5rem;
    }

    .nav-left a:not(.brand) {
        font-size: 0.68rem;
        letter-spacing: 0.05em;
    }

    .nav-right {
        gap: 0.8rem;
    }
}

/* ---------- Atmosphere: frosted-glass collage (additive decoration) ----------
   A viewport-pinned positioning layer at z-index: -1 — fixed, so the panes hold
   their place as the page scrolls. It sits behind the nav, text, images and
   every player, but above the starfield (-2). Its panes' backdrop-filter
   therefore blurs the field behind them, never the content. Everything here is
   click-transparent and static (no motion).
   Each pane is the lightest cut of the masthead's glass: the same hairline rule
   and blur/saturate, but a much thinner black fill and a near-clear blur, so the
   drifting stars stay legible as they pass under the sheet. The nav keeps the
   denser fill; it must hold its labels over scrolling content, the panes must
   not. */

.glass {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    perspective: 1200px;
    perspective-origin: 50% 50%;
}

/* Each pane is a flat sheet suspended in the same space as the starfield: a
   shared perspective, an X/Y tilt so the near edge reads larger than the far
   edge, a depth along Z, and a sheen that falls on the edge facing the nebula's
   centre (--sh). Nearer panes are less hazy and less opaque; farther ones sit
   deeper into the field. Roll (--r) is kept as the pane's own small wobble. */
.glass span {
    position: absolute;
    display: block;
    width: var(--w, 220px);
    height: var(--h, 150px);
    transform:
        translateZ(var(--tz, 0px))
        rotateX(var(--rx, 0deg))
        rotateY(var(--ry, 0deg))
        rotate(var(--r, 0deg));
    transform-origin: 50% 50%;
    pointer-events: none;
    border: 1px solid var(--rule);
    background: rgba(0, 0, 0, var(--fill, 0.09));
    -webkit-backdrop-filter: blur(var(--b, 1.5px)) saturate(1.5);
    backdrop-filter: blur(var(--b, 1.5px)) saturate(1.5);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 26px 64px -30px rgba(0, 0, 0, 0.85);
}

/* Sheen: the nebula is the page's one light, so each sheet catches it on the
   edge turned toward the field's centre. A faint specular fall-off across the
   face is what sells the pane as a lit surface rather than a flat cut-out. */
.glass span::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        var(--sh, 135deg),
        rgba(244, 241, 234, 0.05),
        rgba(244, 241, 234, 0.01) 34%,
        rgba(244, 241, 234, 0) 62%
    );
}

/* without backdrop-filter support the pane keeps its role with a denser fill */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    nav {
        background: rgba(0, 0, 0, 0.92);
    }

    .glass span {
        background: rgba(0, 0, 0, 0.42);
    }
}

/* small screens: keep only the two panes each page places in its inline style —
   backdrop-filter is costly while scrolling */
@media (max-width: 720px) {
    .glass span:nth-child(n + 3) {
        display: none;
    }
}
