@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;700;800&display=swap');

:root {
    --brand-red: #D51001;
    --brand-yellow: #FFC734;
    --bg-deep: #050505;
    --bg-panel: #0a0a0a;
    --border-muted: #1a1a1a;
    --text-main: #e0e0e0;
    --text-dim: #888888;
    --selection-bg: var(--brand-red);
}

/* 1. Global Reset & Performance Base */
* { box-sizing: border-box; }

::selection { background: var(--selection-bg); color: #fff; }

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
}

.mono { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.02em; }

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

/* 2. Typography & Links */
a {
    color: var(--brand-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited { color: var(--brand-red); }
a:hover { color: var(--brand-yellow); }

h1, h2, h3, h4 { 
    font-family: 'JetBrains Mono', monospace; 
    text-transform: uppercase; 
    margin: 0; 
    letter-spacing: -0.04em;
}

/* 3. Hub Layout System (Docs, Tech, Blog, Agency) */
.hub-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 4rem;
    padding: 4rem 0;
    align-items: start;
    width: 100%;
}

.hub-sidebar {
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    border-right: 1px solid var(--border-muted);
    padding-right: 2rem;
}

.docs-nav ul { list-style: none; padding: 0; margin: 0; }
.docs-nav li { margin-bottom: 0.5rem; }

.docs-content {
    background: #080808; 
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    width: 100%;
    min-width: 0; /* Critical fix for grid child overflow */
}

.markdown-body {
    width: 100%;
    overflow-x: auto;
}

.markdown-body h2 {
    color: var(--brand-yellow);
    margin-top: 4rem;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--brand-red);
    padding-left: 1rem;
}

.markdown-body p { margin-bottom: 1.5rem; color: var(--text-main); }

/* 4. Bento Grid (Home Page) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(100px, auto);
    gap: 1.5rem;
    margin: 4rem 0;
}

.bento-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 2.5rem;
    position: relative;
}

.bento-card:hover { border-color: var(--brand-red); }

.bento-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.bento-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--brand-red);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 5. Terminal & UI Elements */
.terminal-window {
    background: #000;
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-header {
    background: #1a1a1a;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }

.terminal-body {
    padding: 1.5rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--brand-red) transparent;
}

.terminal-body::-webkit-scrollbar {
    width: 4px;
}

.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-body::-webkit-scrollbar-thumb {
    background-color: var(--brand-red);
    border-radius: 10px;
}

/* 6. Comparison Matrix & Tables */
.matrix-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-muted);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border-muted);
}

th {
    background: rgba(255, 255, 255, 0.02);
    color: var(--brand-yellow);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
}

tr:hover { background: rgba(213, 16, 1, 0.02); }

.status-yes { color: #00ff00; font-weight: 900; }
.status-no { color: var(--brand-red); opacity: 0.5; }

/* 7. Gallery & Screenshots */
.gallery-item { display: block; }
.gallery-item:hover .screenshot-placeholder { border-style: solid; color: var(--brand-yellow); }

.mfp-bg { background: #020202; opacity: 0.95; z-index: 10000; }
.mfp-wrap { z-index: 10001; }

.mfp-close { 
    font-family: 'JetBrains Mono', monospace; 
    color: #fff !important; 
    background: var(--brand-red) !important;
    position: fixed !important; 
    top: 20px !important; 
    right: 20px !important; 
    width: 50px !important;
    height: 50px !important;
    line-height: 50px !important;
    font-size: 2rem !important; /* Made X bigger */
    text-align: center !important; /* Centered X */
    opacity: 1 !important;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(213, 16, 1, 0.4);
    z-index: 10002;
    cursor: pointer;
}

.mfp-arrow { 
    position: fixed !important; 
    top: 50% !important; 
    margin-top: -55px !important; 
    opacity: 1 !important;
    z-index: 10002;
}
.mfp-arrow-left { left: 20px !important; }
.mfp-arrow-right { right: 20px !important; }

.mfp-arrow-left:before { border-right: 27px solid var(--brand-red) !important; }
.mfp-arrow-right:before { border-left: 27px solid var(--brand-red) !important; }

/* Scrolling Lightbox for Tall Images */
img.mfp-img {
    max-height: none !important;
    width: 100%;
    max-width: 1200px;
    padding: 4rem 0 !important;
    margin: 0 auto;
    display: block;
}

.mfp-container {
    padding: 0 2rem;
    overflow-y: auto;
}

.mfp-bottom-bar {
    margin-top: -3rem; /* Adjust title/counter position relative to new padding */
}


/* 8. Interface Preview Slider */
.slider-container {
    position: relative;
}

.slider-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.slide {
    width: 100%;
    flex-shrink: 0;
}

.slider-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot.active {
    background: var(--brand-yellow);
    box-shadow: 0 0 10px var(--brand-yellow);
    transform: scale(1.3);
}

button#slider-prev:hover, button#slider-next:hover {
    background: var(--brand-red) !important;
    color: #fff !important;
}

/* 8. Responsiveness */
@media (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }
    .hub-grid { 
        display: block; 
    }
    .hub-sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        padding-right: 0;
        margin-bottom: 3rem;
    }
    .docs-content {
        padding: 1.5rem; /* Reduced padding for mobile */
    }
    .bento-card {
        padding: 1.5rem;
    }
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 1;
    }
}


/* 9. Agent Easter Egg */
.glitch-text {
    animation: glitch 0.2s linear infinite;
    color: var(--brand-red) !important;
}

@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 1px) }
    40% { transform: translate(-1px, -1px) }
    60% { transform: translate(2px, 1px) }
    80% { transform: translate(1px, -1px) }
    100% { transform: translate(0) }
}

.agent-link {
    color: var(--brand-red);
    text-decoration: underline;
}
.agent-link:hover {
    color: var(--brand-yellow);
}

/* 10. Honeypot Terminal Styles */
.aggressive-glitch {
    animation: aggressive-shake 0.1s linear infinite;
    box-shadow: inset 0 0 50px rgba(213, 16, 1, 0.4);
}

@keyframes aggressive-shake {
    0% { transform: translate(0, 0) }
    25% { transform: translate(4px, -4px) }
    50% { transform: translate(-4px, 4px) }
    75% { transform: translate(4px, 4px) }
    100% { transform: translate(0, 0) }
}

.tree-folder {
    color: var(--brand-yellow);
    cursor: pointer;
    user-select: none;
    display: block;
    margin-bottom: 0.25rem;
}
.tree-folder:hover {
    text-decoration: underline;
}

.tree-content {
    display: none;
    margin-left: 1.5rem;
    border-left: 1px solid var(--border-muted);
    padding-left: 0.5rem;
}

.tree-item {
    margin-bottom: 0.25rem;
}


/* 10. Masonry Gallery */
.masonry-grid {
    column-count: 3;
    column-gap: 2rem;
    margin-top: 2rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    display: inline-block;
    width: 100%;
}

.masonry-item .mock-window-body {
    height: auto !important;
    max-height: none !important;
    overflow: hidden;
}

/* 11. Mock Window Viewport (Replaces Placeholders) */

.mock-window {
    background: #050505;
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 2rem;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: border-color 0.3s ease;
}

.mock-window:hover {
    border-color: var(--brand-red);
}

.mock-window-header {
    background: #111;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-muted);
}

.mock-window-body {
    height: 350px;
    overflow-y: auto;
    position: relative;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--brand-red) #0a0a0a;
}

.mock-window-body::-webkit-scrollbar {
    width: 6px;
}
.mock-window-body::-webkit-scrollbar-track {
    background: #0a0a0a;
}
.mock-window-body::-webkit-scrollbar-thumb {
    background: var(--brand-red);
    border-radius: 3px;
}

.mock-window-body img {
    width: 100%;
    display: block;
}

.expand-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 5, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Let clicks pass through to the <a> tag */
}

.mock-window:hover .expand-overlay {
    opacity: 1;
}

.expand-tag {
    background: var(--brand-yellow);
    color: #000;
    padding: 0.5rem 1rem;
    font-weight: 900;
    border-radius: 4px;
}

/* 12. Opportunity Window Grid */
.opportunity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

@media (max-width: 1024px) {
    .opportunity-grid {
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .opportunity-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .timeline-visual {
        max-width: 400px;
        margin: 0 auto;
        text-align: left;
    }
}

/* 13. Compatibility Shield */
.compatibility-shield {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-muted);
}

.shield-dot {
    width: 8px;
    height: 8px;
    background: #00ff00;
    border-radius: 50%;
    box-shadow: 0 0 10px #00ff00;
    animation: shield-pulse 2s infinite;
}

@keyframes shield-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

/* 14. Pricing Matrix */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1100px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.price-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-muted);
    padding: 3rem 2rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.price-card:hover {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
    transform: translateY(-5px);
}

.price-card.featured {
    border-color: var(--brand-red);
    box-shadow: 0 0 40px rgba(213, 16, 1, 0.1);
    transform: scale(1.02);
    z-index: 5;
    transition: all 0.3s ease;
}

.price-card.featured:hover {
    border-color: var(--brand-red);
    box-shadow: 0 15px 50px rgba(213, 16, 1, 0.25);
    transform: scale(1.02) translateY(-5px);
}

.price-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
}

.price-period {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 3rem 0;
    text-align: left;
}

.feature-list li {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    position: relative;
}

.feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--brand-red);
    font-weight: bold;
}

.price-btn {
    display: block;
    padding: 1rem;
    border: 1px solid var(--border-muted);
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    margin-top: auto;
    transition: all 0.2s ease;
}

.price-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-main);
    color: #fff;
}

.price-btn.active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: #fff;
}

.price-btn.active:hover {
    background: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: #000;
    box-shadow: 0 5px 15px rgba(255, 199, 52, 0.3);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .price-card.featured {
        transform: none;
    }
}

@media (max-width: 900px) {
    .strategic-hero .container, 
    .terminal-deep-dive .container {
        grid-template-columns: 1fr !important;
        gap: 3rem !important;
    }
}

/* 15. Advanced Terminal Aesthetics */
.terminal-window {
    position: relative;
    overflow: hidden;
}

.terminal-window::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 10;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.aggressive-glitch {
    animation: chromatic-shift 0.2s infinite;
}

@keyframes chromatic-shift {
    0% { text-shadow: 2px 0 red, -2px 0 blue; transform: translate(1px, 1px); }
    25% { text-shadow: -2px 0 red, 2px 0 blue; transform: translate(-1px, -1px); }
    50% { text-shadow: 1px 0 red, -1px 0 blue; transform: translate(-1px, 1px); }
    75% { text-shadow: -1px 0 red, 1px 0 blue; transform: translate(1px, -1px); }
    100% { text-shadow: 2px 0 red, -2px 0 blue; transform: translate(0, 0); }
}

.telemetry-line {
    font-size: 0.75rem;
    padding: 0.1rem 0;
    border-left: 2px solid transparent;
    transition: 0.2s;
}

.telemetry-line:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: var(--brand-red);
}

.bot-tag {
    color: var(--brand-yellow);
    font-weight: bold;
}

.hit-tag {
    color: #00ff00;
    font-weight: bold;
}

@keyframes scanline {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
