@font-face {
    font-family: 'Departure Mono';
    src: url('https://q3-iota.vercel.app/api/absorb?url=https://cdn.jsdelivr.net/gh/r-place/departure-mono@latest/DepartureMono-Regular.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
}

:root {
    --void-bg: #000000;
    --neural-green: #4ade80;
    --quantum-cyan: #00d4aa;
    --glass-white: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-main: #f3f4f6;
    --text-dim: #9ca3af;
    --font-mono: 'Departure Mono', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --glow-neural: 0 0 25px rgba(74, 222, 128, 0.5);
    --glow-quantum: 0 0 25px rgba(0, 212, 170, 0.5);
    --neural-gradient: linear-gradient(135deg, var(--neural-green), var(--quantum-cyan));
}

@keyframes resonance {
    0% {
        transform: translateY(0) scale(1.0);
        opacity: 0.1;
    }

    50% {
        transform: translateY(-20px) scale(1.1);
        opacity: 0.2;
    }

    100% {
        transform: translateY(0) scale(1.0);
        opacity: 0.1;
    }
}

#neural-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.wave {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--neural-green) 0%, transparent 40%);
    animation: resonance 15s infinite ease-in-out;
}

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

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

h1,
h2,
h3,
h4,
.mono {
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.neural-text {
    color: var(--neural-green);
    text-shadow: var(--glow-neural);
}

.quantum-text {
    color: var(--quantum-cyan);
    text-shadow: var(--glow-quantum);
}

/* Optimization: Hidden by default for IntersectionObserver */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism — Layered Depth System */
.glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

.glass:hover {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Voxel Engine Container */
[data-voxel] {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
}

[data-voxel] canvas {
    border-radius: 24px;
}

/* Layout */
header {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    text-align: center;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

section {
    padding: 100px 0;
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s;
}

nav.scrolled {
    background: rgba(2, 2, 2, 0.8);
    backdrop-filter: blur(8px);
}

.logo-wrapper img {
    height: 42px;
    /* 5% increase from 40px */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.logo-wrapper img:hover {
    transform: perspective(500px) rotateY(15deg) rotateX(10deg) scale(1.1);
    filter: drop-shadow(0 10px 15px rgba(74, 222, 128, 0.4));
    image-rendering: pixelated;
    /* Voxel feel */
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--neural-green);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* ═══════════════════════════════════════════════════ */
/* QUANTUM CANVAS (VANTA)                                */
/* ═══════════════════════════════════════════════════ */
#quantum-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    /* Behind everything */
    pointer-events: none;
    background: #000;
    /* Fallback */
    overflow: hidden;
}

/* AFT-Q Section */
.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: var(--text-dim);
    max-width: 600px;
    margin-bottom: 3rem;
}

.cta-group {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 12px 32px;
    font-family: var(--font-mono);
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--neural-green);
    color: var(--void-bg);
}

.btn-primary:hover {
    box-shadow: 0 0 20px var(--neural-green);
    transform: translateY(-2px);
}

.btn-outline {
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--void-bg);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neural-green);
}

footer {
    padding: 4rem 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-family: var(--font-mono);
    color: var(--text-dim);
}

.converter-input {
    width: 100%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem;
    font-family: var(--font-mono);
    border-radius: 4px;
    margin-bottom: 1rem;
    outline: none;
}

.converter-input:focus {
    border-color: var(--neural-green);
    box-shadow: var(--glow-neural);
}

.converter-result {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    min-height: 100px;
    word-break: break-all;
    font-size: 1.2rem;
    color: var(--neural-green);
}

.parallax-container {
    perspective: 1000px;
    overflow: hidden;
}

.parallax-layer {
    transition: transform 0.1s ease-out;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

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

.hardware-pulse {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    width: 100px;
    height: 100px;
    border: 1px solid var(--neural-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--neural-green);
    opacity: 0.5;
    animation: pulse 4s infinite ease-in-out;
}

.gradient-text {
    background: var(--neural-gradient);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
}

.blog-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 2;
    color: var(--text-main);
}

.blog-content h2,
.blog-content h3 {
    margin-top: 3rem;
    margin-bottom: 1.5rem;
}

.blog-content p {
    margin-bottom: 2rem;
}

.blog-content code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* Documentation Expansion Logic */
.doc-link-card {
    cursor: pointer;
    overflow: hidden;
    max-height: 80px;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

.doc-link-card.expanded {
    max-height: 2000px;
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--neural-green);
}

.doc-detail {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s 0.2s, transform 0.4s 0.2s;
}

.doc-link-card.expanded .doc-detail {
    opacity: 1;
    transform: translateY(0);
}

.expand-indicator {
    float: right;
    transition: transform 0.3s;
}

.doc-link-card.expanded .expand-indicator {
    transform: rotate(180deg);
}

/* Quantum Background */
#quantum-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -2;
    opacity: 0.1;
    transition: opacity 2s ease-in-out;
}

/* ═══════════════════════════════════════════════════ */
/* PREMIUM ELEVATION — Site-Wide Enhancements         */
/* ═══════════════════════════════════════════════════ */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* ── Staggered Reveal Animations ── */
.stagger-grid>* {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.stagger-grid.active>*:nth-child(1) {
    transition-delay: 0ms;
}

.stagger-grid.active>*:nth-child(2) {
    transition-delay: 80ms;
}

.stagger-grid.active>*:nth-child(3) {
    transition-delay: 160ms;
}

.stagger-grid.active>*:nth-child(4) {
    transition-delay: 240ms;
}

.stagger-grid.active>*:nth-child(5) {
    transition-delay: 320ms;
}

.stagger-grid.active>*:nth-child(6) {
    transition-delay: 400ms;
}

.stagger-grid.active>*:nth-child(7) {
    transition-delay: 480ms;
}

.stagger-grid.active>*:nth-child(8) {
    transition-delay: 560ms;
}

.stagger-grid.active>*:nth-child(9) {
    transition-delay: 640ms;
}

.stagger-grid.active>* {
    opacity: 1;
    transform: translateY(0);
}

/* ── 3D Tilt Hover on Glass Cards ── */
.glass-tilt {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s ease, border-color 0.4s ease;
    will-change: transform;
}

.glass-tilt:hover {
    transform: perspective(800px) rotateX(-2deg) rotateY(3deg) translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── Protocol Status Pulse ── */
@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.35;
        text-shadow: none;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 8px currentColor;
    }
}

.protocol-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
}

.protocol-status span {
    animation: statusPulse 3s infinite ease-in-out;
}

.protocol-status span:nth-child(1) {
    animation-delay: 0s;
}

.protocol-status span:nth-child(2) {
    animation-delay: 0.6s;
}

.protocol-status span:nth-child(3) {
    animation-delay: 1.2s;
}

.protocol-status span:nth-child(4) {
    animation-delay: 1.8s;
}

/* ── Loading Skeleton ── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-bar {
    width: 200px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--neural-green), transparent);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ── Docs Sidebar — Sticky + Active State ── */
.sidebar {
    position: sticky;
    top: 120px;
    align-self: start;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.sidebar .nav-links a {
    position: relative;
    transition: color 0.3s, padding-left 0.3s;
    padding-left: 0;
}

.sidebar .nav-links a.active {
    color: var(--neural-green) !important;
    padding-left: 12px;
}

.sidebar .nav-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--neural-green);
    border-radius: 2px;
}

/* ── Premium Footer ── */
.premium-footer {
    border-top: 1px solid var(--glass-border);
    padding: 5rem 2rem 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
    font-size: 0.85rem;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.2rem;
    color: var(--neural-green);
}

.footer-col a {
    display: block;
    color: var(--text-dim);
    text-decoration: none;
    padding: 0.3rem 0;
    transition: color 0.2s, padding-left 0.2s;
}

.footer-col a:hover {
    color: var(--text-main);
    padding-left: 4px;
}

.footer-brand p {
    color: var(--text-dim);
    line-height: 1.8;
    font-size: 0.85rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom p {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

/* ── Blog Category Colors ── */
.tag[data-cat="Technical"] {
    color: var(--quantum-cyan);
}

.tag[data-cat="Philosophy"] {
    color: #b44aff;
}

.tag[data-cat="Security"] {
    color: #ff4ea0;
}

.tag[data-cat="Networking"] {
    color: #ff6432;
}

.tag[data-cat="Architecture"] {
    color: #ffd200;
}

.tag[data-cat="Documentation"] {
    color: var(--neural-green);
}

.tag[data-cat="Logic"] {
    color: #6958d5;
}

.tag[data-cat="Tutorial"] {
    color: #00b4ff;
}

/* Blog Filter Buttons */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.blog-filter-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 0.05em;
}

.blog-filter-btn:hover,
.blog-filter-btn.active {
    border-color: var(--neural-green);
    color: var(--neural-green);
    background: rgba(74, 222, 128, 0.05);
}

/* --- Download Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 280px;
    margin-top: 10px;
    z-index: 1000;
    padding: 1.2rem;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
}

.dropdown:hover .dropdown-content {
    display: block;
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.dropdown-group-label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--neural-green);
    letter-spacing: 0.2em;
    margin-bottom: 0.8rem;
    display: block;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.4rem;
    opacity: 0.7;
}

.dropdown-item {
    display: block;
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 10px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* --- Responsive Fixes --- */

/* Homepage */
.hero-title {
    font-size: clamp(2rem, 10vw, 3.5rem);
}

.stagger-grid {
    grid-template-columns: 1fr !important;
}

.reveal[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
}

/* Ensure images in grid stack correctly */
.reveal>div[style*="order: 2"] {
    order: -1 !important;
    /* Move images to top on mobile */
}

/* Docs */
main.container[style*="grid-template-columns: 250px 1fr"] {
    grid-template-columns: 1fr !important;
    padding-top: 2rem !important;
}

.sidebar {
    display: none;
    /* Hide sidebar on mobile for now */
}

.doc-section .glass {
    margin-bottom: 2rem;
}

.doc-link-card {
    padding: 1rem;
}

/* Footer */
.footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
}

.dropdown-item.disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
    filter: grayscale(1);
}

.dropdown-item .status {
    float: right;
    font-size: 0.55rem;
    opacity: 0.5;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════ */
/* MOBILE RESPONSIVE BREAKPOINTS                       */
/* ═══════════════════════════════════════════════════ */

/* Tablet — 1024px */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    header {
        padding: 2rem 1rem;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    section {
        padding: 60px 0;
    }

    .container {
        padding: 1.5rem;
    }
}

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

    /* Navigation */
    nav {
        padding: 1rem;
    }

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

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

    /* Hero */
    .hero-title {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
    }


    /* --- Voxel Visualizer --- */
    .voxel-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
        overflow: hidden;
        pointer-events: none;
        perspective: 1000px;
        background: #050505;
        /* Deep background */
    }

    .voxel-world {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        transform-style: preserve-3d;
    }

    .voxel {
        position: absolute;
        width: 24px;
        height: 24px;
        background: var(--neural-green);
        transform-style: preserve-3d;
        transition: all 4s cubic-bezier(0.16, 1, 0.3, 1);
        /* Slow, smooth drift */
        border-radius: 4px;
    }

    .cta-group {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .cta-group {
        flex-direction: column;
        gap: 0.8rem;
        align-items: center;
    }

    .cta-group .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }

    .protocol-status {
        flex-wrap: wrap;
        gap: 1rem;
        font-size: 0.55rem;
    }

    /* Grids → Single Column */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: 1fr 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* Docs Layout */
    main[style*="grid-template-columns: 250px"] {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        position: relative;
        top: 0;
        max-height: none;
        padding-bottom: 2rem;
        border-bottom: 1px solid var(--glass-border);
        margin-bottom: 2rem;
    }

    .sidebar .nav-links {
        flex-direction: row !important;
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }

    .sidebar .nav-links a {
        font-size: 0.7rem;
        padding: 4px 10px;
        border: 1px solid var(--glass-border);
        border-radius: 16px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .footer-col a {
        padding: 0.4rem 0;
    }

    /* Hardware Pulse */
    .hardware-pulse {
        width: 70px;
        height: 70px;
        font-size: 0.45rem;
        bottom: 1rem;
        right: 1rem;
    }

    /* Doc Cards */
    .doc-link-card {
        max-height: 100px;
    }
}

/* Small Phone — 480px */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 0.8rem;
    }

    nav .logo-wrapper img {
        height: 28px;
    }

    .nav-links {
        gap: 0.6rem;
    }

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

    h2 {
        font-size: 1.5rem;
    }

    .protocol-status {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════ */
/* PREFERS REDUCED MOTION                              */
/* ═══════════════════════════════════════════════════ */
@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;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .stagger-grid>* {
        opacity: 1;
        transform: none;
    }

    .loading-screen {
        display: none;
    }

    .wave {
        animation: none;
    }

    #quantum-canvas {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════ */
/* MOBILE OPTIMIZATIONS & NEURAL DECK                  */
/* ═══════════════════════════════════════════════════ */

@media (max-width: 768px) {
    nav {
        display: none !important;
        /* Force hide top nav */
    }

    /* --- Neural Deck --- */
    .neural-deck {
        position: fixed !important;
        bottom: 2rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 2147483647 !important;
        /* Max z-index to beat everything */
        width: 90% !important;
        max-width: 400px !important;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        display: block !important;
    }

    .deck-control {
        background: rgba(10, 10, 10, 0.85) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
        border-radius: 50px !important;
        padding: 12px 24px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        cursor: pointer !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
        transition: all 0.3s;
        color: var(--text-main);
    }

    .deck-control:active {
        transform: scale(0.95);
        background: rgba(20, 20, 20, 0.95) !important;
    }

    .deck-label {
        font-family: var(--font-mono);
        font-size: 0.8rem;
        letter-spacing: 0.2em;
        color: var(--text-main) !important;
        text-transform: uppercase;
        font-weight: 700;
    }

    .deck-icon {
        color: var(--neural-green) !important;
        font-size: 1rem;
        animation: pulse 2s infinite;
    }

    .deck-panel {
        position: absolute;
        bottom: 100%;
        left: 0;
        width: 100%;
        margin-bottom: 1rem;
        background: rgba(15, 15, 15, 0.95) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 24px;
        padding: 1.5rem;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        transform: translateY(20px) scale(0.95);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8) !important;
        z-index: 2147483647;
    }

    .neural-deck.active .deck-panel {
        transform: translateY(0) scale(1);
        opacity: 1;
        pointer-events: all;
    }

    .deck-link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 16px;
        text-decoration: none;
        border: 1px solid transparent;
        transition: all 0.2s;
    }

    .deck-link:active {
        background: rgba(74, 222, 128, 0.1) !important;
        border-color: rgba(74, 222, 128, 0.3);
        transform: scale(0.98);
    }

    .deck-link span {
        font-family: var(--font-mono);
        font-size: 0.7rem;
        color: var(--text-dim) !important;
        margin-top: 0.5rem;
    }

    .deck-link i {
        font-size: 1.2rem;
        color: var(--text-main) !important;
        font-style: normal;
    }

    /* --- Responsive Overrides --- */

    /* Global Grid Collapse */
    [style*="grid-template-columns: 1fr 1fr"],
    [style*="grid-template-columns: repeat(3"],
    [style*="grid-template-columns: 1fr 1fr 1fr"],
    .pricing-grid,
    .aftq-grid,
    .faq-grid,
    .footer-grid {
        grid-template-columns: 1fr !important;
    }

    /* Homepage / Generic */
    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .stagger-grid {
        grid-template-columns: 1fr !important;
    }

    .reveal[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Ensure images in grid stack correctly */
    .reveal>div[style*="order: 2"] {
        order: -1 !important;
        /* Move images to top on mobile */
    }

    /* Pricing Specific */
    .pricing-grid {
        max-width: 400px;
        margin: 0 auto;
    }

    .pricing-hero {
        padding: 7rem 1.5rem 3rem;
    }

    /* Docs Specific */
    main.container[style*="grid-template-columns: 250px 1fr"] {
        grid-template-columns: 1fr !important;
        padding-top: 2rem !important;
    }

    .sidebar {
        display: none;
    }

    /* Fix table overflow */
    .compare-grid {
        overflow-x: auto;
    }

    .compare-table {
        min-width: 500px;
    }
}