:root {
    --bg-color: #050505;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-primary: #00ff41;
    --accent-secondary: #008f11;
    --accent-glow: rgba(0, 255, 65, 0.5);
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.1);
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* --- Layout Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 60px;
    background: linear-gradient(90deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    padding-bottom: 20px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* --- Header & Nav --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    padding: 20px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent-primary);
    text-shadow: 0 0 10px var(--accent-glow);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.4s ease;
    margin-right: 40px;
}

.logo:hover {
    text-shadow:
        0 0 5px var(--accent-primary),
        0 0 15px var(--accent-glow),
        0 0 25px var(--accent-glow);
    color: #fff;
}

.logo span {
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.logo:hover span {
    animation: matrixPulse 1.5s ease-in-out infinite;
}

@keyframes matrixPulse {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1);
    }

    50% {
        opacity: 0.85;
        filter: brightness(1.2);
    }
}

.logo img {
    height: 32px;
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.logo:hover img {
    box-shadow: 0 0 12px var(--accent-glow);
}

.version-tag {
    font-size: 0.7em;
    opacity: 0.6;
    font-weight: 400;
    margin-left: 4px;
    color: var(--text-secondary);
    text-shadow: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a:hover {
    color: var(--accent-primary);
    text-shadow: 0 0 8px var(--accent-glow);
}

.nav-links a svg {
    transition: filter 0.3s ease;
}

.nav-links a:hover svg {
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(circle at center, rgba(0, 255, 65, 0.05) 0%, transparent 70%);
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

/* Particle Background */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 80% 60%, rgba(0, 255, 65, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 50% 80%, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 100px 100px, 150px 150px, 80px 80px;
    animation: particleDrift 20s linear infinite;
    pointer-events: none;
}

@keyframes particleDrift {
    0% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-20px) translateX(10px);
    }

    100% {
        transform: translateY(0) translateX(0);
    }
}

.hero h1 {
    font-size: 6rem;
    margin-bottom: 20px;
    line-height: 1;
    position: relative;
}

.glitch {
    position: relative;
    color: var(--text-primary);
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(0, 0, 0, 0);
    animation: glitch-anim-1 2.5s 1 linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 #00fff9;
    clip: rect(0, 0, 0, 0);
    animation: glitch-anim-2 2.5s 1 linear alternate-reverse;
}

/* Trigger on Hover & Click */
.glitch:hover::before,
.glitch:active::before {
    animation: glitch-anim-1 0.5s infinite linear alternate-reverse;
}

.glitch:hover::after,
.glitch:active::after {
    animation: glitch-anim-2 0.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
    0% {
        clip: rect(20px, 9999px, 15px, 0);
    }

    20% {
        clip: rect(70px, 9999px, 90px, 0);
    }

    40% {
        clip: rect(20px, 9999px, 15px, 0);
    }

    60% {
        clip: rect(80px, 9999px, 100px, 0);
    }

    80% {
        clip: rect(10px, 9999px, 5px, 0);
    }

    100% {
        clip: rect(50px, 9999px, 70px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(90px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(10px, 9999px, 5px, 0);
    }

    40% {
        clip: rect(60px, 9999px, 80px, 0);
    }

    60% {
        clip: rect(30px, 9999px, 20px, 0);
    }

    80% {
        clip: rect(80px, 9999px, 90px, 0);
    }

    100% {
        clip: rect(10px, 9999px, 50px, 0);
    }
}

/* Typing cursor effect */
#typing-text {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--accent-primary);
    min-height: 1.6em;
    margin-bottom: 40px;
}

#typing-text::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-primary);
    color: #000;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Discord Button */
.btn-discord {
    background: #5865F2;
    border-color: #5865F2;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-discord:hover {
    background: #4752C4;
    border-color: #4752C4;
    color: #fff;
    box-shadow: 0 0 20px rgba(88, 101, 242, 0.5);
}

.btn-discord svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- Telemetry Section --- */
.telemetry-section {
    padding: 60px 0;
    background: #080808;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.telemetry-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    overflow: hidden;
    /* ADD THIS */
    max-width: 100%;
    /* ADD THIS */
}

.telemetry-card {
    background: #000;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 15px;
    font-family: var(--font-mono);
    overflow: hidden;
    /* ADD THIS */
    max-width: 100%;
    /* ADD THIS */
    box-sizing: border-box;
    /* ADD THIS (may already be set globally) */
}

.telemetry-card h3 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    text-transform: uppercase;
    border-bottom: 1px solid #222;
    padding-bottom: 5px;
}

/* Terminal */
.terminal-card {
    height: 100%;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.terminal-window {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 0.85rem;
    color: #ccc;
    scrollbar-width: thin;
    scrollbar-color: #333 #000;
    overflow-wrap: break-word;
    word-break: break-word;
}

.log-entry {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.log-time {
    color: #555;
}

.log-level.info {
    color: #00ff41;
}

.log-level.warn {
    color: #ff4400;
    /* More vibrant orange-red per user request */
}

.log-level.error {
    color: #ff0000;
}

.log-redacted {
    color: #00c8ff;
    opacity: 0.7;
    font-style: italic;
}

/* Semantic Log Tags (Neural Feed) */
.log-tag-vibe { color: #ff66b2; }
.log-tag-recall { color: #00c8ff; }
.log-tag-synapse { color: #ffd700; }
.log-tag-persona { color: #b366ff; }
.log-tag-interrupt { color: #ff9933; }

/* Sidebar Cards */
.telemetry-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;

    justify-content: center;
}

.vibe-icon {
    font-size: 3rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.vibe-text {
    display: flex;
    flex-direction: column;
}

#vibe-status {
    font-weight: 700;
    font-size: 1.2rem;
}

#vibe-topic {
    color: #666;
    font-size: 0.8rem;
    justify-content: center;
}

/* Haunt List */
.haunt-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.haunt-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.haunt-row:first-child {
    background: rgba(255, 0, 0, 0.1);
    border-color: rgba(255, 0, 0, 0.3);
    margin-bottom: 4px;
}

.haunt-row:hover {
    background: rgba(255, 255, 255, 0.08);
}

.haunt-row-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #333;
}

.haunt-row:first-child .haunt-row-avatar {
    width: 40px;
    height: 40px;
    border-color: #ff0000;
}

.haunt-row-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.haunt-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.haunt-time {
    font-size: 0.75rem;
    color: #666;
}

/* Entity Graph */
#entity-graph {
    width: 100%;
    height: 500px;
    background: #000;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    cursor: grab;
}

#entity-graph:active {
    cursor: grabbing;
}

.graph-link {
    stroke: #333;
    stroke-opacity: 0.6;
    stroke-width: 1.5px;
}

.graph-node {
    stroke: #fff;
    stroke-width: 1.5px;
    transition: all 0.3s;
    cursor: pointer;
    /* Hardware acceleration for smooth drag */
    will-change: transform;
}

.node-glow {
    filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
}

.node-pulse {
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        stroke-width: 1.5px;
        filter: drop-shadow(0 0 5px rgba(0, 255, 255, 0.4));
    }

    100% {
        stroke-width: 3px;
        filter: drop-shadow(0 0 15px rgba(0, 255, 255, 0.9));
    }
}

.graph-label-name {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: #fff;
    text-shadow: 1px 1px 2px #000;
    font-weight: 600;
    pointer-events: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.graph-label-meta {
    font-family: var(--font-mono);
    font-size: 9px;
    fill: #aaa;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

/* Data Packet (Particle) */
.packet {
    fill: #fff;
    filter: drop-shadow(0 0 3px #fff);
    pointer-events: none;
}

/* Dimming Class for Focus Mode */
.dimmed {
    opacity: 0.1 !important;
    filter: grayscale(100%) !important;
}

/* --- Features / Grid --- */
.features {
    padding: 100px 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* Card Micro-Animations */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 30px;
    border-radius: 12px;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    animation: cardFloat 6s ease-in-out infinite;
    animation-delay: calc(var(--card-index, 0) * 0.5s);
}

.card:nth-child(1) {
    --card-index: 0;
}

.card:nth-child(2) {
    --card-index: 1;
}

.card:nth-child(3) {
    --card-index: 2;
}

.card:nth-child(4) {
    --card-index: 3;
}

.card:nth-child(5) {
    --card-index: 4;
}

.card:nth-child(6) {
    --card-index: 5;
}

@keyframes cardFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 30px rgba(0, 255, 65, 0.1);
    animation-play-state: paused;
}

.card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--accent-primary);
}

/* --- Changelog Section --- */
.changelog-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.changelog-entry {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent-primary);
    border-radius: 8px;
    padding: 25px;
    transition: transform 0.2s ease, background 0.2s ease;
}

.changelog-entry:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.changelog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.changelog-version {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.changelog-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.changelog-content {
    font-size: 0.95rem;
    color: #ddd;
    line-height: 1.6;
    white-space: pre-wrap;
    /* Preserve markdown formatting */
}

/* Markdown Styling within Changelog */
.changelog-content strong {
    color: #fff;
}

.changelog-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--accent-primary);
}

/* --- Commands Section --- */
.commands {
    padding: 100px 0;
    background: #080808;
}

.cmd-category {
    margin-bottom: 50px;
}

.cmd-category h3 {
    font-family: var(--font-mono);
    color: var(--accent-secondary);
    margin-bottom: 20px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

.cmd-list {
    display: grid;
    gap: 15px;
}

.cmd-item {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 2px solid #333;
    transition: all 0.2s ease;
}

.cmd-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--accent-primary);
    transform: translateX(5px);
}

.cmd-name {
    font-family: var(--font-mono);
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 5px;
}

.cmd-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Gallery Section --- */
.gallery-section {
    padding: 100px 0;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.filter-btn.active,
.filter-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(0, 255, 65, 0.05);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-media {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-type {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Play Overlay for Videos */
.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.play-overlay svg {
    width: 24px;
    height: 24px;
    fill: #fff;
    margin-left: 4px;
}

/* Hide play button when hovering (since video plays) */
.gallery-item:hover .play-overlay {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.gallery-loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* --- Lightbox Modal --- */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 2rem;
    padding: 20px 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* --- Discord Widget --- */
.discord-widget {
    background: linear-gradient(135deg, #5865F2, #4752C4);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 60px;
    position: relative;
    overflow: hidden;
}

.discord-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: discordShine 5s linear infinite;
}

@keyframes discordShine {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.discord-widget h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.discord-widget p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.discord-widget .btn-discord {
    position: relative;
    z-index: 1;
    background: #fff;
    color: #5865F2;
    border-color: #fff;
}

.discord-widget .btn-discord:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

/* --- Footer --- */
footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(15px);
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        width: 75%;
        max-width: 300px;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding-left: 30px;
        gap: 20px;
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .nav-links a {
        font-size: 1rem;
        width: 100%;
        padding: 10px 0;
    }

    .nav-links a svg {
        width: 22px;
        height: 22px;
        margin-right: 10px;
    }

    .nav-active {
        transform: translateX(0%);
    }

    .hamburger {
        display: block;
        cursor: pointer;
        z-index: 1001;
        padding: 10px;
    }

    .hamburger div {
        width: 25px;
        height: 3px;
        background-color: var(--text-primary);
        margin: 5px;
        transition: all 0.3s ease;
        border-radius: 2px;
    }

    /* Hamburger Animation */
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
        background-color: var(--accent-primary);
    }

    .toggle .line2 {
        opacity: 0;
        transform: translateX(20px);
    }

    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
        background-color: var(--accent-primary);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    #typing-text {
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .telemetry-grid {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card {
        padding: 20px;
        animation: none;
    }

    .card:hover {
        transform: none;
    }



    /* Gallery Mobile */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        border-radius: 6px;
    }

    .play-overlay {
        width: 40px;
        height: 40px;
    }

    .play-overlay svg {
        width: 16px;
        height: 16px;
    }

    /* Commands Mobile */
    .cmd-item {
        padding: 12px;
    }

    .cmd-name {
        font-size: 0.85rem;
    }

    .cmd-desc {
        font-size: 0.8rem;
    }

    /* Lightbox Mobile */
    .lightbox-nav {
        padding: 10px;
        font-size: 1.5rem;
    }

    .lightbox-prev {
        left: 5px;
    }

    .lightbox-next {
        right: 5px;
    }

    /* Discord Widget Mobile */
    .discord-widget {
        padding: 20px;
        margin-top: 40px;
    }

    .discord-widget h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.8rem;
    }
}

/* --- Intrusive Thoughts Ticker --- */
.thoughts-ticker-container {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    overflow: hidden;
    height: 40px;
}

.ticker-label {
    background: var(--accent-primary);
    color: #000;
    font-weight: bold;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    white-space: nowrap;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 20s linear infinite;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

@keyframes ticker {
    0% {
        transform: translate3d(0, 0, 0);
    }

    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* Neural Cloud (Context) */
.context-card {
    min-height: 150px;
}

.context-cloud {
    padding: 10px 0;
}

.context-summary {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.3);
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile Ticker */
@media (max-width: 768px) {
    .thoughts-ticker-container {
        height: 35px;
    }

    .ticker-label {
        font-size: 0.6rem;
        padding: 0 10px;
    }

    .ticker-content {
        font-size: 0.75rem;
    }

    .telemetry-grid-secondary {
        grid-template-columns: 1fr;
    }
}

/* --- Discord CTA Section --- */
.discord-cta {
    padding: 60px 0;
    background: linear-gradient(135deg, rgba(0, 255, 65, 0.05) 0%, rgba(0, 143, 17, 0.1) 100%);
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
}

.discord-cta h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.discord-cta p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--accent-primary);
    color: var(--bg-color);
    border-color: var(--accent-primary);
}

.btn-discord:hover {
    background: transparent;
    color: var(--accent-primary);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-discord svg {
    fill: currentColor;
}

/* --- Nav Discord Link --- */
.nav-discord {
    color: var(--accent-primary) !important;
    font-weight: 600;
}

.nav-discord svg {
    fill: var(--accent-primary);
}

.nav-discord:hover {
    color: var(--text-primary) !important;
    text-shadow: 0 0 10px var(--accent-glow);
}

/* --- Age Warning --- */
.age-warning {
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}


/* --- Reveal on Scroll Animations (Improved) --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Section Reveal */
.section-reveal {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.section-reveal.section-revealed {
    opacity: 1;
}

/* --- Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: rgba(0, 255, 65, 0.15);
    border: 1px solid var(--accent-primary);
    border-radius: 50%;
    color: var(--accent-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
    backdrop-filter: blur(10px);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (hover: hover) {
    #back-to-top:hover {
        background: var(--accent-primary);
        color: var(--bg-color);
        box-shadow: 0 0 20px var(--accent-glow);
        transform: translateY(-3px);
    }
}

#back-to-top:active {
    transform: translateY(0) scale(0.95);
}

/* Mobile Back to Top */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* --- Improved Mobile Performance --- */
@media (max-width: 768px) {

    /* Reduce animations on mobile for battery/performance */
    .card,
    .section-reveal,
    .reveal-on-scroll {
        transition-duration: 0.3s;
    }

    /* Faster reveal on mobile */
    .reveal-on-scroll {
        transform: translateY(15px);
    }

    /* Disable heavy animations on mobile */
    .hero::before {
        animation: none;
    }

    /* Smooth touch scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Pulsing Discord Button (subtle) --- */
.nav-discord {
    animation: discordPulse 3s ease-in-out infinite;
}

@keyframes discordPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 2px var(--accent-primary));
    }

    50% {
        filter: drop-shadow(0 0 8px var(--accent-glow));
    }
}

/* --- Loading State Improvements --- */
.gallery-loader {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}


/* --- Nav Overflow Fix (Desktop) --- */
.nav-links {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.nav-links a {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

/* At smaller widths, reduce nav gap */
@media (max-width: 1100px) {
    .nav-links {
        gap: 18px;
    }
}

@media (max-width: 950px) {
    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 0.75rem;
    }
}

/* --- Footer Status --- */
.footer-status {
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0.7;
    font-family: var(--font-mono);
    color: var(--accent-primary);
    transition: all 0.3s ease;
}

.footer-status:hover {
    opacity: 1;
}

/* Glitch effect on hover */
.glitch-hover {
    position: relative;
}

.glitch-hover:hover {
    animation: footerGlitch 0.3s ease;
}

@keyframes footerGlitch {

    0%,
    100% {
        transform: translate(0);
    }

    20% {
        transform: translate(-2px, 1px);
        text-shadow: 2px 0 #ff00ff, -2px 0 #00ffff;
    }

    40% {
        transform: translate(2px, -1px);
        text-shadow: -2px 0 #ff00ff, 2px 0 #00ffff;
    }

    60% {
        transform: translate(-1px, 2px);
        text-shadow: 1px 0 #ff00ff, -1px 0 #00ffff;
    }

    80% {
        transform: translate(1px, -2px);
        text-shadow: -1px 0 #ff00ff, 1px 0 #00ffff;
    }
}

.changelog-entry {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.35);
    font-family: "JetBrains Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
}

.changelog-content h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.changelog-content ul {
    list-style: none;
    padding-left: 0;
    margin: 0 0 0.5rem;
}

.changelog-content li {
    margin: 0.1rem 0;
}

.changelog-content code {
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.06);
}



.changelog-entry {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

.changelog-content code {
    white-space: normal;
    /* allow wrapping */
    word-break: break-word;
    /* break long tokens if needed */
    overflow-wrap: anywhere;
    display: inline;
    /* make sure it's inline, not block */
}

/* Gallery Like Button */
.like-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 5px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.like-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.like-btn.liked {
    border-color: #ff0055;
    background: rgba(255, 0, 85, 0.1);
}

.heart-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #fff;
    stroke-width: 2px;
    transition: all 0.2s;
}

.like-btn.liked .heart-icon {
    fill: #ff0055;
    stroke: #ff0055;
    animation: heartPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.like-count {
    color: #fff;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    font-weight: 600;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* Changelog Expand/Collapse Button */
.changelog-expand-btn {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 30px auto 0;
    padding: 12px 24px;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 8px;
    color: var(--accent-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.changelog-expand-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

.changelog-expand-btn .expand-icon {
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.changelog-expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}