/* ==========================================================================
   MK3.Org — stylesheet
   Black background, white/grey body text, red display headings.
   Orbitron for headings, Inter for body, JetBrains Mono for
   coordinates and technical labels.
   ========================================================================== */

:root {
    /* -- Color tokens -- */
    --black:      #060606;
    --panel:      #101012;
    --panel-light:#17171A;
    --border:     rgba(255, 255, 255, 0.09);
    --border-red: rgba(233, 32, 79, 0.35);

    --white:    #F2F2F0;
    --grey:     #A6A6AC;
    --grey-dim: #6C6C74;

    --red:       #e9204f;
    --red-light: #f16e8d;
    --red-bright:#FF4438;
    --red-deep:  #7A120C;

    --green:        #22C55E;
    --green-bright: #4ADE80;

    /* -- Type -- */
    --font-display: 'Orbitron', 'Arial Narrow', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* -- Layout -- */
    --max-width: 1120px;
    --radius: 10px;
    --radius-sm: 6px;
}

/* -------------------------------------------------------------------- */
/* Reset                                                                 */
/* -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--black);
    color: var(--grey);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.6em;
    color: var(--red);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--grey); }
strong, b { color: var(--white); }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.15em 0.45em;
    border-radius: 4px;
}

.skip-link a {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--red);
    color: var(--black);
    padding: 0.6em 1em;
    z-index: 200;
    border-radius: 0 0 var(--radius-sm) 0;
    font-family: var(--font-mono);
}
.skip-link a:focus { left: 0; }

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

/* -------------------------------------------------------------------- */
/* Fixed background image (galaxy) + ambient particle network canvas    */
/* -------------------------------------------------------------------- */
.bg-image {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('../img/bg-galaxy.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.45;
}
#bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
}
/* Foreground effects canvas (copy-success sparks, etc.) — layered above
   every other page element, including the header, so a flourish is never
   hidden behind the opaque element that triggered it. */
#fx-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 300;
    pointer-events: none;
}

/* -------------------------------------------------------------------- */
/* Header / nav                                                         */
/* -------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(6, 6, 6, 0.85);
    backdrop-filter: blur(10px);
}
.header-inner {
    /* Wider than the shared content max-width — the header now carries
       a full 9-item nav plus a clock and the music player, so it needs
       more room than a page section does to lay everything out on one
       line without crowding the logo. */
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.header-rule {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--red) 50%, transparent);
    opacity: 0.6;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    color: var(--white);
}
.brand-logo {
    display: block;
    height: 26px;
    width: auto;
    flex-shrink: 0;
}
.primary-nav {
    flex-shrink: 0;
}
.primary-nav ul {
    display: flex;
    gap: 2rem;
}
.primary-nav a {
    position: relative;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey);
    padding: 0.4em 0;
    transition: color 0.2s ease;
}
.primary-nav a:hover { color: var(--white); }
.primary-nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 100%;
    bottom: -2px;
    height: 2px;
    background: var(--red);
    transition: right 0.25s ease;
}
.primary-nav a:hover::after,
.primary-nav a.is-active::after { right: 0; }
.primary-nav a.is-active { color: var(--red-bright); }

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: var(--white);
    transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hud-clock {
    display: flex;
    align-items: baseline;
    gap: 0.5em;
    flex-shrink: 0;
    font-family: var(--font-mono);
    white-space: nowrap;
    border: 1px solid var(--border-red);
    border-radius: var(--radius-sm);
    padding: 0.45em 0.85em;
    background: rgba(233, 32, 79, 0.06);
}
.hud-clock-time {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
    color: var(--red-bright);
}
.hud-clock-zone {
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-dim);
}

/* -------------------------------------------------------------------- */
/* Header music player ("Grid Radio") — plays a random track from the   */
/* mp3/ folder. Themed to match the HUD clock beside it.                */
/* -------------------------------------------------------------------- */
/* Hidden on the Firestorm splash page only (welcome/index.php) — see   */
/* the page- body class header.php sets from $GLOBALS['current_page'].  */
/* Everywhere else the player still shows normally.                     */
.page-welcome-index .mp3-player {
    display: none;
}

.mp3-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    border: 1px solid var(--border-red);
    border-radius: var(--radius-sm);
    padding: 0.4em 0.65em;
    background: rgba(233, 32, 79, 0.06);
}

.mp3-play-btn,
.mp3-next-btn,
.mp3-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border-red);
    background: var(--panel);
    color: var(--red-light);
    font-size: 0.62rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.mp3-play-btn:hover,
.mp3-next-btn:hover,
.mp3-menu-btn:hover { color: var(--red-bright); border-color: var(--red-bright); }
.mp3-play-btn:active,
.mp3-next-btn:active,
.mp3-menu-btn:active { transform: scale(0.9); }
.mp3-menu-btn[aria-expanded="true"] { color: var(--red-bright); border-color: var(--red-bright); }

.mp3-icon-play { display: inline; }
.mp3-icon-pause { display: none; letter-spacing: -1px; }
.mp3-player.is-playing .mp3-icon-play { display: none; }
.mp3-player.is-playing .mp3-icon-pause { display: inline; }

.mp3-player.is-playing .mp3-play-btn {
    color: var(--red-bright);
    border-color: var(--red-bright);
    animation: mp3-pulse 1.8s ease-out infinite;
}
@keyframes mp3-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(233, 32, 79, 0.45); }
    70%  { box-shadow: 0 0 0 9px rgba(233, 32, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(233, 32, 79, 0); }
}

.mp3-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
    flex-shrink: 0;
}
.mp3-visualizer span {
    width: 3px;
    height: 4px;
    border-radius: 1px;
    background: var(--red-light);
    transition: background 0.2s ease;
}
.mp3-player.is-playing .mp3-visualizer span {
    background: var(--red-bright);
    animation: mp3-eq 0.9s ease-in-out infinite;
}
.mp3-visualizer span:nth-child(1) { animation-delay: 0s; }
.mp3-visualizer span:nth-child(2) { animation-delay: 0.2s; }
.mp3-visualizer span:nth-child(3) { animation-delay: 0.4s; }
.mp3-visualizer span:nth-child(4) { animation-delay: 0.1s; }
.mp3-visualizer span:nth-child(5) { animation-delay: 0.3s; }
@keyframes mp3-eq {
    0%, 100% { height: 4px; }
    50% { height: 16px; }
}

.mp3-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 128px;
}
.mp3-label {
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-dim);
}
.mp3-track-name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}
.mp3-player.is-playing .mp3-track-name { color: var(--white); }

.mp3-menu-wrap {
    position: relative;
    flex-shrink: 0;
}
.mp3-menu {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    width: max-content;
    min-width: 190px;
    max-width: 260px;
    max-height: 300px;
    overflow-y: auto;
    margin: 0;
    padding: 0.4rem;
    list-style: none;
    background: var(--black);
    border: 1px solid var(--border-red);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    z-index: 10;
}
.mp3-menu[hidden] { display: none; }
.mp3-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5em;
    width: 100%;
    padding: 0.55em 0.7em;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.mp3-menu-item:hover,
.mp3-menu-item:focus-visible { background: rgba(233, 32, 79, 0.12); color: var(--white); }
.mp3-menu-item.is-current {
    color: var(--red-bright);
    background: rgba(233, 32, 79, 0.08);
}
.mp3-menu-item.is-current::before {
    content: '\25B6';
    font-size: 0.55em;
    flex-shrink: 0;
}
.mp3-menu-empty {
    padding: 0.6em 0.7em;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: var(--grey-dim);
}

/* -------------------------------------------------------------------- */
/* Buttons / links                                                      */
/* -------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    padding: 0.8em 1.6em;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.btn-primary {
    background: var(--red-light);
    color: var(--black);
    font-weight: 600;
}
.btn-primary:hover {
    background: var(--red);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233, 32, 79, 0.3);
}
.btn-ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--grey);
}
.btn-ghost:hover {
    color: var(--white);
    border-color: var(--grey);
}

.text-link {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--red);
    letter-spacing: 0.02em;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease, color 0.2s ease;
}
.text-link:hover { border-color: var(--red-bright); color: var(--red-bright); }

/* -------------------------------------------------------------------- */
/* Shared section scaffolding                                           */
/* -------------------------------------------------------------------- */
.section { position: relative; padding: 5rem 1.5rem; z-index: 1; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.two-col {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
    align-items: start;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--grey-dim);
    margin: 0 0 0.9em;
}

.status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--green-bright);
    box-shadow: 0 0 8px 2px rgba(74, 222, 128, 0.6);
    animation: blink 2.4s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.page-hero {
    max-width: 760px;
    margin: 0 auto;
    padding: 4rem 1.5rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
}
.page-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.page-hero-sub { color: var(--grey-dim); font-size: 1rem; }
.page-hero .eyebrow { justify-content: center; }

.cta-section { text-align: center; }
.cta-inner p { color: var(--grey-dim); }
.cta-inner h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }

/* -------------------------------------------------------------------- */
/* Hero                                                                  */
/* -------------------------------------------------------------------- */
.hero {
    position: relative;
    padding: 6rem 1.5rem 0;
    text-align: center;
    z-index: 1;
}
.hero-content { max-width: 680px; margin: 0 auto; }
.hero-content .eyebrow { justify-content: center; }
.hero-title {
    font-size: clamp(2.8rem, 9vw, 5rem);
    letter-spacing: 0.03em;
    color: var(--white);
}
.hero-title .dim { color: var(--red); }
.hero-sub {
    color: var(--grey);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.6rem;
    flex-wrap: wrap;
}

.grid-info-strip {
    max-width: var(--max-width);
    margin: 3.5rem auto 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.grid-info-strip > div {
    padding: 1.4rem 1rem;
    text-align: left;
    border-left: 1px solid var(--border);
}
.grid-info-strip > div:first-child { border-left: none; }
.grid-info-strip dt {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-dim);
    margin-bottom: 0.5em;
}
.grid-info-strip dd { margin: 0; }
.grid-info-strip code {
    background: none;
    padding: 0;
    font-size: 0.88rem;
    color: var(--white);
}

/* -------------------------------------------------------------------- */
/* Highlight list (home)                                                */
/* -------------------------------------------------------------------- */
.highlight-list { display: flex; flex-direction: column; gap: 1.6rem; }
.highlight-list li { display: flex; gap: 1rem; align-items: flex-start; }
.highlight-mark {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--red);
    border: 1px solid var(--border-red);
    border-radius: 4px;
    padding: 0.3em 0.5em;
    flex-shrink: 0;
}
.highlight-list h3 { margin-bottom: 0.3em; }
.highlight-list p { font-size: 0.92rem; margin-bottom: 0; }

/* -------------------------------------------------------------------- */
/* Teaser grid (home)                                                    */
/* -------------------------------------------------------------------- */
.teaser-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.teaser-head h2 { margin: 0; }
.teaser-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}
.teaser-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.teaser-card:hover { border-color: var(--border-red); transform: translateY(-3px); }
.teaser-thumb {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background:
        repeating-linear-gradient(45deg, rgba(233,32,79,0.08) 0 2px, transparent 2px 14px),
        var(--panel);
    position: relative;
}
.teaser-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.teaser-card:hover .teaser-thumb img { transform: scale(1.04); }
.teaser-thumb-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-dim);
}
.teaser-thumb.no-photo .teaser-thumb-fallback { display: flex; }
.teaser-card h3 { margin: 1rem 1rem 0.2rem; font-size: 0.95rem; }
.mono-tag {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--grey-dim);
    margin: 0 1rem 1rem;
}
.teaser-card .mono-tag { margin-bottom: 1rem; }

/* -------------------------------------------------------------------- */
/* Stat card (about)                                                     */
/* -------------------------------------------------------------------- */
.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
}
.stat-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0;
    border-bottom: 1px dashed var(--border);
}
.stat-list > div:last-child { border-bottom: none; }
.stat-list dt { font-size: 0.85rem; color: var(--grey-dim); }
.stat-list dd { margin: 0; text-align: right; }
.stat-list code { background: none; padding: 0; }

/* -------------------------------------------------------------------- */
/* Connect steps (about)                                                 */
/* -------------------------------------------------------------------- */
.connect-section h2 { max-width: 560px; }
.connect-steps {
    max-width: 720px;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
}
.connect-steps li {
    display: flex;
    gap: 1.4rem;
    padding: 1.6rem 0;
    border-top: 1px solid var(--border);
}
.connect-steps li:last-child { border-bottom: 1px solid var(--border); }
.step-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--red);
    flex-shrink: 0;
    padding-top: 0.15em;
}
.connect-steps h3 { margin-bottom: 0.35em; }
.connect-steps p { font-size: 0.94rem; margin-bottom: 0; }

/* -------------------------------------------------------------------- */
/* Region list (regions.php)                                             */
/* -------------------------------------------------------------------- */
.region-list { display: flex; flex-direction: column; gap: 3.5rem; }
.region-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.region-entry.is-reversed .region-photo { order: 2; }
.region-entry.is-reversed .region-copy { order: 1; }

.region-photo {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel);
}
.region-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.region-entry:hover .region-photo img { transform: scale(1.04); }
.region-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.region-photo.no-photo .region-photo-fallback { display: flex; }

.region-copy h2 { font-size: 1.4rem; }
.region-copy .mono-tag { margin: 0 0 0.7em; }
.region-copy p:not(.mono-tag) { font-size: 0.96rem; }

/* SLURL copy box */
.slurl-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.75rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--grey);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.slurl-box:hover,
.slurl-box:focus-visible {
    border-color: var(--border-red);
    background: var(--panel-light);
}
.slurl-icon {
    flex-shrink: 0;
    color: var(--grey-dim);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.slurl-box:hover .slurl-icon { color: var(--red); }
.slurl-text {
    flex: 1;
    min-width: 0;
    background: none;
    padding: 0;
    font-size: 0.78rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.slurl-action {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid var(--border-red);
    border-radius: 4px;
    padding: 0.25em 0.55em;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.slurl-box.is-copied {
    border-color: var(--red);
}
.slurl-box.is-copied .slurl-action {
    background: var(--red);
    color: var(--black);
    border-color: var(--red);
}

/* -------------------------------------------------------------------- */
/* Member tiles (members.php)                                            */
/* -------------------------------------------------------------------- */
.member-tiles {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}
.member-tile {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.member-tile:hover,
.member-tile:focus-visible {
    border-color: var(--border-red);
    transform: translateY(-3px);
}
.member-tile-photo {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--panel-light);
}
.member-tile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.member-tile:hover .member-tile-photo img { transform: scale(1.04); }
.member-tile-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.member-tile-photo.no-photo .member-tile-fallback { display: flex; }
.member-tile-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.2rem;
    text-align: center;
}
.member-tile-title {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--white);
}
.member-tile-sub {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--grey-dim);
    margin-top: 0.3em;
}
.member-tile-arrow {
    flex-shrink: 0;
    color: var(--red);
    font-size: 1.1rem;
    transition: transform 0.2s ease, color 0.2s ease;
}
.member-tile:hover .member-tile-arrow,
.member-tile:focus-visible .member-tile-arrow {
    color: var(--red-bright);
    transform: translateX(4px);
}

/* -------------------------------------------------------------------- */
/* Event list (events.php)                                               */
/* -------------------------------------------------------------------- */
.event-list { display: flex; flex-direction: column; }
.event-entry {
    display: flex;
    gap: 1.8rem;
    padding: 1.8rem 0;
    border-top: 1px solid var(--border);
    align-items: flex-start;
}
.event-entry:last-child { border-bottom: 1px solid var(--border); }

.event-date {
    flex-shrink: 0;
    width: 68px;
    text-align: center;
    border: 1px solid var(--border-red);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0;
    background: var(--panel);
}
.event-day {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--white);
    line-height: 1;
}
.event-month {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-top: 0.3em;
}
.event-photo {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel);
}
.event-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.event-entry:hover .event-photo img { transform: scale(1.04); }
.event-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.event-photo.no-photo .event-photo-fallback { display: flex; }

.event-body {
    /* min-width: 0 overrides the flex item default of "auto", which
       otherwise refuses to shrink narrower than its widest unbreakable
       child — the .slurl-box's nowrap URL text — and pushes the whole
       row wider than the viewport on narrow screens instead of letting
       the URL ellipsis-truncate the way it's meant to. */
    flex: 1;
    min-width: 0;
}
.event-body h2 { font-size: 1.15rem; margin-bottom: 0.3em; }
.event-body .mono-tag { margin: 0 0 0.6em; }
.event-body p:not(.mono-tag) { font-size: 0.94rem; margin-bottom: 0; }

.event-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1rem;
}
.event-countdown {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5em;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--border-red);
    border-radius: 999px;
    background: var(--panel-light);
}
.event-countdown-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--grey-dim);
}
.event-countdown-value {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--red-light);
}
.event-local-time {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--grey-dim);
}
.event-local-time::before {
    content: '\1F310';
    margin-right: 0.4em;
}

/* -------------------------------------------------------------------- */
/* Splash page (welcome/index.php) — a large centered logo and, below   */
/* it, a strip of upcoming events with pictures. Meant to be shown as   */
/* the Firestorm viewer's login splash page. Reuses .event-countdown   */
/* and .event-local-time from the Events page above.                    */
/* -------------------------------------------------------------------- */
.splash-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 90px);
}
.splash-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: 3rem 1.5rem;
    text-align: center;
}
.splash-logo {
    width: 100%;
    max-width: min(560px, 60vw);
    height: auto;
    display: block;
    filter: drop-shadow(0 0 40px rgba(233, 32, 79, 0.25));
}
.splash-welcome {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    letter-spacing: 0.03em;
    color: var(--white);
    text-transform: uppercase;
}

.splash-events {
    padding: 0 1.5rem 3rem;
    margin-top: -25px;
    text-align: center;
}
.splash-events-title {
    /* h1-h4's shared rule already gives this the display font, bold
       weight, uppercase, red color, and letter-spacing — just sizes
       and centers it here. */
    font-size: clamp(1.4rem, 3.2vw, 1.9rem);
    text-align: center;
    margin: 0 0 1.4rem;
}

.welcome-event-strip {
    display: flex;
    /* Never wraps to a second row — JS (initWelcomeStrip in effects.js)
       measures how many cards actually fit and hides the rest via the
       native "hidden" attribute, keeping the soonest events (the strip
       is already sorted nearest-first) and clipping only the extras.
       overflow stays hidden as a fallback for the brief pre-JS moment
       and for no-JS visitors. justify-content defaults to flex-start
       so a no-JS/pre-JS view never centers a partially cut-off row;
       initWelcomeStrip() switches it to center once trimming is done. */
    flex-wrap: nowrap;
    overflow: hidden;
    justify-content: flex-start;
    gap: 1.3rem;
    max-width: var(--max-width);
    margin: 0 auto;
}
.welcome-event-card {
    display: block;
    width: 252px;
    flex-shrink: 0;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
/* The card's own "display: block" above has the same specificity tier
   as the browser's built-in "[hidden] { display: none }" rule, and
   author styles always win that tie regardless of source order — so
   without this more-specific override, a card the JS marks "hidden"
   (initWelcomeStrip in effects.js) would keep rendering and taking up
   space in the row instead of actually disappearing. */
.welcome-event-card[hidden] {
    display: none;
}
.welcome-event-card:hover,
.welcome-event-card:focus-visible {
    border-color: var(--border-red);
    transform: translateY(-3px);
}
.welcome-event-date {
    margin: 0;
    padding: 0.7rem 0.5rem 0.5rem;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    color: var(--white);
    white-space: nowrap;
}
.welcome-event-photo {
    /* Square — height matches the card's fixed width (252px, 210px on
       mobile) since aspect-ratio scales off the container's own width. */
    aspect-ratio: 1 / 1;
    background: var(--panel-light);
    overflow: hidden;
}
.welcome-event-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.welcome-event-card:hover .welcome-event-photo img { transform: scale(1.05); }
.welcome-event-info { padding: 0.85rem 0.9rem 1rem; }
.welcome-event-info h3 {
    font-size: 0.85rem;
    margin-bottom: 0.35em;
    line-height: 1.25;
}
.welcome-event-info .mono-tag { font-size: 0.62rem; margin: 0 0 0.6em; }
.welcome-event-info .event-countdown { padding: 0.3rem 0.6rem; }
.welcome-event-info .event-countdown-value { font-size: 0.68rem; }
.welcome-event-info .event-local-time {
    display: block;
    margin-top: 0.5em;
    font-size: 0.64rem;
}

@media (max-width: 720px) {
    .splash-logo { max-width: 80vw; }
    .welcome-event-card { width: 210px; }
    .welcome-event-date { font-size: 0.85rem; padding: 0.6rem 0.3rem 0.4rem; }
}

/* -------------------------------------------------------------------- */
/* Staff list (staff.php) — same layout as .region-list, square photos   */
/* -------------------------------------------------------------------- */
.staff-list { display: flex; flex-direction: column; gap: 3.5rem; }
.staff-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.staff-entry.is-reversed .staff-photo { order: 2; }
.staff-entry.is-reversed .staff-copy { order: 1; }

.staff-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel);
}
.staff-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.staff-entry:hover .staff-photo img { transform: scale(1.04); }
.staff-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.staff-photo.no-photo .staff-photo-fallback { display: flex; }

.staff-copy h2 { font-size: 1.4rem; }
.staff-copy .mono-tag { margin: 0 0 0.7em; }
.staff-copy p:not(.mono-tag) { font-size: 0.96rem; }

/* UUID copy box — same click-to-copy behavior as .slurl-box */
.uuid-box {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    margin-top: 0.4rem;
    padding: 0.75rem 0.9rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--grey);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.uuid-box:hover,
.uuid-box:focus-visible {
    border-color: var(--border-red);
    background: var(--panel-light);
}
.uuid-icon {
    flex-shrink: 0;
    color: var(--grey-dim);
    font-size: 0.95rem;
    transition: color 0.2s ease;
}
.uuid-box:hover .uuid-icon { color: var(--red); }
.uuid-text {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.uuid-action {
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--red);
    border: 1px solid var(--border-red);
    border-radius: 4px;
    padding: 0.25em 0.55em;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.uuid-box.is-copied { border-color: var(--red); }
.uuid-box.is-copied .uuid-action {
    background: var(--red);
    color: var(--black);
    border-color: var(--red);
}

/* -------------------------------------------------------------------- */
/* Script list (scripts.php) — same layout as .region-list               */
/* -------------------------------------------------------------------- */
.script-list { display: flex; flex-direction: column; gap: 3.5rem; }
.script-entry {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}
.script-entry.is-reversed .script-photo { order: 2; }
.script-entry.is-reversed .script-copy { order: 1; }

.script-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel);
}
.script-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.script-entry:hover .script-photo img { transform: scale(1.04); }
.script-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.script-photo.no-photo .script-photo-fallback { display: flex; }

.script-copy h2 { font-size: 1.4rem; }
.script-copy .mono-tag { margin: 0 0 0.7em; }
.script-copy p:not(.mono-tag) { font-size: 0.96rem; }

/* -------------------------------------------------------------------- */
/* NPC feature list (npcs.php)                                           */
/* -------------------------------------------------------------------- */
.npc-features {
    max-width: 780px;
    margin-top: 2.5rem;
    display: flex;
    flex-direction: column;
}
.npc-feature {
    display: flex;
    gap: 1.6rem;
    padding: 2.2rem 0;
    border-top: 1px solid var(--border);
    align-items: flex-start;
}
.npc-feature:last-child { border-bottom: 1px solid var(--border); }
.npc-feature-num {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--red);
    flex-shrink: 0;
    padding-top: 0.15em;
}
.npc-feature-body { flex: 1; min-width: 0; }
.npc-feature-body h3 { margin-bottom: 0.7em; }
.npc-feature-photo {
    position: relative;
    aspect-ratio: 21 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 1rem;
}
.npc-feature-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.npc-feature-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.npc-feature-photo.no-photo .npc-feature-photo-fallback { display: flex; }
.npc-feature-body p { font-size: 0.96rem; margin-bottom: 0; }

/* -------------------------------------------------------------------- */
/* DJ roster (djs.php)                                                   */
/* -------------------------------------------------------------------- */
.dj-grid {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.6rem;
}
.dj-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.dj-card:hover { border-color: var(--border-red); transform: translateY(-3px); }
.dj-photo {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--panel-light);
}
.dj-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.dj-card:hover .dj-photo img { transform: scale(1.04); }
.dj-photo-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--grey-dim);
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
        var(--panel-light);
}
.dj-photo.no-photo .dj-photo-fallback { display: flex; }
.dj-body { padding: 1.1rem 1.2rem 1.3rem; }
.dj-body h3 { font-size: 1.05rem; margin-bottom: 0.2em; }
.dj-body p { font-size: 0.88rem; color: var(--grey-dim); margin-bottom: 0; }

/* Gear showcase panel (djs.php) */
.gear-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.gear-showcase img {
    width: 100%;
    max-width: 480px;
    height: auto;
    display: block;
}

/* -------------------------------------------------------------------- */
/* Help topics + FAQ (help.php)                                          */
/* -------------------------------------------------------------------- */
.help-topics {
    margin-top: 2.5rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.4rem;
}
.help-topic-card {
    display: block;
    padding: 1.6rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.help-topic-card:hover,
.help-topic-card:focus-visible {
    border-color: var(--border-red);
    transform: translateY(-3px);
}
.help-topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: rgba(233, 32, 79, 0.12);
    color: var(--red-light);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}
.help-topic-card h3 { font-size: 1.02rem; margin-bottom: 0.4em; }
.help-topic-card p { font-size: 0.88rem; color: var(--grey-dim); margin-bottom: 0; }

.help-faq-group { max-width: 780px; }
.help-faq-group + .help-faq-group { margin-top: 3.5rem; }
.help-faq-list { margin-top: 1.5rem; }
.help-faq-item {
    border-top: 1px solid var(--border);
    padding: 1.1rem 0;
}
.help-faq-list .help-faq-item:last-child { border-bottom: 1px solid var(--border); }
.help-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 600;
    font-size: 0.98rem;
}
.help-faq-item summary::-webkit-details-marker { display: none; }
.help-faq-item summary::after {
    content: '+';
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--red);
    transition: transform 0.2s ease;
}
.help-faq-item[open] summary::after { content: '\2212'; }
.help-faq-item p {
    margin: 0.9rem 0 0;
    font-size: 0.92rem;
    color: var(--grey-dim);
}
.help-faq-item p .text-link { font-size: inherit; }

/* -------------------------------------------------------------------- */
/* Footer                                                                */
/* -------------------------------------------------------------------- */
.footer-rule {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-red) 50%, transparent);
    margin-top: 3rem;
}
.site-footer {
    background: var(--panel);
    margin-top: 4rem;
    position: relative;
    z-index: 1;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2.5rem;
}
.footer-brand,
.footer-grid-info { align-self: start; }
.footer-logo {
    display: block;
    height: 32px;
    width: auto;
}
.footer-brand p { color: var(--grey-dim); font-size: 0.88rem; margin-top: 0.9em; }
.footer-heading {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-dim);
    margin-bottom: 0.9em;
}
.footer-nav {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}
.footer-nav a {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    color: var(--grey);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.45em 0.9em;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.footer-nav a:hover {
    color: var(--red-bright);
    border-color: var(--border-red);
    background: rgba(233, 32, 79, 0.08);
}
.grid-info-list { display: flex; flex-direction: column; gap: 0.55rem; }
.grid-info-list li { display: flex; flex-direction: column; gap: 0.15rem; }
.grid-info-list span {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--grey-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.grid-info-list code { background: none; padding: 0; font-size: 0.82rem; }
.footer-meta {
    border-top: 1px solid var(--border);
    padding: 1.2rem 1.5rem;
    text-align: center;
}
.footer-meta p {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--grey-dim);
    margin: 0;
}

/* -------------------------------------------------------------------- */
/* Back-to-top button — fixed bottom-right on every page, fades in once  */
/* the visitor has scrolled a bit. Lives outside <main>, so same-site    */
/* page navigation never tears it down.                                  */
/* -------------------------------------------------------------------- */
.back-to-top {
    position: fixed;
    right: 1.6rem;
    bottom: 1.6rem;
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--border-red);
    background: var(--panel);
    color: var(--red-light);
    font-family: var(--font-mono);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease,
                color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover,
.back-to-top:focus-visible {
    color: var(--red-bright);
    border-color: var(--red-bright);
    box-shadow: 0 10px 28px rgba(233, 32, 79, 0.35);
}
.back-to-top:active { transform: scale(0.9); }

@media (max-width: 720px) {
    .back-to-top { right: 1.1rem; bottom: 1.1rem; width: 42px; height: 42px; }
}

/* -------------------------------------------------------------------- */
/* Scroll reveal                                                        */
/* -------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------------------- */
/* Responsive                                                            */
/* -------------------------------------------------------------------- */
@media (max-width: 900px) {
    .two-col { grid-template-columns: 1fr; }
    .teaser-grid { grid-template-columns: 1fr 1fr; }
    .grid-info-strip { grid-template-columns: 1fr 1fr; }
    .grid-info-strip > div:nth-child(3) { border-left: none; }
    .region-entry,
    .region-entry.is-reversed { grid-template-columns: 1fr; }
    .region-entry.is-reversed .region-photo,
    .region-entry.is-reversed .region-copy { order: initial; }
    .staff-entry,
    .staff-entry.is-reversed { grid-template-columns: 1fr; }
    .staff-entry.is-reversed .staff-photo,
    .staff-entry.is-reversed .staff-copy { order: initial; }
    .staff-photo { max-width: 420px; margin: 0 auto; }
    .script-entry,
    .script-entry.is-reversed { grid-template-columns: 1fr; }
    .script-entry.is-reversed .script-photo,
    .script-entry.is-reversed .script-copy { order: initial; }
    .dj-grid { grid-template-columns: 1fr 1fr; }
    .footer-inner { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* Header/nav breakpoints are wider than the general content breakpoints
   below — a 9-item nav plus the clock and music player need more room
   than that to sit on one line, so the header switches to its compact
   hamburger layout well before the page content below it needs to. */
@media (max-width: 1500px) {
    .mp3-info { display: none; }
}

@media (max-width: 1240px) {
    .primary-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--black);
        border-bottom: 1px solid var(--border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    .primary-nav.is-open { max-height: 320px; }
    .primary-nav ul { flex-direction: column; gap: 0; padding: 0.5rem 1.5rem 1.5rem; }
    .primary-nav a { display: block; padding: 0.8em 0; }
    .brand-logo { height: 20px; }
    .nav-toggle { display: flex; }
    .hud-clock { display: none; }
    .mp3-player { padding: 0.3em 0.5em; gap: 0.4rem; }
    .mp3-visualizer { display: none; }
}

@media (max-width: 720px) {
    .teaser-grid { grid-template-columns: 1fr; }
    .member-tiles { grid-template-columns: 1fr; }
    .dj-grid { grid-template-columns: 1fr; }
    .help-topics { grid-template-columns: 1fr; }
    .gear-showcase { padding: 1.5rem; }
    .npc-feature { flex-direction: column; gap: 0.8rem; padding: 1.8rem 0; }
    .grid-info-strip { grid-template-columns: 1fr 1fr; }
    .event-entry { gap: 1rem; }
    .event-date { width: 56px; }
    .event-photo { width: 56px; }
}

/* -------------------------------------------------------------------- */
/* Reduced motion                                                        */
/* -------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .mp3-player.is-playing .mp3-play-btn { animation: none; }
    .mp3-player.is-playing .mp3-visualizer span { animation: none; height: 10px; }
}

/* -------------------------------------------------------------------- */
/* View transitions — native cross-document fade between pages on       */
/* browsers that support it. No-op elsewhere; nothing to fall back to.  */
/* -------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
    @view-transition {
        navigation: auto;
    }
}

/* -------------------------------------------------------------------- */
/* Scroll-linked parallax on the galaxy background                      */
/* .bg-image is position:fixed, so it never actually scrolls — this     */
/* just drifts where the (cover-sized) image is centered as the page    */
/* scrolls, which reads as parallax without ever exposing an edge.      */
/* -------------------------------------------------------------------- */
@keyframes bg-parallax-drift {
    from { background-position: 50% 38%; }
    to   { background-position: 50% 62%; }
}
@media (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: scroll(root)) {
        .bg-image {
            animation: bg-parallax-drift linear both;
            animation-timeline: scroll(root);
            animation-range: 0% 100%;
        }
    }
}
