/* ============================================
   XIAORAN — Independent Game Studio
   Dark, restrained, tech aesthetic
   ============================================ */

/* ---------- Tokens ---------- */
:root {
    --bg: #050507;
    --bg-elev: #0a0a0e;
    --bg-card: #0c0c12;
    --surface: #111119;
    --border: #1c1c26;
    --border-bright: #2a2a3a;
    --text: #e8e8ee;
    --text-dim: #8a8a98;
    --text-mute: #565666;
    --accent: #00ffd1;
    --accent-dim: #00b896;
    --accent-2: #ff4d6d;
    --warn: #ffb347;
    --glow: 0 0 40px rgba(0, 255, 209, 0.15);
    --glow-strong: 0 0 60px rgba(0, 255, 209, 0.35);
    --radius: 2px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-sans: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    --maxw: 1440px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none;
}
@media (max-width: 900px) { body { cursor: auto; } }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: none; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

/* ---------- Background layers ---------- */
.bg-grid {
    position: fixed; inset: 0; z-index: -3;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 100%);
}
.bg-glow {
    position: fixed; inset: 0; z-index: -4;
    background:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 209, 0.08), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255, 77, 109, 0.06), transparent 45%);
    filter: blur(0px);
}
.bg-scanlines {
    position: fixed; inset: 0; z-index: -2; pointer-events: none;
    background: repeating-linear-gradient(
        0deg, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px,
        rgba(255,255,255,0.012) 2px, rgba(255,255,255,0.012) 3px
    );
    opacity: 0.5;
}
.bg-noise {
    position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.4;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0 0.9 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Custom cursor ---------- */
.cursor { position: fixed; inset: 0; pointer-events: none; z-index: 9999; display: none; }
@media (min-width: 901px) { .cursor { display: block; } }
.cursor__dot {
    position: absolute; width: 6px; height: 6px; background: var(--accent);
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: width 0.2s var(--ease), height 0.2s var(--ease), background 0.2s;
}
.cursor__ring {
    position: absolute; width: 32px; height: 32px;
    border: 1px solid rgba(0, 255, 209, 0.4); border-radius: 50%;
    transform: translate(-50%, -50%); transition: transform 0.15s var(--ease),
    width 0.25s var(--ease), height 0.25s var(--ease), border-color 0.2s;
}
.cursor.is-hover .cursor__dot { width: 0; height: 0; }
.cursor.is-hover .cursor__ring { width: 56px; height: 56px; border-color: var(--accent); }

/* ---------- Loader ---------- */
.loader {
    position: fixed; inset: 0; z-index: 10000; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.loader.is-hidden { opacity: 0; visibility: hidden; }
.loader__inner { width: min(280px, 60vw); }
.loader__bar { height: 1px; background: var(--border-bright); position: relative; overflow: hidden; }
.loader__bar span {
    position: absolute; inset: 0; background: var(--accent); transform-origin: left;
    animation: load 1.8s var(--ease) forwards; box-shadow: var(--glow);
}
@keyframes load { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.loader__text {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.4em;
    color: var(--text-dim); margin-top: 16px; text-align: center;
}

/* ---------- Navigation ---------- */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px clamp(20px, 5vw, 64px);
    transition: padding 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s;
    border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
    padding: 14px clamp(20px, 5vw, 64px);
    background: rgba(5, 5, 7, 0.7);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-bottom-color: var(--border);
}
.nav__brand { display: flex; align-items: center; gap: 12px; }
.nav__brand-mark {
    font-family: var(--font-mono); font-size: 11px; font-weight: 600;
    letter-spacing: 0.1em; color: #000; background: var(--accent);
    padding: 5px 7px; border-radius: var(--radius); line-height: 1;
}
.nav__brand-name { font-weight: 600; letter-spacing: 0.18em; font-size: 13px; }
.nav__menu { display: flex; gap: 32px; }
.nav__link {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em;
    color: var(--text-dim); display: flex; align-items: center; gap: 6px;
    transition: color 0.25s; position: relative;
}
.nav__link-idx { color: var(--text-mute); font-size: 10px; }
.nav__link:hover { color: var(--text); }
.nav__link::after {
    content: ''; position: absolute; bottom: -6px; left: 0; width: 0; height: 1px;
    background: var(--accent); transition: width 0.3s var(--ease);
}
.nav__link:hover::after { width: 100%; }
.nav__cta {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
    padding: 10px 16px; border: 1px solid var(--border-bright); border-radius: var(--radius);
    transition: all 0.3s var(--ease); color: var(--text);
}
.nav__cta:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.nav__cta svg { transition: transform 0.3s var(--ease); }
.nav__cta:hover svg { transform: translateX(3px); }
.nav__toggle {
    display: none; flex-direction: column; gap: 5px; padding: 8px; z-index: 101;
}
.nav__toggle span {
    width: 22px; height: 1.5px; background: var(--text); transition: all 0.3s var(--ease);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (max-width: 900px) {
    .nav__menu, .nav__cta { display: none; }
    .nav__toggle { display: flex; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
    position: fixed; inset: 0; z-index: 99; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.4s var(--ease), visibility 0.4s;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 8px; }
.mobile-menu__link {
    font-size: clamp(36px, 9vw, 64px); font-weight: 500; line-height: 1.1;
    color: var(--text-dim); transition: color 0.3s; display: flex; align-items: baseline; gap: 16px;
}
.mobile-menu__link span { font-family: var(--font-mono); font-size: 14px; color: var(--accent); }
.mobile-menu__link:hover { color: var(--text); }

/* ---------- Shared ---------- */
.section-head { margin-bottom: 64px; max-width: 720px; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head__idx {
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em;
    color: var(--accent); display: block; margin-bottom: 20px;
}
.section-head__title {
    font-size: clamp(36px, 6vw, 72px); font-weight: 500; line-height: 1.02;
    letter-spacing: -0.02em;
}
.section-head__desc { color: var(--text-dim); margin-top: 24px; font-size: 17px; max-width: 560px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.12em;
    padding: 16px 26px; border-radius: var(--radius); position: relative;
    transition: all 0.35s var(--ease); overflow: hidden; white-space: nowrap;
}
.btn__label { position: relative; z-index: 2; }
.btn__icon { position: relative; z-index: 2; display: flex; transition: transform 0.35s var(--ease); }
.btn:hover .btn__icon { transform: translateX(3px); }

.btn--primary {
    background: var(--accent); color: #000;
    box-shadow: 0 0 0 rgba(0,255,209,0); 
}
.btn--primary::before {
    content: ''; position: absolute; inset: 0; background: #fff;
    transform: translateY(101%); transition: transform 0.4s var(--ease); z-index: 1;
}
.btn--primary:hover::before { transform: translateY(0); }
.btn--primary:hover { box-shadow: var(--glow-strong); }

.btn--outline {
    border: 1px solid var(--border-bright); color: var(--text);
}
.btn--outline::before {
    content: ''; position: absolute; inset: 0; background: var(--accent);
    transform: translateY(101%); transition: transform 0.4s var(--ease); z-index: 1;
}
.btn--outline:hover { border-color: var(--accent); color: #000; }
.btn--outline:hover::before { transform: translateY(0); }

.btn--ghost { color: var(--text-dim); padding: 16px 6px; }
.btn--ghost::after {
    content: ''; position: absolute; left: 6px; right: 6px; bottom: 12px; height: 1px;
    background: var(--border-bright); transition: all 0.35s var(--ease);
}
.btn--ghost:hover { color: var(--text); }
.btn--ghost:hover::after { background: var(--accent); left: 0; right: 0; bottom: 8px; }

.btn--text { color: var(--text-dim); padding: 16px 6px; }
.btn--text:hover { color: var(--accent); }

.btn--block { width: 100%; padding: 18px; }

/* ---------- HERO ---------- */
.hero {
    min-height: 100vh; min-height: 100svh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 120px clamp(20px, 5vw, 64px) 80px; position: relative; text-align: center;
}
.hero__meta {
    display: flex; gap: 32px; margin-bottom: 56px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--text-mute);
}
.hero__meta-tag { position: relative; }
.hero__meta-tag:not(:last-child)::after {
    content: ''; position: absolute; right: -16px; top: 50%; width: 4px; height: 4px;
    background: var(--accent); border-radius: 50%; transform: translateY(-50%);
}
.hero__title {
    font-size: clamp(64px, 18vw, 220px); font-weight: 700; line-height: 0.88;
    letter-spacing: -0.04em; margin-bottom: 40px;
    display: flex; flex-direction: column; align-items: center;
}
.hero__title-line {
    position: relative; display: inline-block;
    background: linear-gradient(180deg, var(--text) 0%, var(--text) 50%, var(--text-mute) 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    opacity: 0; transform: translateY(40px);
    animation: rise 1s var(--ease) forwards;
}
.hero__title-line--accent {
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
    -webkit-background-clip: text; background-clip: text;
    animation-delay: 0.15s;
    filter: drop-shadow(0 0 30px rgba(0,255,209,0.25));
}
@keyframes rise { to { opacity: 1; transform: translateY(0); } }
.hero__sub {
    max-width: 540px; color: var(--text-dim); font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.7; margin-bottom: 48px;
    opacity: 0; animation: rise 0.9s var(--ease) 0.4s forwards;
}
.hero__actions {
    display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
    opacity: 0; animation: rise 0.9s var(--ease) 0.55s forwards;
}
.hero__scroll {
    position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.3em; color: var(--text-mute);
}
.hero__scroll-line {
    width: 1px; height: 40px; background: linear-gradient(180deg, var(--accent), transparent);
    animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine { 0%,100% { transform: scaleY(1); transform-origin: top; } 50% { transform: scaleY(0.4); } }
.hero__coords {
    position: absolute; bottom: 36px; left: clamp(20px, 5vw, 64px);
    display: flex; flex-direction: column; gap: 4px;
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.15em; color: var(--text-mute);
}
@media (max-width: 700px) {
    .hero__coords { display: none; }
    .hero__scroll { bottom: 20px; }
}

/* ---------- GAMES ---------- */
.games { padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 64px); }
.games__grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
    max-width: var(--maxw); margin: 0 auto;
}
@media (max-width: 800px) { .games__grid { grid-template-columns: 1fr; } }
.game-card {
    background: var(--bg-card); border: 1px solid var(--border); overflow: hidden;
    transition: border-color 0.4s, transform 0.5s var(--ease);
    opacity: 0; transform: translateY(30px);
}
.game-card.is-visible { opacity: 1; transform: translateY(0); }
.game-card:hover { border-color: var(--border-bright); }
.game-card__media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: linear-gradient(135deg, #0c0c12 0%, #16161f 50%, #0c0c12 100%); }
.game-card__media img {
    width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.3) brightness(0.7) contrast(1.05);
    transition: transform 0.7s var(--ease), filter 0.5s;
}
.game-card:hover .game-card__media img { transform: scale(1.05); filter: grayscale(0) brightness(0.85); }
/* Graceful fallback when a cover image fails to generate/load */
.game-card__media.is-failed img { display: none; }
.game-card__media.is-failed::before {
    content: 'PREVIEW UNAVAILABLE'; position: absolute; inset: 0; z-index: 1;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.3em; color: var(--text-mute);
    background:
        radial-gradient(circle at 30% 30%, rgba(0,255,209,0.08), transparent 60%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 10px, transparent 10px 20px);
}
.game-card__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(5,5,7,0.9) 100%),
                linear-gradient(125deg, rgba(0,255,209,0.1), transparent 50%);
    mix-blend-mode: normal;
}
.game-card__status {
    position: absolute; top: 16px; left: 16px; z-index: 2;
    font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.2em;
    padding: 6px 10px; background: rgba(5,5,7,0.7); backdrop-filter: blur(6px);
    border: 1px solid var(--border-bright); color: var(--accent);
}
.game-card__body { padding: 28px; }
.game-card__genre {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-mute);
}
.game-card__title {
    font-size: 28px; font-weight: 600; letter-spacing: -0.01em; margin: 10px 0 14px;
    transition: color 0.3s;
}
.game-card:hover .game-card__title { color: var(--accent); }
.game-card__text { color: var(--text-dim); font-size: 15px; margin-bottom: 24px; }
.game-card__link {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--text);
}
.game-card__link svg { transition: transform 0.3s var(--ease); }
.game-card__link:hover svg { transform: translateX(4px); }

/* ---------- STUDIO ---------- */
.studio { padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 64px); }
.studio__grid {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px, 8vw, 96px);
    align-items: start; max-width: var(--maxw); margin: 0 auto;
}
@media (max-width: 900px) { .studio__grid { grid-template-columns: 1fr; } }
.studio__lead {
    color: var(--text-dim); font-size: 19px; line-height: 1.6; margin: 24px 0 56px; max-width: 540px;
}
.studio__principles { display: flex; flex-direction: column; gap: 32px; }
.principle { padding-left: 20px; border-left: 1px solid var(--border-bright); }
.principle__num {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em; color: var(--accent);
}
.principle h4 { font-size: 20px; font-weight: 500; margin: 8px 0 6px; }
.principle p { color: var(--text-dim); font-size: 14px; }

.studio__terminal { position: relative; }
.studio__terminal::before {
    content: ''; position: absolute; inset: -1px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), transparent 60%);
    opacity: 0.3; z-index: -1;
}
.terminal {
    background: #07070b; border: 1px solid var(--border-bright);
    font-family: var(--font-mono); font-size: 13px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.terminal__bar {
    display: flex; align-items: center; gap: 7px; padding: 12px 16px;
    border-bottom: 1px solid var(--border); background: #0a0a10;
}
.terminal__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-bright); }
.terminal__dot:nth-child(1) { background: #ff5f57; }
.terminal__dot:nth-child(2) { background: #ffbd2e; }
.terminal__dot:nth-child(3) { background: #28ca42; }
.terminal__title { margin-left: 12px; font-size: 11px; color: var(--text-mute); letter-spacing: 0.05em; }
.terminal__body { padding: 24px; color: var(--text-dim); line-height: 1.9; }
.terminal__prompt { color: var(--accent); }
.terminal__line { padding-left: 16px; }
.terminal__key { color: var(--text-mute); }
.terminal__val { color: var(--accent); }
.terminal__caret {
    display: inline-block; width: 8px; height: 14px; background: var(--accent);
    vertical-align: text-bottom; animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- STATS ---------- */
.stats { padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 64px); text-align: center; }
.stats__grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--border); border: 1px solid var(--border);
    max-width: var(--maxw); margin: 64px auto 0;
}
@media (max-width: 700px) { .stats__grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
    background: var(--bg); padding: clamp(32px, 5vw, 56px) 20px;
    transition: background 0.4s; position: relative;
}
.stat:hover { background: var(--bg-elev); }
.stat__num {
    display: block; font-size: clamp(36px, 5vw, 56px); font-weight: 500;
    letter-spacing: -0.02em; color: var(--text); margin-bottom: 10px;
    font-feature-settings: 'tnum';
}
.stat:hover .stat__num { color: var(--accent); }
.stat__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.15em; color: var(--text-mute); }

.ticker {
    margin-top: clamp(80px, 12vw, 140px); border-block: 1px solid var(--border);
    overflow: hidden; padding: 22px 0;
}
.ticker__track {
    display: flex; gap: 0; white-space: nowrap; width: max-content;
    animation: ticker 28s linear infinite;
}
.ticker__track span {
    font-family: var(--font-mono); font-size: clamp(20px, 3vw, 32px); font-weight: 500;
    letter-spacing: 0.05em; color: var(--text-mute); padding-right: 40px;
}
.ticker__track span:nth-child(even) { color: var(--accent); opacity: 0.7; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- CONTACT ---------- */
.contact { padding: clamp(80px, 12vw, 160px) clamp(20px, 5vw, 64px); }
.contact__inner { max-width: 720px; margin: 0 auto; }
.contact__title {
    font-size: clamp(36px, 6vw, 64px); font-weight: 500; letter-spacing: -0.02em;
    margin: 20px 0 16px;
}
.contact__lead { color: var(--text-dim); font-size: 17px; margin-bottom: 48px; }
.contact__form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 600px) { .contact__form { grid-template-columns: 1fr; } }
.field { position: relative; }
.field--full { grid-column: 1 / -1; }
.field input, .field textarea {
    width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--border-bright);
    color: var(--text); font-family: var(--font-sans); font-size: 16px; padding: 16px 0 12px;
    resize: none; transition: border-color 0.3s; outline: none;
}
.field label {
    position: absolute; left: 0; top: 16px; color: var(--text-mute); font-size: 16px;
    pointer-events: none; transition: all 0.3s var(--ease);
}
.field input:focus ~ label,
.field input:valid ~ label,
.field textarea:focus ~ label,
.field textarea:valid ~ label {
    top: -8px; font-size: 10px; letter-spacing: 0.15em; color: var(--accent);
    font-family: var(--font-mono);
}
.field input:focus, .field textarea:focus { border-bottom-color: transparent; }
.field__line {
    position: absolute; bottom: 0; left: 0; width: 0; height: 1px; background: var(--accent);
    transition: width 0.4s var(--ease);
}
.field input:focus ~ .field__line,
.field textarea:focus ~ .field__line { width: 100%; }
.contact__form .btn { grid-column: 1 / -1; margin-top: 8px; }
.contact__status { grid-column: 1 / -1; font-family: var(--font-mono); font-size: 12px; color: var(--accent); min-height: 18px; }
.contact__channels {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 64px;
    background: var(--border); border: 1px solid var(--border);
}
@media (max-width: 600px) { .contact__channels { grid-template-columns: 1fr; } }
.channel {
    background: var(--bg); padding: 24px; display: flex; flex-direction: column; gap: 6px;
    transition: background 0.3s;
}
.channel:hover { background: var(--bg-elev); }
.channel__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-mute); }
.channel__handle { font-size: 16px; color: var(--text); transition: color 0.3s; }
.channel:hover .channel__handle { color: var(--accent); }

/* ---------- FOOTER ---------- */
.footer { border-top: 1px solid var(--border); padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 64px) 32px; }
.footer__top {
    display: grid; grid-template-columns: 1fr 2fr; gap: clamp(40px, 8vw, 96px);
    max-width: var(--maxw); margin: 0 auto 64px;
}
@media (max-width: 800px) { .footer__top { grid-template-columns: 1fr; } }
.footer__logo { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em; }
.footer__tag { color: var(--text-dim); margin-top: 12px; font-size: 14px; }
.footer__links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 500px) { .footer__links { grid-template-columns: 1fr 1fr; } }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__col-title { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.18em; color: var(--text-mute); margin-bottom: 4px; }
.footer__col a { color: var(--text-dim); font-size: 14px; transition: color 0.25s; }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
    display: flex; justify-content: space-between; align-items: center;
    max-width: var(--maxw); margin: 0 auto; padding-top: 32px; border-top: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.1em; color: var(--text-mute);
}
@media (max-width: 600px) { .footer__bottom { flex-direction: column; gap: 12px; text-align: center; } }
.footer__signal { display: inline-flex; align-items: center; gap: 8px; }
.footer__pulse {
    width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(0,255,209,0.6); }
    70% { box-shadow: 0 0 0 8px rgba(0,255,209,0); }
    100% { box-shadow: 0 0 0 0 rgba(0,255,209,0); }
}

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }
.reveal[data-delay="3"] { transition-delay: 0.3s; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .bg-noise, .bg-scanlines { display: none; }
}

/* ---------- Toast ---------- */
.toast {
    position: fixed; left: 50%; bottom: 32px; z-index: 9998;
    transform: translate(-50%, 140%); opacity: 0;
    max-width: min(440px, 90vw);
    background: rgba(10, 10, 14, 0.92);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--border-bright); border-left: 2px solid var(--accent);
    padding: 14px 22px; font-family: var(--font-mono); font-size: 12px;
    letter-spacing: 0.06em; color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: transform 0.5s var(--ease), opacity 0.4s var(--ease);
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.toast--err { border-left-color: var(--accent-2); }

/* ---------- Game modal ---------- */
.game-modal {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; visibility: hidden; transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.game-modal.is-open { opacity: 1; visibility: visible; }
.game-modal__backdrop {
    position: absolute; inset: 0; background: rgba(3, 3, 5, 0.85);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.game-modal__panel {
    position: relative; width: min(720px, 100%);
    max-height: min(88vh, 780px); display: flex; flex-direction: column;
    background: #07070b; border: 1px solid var(--border-bright);
    box-shadow: 0 40px 120px rgba(0,0,0,0.7), var(--glow);
    transform: translateY(24px) scale(0.98); transition: transform 0.35s var(--ease);
}
.game-modal.is-open .game-modal__panel { transform: translateY(0) scale(1); }
.game-modal__bar {
    display: flex; align-items: center; gap: 16px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.game-modal__title {
    font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; color: var(--accent);
}
.game-modal__hud {
    flex: 1; text-align: right;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--text-dim);
    font-feature-settings: 'tnum';
}
.game-modal__close {
    padding: 6px; color: var(--text-dim); transition: color 0.25s;
}
.game-modal__close:hover { color: var(--accent-2); }
.game-modal__stage {
    position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 24px; overflow: auto; min-height: 320px;
    background:
        radial-gradient(circle at 50% 20%, rgba(0,255,209,0.05), transparent 60%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.008) 0 12px, transparent 12px 24px);
}
.game-modal__hint {
    padding: 10px 16px; border-top: 1px solid var(--border);
    font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--text-mute);
    text-align: center;
}
/* Shared start / game-over overlay */
.gm-start {
    position: absolute; inset: 0; z-index: 5;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    background: rgba(5, 5, 7, 0.82); backdrop-filter: blur(4px);
    font-family: var(--font-mono); text-align: center; cursor: pointer;
}
.gm-start__line1 { font-size: 12px; letter-spacing: 0.3em; color: var(--accent); animation: blink 1.2s steps(2) infinite; }
.gm-start__line2 { font-size: 10px; letter-spacing: 0.15em; color: var(--text-mute); }
.gm-start.is-over .gm-start__line1 { color: var(--accent-2); animation: none; }

/* --- Neon Drift (canvas runner) --- */
.gm-canvas {
    width: 100%; max-width: 440px; aspect-ratio: 3 / 4;
    background: #060609; border: 1px solid var(--border);
    touch-action: none; outline: none;
}
/* --- Hollow Signal (pads) --- */
.gm-pads {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
    width: min(380px, 100%); aspect-ratio: 1;
}
.gm-pad {
    border: 1px solid var(--border-bright); background: var(--bg-elev);
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.2em; color: var(--text-mute);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.gm-pad:hover { border-color: var(--accent-dim); }
.gm-pad.lit {
    background: rgba(0, 255, 209, 0.22); border-color: var(--accent);
    box-shadow: 0 0 30px rgba(0,255,209,0.35), inset 0 0 20px rgba(0,255,209,0.2);
    color: var(--accent);
}
.gm-pad.err { background: rgba(255,77,109,0.2); border-color: var(--accent-2); color: var(--accent-2); }
/* --- The Last Loom (lights out) --- */
.gm-loom {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px;
    width: min(380px, 100%); aspect-ratio: 1;
}
.gm-cell {
    border: 1px solid var(--border); background: var(--bg-elev);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; position: relative;
}
.gm-cell::after {
    content: ''; position: absolute; inset: 30%;
    border: 1px solid transparent; border-radius: 50%;
    transition: all 0.2s;
}
.gm-cell.on {
    background: rgba(0, 255, 209, 0.14); border-color: var(--accent-dim);
    box-shadow: inset 0 0 14px rgba(0,255,209,0.15);
}
.gm-cell.on::after { border-color: var(--accent); box-shadow: 0 0 10px rgba(0,255,209,0.5); background: rgba(0,255,209,0.25); }
.gm-cell:hover { border-color: var(--border-bright); }
/* --- Vessel Zero (vents) --- */
.gm-vents {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    width: min(420px, 100%); aspect-ratio: 1;
}
.gm-vent {
    border: 1px solid var(--border-bright); background: var(--bg-elev); position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.gm-vent::before {
    content: ''; position: absolute; inset: 18%;
    background: repeating-linear-gradient(0deg, var(--border) 0 2px, transparent 2px 8px);
}
.gm-vent.intruder { border-color: var(--accent-2); background: rgba(255,77,109,0.12); }
.gm-vent.intruder::before {
    background: repeating-linear-gradient(0deg, rgba(255,77,109,0.7) 0 2px, transparent 2px 8px);
    animation: blink 0.5s steps(2) infinite;
}
.gm-vent:active { border-color: var(--accent); }
