:root {
    --bg: #0a0b0d;
    --bg-2: #101216;
    --panel: #141821;
    --panel-2: #1a1f2a;
    --line: #242a36;
    --text: #e9edf2;
    --muted: #79828f;
    --signal: #2de2c4; /* phosphor cyan accent */
    --signal-dim: #16a892;
    --live: #ff3b3b; /* broadcast red */
    --radius: 14px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background:
        radial-gradient(
            1200px 600px at 80% -10%,
            rgba(45, 226, 196, 0.06),
            transparent 60%
        ),
        radial-gradient(
            900px 500px at 0% 110%,
            rgba(255, 59, 59, 0.05),
            transparent 55%
        ),
        var(--bg);
    color: var(--text);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* film grain / scanline atmosphere */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.35;
    background-image: repeating-linear-gradient(
        0deg,
        rgba(255, 255, 255, 0.018) 0px,
        rgba(255, 255, 255, 0.018) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: overlay;
}

.muted {
    color: var(--muted);
}

/* ── Header ───────────────────────────────────────────────── */
.site-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(
        180deg,
        rgba(16, 18, 22, 0.9),
        rgba(10, 11, 13, 0.6)
    );
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}
.brand-mark {
    width: 14px;
    height: 14px;
    background: var(--signal);
    box-shadow: 0 0 12px var(--signal);
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}
.brand-text {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 1.05rem;
}

.nav {
    display: flex;
    gap: 8px;
}
.nav-link {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 600;
    letter-spacing: 0.1em;
    font-size: 0.82rem;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.18s ease;
}
.nav-link:hover {
    color: var(--text);
    border-color: var(--line);
}
.nav-link.is-active {
    color: var(--signal);
    border-color: rgba(45, 226, 196, 0.3);
    background: rgba(45, 226, 196, 0.06);
}

/* ── Live dot / badge ─────────────────────────────────────── */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7);
    animation: pulse 1.8s infinite;
    display: inline-block;
}
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.6);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(255, 59, 59, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
    }
}

.wrap {
    flex: 1;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 28px;
}

/* ── Live stage ───────────────────────────────────────────── */
.live-header {
    text-align: center;
    margin-bottom: 26px;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--live);
    font-size: 0.8rem;
    padding: 6px 14px;
    border: 1px solid rgba(255, 59, 59, 0.35);
    border-radius: 999px;
    background: rgba(255, 59, 59, 0.07);
    margin-bottom: 18px;
}
.stage-title {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    letter-spacing: 0.04em;
    margin: 0;
    background: linear-gradient(180deg, #fff, #aab4c0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stage-sub {
    color: var(--muted);
    margin: 6px 0 0;
    letter-spacing: 0.05em;
}

.player-frame {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden; /* clips anything spilling out */
    background: #000;
    box-shadow:
        0 30px 80px -30px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(45, 226, 196, 0.05);
    aspect-ratio: 16 / 9;
}
.player-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    pointer-events: none;
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.5);
    z-index: 2;
}
.player {
    width: calc(100% + 34px); /* push scrollbars past the clip edge */
    height: calc(100% + 34px);
    margin: -17px; /* recenter so the video stays centered */
    display: block;
    border: 0;
}

.stage-footnote {
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.88rem;
}
.ghost-link {
    color: var(--signal);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.18s;
}
.ghost-link:hover {
    border-color: var(--signal);
}

/* ── Archive ──────────────────────────────────────────────── */
.archive-head {
    margin-bottom: 28px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
}
.archive-title {
    font-family: "Chakra Petch", sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    letter-spacing: 0.12em;
    margin: 0;
}
.archive-sub {
    margin: 6px 0 0;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.loading {
    grid-column: 1 / -1;
    padding: 60px 0;
    text-align: center;
    letter-spacing: 0.05em;
}

.card {
    text-align: left;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    color: var(--text);
    font-family: inherit;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    opacity: 0;
    transform: translateY(14px);
    animation: rise 0.5s forwards;
}
@keyframes rise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(45, 226, 196, 0.4);
    box-shadow:
        0 20px 40px -20px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(45, 226, 196, 0.15);
}

.card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--panel-2);
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.card:hover .card-thumb img {
    transform: scale(1.05);
}
.card-thumb.no-thumb::after {
    content: "NO SIGNAL";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

.card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(10, 11, 13, 0.7);
    border: 1px solid var(--signal);
    color: var(--signal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    transition: all 0.22s ease;
    backdrop-filter: blur(4px);
}
.card:hover .card-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.card-dur {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(10, 11, 13, 0.85);
    color: var(--text);
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    border: 1px solid var(--line);
}

.card-meta {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.card-title {
    font-weight: 500;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}
.card-size {
    font-size: 0.76rem;
}

/* ── Modal ────────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(5, 6, 8, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}
.modal[hidden] {
    display: none;
}
.modal-inner {
    width: 100%;
    max-width: 1000px;
}
.modal-inner video {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #000;
    box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.9);
    display: block;
}
.modal-meta {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-top: 14px;
    font-family: "Chakra Petch", sans-serif;
    letter-spacing: 0.04em;
}
.modal-close {
    position: absolute;
    top: 22px;
    right: 26px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.18s;
}
.modal-close:hover {
    border-color: var(--signal);
    color: var(--signal);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-foot {
    border-top: 1px solid var(--line);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: var(--muted);
}
.site-foot span:first-child {
    font-family: "Chakra Petch", sans-serif;
    color: var(--text);
}

@media (max-width: 560px) {
    .site-head {
        padding: 16px;
    }
    .wrap {
        padding: 28px 16px;
    }
    .grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    .card-meta {
        padding: 10px 12px 12px;
    }
}
