@font-face {
    font-family: 'Audiowide';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/audiowide.woff2') format('woff2');
    unicode-range: U+0020-007F;
}

:root {
    color-scheme: dark;
    --bg: #000;
    --text: #e4e4e7;
    --text-strong: #fff;
    --text-muted: #a8a8ad;
    --text-dim: #7d7d82;
    --accent: #00ff41;
    --accent-soft: rgba(0, 255, 65, 0.12);
    --accent-dim: rgba(0, 255, 65, 0.04);
    --accent-warm: #ff9926;
    --accent-warm-soft: rgba(255, 153, 38, 0.15);
    --border: #1f1f1f;
    --border-soft: #141414;
    --border-strong: #2a2a2a;
    --border-hover: #3a3a3a;
    --border-green: rgba(0, 255, 65, 0.35);
    --surface: rgba(255, 255, 255, 0.02);
    --surface-raised: rgba(255, 255, 255, 0.035);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-pill: 999px;
    --content-width: 960px;
    --content-narrow: 760px;
    --nav-height: 56px;
    --font-display: 'Audiowide', system-ui, sans-serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* Deep-green aurora echoing the app dashboard. A broad wash casts the whole page
   in green, then brighter curtains bleed in from the edges. Every gradient center
   is pushed off-screen (50% -20%, 8% -12%, 112% 4%, …) so only a soft arc shows,
   never a full circle — a centered orb is exactly what got the old green glow
   removed for reading as a half-orb/globe. A faint warm ember stays bottom-right
   for brand balance. The layer is oversized (inset: -15%) so the slow drift never
   reveals an edge; the drift freezes under prefers-reduced-motion (global override). */
body::before {
    content: '';
    position: fixed;
    inset: -15%;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(125% 95% at 50% -22%,  rgba(0, 200, 95, 0.13), transparent 70%),
        radial-gradient(60% 60% at 6% -12%,    rgba(0, 255, 95, 0.22), transparent 60%),
        radial-gradient(58% 58% at 114% 2%,    rgba(20, 225, 135, 0.18), transparent 58%),
        radial-gradient(42% 120% at 72% -12%,  rgba(0, 255, 110, 0.11), transparent 55%),
        radial-gradient(64% 64% at -12% 108%,  rgba(0, 215, 115, 0.13), transparent 60%),
        radial-gradient(70% 62% at 96% 116%,   rgba(0, 220, 100, 0.10), transparent 60%),
        radial-gradient(ellipse 800px 620px at 96% 110%, rgba(255, 153, 38, 0.06), transparent 60%);
    animation: aurora-drift 30s ease-in-out infinite alternate;
}

/* Barely-there breathing so the green feels alive like the app, not a static
   vignette. Resting state is the 'from' frame, which is what shows when the
   global reduced-motion override freezes the animation. */
@keyframes aurora-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-1.6%, 1.2%, 0) scale(1.06); }
}

/* Fine-grain film grain layered above the glow, under the content. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    mix-blend-mode: overlay;
    opacity: 0.4;
}

a { color: inherit; text-decoration: none; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.sr-only:focus,
.sr-only:focus-visible {
    position: fixed;
    top: 8px;
    left: 8px;
    width: auto;
    height: auto;
    padding: 12px 20px;
    margin: 0;
    clip: auto;
    background: var(--accent);
    color: #000;
    font-weight: 600;
    border-radius: var(--radius-sm);
    z-index: 1000;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.highlight { color: var(--accent); }
.highlight-orange { color: var(--accent-warm); }
.breadcrumb-current { color: var(--text); }
.mono { font-family: var(--font-mono); }

/* ─── Top nav ─────────────────────────────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
    height: var(--nav-height);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(0, 255, 65, 0.08);
}

.topbar-inner {
    max-width: var(--content-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    color: var(--text-strong);
    letter-spacing: 0.02em;
    transition: opacity 0.2s var(--ease);
}
.topbar-brand:hover { opacity: 0.85; }
.topbar-brand img { display: none; }

.topbar-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}
.topbar-nav a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.01em;
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.topbar-nav a:hover { color: var(--text-strong); background: var(--accent-dim); }
.topbar-nav a::before { content: '> '; color: var(--accent); opacity: 0.6; }
.topbar-nav .topbar-cta {
    color: var(--accent);
    border: 1px solid var(--border-green);
    margin-left: 8px;
    padding: 8px 14px;
}
.topbar-nav .topbar-cta::before { content: ''; }
.topbar-nav .topbar-cta:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

@media (max-width: 430px) {
    .topbar-brand span { display: none; }
}

@media (max-width: 580px) {
    .topbar-inner { padding: 0 14px; gap: 8px; }
    .topbar-brand { font-size: 0.95rem; }
    .topbar-nav { gap: 0; }
    .topbar-nav a { padding: 6px 8px; font-size: 0.75rem; }
    .topbar-nav a::before { display: none; }
    .topbar-nav .topbar-cta { padding: 6px 10px; margin-left: 4px; }
}

/* ─── Languages section (footer-style picker on home page) ─────────────── */

.languages-section {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 32px 24px;
    text-align: center;
}
.lang-heading {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-dim);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 18px;
}
.lang-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}
.lang-row li { display: contents; }
.lang-row a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.lang-row a:hover {
    background: var(--surface-raised);
    color: var(--text-strong);
    border-color: var(--border-hover);
}
.lang-row a[aria-current="page"] {
    color: var(--accent);
    border-color: var(--border-green);
    background: var(--accent-dim);
}

/* ─── Layout primitives ───────────────────────────────────────────────────── */

.container { max-width: var(--content-narrow); margin: 0 auto; padding: 32px 24px 0; }

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.01em;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-strong); }
.breadcrumb .sep { margin: 0 8px; color: var(--border-hover); }

.category-note {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* ─── Live pulse indicator ────────────────────────────────────────────────── */

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.7), 0 0 8px rgba(0, 255, 65, 0.9);
    }
    50% {
        transform: scale(1.25);
        box-shadow: 0 0 0 8px rgba(0, 255, 65, 0), 0 0 16px rgba(0, 255, 65, 1);
    }
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse-dot 1.6s ease-in-out infinite;
    flex-shrink: 0;
    transform-origin: center;
}

@keyframes cursor-blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
.cursor {
    display: inline-block;
    color: var(--accent);
    animation: cursor-blink 1.1s steps(1) infinite;
    margin-left: 2px;
    font-weight: bold;
}

/* ─── Shared CTA ──────────────────────────────────────────────────────────── */

.cta { text-align: center; padding: 48px 24px; margin-bottom: 16px; }
.cta h2 {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--text-strong);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
.cta p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.cta a {
    display: inline-block;
    padding: 13px 30px;
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.cta a:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(0, 255, 65, 0.3);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

footer {
    text-align: center;
    padding: 40px 24px 32px;
    margin-top: 32px;
    border-top: 1px solid var(--border-soft);
    position: relative;
}
footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.5;
}
footer nav { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; }
footer a {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-family: var(--font-mono);
    transition: color 0.2s var(--ease);
}
footer a:hover { color: var(--accent); }
.copyright {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 14px;
    font-family: var(--font-mono);
    letter-spacing: 0.02em;
}

/* ─── Category pill list (shared) ─────────────────────────────────────────── */

.cat-links { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-link {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--surface);
    transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}
.cat-link:hover {
    border-color: var(--border-green);
    color: var(--accent);
    background: var(--accent-dim);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .fade-up { opacity: 1; animation: none; }
    .cursor, .pulse-dot { animation: none; }
}
