/* ====================================================================
   AOMOVEMENT — vjp-ao campaign stylesheet
   Deep Black #050505 · Pure White #ffffff · AO Neon Red #ef4444.
   Space Grotesk (display) · JetBrains Mono (technical/UI).
   ==================================================================== */
/* ====================================================================
   AOMOVEMENT — CI
   Deep Black #050505 · Neon Red #ef4444 · white/zinc type. Nothing else.
   ==================================================================== */
:root {
    --ao-void: #050505;
    --ao-red:  #ef4444;
    --bar: 4.25rem;   /* sticky transport bar — hero clears it */
    --nav-h: 3.5rem;  /* measured and overwritten by the nav-metrics module */
    --safe-t: env(safe-area-inset-top, 0px);
    --safe-b: env(safe-area-inset-bottom, 0px);
    --safe-l: env(safe-area-inset-left, 0px);
    --safe-r: env(safe-area-inset-right, 0px);
}

/* Painted before Tailwind's CDN runtime resolves — no flash of unstyled page. */
html, body { background-color: var(--ao-void); }

html {
    -webkit-text-size-adjust: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    color: #ffffff;
    font-family: '"Space Grotesk"', 'Space Grotesk', Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    /* Native feel: no rubber-band, no double-tap zoom, no accidental text lasso.
       Vertical scrolling stays available for small screens that overflow. */
    overscroll-behavior-y: none;
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

::selection { background: var(--ao-red); color: #000; }

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

img, svg, video { display: block; max-width: 100%; }

/* ====================================================================
   BACKGROUND MEDIA
   ==================================================================== */
#bg-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%) contrast(155%) brightness(0.34);
    transform: translateZ(0);
    pointer-events: none;
}

/* ====================================================================
   CRT / GRAIN / VIGNETTE — all fixed, composited, pointer-inert
   ==================================================================== */
.fx { position: fixed; inset: 0; pointer-events: none; transform: translateZ(0); }

.fx-grid {
    opacity: 0.26;
    background-image:
        linear-gradient(rgba(239, 68, 68, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 34px 34px;
}

.fx-scan {
    opacity: 0.2;
    mix-blend-mode: screen;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.11) 0px,
        rgba(255, 255, 255, 0.11) 1px,
        transparent 1px,
        transparent 4px
    );
}

.fx-grain {
    inset: -6%;
    opacity: 0.07;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 240px 240px;
    will-change: transform;
    animation: grain 0.9s steps(1, end) infinite;
}
@keyframes grain {
    0%   { transform: translate3d(0, 0, 0); }
    25%  { transform: translate3d(-2%, 1%, 0); }
    50%  { transform: translate3d(1.5%, -1.5%, 0); }
    75%  { transform: translate3d(-1%, -2%, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.fx-vignette {
    background:
        radial-gradient(ellipse at 50% 44%, transparent 0 42%, rgba(0,0,0,0.45) 76%, rgba(0,0,0,0.94) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.82), transparent 26%, transparent 62%, rgba(0,0,0,0.9));
}

/* ====================================================================
   SPLIT HEADER — collective on the left, the new event on the right
   ==================================================================== */
.hdr-split {
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 5, 5, 0.72);
    -webkit-backdrop-filter: saturate(120%) blur(8px);
    backdrop-filter: saturate(120%) blur(8px);
}
/* The seam between "old view" and "new view". */
.hdr-split::after {
    content: '';
    position: absolute;
    right: 0; bottom: -1px;
    width: 42%;
    height: 1px;
    background: var(--ao-red);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}

.hdr-seam {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(239, 68, 68, 0.75), transparent);
}

.badge-date {
    border: 1px solid var(--ao-red);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55);
    animation: badge-pulse 2.4s cubic-bezier(0.16, 1, 0.3, 1) infinite;
    will-change: transform, box-shadow;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);  transform: translate3d(0,0,0) scale(1); }
    50%      { box-shadow: 0 0 22px 2px rgba(239, 68, 68, 0.45); transform: translate3d(0,0,0) scale(1.015); }
}
.badge-dot { animation: dot-blink 1.6s steps(1, end) infinite; }
@keyframes dot-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.15; } }

/* ====================================================================
   HERO TYPOGRAPHY
   ==================================================================== */
.h-massive {
    font-size: clamp(2.75rem, min(13vw, 12vh), 9.5rem);
    line-height: 0.84;
    letter-spacing: -0.05em;
    font-weight: 700;
}
.h-sub {
    font-size: clamp(1rem, min(4.4vw, 4.6vh), 2.6rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
}
.t-glow { text-shadow: 0 0 34px rgba(239, 68, 68, 0.5); }

/* ====================================================================
   COUNTDOWN — digital-clock alignment, brackets drawn by CSS so the JS
   only ever writes two characters per field.
   ==================================================================== */
.countdown {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
}
.cd-num { color: var(--ao-red); }
.cd-num::before { content: '['; color: #52525b; }
.cd-num::after  { content: ']'; color: #52525b; }
.cd-unit { margin-left: 0.4em; color: #71717a; }
.cd-sep  { color: rgba(255, 255, 255, 0.2); }

/* Event running or over: the digits go, the label carries the message. */
.countdown.is-done .cd-group,
.countdown.is-done .cd-sep { display: none; }

/* ====================================================================
   SCROLL CUE
   ==================================================================== */
.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: calc(var(--bar) + 1.25rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    transform: translate3d(-50%, 0, 0);
    animation: cue-bounce 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
    transition: opacity 0.4s ease;
    will-change: transform;
}
.scroll-cue.is-hidden { opacity: 0; pointer-events: none; }
@keyframes cue-bounce {
    0%, 100% { transform: translate3d(-50%, 0, 0); }
    50%      { transform: translate3d(-50%, 7px, 0); }
}

.cue-rail {
    position: relative;
    display: block;
    width: 1px;
    height: 2.75rem;
    background: rgba(255, 255, 255, 0.14);
    overflow: hidden;
}
.cue-rail::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 45%;
    background: var(--ao-red);
    will-change: transform;
    animation: cue-travel 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes cue-travel {
    0%        { transform: translate3d(0, -100%, 0); }
    60%, 100% { transform: translate3d(0, 222%, 0); }
}

/* ====================================================================
   SCROLL REVEAL — driven by IntersectionObserver, one-shot per element
   ==================================================================== */
.js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition:
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--r, 0) * 90ms),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) calc(var(--r, 0) * 90ms);
    will-change: opacity, transform;
}
.js [data-reveal].is-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* ====================================================================
   AUDIO VISUALIZER — 28 bars, transform-only
   ==================================================================== */
.viz { display: flex; align-items: flex-end; gap: 2px; height: 22px; }
.viz-bar {
    width: 3px;
    height: 100%;
    background: var(--ao-red);
    opacity: 0.85;
    transform: scaleY(0.12);
    transform-origin: 50% 100%;
    will-change: transform;
}
/* Idle: a slow standby shimmer until real frequency data takes over. */
.viz.is-idle .viz-bar {
    animation: viz-idle 1.9s ease-in-out infinite;
    animation-delay: calc(var(--i) * -0.11s);
}
@keyframes viz-idle {
    0%, 100% { transform: scaleY(0.1); }
    50%      { transform: scaleY(0.34); }
}
.viz.is-live .viz-bar { transition: transform 0.06s linear; }

/* ====================================================================
   BUTTONS — hard edges, hard shadow
   ==================================================================== */
.btn-hard {
    border: 1px solid #ffffff;
    box-shadow: 6px 6px 0 0 var(--ao-red);
    will-change: transform;
    transition: transform 0.16s cubic-bezier(0.6,0,0.1,1),
                box-shadow 0.16s cubic-bezier(0.6,0,0.1,1),
                background-color 0.16s cubic-bezier(0.6,0,0.1,1),
                color 0.16s cubic-bezier(0.6,0,0.1,1),
                border-color 0.16s cubic-bezier(0.6,0,0.1,1);
}
@media (hover: hover) {
    .btn-hard:hover {
        transform: translate3d(6px, 6px, 0);
        box-shadow: 0 0 0 0 var(--ao-red);
        background-color: var(--ao-red);
        border-color: var(--ao-red);
        color: #000;
    }
    .btn-hard:hover .btn-icon { color: #000; }
}
.btn-hard:active { transform: translate3d(6px, 6px, 0); box-shadow: 0 0 0 0 var(--ao-red); }

.btn-ghost {
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: color 0.2s ease, border-color 0.2s ease;
}
.btn-ghost:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); }

/* ====================================================================
   LEGAL MODAL
   ==================================================================== */
#legal-modal[hidden] { display: none; }
#legal-modal { opacity: 0; transition: opacity 0.28s cubic-bezier(0.6,0,0.1,1); }
#legal-modal.is-open { opacity: 1; }

.modal-scroll {
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--ao-red) var(--ao-void);
    -webkit-user-select: text;
    user-select: text;
}
.modal-scroll::-webkit-scrollbar { width: 6px; }
.modal-scroll::-webkit-scrollbar-track { background: var(--ao-void); }
.modal-scroll::-webkit-scrollbar-thumb { background: var(--ao-red); }

/* ====================================================================
   ENTRANCE — short, no boot sequence, straight into the event
   ==================================================================== */
.rise { animation: rise 0.85s cubic-bezier(0.16, 1, 0.3, 1) both; }
.d1 { animation-delay: 0.06s; }
.d2 { animation-delay: 0.14s; }
.d3 { animation-delay: 0.22s; }
.d4 { animation-delay: 0.30s; }
.d5 { animation-delay: 0.38s; }
@keyframes rise {
    from { opacity: 0; transform: translate3d(0, 18px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .fx-grain { display: none; }
}

/* ====================================================================
   TOP NAVIGATION — Resident Advisor register, brutalist
   Row 1: identity + save-the-date.  Row 2 (mobile) / inline (desktop):
   the tab register.  flex-wrap + order does the whole responsive job,
   so there is no JS-driven breakpoint logic to desynchronise.
   ==================================================================== */
.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 5, 5, 0.82);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
    backdrop-filter: saturate(120%) blur(10px);
}

/* The seam that separates the collective from the campaign. */
.nav::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: -1px;
    width: 42%;
    height: 1px;
    background: var(--ao-red);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.7);
}

.nav-seam {
    width: 1px;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, rgba(239, 68, 68, 0.75), transparent);
}

/* --- Tab register --- */
.tabs {
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-x: contain;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 0.85rem 0.9rem;
    color: #a1a1aa;
    text-decoration: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color 0.18s ease, background-color 0.18s ease;
}
.tab:hover { color: #ffffff; background: rgba(255, 255, 255, 0.04); }

/* Underline drawn from the left on hover / active — no layout shift. */
.tab::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--ao-red);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.22s cubic-bezier(0.6, 0, 0.1, 1);
}
.tab:hover::after { transform: scaleX(1); }

.tab.is-active { color: #ffffff; }
.tab.is-active::after { transform: scaleX(1); }

@media (min-width: 768px) {
    .tab { padding: 1.1rem 1.15rem; }
}

/* ====================================================================
   NEXT DATES — terminal-style register
   One grid definition, two shapes: stacked rows on handsets, a strict
   five-column ledger from md up.
   ==================================================================== */
.date-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem 1.25rem;
    padding: 1rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

@media (min-width: 768px) {
    .date-row {
        grid-template-columns: 3.5rem 10.5rem minmax(0, 1fr) minmax(0, 1.15fr) 7rem;
        align-items: center;
        padding: 1.15rem 1.35rem;
    }
}

.date-row--active { border-color: rgba(239, 68, 68, 0.45); }
.date-row--active:hover {
    border-color: var(--ao-red);
    background: rgba(239, 68, 68, 0.06);
}

.date-row--tba { border-style: dashed; border-color: rgba(255, 255, 255, 0.1); }

/* Mobile-only field captions; the md ledger has real column headers. */
.date-cap {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.5rem;
    letter-spacing: 0.24em;
    color: #52525b;
}
@media (min-width: 768px) {
    .date-cap { display: none; }
}

.date-status {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}
.date-dot {
    width: 6px;
    height: 6px;
    flex: none;
    background: currentColor;
}
.date-row--active .date-dot { animation: date-blink 2s steps(1, end) infinite; }
@keyframes date-blink { 0%, 62% { opacity: 1; } 63%, 100% { opacity: 0.2; } }

/* ====================================================================
   MAP LINK — must not disturb the technical typography metrics
   ==================================================================== */
.map-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.18s ease, border-color 0.18s ease;
}
.map-link:hover,
.map-link:focus-visible {
    color: var(--ao-red);
    border-bottom-color: var(--ao-red);
}
.map-link .map-pin {
    display: inline-block;
    margin-left: 0.45em;
    color: var(--ao-red);
    transform: translateY(0.05em);
}


/* ====================================================================
   HERO / SECTION GEOMETRY
   The register is sticky and therefore occupies flow space, so the hero
   subtracts its measured height instead of guessing at a fixed offset.
   ==================================================================== */
.hero {
    min-height: calc(100vh - var(--nav-h));
    min-height: calc(100dvh - var(--nav-h));
}

/* Anchor targets must clear the sticky register. */
section[id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
}
