:root {
    --bg: #ffffff;
    --fg: #000000;
    --muted: rgba(0, 0, 0, 0.58);
    --line: rgba(0, 0, 0, 0.14);
    --line-strong: rgba(0, 0, 0, 0.82);
    --panel: rgba(255, 255, 255, 0.78);
    --wash: rgba(0, 0, 0, 0.04);
    --grid: rgba(0, 0, 0, 0.06);
    --glitch-red: rgba(255, 57, 57, 0.72);
    --glitch-cyan: rgba(0, 198, 255, 0.72);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px),
        var(--bg);
    background-size: 3rem 3rem, 3rem 3rem, auto;
    color: var(--fg);
    font-family: "Space Grotesk", sans-serif;
}

body {
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

.subpage-shell {
    display: flex;
    min-height: 100vh;
}

.subpage-rail {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2vw, 1.5rem);
    width: min(35vw, 27rem);
    min-height: 100vh;
    padding: clamp(2rem, 4vw, 3.25rem) clamp(1.75rem, 3vw, 2.75rem) clamp(2.5rem, 4vw, 3.5rem);
    border-right: 4px solid var(--fg);
    background: rgba(255, 255, 255, 0.94);
}

.rail-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.8rem 1rem;
    border: 2px solid var(--fg);
    background: rgba(255, 255, 255, 0.82);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
        transform 0.25s var(--ease-out),
        background-color 0.25s var(--ease-out),
        box-shadow 0.25s var(--ease-out);
}

.rail-badge::before {
    content: "";
    width: 2.75rem;
    height: 2px;
    background: var(--fg);
}

.rail-badge:hover,
.rail-badge:focus-visible {
    background: rgba(0, 0, 0, 0.025);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
    transform: translateX(0.15rem);
    outline: none;
}

.rail-title {
    position: relative;
    margin: clamp(1.25rem, 3vw, 2rem) 0 0;
    font-family: "Archivo Black", sans-serif;
    font-size: clamp(3rem, 6vw, 5rem);
    line-height: 0.9;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.rail-title .glitch-layer {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

.rail-title .glitch-red {
    color: var(--glitch-red);
    transform: translate(-3px, -2px);
    clip-path: polygon(0 0, 100% 0, 100% 46%, 0 46%);
}

.rail-title .glitch-cyan {
    color: var(--glitch-cyan);
    transform: translate(4px, 2px);
    clip-path: polygon(0 54%, 100% 54%, 100% 100%, 0 100%);
}

.rail-copy {
    max-width: 20rem;
    margin: 0;
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.85;
}

.rail-nav {
    display: grid;
    gap: 0;
    margin-top: clamp(1rem, 2vw, 1.5rem);
    border-top: 2px solid rgba(0, 0, 0, 0.22);
}

.rail-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.75rem;
    padding: 1rem 0;
    border-bottom: 2px solid rgba(0, 0, 0, 0.22);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.75rem;
    font-weight: 700;
    transition:
        padding-left 0.3s var(--ease-out),
        border-color 0.3s var(--ease-out),
    background-color 0.3s var(--ease-out);
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
    padding-left: 0.5rem;
    border-color: var(--fg);
    background: rgba(0, 0, 0, 0.025);
    outline: none;
}

.rail-link-text {
    min-width: 0;
}

.rail-nav .link-arrow {
    width: 2.7rem;
    height: 2.7rem;
    flex: 0 0 2.7rem;
    font-size: 1.15rem;
}

.rail-nav a:hover .link-arrow,
.rail-nav a:focus-visible .link-arrow {
    transform: translateX(0.35rem);
}

.subpage-main {
    flex: 1;
    padding: clamp(2rem, 4vw, 3.5rem);
}

.main-frame {
    max-width: 74rem;
    padding: clamp(2.75rem, 5vw, 4.5rem);
    background: var(--panel);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.main-kicker {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.main-kicker::before {
    content: "";
    width: 3rem;
    height: 2px;
    background: var(--fg);
}

.main-kicker span {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
}

.main-intro {
    max-width: 46rem;
    margin: 0 0 3.75rem;
    font-size: clamp(1.08rem, 1.9vw, 1.3rem);
    line-height: 1.8;
    color: rgba(0, 0, 0, 0.76);
}

.section-stack {
    display: grid;
    gap: 2.25rem;
}

.editorial-section {
    position: relative;
    padding: clamp(2rem, 4vw, 2.85rem);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.09);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.35rem;
    margin-bottom: 1.65rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.22);
}

.section-title {
    margin: 0;
    font-family: "Archivo Black", sans-serif;
    font-size: clamp(2.3rem, 5vw, 4.25rem);
    line-height: 0.94;
    letter-spacing: -0.05em;
    text-transform: uppercase;
}

.section-meta {
    font-family: monospace;
    font-size: 0.85rem;
    letter-spacing: 0.24em;
    color: rgba(0, 0, 0, 0.44);
    white-space: nowrap;
}

.section-text {
    max-width: 48rem;
    font-size: 1.1rem;
    line-height: 1.78;
    color: rgba(0, 0, 0, 0.78);
}

.link-list {
    display: grid;
    gap: 0;
    margin-top: 1.5rem;
}

.link-row {
    display: flex;
    align-items: center;
    gap: 1.35rem;
    min-height: 6rem;
    padding: 1.35rem 0;
    border-top: 2px solid rgba(0, 0, 0, 0.18);
    transition: padding-left 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.link-row:last-child {
    border-bottom: 2px solid rgba(0, 0, 0, 0.18);
}

.link-row:hover,
.link-row:focus-within {
    padding-left: 0.9rem;
    border-color: var(--fg);
}

.link-index {
    width: 3rem;
    flex: 0 0 3rem;
    font-family: monospace;
    font-size: 0.82rem;
    letter-spacing: 0.22em;
    color: rgba(0, 0, 0, 0.46);
}

.link-content {
    flex: 1;
}

.link-content a {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.link-content a:hover,
.link-content a:focus-visible {
    text-decoration: underline;
    outline: none;
}

.link-note {
    display: block;
    margin-top: 0.45rem;
    color: rgba(0, 0, 0, 0.58);
    font-size: 1rem;
    line-height: 1.6;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 3rem;
    height: 3rem;
    border: 2px solid var(--fg);
    font-size: 1.4rem;
    overflow: hidden;
    transform-origin: center;
    will-change: transform, filter, box-shadow, opacity;
    transition:
        transform 0.3s var(--ease-out),
        background-color 0.3s var(--ease-out),
        color 0.3s var(--ease-out),
        filter 0.3s var(--ease-out),
        box-shadow 0.3s var(--ease-out),
        opacity 0.3s var(--ease-out);
}

.link-arrow::before {
    content: "";
    position: absolute;
    inset: -0.2rem;
    background: rgba(0, 0, 0, 0.92);
    opacity: 0;
    filter: blur(0px);
    transform: translate(0, 0) scale(1);
    pointer-events: none;
    transition:
        opacity 0.25s var(--ease-out),
        filter 0.25s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.link-arrow::after {
    content: "";
    position: absolute;
    inset: -0.35rem;
    opacity: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 28% 36%, rgba(0, 0, 0, 0.42) 0 20%, transparent 56%),
        radial-gradient(circle at 70% 62%, rgba(0, 0, 0, 0.36) 0 18%, transparent 58%),
        radial-gradient(circle at 54% 28%, rgba(0, 0, 0, 0.22) 0 14%, transparent 52%);
    filter: blur(0px);
    transform: scale(0.92);
    transition:
        opacity 0.25s var(--ease-out),
        filter 0.25s var(--ease-out),
        transform 0.25s var(--ease-out);
}

.link-arrow .cellular-arrow-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition:
        opacity 0.18s var(--ease-out),
        filter 0.18s var(--ease-out),
        transform 0.18s var(--ease-out);
}

.link-row:hover .link-arrow,
.link-row:focus-within .link-arrow {
    transform: translateX(0.4rem);
}

.link-arrow.is-cellular-active {
    background: var(--fg);
    color: transparent;
    opacity: 0.985;
    filter: blur(0.18px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 0 24px rgba(0, 0, 0, 0.14);
    animation: living-arrow-box var(--living-box-duration, 3.8s) ease-in-out infinite;
    animation-delay: var(--living-box-delay, 0s);
}

.link-arrow.is-cellular-active::before {
    opacity: 0.7;
    animation: living-arrow-bloom var(--living-box-duration, 3.8s) ease-in-out infinite;
    animation-delay: var(--living-box-delay, 0s);
}

.link-arrow.is-cellular-active::after {
    opacity: 0.8;
    animation: living-arrow-cloud var(--living-box-duration, 3.8s) ease-in-out infinite;
    animation-delay: calc(var(--living-box-delay, 0s) - 0.6s);
}

.link-arrow.is-cellular-active .cellular-arrow-canvas {
    opacity: 1;
    animation: cellular-arrow-breathe calc(var(--living-box-duration, 3.8s) * 0.92) ease-in-out infinite;
    animation-delay: calc(var(--living-box-delay, 0s) * 0.8);
}

.quote-block {
    margin: 2rem 0;
    padding: 1.6rem 1.75rem;
    border-left: 3px solid var(--fg);
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.72);
    line-height: 1.8;
}

.meta-line {
    margin-top: 1.35rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.74rem;
    color: rgba(0, 0, 0, 0.56);
}

.mix-stack {
    display: grid;
    gap: 2rem;
}

.mix-card {
    padding: clamp(2rem, 4vw, 2.8rem);
    background: rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.09);
}

.mix-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1.25rem;
    margin-bottom: 1.4rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.18);
}

.mix-title {
    margin: 0;
    font-family: "Archivo Black", sans-serif;
    font-size: clamp(2.2rem, 4vw, 3.3rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    text-transform: uppercase;
}

.mix-meta {
    font-family: monospace;
    font-size: 0.82rem;
    letter-spacing: 0.22em;
    color: rgba(0, 0, 0, 0.44);
}

.mix-card iframe {
    display: block;
    width: 100%;
    min-height: 166px;
    border: 0;
}

.mix-note {
    margin-top: 1.2rem;
    color: rgba(0, 0, 0, 0.62);
    font-size: 1rem;
    line-height: 1.7;
}

@keyframes living-arrow-box {
    0% {
        filter: blur(0.05px);
        opacity: 0.98;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.04),
            0 0 12px rgba(0, 0, 0, 0.06);
    }
    22% {
        filter: blur(0.68px);
        opacity: 0.85;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.08),
            0 0 28px rgba(0, 0, 0, 0.18);
    }
    41% {
        filter: blur(0.16px);
        opacity: 0.95;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.05),
            0 0 16px rgba(0, 0, 0, 0.08);
    }
    64% {
        filter: blur(0.92px);
        opacity: 0.8;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.1),
            0 0 36px rgba(0, 0, 0, 0.2);
    }
    82% {
        filter: blur(0.12px);
        opacity: 0.96;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.05),
            0 0 17px rgba(0, 0, 0, 0.08);
    }
    100% {
        filter: blur(0.05px);
        opacity: 0.98;
        box-shadow:
            0 0 0 1px rgba(0, 0, 0, 0.04),
            0 0 12px rgba(0, 0, 0, 0.06);
        }
}

@keyframes living-arrow-bloom {
    0% {
        transform: translate(0, 0) scale(0.92);
        filter: blur(0.45px);
        opacity: 0.28;
    }
    26% {
        transform: translate(0, 0) scale(1.18);
        filter: blur(2.2px);
        opacity: 0.7;
    }
    48% {
        transform: translate(0, 0) scale(1.02);
        filter: blur(0.95px);
        opacity: 0.34;
    }
    72% {
        transform: translate(0, 0) scale(1.24);
        filter: blur(2.6px);
        opacity: 0.76;
    }
    100% {
        transform: translate(0, 0) scale(0.95);
        filter: blur(0.6px);
        opacity: 0.3;
    }
}

@keyframes living-arrow-cloud {
    0% {
        transform: translate(-0.02rem, 0.03rem) scale(0.9, 0.94);
        filter: blur(0.4px);
        opacity: 0.22;
    }
    24% {
        transform: translate(0.05rem, -0.04rem) scale(1.08, 1.18);
        filter: blur(1.7px);
        opacity: 0.56;
    }
    46% {
        transform: translate(-0.04rem, 0.02rem) scale(0.98, 1.04);
        filter: blur(0.9px);
        opacity: 0.34;
    }
    73% {
        transform: translate(0.04rem, 0.05rem) scale(1.15, 1.08);
        filter: blur(2.4px);
        opacity: 0.62;
    }
    100% {
        transform: translate(0.01rem, -0.02rem) scale(0.94, 0.96);
        filter: blur(0.65px);
        opacity: 0.26;
    }
}

@keyframes cellular-arrow-breathe {
    0% {
        transform: translate(-50%, -50%) scale(0.95);
        filter: blur(0px);
        opacity: 0.92;
    }
    28% {
        transform: translate(-50%, -50%) scale(1.04);
        filter: blur(0.45px);
        opacity: 1;
    }
    55% {
        transform: translate(-50%, -50%) scale(0.98);
        filter: blur(0.12px);
        opacity: 0.94;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.02);
        filter: blur(0.32px);
        opacity: 0.98;
    }
}

@media (max-width: 960px) {
    .subpage-shell {
        display: block;
    }

    .subpage-rail {
        position: relative;
        width: auto;
        min-height: auto;
        border-right: 0;
        border-bottom: 4px solid var(--fg);
    }

    .subpage-main {
        padding-top: 1.25rem;
    }

    .main-frame {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    html,
    body {
        background-size: 2.15rem 2.15rem, 2.15rem 2.15rem, auto;
    }

    .subpage-rail,
    .subpage-main {
        padding: 1.1rem;
    }

    .rail-title {
        font-size: 3.75rem;
    }

    .main-frame {
        padding: 1.5rem;
    }

    .section-head,
    .mix-head {
        display: block;
    }

    .section-meta,
    .mix-meta {
        display: block;
        margin-top: 0.75rem;
    }

    .link-row {
        gap: 0.75rem;
        align-items: flex-start;
    }

    .link-index {
        width: 2.7rem;
        flex-basis: 2.7rem;
    }

    .rail-nav .link-arrow,
    .link-arrow {
        font-size: 0;
        line-height: 0;
        color: transparent;
        background-image: none;
    }
}
