/* ============================================================================
   offsets-site — dark, sleek, minimal.

   Design tokens live in :root so a future theme switcher is one variable
   flip away.  Layout is unopinionated flex/grid; there are no framework
   utility classes because everything here is written once and rarely.
   ============================================================================ */

:root {
    --bg:            #08080d;
    --bg-elev-1:     #0e0e15;
    --bg-elev-2:     #12121b;
    --bg-elev-3:     #1a1a25;
    --border:        #23232f;
    --border-strong: #2f2f3d;

    --text:          #e6e6ec;
    --text-muted:    #8a8a99;
    --text-dim:      #5c5c6b;

    --accent:        #8b5cf6;
    --accent-2:      #a78bfa;
    --accent-soft:   rgba(139, 92, 246, 0.18);
    --accent-hover:  #9f7bff;

    --danger:        #ef4444;
    --warn:          #f59e0b;
    --ok:            #22c55e;

    --radius-sm:     6px;
    --radius:        10px;
    --radius-lg:     14px;

    --font-sans:     'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:     0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-glow:   0 0 0 1px var(--accent-soft), 0 8px 24px rgba(139, 92, 246, 0.15);

    --wrap-max:      1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;

    /* Subtle vignette so the flat black feels intentional, not cheap. */
    background-image:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(139, 92, 246, 0.07), transparent 60%),
        radial-gradient(ellipse 50% 40% at 100% 100%, rgba(139, 92, 246, 0.04), transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent-hover); }
.muted { color: var(--text-muted); }
.mono  { font-family: var(--font-mono); }

.wrap {
    width: 100%;
    max-width: var(--wrap-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── header / nav ───────────────────────────────────────────────────────── */

.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(8, 8, 13, 0.7);
    border-bottom: 1px solid var(--border);
}
.site-header .wrap {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; font-size: 17px; }
.brand:hover { color: var(--text); }
.brand-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.brand-name { }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a, .site-nav .link-btn {
    color: var(--text-muted); font-weight: 500;
    padding: 8px 12px; border-radius: var(--radius-sm);
    transition: color .12s ease, background-color .12s ease;
}
.site-nav a:hover, .site-nav .link-btn:hover {
    color: var(--text); background: var(--bg-elev-2);
}
.site-nav .nav-cta {
    color: var(--text); background: var(--accent);
    box-shadow: var(--shadow-sm);
}
.site-nav .nav-cta:hover { background: var(--accent-hover); }

/* ─── generic elements ───────────────────────────────────────────────────── */

.link-btn {
    appearance: none; background: none; border: 0; padding: 0;
    color: inherit; cursor: pointer; font: inherit;
}
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { color: #fca5a5; }

.primary-btn {
    appearance: none; border: 0; cursor: pointer;
    background: var(--accent); color: white; font-weight: 600;
    padding: 10px 18px; border-radius: var(--radius-sm);
    transition: background-color .12s ease, transform .06s ease;
    font-size: 14px;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
    display: inline-flex; align-items: center;
    background: var(--bg-elev-2); color: var(--text-muted);
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px; font-weight: 500;
    transition: color .12s ease, background-color .12s ease, border-color .12s ease;
}
.ghost-btn:hover { color: var(--text); background: var(--bg-elev-3); border-color: var(--border-strong); }

.pill {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
    padding: 3px 8px; border-radius: 999px;
    background: var(--bg-elev-3); color: var(--text-muted); border: 1px solid var(--border);
}
.pill.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.pill.warn   { background: rgba(245, 158, 11, 0.15); color: var(--warn); border-color: transparent; }

.eyebrow {
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em;
    font-size: 12px; font-weight: 600; margin-bottom: 12px;
}

/* ─── main / footer ──────────────────────────────────────────────────────── */

.site-main { flex: 1 1 auto; padding: 40px 0 80px; }

.site-footer {
    border-top: 1px solid var(--border); padding: 22px 0; color: var(--text-dim);
    font-size: 13px;
}
.site-footer .wrap { display: flex; justify-content: space-between; }

/* ─── landing ────────────────────────────────────────────────────────────── */

.hero { margin-bottom: 48px; }
.hero-title {
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
    margin: 6px 0 14px;
    background: linear-gradient(180deg, #fff 0%, #b9b9c8 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    max-width: 720px;
}
.hero-sub { color: var(--text-muted); font-size: 17px; max-width: 620px; margin: 0; }

.game-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.game-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 22px; background: var(--bg-elev-1);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    color: var(--text);
    transition: transform .12s ease, border-color .12s ease, background-color .12s ease, box-shadow .18s ease;
    position: relative; overflow: hidden;
}
.game-card::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(ellipse at top left, var(--accent), transparent 70%);
    opacity: 0; transition: opacity .18s ease;
    pointer-events: none;
}
.game-card:hover {
    transform: translateY(-2px); border-color: var(--accent);
    box-shadow: 0 12px 40px -12px var(--accent);
    color: var(--text);
}
.game-card:hover::before { opacity: 0.06; }

.game-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.game-card-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.game-card-badge {
    font-family: var(--font-mono); font-size: 11px; font-weight: 500;
    background: var(--bg-elev-3); color: var(--text-muted);
    padding: 4px 8px; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--border);
}
.game-card-tagline { margin: 0; color: var(--text-muted); font-size: 14px; }
.game-card-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: auto; color: var(--text-dim); font-size: 13px;
}
.game-card-foot .arrow { color: var(--accent); font-weight: 600; transition: transform .12s ease; }
.game-card:hover .arrow { transform: translateX(3px); }

/* ─── game hero (per-game page) ──────────────────────────────────────────── */

.game-hero {
    padding: 40px 0 28px; margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, color-mix(in oklab, var(--accent, #8b5cf6) 12%, transparent) 0%, transparent 100%);
}
.game-title {
    font-size: clamp(30px, 4.5vw, 48px);
    font-weight: 800; letter-spacing: -0.025em; margin: 6px 0 14px;
}
.pinned-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.pinned-version { font-family: var(--font-mono); font-weight: 600; }
.pinned-label   { color: var(--text-muted); }
.crumb { color: var(--text-muted); }
.crumb:hover { color: var(--accent-2); }

/* Grid switches on when a history sidebar is present.  Without an
   .history sibling the main column takes the full width — otherwise
   the article ends up squashed into the 260px column. */
.game-body { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
.game-body:has(.history) { grid-template-columns: minmax(0, 1fr) 260px; }
.build-main { min-width: 0; }
@media (max-width: 900px) {
    .game-body:has(.history) { grid-template-columns: 1fr; }
    .history { position: static !important; }
}

/* ─── build doc / markdown body ──────────────────────────────────────────── */

.build-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.search-input {
    flex: 1 1 260px; max-width: 480px;
    background: var(--bg-elev-1); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 14px; font-family: inherit;
    transition: border-color .12s ease, background-color .12s ease;
}
.search-input:focus {
    outline: none; border-color: var(--accent); background: var(--bg-elev-2);
}

.markdown-body { font-size: 15px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
    letter-spacing: -0.015em; line-height: 1.25;
    margin: 32px 0 12px; scroll-margin-top: 90px;
}
.markdown-body h1 { font-size: 28px; }
.markdown-body h2 { font-size: 22px; padding-top: 12px; border-top: 1px solid var(--border); }
.markdown-body h3 { font-size: 18px; color: var(--text); }
.markdown-body h4 { font-size: 16px; color: var(--text-muted); }
.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }
.markdown-body li { margin: 4px 0; }
.markdown-body strong { color: #fff; font-weight: 700; }
.markdown-body em { color: var(--text); }
.markdown-body a { text-decoration: underline; text-underline-offset: 3px; }

/* markdown's toc extension wraps headings in anchor links for permalinks;
   we don't want those styled like body links. */
.markdown-body h1 a, .markdown-body h2 a, .markdown-body h3 a,
.markdown-body h4 a, .markdown-body h5 a, .markdown-body h6 a,
.markdown-body .heading-anchor {
    color: inherit;
    text-decoration: none;
}
.markdown-body h2 a:hover, .markdown-body h3 a:hover,
.markdown-body h4 a:hover { color: var(--accent-2); }
.markdown-body code:not(pre code) {
    font-family: var(--font-mono); font-size: 0.9em;
    background: var(--bg-elev-3); color: var(--accent-2);
    padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}
.markdown-body blockquote {
    margin: 16px 0; padding: 10px 16px; color: var(--text-muted);
    border-left: 3px solid var(--accent); background: var(--bg-elev-1);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body table {
    width: 100%; border-collapse: collapse; margin: 16px 0;
    font-family: var(--font-mono); font-size: 13px;
}
.markdown-body th, .markdown-body td {
    padding: 8px 12px; border: 1px solid var(--border);
    text-align: left;
}
.markdown-body th { background: var(--bg-elev-2); color: var(--text); font-weight: 600; }
.markdown-body tr:nth-child(2n) td { background: var(--bg-elev-1); }

/* Code blocks — Prism will inject its own token colors on top of this. */
.markdown-body pre {
    position: relative;
    margin: 16px 0;
    padding: 16px 18px;
    background: var(--bg-elev-1) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
}
.markdown-body pre code {
    font-family: inherit; background: transparent !important; padding: 0 !important;
    color: var(--text);
}

/* Copy button injected by copy.js */
.copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: var(--bg-elev-3); color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 4px 10px; font-size: 11px; font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.02em; text-transform: uppercase;
    cursor: pointer; opacity: 0; transform: translateY(-2px);
    transition: opacity .12s ease, transform .12s ease, color .12s ease, background-color .12s ease;
}
.markdown-body pre:hover .copy-btn { opacity: 1; transform: translateY(0); }
.copy-btn:hover { color: var(--text); background: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); background: rgba(34, 197, 94, 0.1); }

/* Hidden block during search (see search.js) */
.markdown-body .search-hidden { display: none; }

/* ─── history sidebar ────────────────────────────────────────────────────── */

.history {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    position: sticky; top: 88px;
}
.history-title { margin: 0 0 12px; font-size: 12px; text-transform: uppercase;
                 letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { margin: 0; }
.history-list a {
    display: flex; flex-direction: column; gap: 3px;
    padding: 10px 12px; margin: 2px -12px;
    border-radius: var(--radius-sm); color: var(--text-muted);
    font-size: 13px;
    transition: color .12s ease, background-color .12s ease;
}
.history-list a:hover { color: var(--text); background: var(--bg-elev-2); }
.history-version { font-family: var(--font-mono); color: var(--text); font-weight: 600; font-size: 13px; }
.history-label   { font-size: 12px; }
.history-date    { font-size: 11px; }

/* ─── empty state ────────────────────────────────────────────────────────── */

.empty-state {
    padding: 60px 20px; text-align: center;
    background: var(--bg-elev-1); border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}
.empty-title { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub   { color: var(--text-muted); }

/* ─── admin ──────────────────────────────────────────────────────────────── */

.admin-wrap { max-width: 1100px; }
.admin-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.admin-head h1 { font-size: 26px; font-weight: 700; margin: 0; }

.admin-actions { display: flex; gap: 10px; }

.admin-game {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px;
    position: relative; overflow: hidden;
}
.admin-game::before {
    content: ""; position: absolute; left: 0; top: 0; width: 3px; height: 100%;
    background: var(--accent);
}
.admin-game-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 12px;
}
.admin-game-head h2 { margin: 0; font-size: 18px; font-weight: 700; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left; padding: 10px 12px;
    color: var(--text-muted); font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
}
.admin-table td {
    padding: 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--bg-elev-2); }
.row-actions { text-align: right; }
.row-actions a, .row-actions .link-btn {
    color: var(--text-muted); margin-left: 12px; font-size: 13px;
}
.row-actions a:hover, .row-actions .link-btn:hover { color: var(--text); }
.row-actions .link-btn.danger:hover { color: var(--danger); }

.admin-pw {
    margin-top: 28px; padding: 20px;
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.admin-pw summary {
    cursor: pointer; user-select: none; color: var(--text-muted);
    font-size: 14px; font-weight: 500;
}
.admin-pw summary:hover { color: var(--text); }
.admin-pw form { margin-top: 16px; max-width: 400px; }

.flash {
    padding: 12px 16px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px; border: 1px solid transparent;
}
.flash.ok  { background: rgba(34, 197, 94, 0.08); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
.flash.err { background: rgba(239, 68, 68, 0.08); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }

/* ─── forms / editor ─────────────────────────────────────────────────────── */

.build-form {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin-bottom: 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-grid label > span { color: var(--text-muted); }
.form-grid input, .form-grid select {
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 14px; font-family: inherit;
    transition: border-color .12s ease, background-color .12s ease;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    outline: none; border-color: var(--accent); background: var(--bg-elev-3);
}
.form-grid input:disabled { color: var(--text-muted); cursor: not-allowed; }
.form-grid .span-full { grid-column: 1 / -1; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 10px !important; grid-column: 1 / -1; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-row span { color: var(--text); font-size: 14px; }

.editor-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 10px; gap: 12px;
}
.editor-head label { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.editor-tabs { display: inline-flex; background: var(--bg-elev-2); border-radius: var(--radius-sm); padding: 3px; }
.editor-tab {
    appearance: none; background: transparent; border: 0;
    color: var(--text-muted); font-weight: 500; font-size: 13px;
    padding: 6px 14px; border-radius: var(--radius-sm); cursor: pointer;
}
.editor-tab.active { color: var(--text); background: var(--bg-elev-3); }

.editor-body { min-height: 400px; }
.editor-textarea {
    width: 100%; min-height: 500px;
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
    resize: vertical;
}
.editor-preview {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 20px;
    min-height: 500px;
}

.form-foot { margin-top: 20px; display: flex; justify-content: flex-end; }

/* ─── auth ───────────────────────────────────────────────────────────────── */

.auth-wrap { max-width: 440px; margin-top: 60px; }
.auth-card {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow-md);
}
.auth-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.auth-sub   { margin: 0 0 20px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.auth-form input {
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.auth-form input:focus { outline: none; border-color: var(--accent); background: var(--bg-elev-3); }
.auth-form .primary-btn { margin-top: 4px; }
.auth-error {
    padding: 10px 14px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px;
}

/* Prism accent hook — soften its default tomorrow theme slightly so the
   code blocks feel a little more integrated with our dark bg. */
pre[class*="language-"] { background: var(--bg-elev-1) !important; }

/* Scrollbar — Firefox + WebKit, thin and quiet. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   Home page ambience — slow-drifting glow orbs + faded grid overlay.
   Position:fixed so they float behind everything without affecting layout.
   Only rendered on the home page (see index.html) so the rest of the site
   stays clean.
   ============================================================================ */

.home-bg-fx {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

/* Content above the fx layer. Everything else already sits above it
   because `.home-bg-fx` is z-index:0 and unstyled positioned elements
   sit at `auto` (which paints later), but stacking is safer when we
   explicitly bump the hero + game grid. */
.hero, .games { position: relative; z-index: 1; }

/* Faint grid, masked to a soft ellipse so edges vanish into the bg. */
.fx-grid {
    position: absolute;
    inset: -10% -10% -10% -10%;
    background-image:
        linear-gradient(rgba(139, 92, 246, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.055) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 55% 55% at 50% 35%, #000 20%, transparent 75%);
            mask-image: radial-gradient(ellipse 55% 55% at 50% 35%, #000 20%, transparent 75%);
    opacity: 0.7;
    animation: fx-grid-pan 90s linear infinite;
}

@keyframes fx-grid-pan {
    from { background-position: 0 0; }
    to   { background-position: 560px 560px; }
}

/* Soft glow orbs.  We use radial-gradient inside a big blurred circle
   so the transition is buttery instead of a hard disc. */
.fx-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform, opacity;
    mix-blend-mode: screen;
}

.fx-blob-a {
    width: 620px; height: 620px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.55), transparent 65%);
    top: -180px; left: -160px;
    animation: fx-drift-a 26s ease-in-out infinite alternate;
}
.fx-blob-b {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.4), transparent 65%);
    top: 12%; right: -180px;
    animation: fx-drift-b 32s ease-in-out infinite alternate;
    animation-delay: -8s;
}
.fx-blob-c {
    width: 460px; height: 460px;
    background: radial-gradient(circle, rgba(109, 40, 217, 0.5), transparent 65%);
    bottom: -160px; left: 38%;
    animation: fx-drift-c 38s ease-in-out infinite alternate;
    animation-delay: -14s;
}

@keyframes fx-drift-a {
    0%   { transform: translate3d(  0px,   0px, 0) scale(1); }
    33%  { transform: translate3d( 90px, -50px, 0) scale(1.08); }
    66%  { transform: translate3d(-40px,  80px, 0) scale(0.96); }
    100% { transform: translate3d( 30px,  20px, 0) scale(1.04); }
}
@keyframes fx-drift-b {
    0%   { transform: translate3d(  0px,   0px, 0) scale(1); }
    50%  { transform: translate3d(-120px,  70px, 0) scale(1.12); }
    100% { transform: translate3d( 20px, -60px, 0) scale(0.94); }
}
@keyframes fx-drift-c {
    0%   { transform: translate3d(  0px,   0px, 0) scale(1); }
    40%  { transform: translate3d( 60px, -70px, 0) scale(1.05); }
    75%  { transform: translate3d(-70px, -20px, 0) scale(0.98); }
    100% { transform: translate3d( 40px,  50px, 0) scale(1.06); }
}

/* Cards fade+rise in on load, staggered so it feels curated. */
.games .game-card {
    animation: card-in 0.55s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.games .game-card:nth-child(1) { animation-delay: 0.05s; }
.games .game-card:nth-child(2) { animation-delay: 0.14s; }
.games .game-card:nth-child(3) { animation-delay: 0.23s; }
.games .game-card:nth-child(4) { animation-delay: 0.32s; }

@keyframes card-in {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Hero title / eyebrow / sub fade in ahead of the cards. */
.hero .eyebrow    { animation: hero-in 0.5s ease-out 0.05s both; }
.hero .hero-title { animation: hero-in 0.6s ease-out 0.12s both; }
.hero .hero-sub   { animation: hero-in 0.6s ease-out 0.22s both; }

@keyframes hero-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Respect user's motion preference — kill all the drift animations
   but keep the tiny fade-ins (they're fast and non-vestibular). */
@media (prefers-reduced-motion: reduce) {
    .fx-grid,
    .fx-blob {
        animation: none !important;
    }
}
