/*
Theme Name: Hacker Shreyansh
Theme URI: https://hackershreyansh.blog
Author: Hacker Shreyansh
Author URI: https://hackershreyansh.blog
Description: A professional, dark-mode, security-focused theme for a cybersecurity personal brand.
Version: 1.0.0
Text Domain: hacker-shreyansh
*/

:root {
    /* Colors */
    --color-bg: #050505;
    --color-surface: #111111;
    --color-surface-hover: #1a1a1a;
    --color-text-main: #e0e0e0;
    --color-text-muted: #888888;
    --color-primary: #00ff41;
    /* Hacker Green */
    --color-primary-dim: rgba(0, 255, 65, 0.1);
    --color-accent: #00ced1;
    /* Cyan */
    --color-alert: #ff0055;
    --border-color: #2a2a2a;

    /* Spacing */
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 32px;
    --spacing-xl: 64px;

    /* Typography - FIX: Updated to web-safe Google Fonts */
    --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;
    --font-heading: 'Inter', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-med: 0.3s ease;
}

/* Reset & Basics */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text-main);
    font-family: var(--font-body);
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 0;
    font-family: var(--font-heading);
    color: #fff;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--color-accent);
    text-shadow: 0 0 5px var(--color-accent);
}

.text-primary {
    color: var(--color-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header */
.site-header {
    background-color: rgba(5, 5, 5, 0.9);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.site-branding .prompt-char {
    color: var(--color-primary);
    margin-right: var(--spacing-sm);
}

.site-title {
    margin: 0;
    font-size: inherit;
}

.site-title a {
    color: #fff;
}

.cursor {
    animation: blink 1s step-end infinite;
    color: var(--color-primary);
}

.custom-logo-wrapper img {
    max-height: 40px;
    width: auto;
    object-fit: contain;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Nav */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--spacing-lg);
}

.main-navigation a {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
    position: relative;
    padding-bottom: 2px;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width var(--transition-med);
}

.main-navigation a:hover::after,
.main-navigation li.current-menu-item a::after,
.main-navigation a.nav-active::after {
    width: 100%;
}

.main-navigation a:hover {
    color: var(--color-primary);
}

/* Active nav item */
.main-navigation li.current-menu-item > a,
.main-navigation a.nav-active {
    color: var(--color-primary);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-mono);
    padding: var(--spacing-sm);
    cursor: pointer;
}

/* Hero Section */
.section-hero {
    padding: 100px 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at center, #111 0%, #050505 70%);
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
}

.hero-title {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    line-height: 1.1;
}

.hero-description {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin-bottom: var(--spacing-lg);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    font-family: var(--font-mono);
    font-weight: bold;
    border: 1px solid transparent;
    cursor: pointer;
    margin-right: var(--spacing-md);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #000;
}

.btn-primary:hover {
    background-color: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-dim), 0 0 20px var(--color-primary-dim);
    text-shadow: 0 0 5px var(--color-primary);
}

.btn-outline {
    border-color: var(--color-text-muted);
    color: var(--color-text-muted);
}

.btn-outline:hover {
    border-color: #fff;
    color: #fff;
}

/* Sections */
section {
    padding: var(--spacing-xl) 0;
}

/* =========================================
   READING PROGRESS BAR
   ========================================= */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    z-index: 9999;
    box-shadow: 0 0 8px var(--color-primary);
    transition: width 0.1s linear;
}

/* =========================================
   SCROLL TO TOP BUTTON
   ========================================= */
#scroll-to-top {
    position: fixed;
    bottom: 90px;
    right: 22px;
    width: 42px;
    height: 42px;
    background: #0a0a0a;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-size: 14px;
    cursor: pointer;
    z-index: 9000;
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-med);
    pointer-events: none;
    box-shadow: 0 0 10px var(--color-primary-dim);
    font-family: var(--font-mono);
}

#scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#scroll-to-top:hover {
    background: var(--color-primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

/* =========================================
   HERO SECTION — MATRIX CANVAS
   ========================================= */
#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.35;
}

.hero-content {
    position: relative;
    z-index: 1;
}

/* CYBER STREAM TICKER */
.skills-ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #000;
    border-top: 1px solid #333;
    border-bottom: 1px solid #333;
    padding: 15px 0;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

.skills-ticker {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

.ticker-item {
    font-family: var(--font-mono);
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.ticker-sep {
    color: var(--color-primary);
    margin: 0 40px;
    font-weight: bold;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* Hover to pause */
.skills-ticker-wrap:hover .skills-ticker {
    animation-play-state: paused;
}

.section-title {
    font-size: 2rem;
    border-bottom: 2px solid var(--color-surface);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    background-color: var(--color-surface);
    padding: var(--spacing-lg);
    border: 1px solid #222;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.service-card .icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

/* Threats */
.threats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

/* Projects */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
}

.project-card {
    background-color: #0e0e0e;
    border: 1px solid #1f1f1f;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--color-primary);
}

.project-title {
    color: #fff;
    margin-bottom: var(--spacing-sm);
}

.project-tech {
    margin-bottom: var(--spacing-md);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tech-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-accent);
    background: rgba(0, 206, 209, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
}

.project-excerpt {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: var(--spacing-md);
}

.threat-card {
    border: 1px solid #333;
    padding: var(--spacing-md);
    position: relative;
    background: repeating-linear-gradient(45deg,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 0) 10px,
            rgba(255, 255, 255, 0.01) 10px,
            rgba(255, 255, 255, 0.01) 20px);
}

.threat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-alert);
}

.threat-date {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: var(--spacing-sm);
}

.read-more {
    display: inline-block;
    margin-top: var(--spacing-md);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: bold;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    background-color: var(--color-surface);
}

.footer-widgets {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-widgets h3 {
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
}

.social-links {
    list-style: none;
    padding: 0;
}

.social-links li {
    margin-bottom: var(--spacing-sm);
}

.social-links a {
    font-family: var(--font-mono);
}

.simple-subscribe form {
    display: flex;
    gap: var(--spacing-sm);
}

.simple-subscribe input {
    background: #000;
    border: 1px solid #333;
    padding: 8px 12px;
    color: #fff;
    font-family: var(--font-mono);
}

.simple-subscribe button {
    background: var(--color-primary);
    border: none;
    padding: 8px 16px;
    font-weight: bold;
    cursor: pointer;
}

.site-info {
    text-align: center;
    border-top: 1px solid #222;
    padding-top: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.crypto-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-top: 5px;
    opacity: 0.5;
}


/* =========================================
   Hacker Dossier (About Page)
   ========================================= */

.dossier-container {
    padding: 60px 20px;
    background: #050505;
    background-image:
        linear-gradient(rgba(0, 255, 65, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 65, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.dossier-card {
    max-width: 900px;
    width: 100%;
    background: #0a0a0a;
    border: 2px solid #333;
    padding: 40px;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', monospace;
}

/* Confidential Stamp */
.stamp-confidential {
    position: absolute;
    top: 20px;
    right: 20px;
    border: 3px double #ff0055;
    color: #ff0055;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    transform: rotate(-10deg);
    opacity: 0.7;
    letter-spacing: 2px;
    pointer-events: none;
}

/* Header */
.dossier-header {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.photo-frame {
    width: 150px;
    height: 150px;
    border: 2px solid #00ff41;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.operative-photo {
    max-width: 100%;
    filter: grayscale(100%) contrast(1.2);
}

.identity-info h1 {
    margin: 0;
    font-size: 32px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.identity-info .role {
    color: #00ff41;
    font-size: 16px;
    margin: 5px 0 15px 0;
    font-weight: bold;
}

.meta-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    font-size: 13px;
    color: #888;
    border-top: 1px dotted #333;
    padding-top: 10px;
}

.dossier-divider {
    border: 0;
    border-bottom: 2px solid #222;
    margin: 30px 0;
}

/* Sections */
.section-title {
    color: #00ff41;
    font-size: 20px;
    border-bottom: 1px solid #00ff41;
    padding-bottom: 5px;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.terminal-text {
    line-height: 1.6;
    color: #ccc;
    font-size: 15px;
}

/* Timeline */
.timeline {
    border-left: 2px solid #333;
    padding-left: 20px;
    margin-left: 5px;
}

.timeline-item {
    margin-bottom: 30px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #00ff41;
    border-radius: 50%;
}

.timeline-date {
    font-size: 12px;
    color: #666;
    display: block;
    margin-bottom: 5px;
}

.timeline-role {
    color: #fff;
    font-size: 16px;
    margin: 0 0 10px 0;
}

.timeline-details {
    padding-left: 20px;
    color: #aaa;
    font-size: 14px;
}

.timeline-details li {
    margin-bottom: 5px;
}

/* Skills Grid */
.dossier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Skill Bars */
.skill-item {
    margin-bottom: 20px;
}

.skill-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    color: #00ff41;
}

.progress-bar {
    height: 6px;
    background: #111;
    border: 1px solid #333;
}

.progress-fill {
    height: 100%;
    background: #00ff41;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

/* Certs */
.cert-list {
    list-style: none;
    padding: 0;
}

.cert-list li {
    margin-bottom: 20px;
    border-left: 2px solid #333;
    padding-left: 15px;
}

.cert-list strong {
    color: #fff;
    display: block;
}

.cert-list small {
    color: #666;
}

/* Footer Button */
.dossier-footer {
    margin-top: 50px;
    text-align: center;
}

.download-btn {
    display: inline-block;
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 15px 30px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    background: rgba(0, 255, 65, 0.1);
    transition: all 0.3s;
}

.download-btn:hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}


/* =========================================
   Code Lab (Compilers) V4.0 - ABSOLUTE POSITIONING
   =========================================*/
.codelab-container {
    position: fixed;
    /* Lock to viewport */
    top: 80px;
    /* Below Header */
    left: 0;
    right: 0;
    bottom: 0;
    background: #050505;
    z-index: 10;
    overflow: hidden;
    /* No scrolling allowed */
    display: flex;
    /* For Mobile fallback */
}

/* DO NOT redefine .site-header here - already set to sticky in global rules */
/* Code Lab needs header in normal flow */
.page-template-page-compilers .site-header {
    z-index: 20;
    position: relative;
    height: 80px;
}

/* Desktop: Absolute Layout */
@media (min-width: 1025px) {
    .codelab-container {
        display: block;
        /* Disable Flex for Absolute */
    }

    /* Main Content Area (Left) */
    .codelab-grid {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 350px;
        /* Leave room for sidebar */
        display: flex;
        flex-direction: column;
        border-right: 1px solid #333;
    }

    /* Sidebar (Right) */
    .ai-sidebar-section {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 350px;
        background: #0a0a0a;
        border-left: 1px solid #333;
        z-index: 15;
        box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
    }

    /* Editor Section */
    .compiler-section {
        height: 60%;
        /* Top 60% */
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .monaco-box {
        flex: 1;
        /* Fill remaining height of top section */
        min-height: 0;
        border: none;
    }

    /* IO Section */
    .io-grid {
        height: 40%;
        /* Bottom 40% */
        border-top: 1px solid #333;
        display: flex;
        flex-direction: row;
        background: #080808;
    }
}

/* Common Styles */
.ide-toolbar {
    height: 40px;
    background: #111;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    flex-shrink: 0;
}

.io-section,
.ide-terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    min-width: 0;
    height: 100%;
}

.terminal-header {
    height: 30px;
    background: #111;
    border-bottom: 1px solid #333;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #888;
    flex-shrink: 0;
}

.terminal-input,
.terminal-body {
    flex: 1;
    width: 100%;
    height: 100%;
    background: #080808;
    color: #00ff41;
    border: none;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    margin: 0;
    overflow-y: auto;
    white-space: pre-wrap;
}

.sidebar-header {
    height: 50px;
    background: #0e0e0e;
    border-bottom: 1px solid #222;
    padding: 0 15px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-header h3 {
    margin: 0;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00ff41;
    letter-spacing: 1px;
}

#ai-inline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

/* Chat Widget Internals - Scoped to Code Lab */
.codelab-container #hacker-ai-widget,
.codelab-container #ai-chat-window,
.codelab-container .ai-messages {
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.ai-input-area {
    flex-shrink: 0;
}

/* Mobile Responsive Fallback */
@media (max-width: 1024px) {
    .codelab-container {
        position: static;
        /* Normal flow */
        height: auto;
        overflow: visible;
        display: block;
        padding-top: 20px;
    }

    .codelab-grid,
    .ai-sidebar-section,
    .io-grid,
    .compiler-section {
        position: static;
        width: 100%;
        height: auto;
        display: block;
    }

    .compiler-section {
        height: 600px;
        /* Fixed height editor */
    }

    .monaco-box {
        height: 500px;
    }

    .io-grid {
        display: block;
        /* Stack */
    }

    .io-section,
    .ide-terminal {
        height: 250px;
        border-bottom: 1px solid #333;
    }

    .ai-sidebar-section {
        height: 600px;
        margin-top: 20px;
    }
}

.codelab-header {
    padding-bottom: 20px;
}

.lab-status {
    font-family: 'Courier New', monospace;
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.lab-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    /* Flush with content */
}

.lab-tab {
    background: #111;
    color: #888;
    border: 1px solid #333;
    border-bottom: none;
    padding: 15px 30px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.lab-tab:hover {
    background: #1a1a1a;
    color: #fff;
    box-shadow: 0 -5px 10px rgba(0, 255, 65, 0.1);
}

.lab-tab.active {
    background: #0a0a0a;
    color: #00ff41;
    border-top: 2px solid #00ff41;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
}

.lab-content {
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    min-height: 600px;
}

.compiler-box iframe {
    border: 1px solid #222;
    background: #000;
}


/* Main Layout Grid (Flex Row) */
.codelab-grid {
    display: flex;
    flex: 1;
    width: 100%;
    overflow: hidden;
    /* Prevent blowouts */
}

/* Left Column: Compiler + IO */
.compiler-section {
    flex: 1;
    /* Take remaining width */
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* CRITICAL for flex truncation */
    border-right: 1px solid #333;
}

/* Right Column: Sidebar (Fixed Width) */
.ai-sidebar-section {
    width: 350px;
    flex-shrink: 0;
    /* Don't shrink */
    height: 100%;
    background: #0a0a0a;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    background: #0e0e0e;
    border-bottom: 1px solid #222;
    padding: 15px;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #00ff41;
    margin: 0;
    text-transform: uppercase;
}

/* Toolbar */
.ide-toolbar {
    padding: 10px;
    background: #111;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    flex-shrink: 0;
}

/* Monaco Editor (Flex Child) */
.monaco-box {
    flex: 1;
    /* Take all available height */
    min-height: 0;
    /* Allow shrinking if IO gets big */
    width: 100%;
    border: none;
}

/* IO Grid (Bottom Pane) */
.io-grid {
    height: 250px;
    /* Fixed Height */
    flex-shrink: 0;
    /* Don't shrink */
    display: flex;
    /* Side by Side */
    border-top: 1px solid #333;
    background: #080808;
    margin-top: 0;
    /* Remove gap */
}

/* Standardize IO Children */
.io-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    min-width: 0;
}

.ide-terminal {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #080808;
}

.terminal-header {
    background: #111;
    border-bottom: 1px solid #333;
    padding: 5px 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #888;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.terminal-input,
.terminal-body {
    flex: 1;
    /* Fill remaining vertical space */
    width: 100%;
    background: #080808;
    color: #00ff41;
    border: none;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    resize: none;
    outline: none;
    margin: 0;
    white-space: pre-wrap;
    overflow-y: auto;
}

.terminal-input:focus {
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.terminal-body {
    border-top: none;
}

/* Pro Buttons */
.ide-controls {
    display: flex;
    gap: 10px;
}

.btn-micro {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-micro:hover {
    border-color: #00ff41;
    color: #00ff41;
    background: rgba(0, 255, 65, 0.05);
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #00ff41;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(0, 255, 65, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 255, 65, 0);
    }
}

#ai-inline-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Ensure Chat Widget Fills the Flex Box ONLY in Code Lab */
.codelab-container #hacker-ai-widget,
.codelab-container #ai-chat-window,
.codelab-container .ai-messages {
    height: 100% !important;
    display: flex;
    flex-direction: column;
}

.codelab-container .ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .codelab-container {
        height: auto;
        /* Allow scrolling */
        overflow: visible;
    }

    .codelab-grid {
        flex-direction: column;
    }

    .compiler-section {
        height: 800px;
        /* Fixed height for editor on mobile */
        border-right: none;
        border-bottom: 1px solid #333;
    }

    .ai-sidebar-section {
        width: 100%;
        height: 600px;
        /* Fixed height for chat on mobile */
        border-left: none;
    }

    .io-grid {
        flex-direction: column;
        height: auto;
    }

    .io-section,
    .ide-terminal {
        height: 200px;
        border-right: none;
        border-bottom: 1px solid #333;
    }
}


/* Mobile Responsive */
@media (max-width: 768px) {
    .dossier-grid {
        grid-template-columns: 1fr;
    }

    .dossier-header {
        flex-direction: column;
        text-align: center;
    }

    .meta-grid {
        text-align: left;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        background: var(--color-surface);
        position: absolute;
        top: 100%;
        left: 0;
        padding: var(--spacing-md);
        border-bottom: 1px solid var(--color-primary);
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

/* Scroll Indicator (Cyberpunk Edition) */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
    transition: all 0.3s;
    cursor: pointer;
    z-index: 10;
}

.scroll-indicator:hover {
    opacity: 1;
    bottom: 35px;
    /* Slight lift */
}

.scroll-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 8px;
    text-shadow: 0 0 5px rgba(0, 255, 65, 0.5);
    animation: blink 3s infinite;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    position: relative;
    margin-bottom: 5px;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
    transition: border-color 0.3s;
}

.scroll-indicator:hover .mouse {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.4);
}

.scroller {
    width: 4px;
    height: 4px;
    background: var(--color-primary);
    border-radius: 50%;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scroll 2.0s cubic-bezier(0.15, 0.41, 0.69, 0.94) infinite;
}

.arrow span {
    display: block;
    width: 12px;
    height: 12px;
    border-bottom: 2px solid var(--color-primary);
    border-right: 2px solid var(--color-primary);
    transform: rotate(45deg);
    animation: arrow 2s infinite;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}

@keyframes scroll {
    0% {
        opacity: 0;
        top: 6px;
    }

    30% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        top: 22px;
    }
}

@keyframes arrow {
    0% {
        opacity: 0;
        transform: rotate(45deg) translate(-5px, -5px);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: rotate(45deg) translate(5px, 5px);
    }
}

/* Fix for Entry Content Visibility */
.entry-content {
    color: #cccccc;
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 800px;
}

.entry-content h2,
.entry-content h3 {
    color: var(--color-primary);
    margin-top: 40px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.entry-content p {
    margin-bottom: 20px;
}


/* FIX FOR AVATAR OVERFLOW */
.photo-frame {
    overflow: hidden;
    flex-shrink: 0;
}

.operative-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* =========================================
   SOCIAL SHARE BUTTONS (Single Posts)
   ========================================= */
.share-buttons {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #333;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.share-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    letter-spacing: 1px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #0e0e0e;
    border: 1px solid #333;
    color: var(--color-text-muted);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    font-family: var(--font-mono);
}

.share-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-primary-dim);
    transform: translateY(-2px);
}

.share-copy {
    font-size: 16px;
}

/* =========================================
   HEADER SEARCH BAR
   ========================================= */
#header-search-toggle {
    background: none;
    border: 1px solid #333;
    color: var(--color-text-muted);
    padding: 6px 12px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 14px;
    transition: all var(--transition-fast);
    margin-left: 15px;
}

#header-search-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

#header-search-bar {
    display: none;
    background: #080808;
    border-bottom: 1px solid var(--color-primary);
    padding: 12px;
    box-shadow: 0 5px 20px rgba(0, 255, 65, 0.05);
}

#header-search-bar.visible {
    display: block;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#header-search-bar form {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

#header-search-bar input[type="search"] {
    flex: 1;
    background: #000;
    border: 1px solid #333;
    color: var(--color-primary);
    padding: 10px 15px;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
}

#header-search-bar input[type="search"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary-dim);
}

#header-search-bar button {
    background: var(--color-primary);
    color: #000;
    border: none;
    padding: 10px 20px;
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-fast);
}

#header-search-bar button:hover {
    background: #00cc33;
    box-shadow: 0 0 10px var(--color-primary);
}

/* =========================================
   READ TIME INDICATOR
   ========================================= */
.read-time {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-accent);
}

.meta-icon {
    margin-right: 4px;
}

/* =========================================
   BTN-GLITCH (Code Lab Run Button) - FIX
   ========================================= */
.btn-glitch {
    background: transparent;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: bold;
    padding: 8px 20px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn-glitch::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,255,65,0.1), transparent);
    transition: left 0.5s;
}

.btn-glitch:hover::before {
    left: 100%;
}

.btn-glitch:hover {
    background: var(--color-primary);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.btn-glitch:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* =========================================
   CONTACT PAGE IMPROVEMENTS
   ========================================= */
.contact-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 8px 0;
    border-bottom: 1px dashed #1a1a1a;
}

.detail-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    min-width: 120px;
    letter-spacing: 1px;
}

.status-online {
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}

/* =========================================
   SECTION TITLE CONSISTENCY FIX
   (dossier section-title overrides global)
   ========================================= */
.dossier-container .section-title {
    color: var(--color-primary);
    font-size: 20px;
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 5px;
    margin-bottom: 20px;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

/* =========================================
   GENERAL GLOBAL section-title
   (outside of dossier overrides)
   ========================================= */
.section-title:not(.dossier-container .section-title) {
    font-size: 2rem;
    border-bottom: 2px solid var(--color-surface);
    padding-bottom: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
}

/* =========================================
   SERVICE CARD ENHANCEMENTS
   ========================================= */
.service-card {
    background: linear-gradient(135deg, #111 0%, #0e0e0e 100%);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transform: scaleX(0);
    transition: transform var(--transition-med);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--color-primary-dim);
}

/* =========================================
   FOOTER ENHANCEMENTS
   ========================================= */
.site-footer {
    background: linear-gradient(180deg, #0a0a0a 0%, var(--color-surface) 100%);
}

.footer-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
}

/* =========================================
   MOBILE NAV ANIMATION
   ========================================= */
.main-navigation.toggled ul {
    animation: slideDown 0.25s ease-out;
}

/* =========================================
   SEARCH RESULTS PAGE
   ========================================= */
.search-results .container-archive {
    max-width: 1000px;
    margin: 40px auto;
}

/* =========================================
   CODE LAB: btn-back fix
   ========================================= */
.btn-back {
    display: inline-block;
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    transition: color var(--transition-fast);
    text-decoration: none;
}

.btn-back:hover {
    color: var(--color-primary);
}

/* =========================================
   SINGLE POST FEATURED IMAGE
   ========================================= */
.post-thumbnail {
    margin-bottom: 30px;
    border: 1px solid #333;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.9);
    transition: filter var(--transition-med);
}

.post-thumbnail img:hover {
    filter: brightness(1);
}

/* =========================================
   RELATED POSTS SECTION
   ========================================= */
.related-posts {
    margin-top: 50px;
    border-top: 1px dashed #333;
    padding-top: 30px;
}

.related-posts h3 {
    font-family: var(--font-mono);
    color: var(--color-primary);
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.related-item {
    background: #0a0a0a;
    border: 1px solid #222;
    padding: 15px;
    transition: all var(--transition-fast);
}

.related-item:hover {
    border-color: var(--color-primary);
    transform: translateY(-3px);
}

.related-item a {
    color: #ddd;
    font-size: 0.9rem;
    text-decoration: none;
    display: block;
}

.related-item a:hover {
    color: var(--color-primary);
}

/* =========================================
   MOBILE RESPONSIVE: New Elements
   ========================================= */
@media (max-width: 768px) {
    #header-search-toggle {
        display: none;
    }

    .share-buttons {
        gap: 8px;
    }

    .contact-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .detail-label {
        min-width: auto;
    }
}

/* =========================================
   ARCHIVE THUMBNAIL
   ========================================= */
.archive-thumb {
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid #1e1e1e;
    aspect-ratio: 16/9;
}

.archive-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.8) grayscale(20%);
    transition: filter var(--transition-med), transform var(--transition-med);
}

.archive-item:hover .archive-thumb img {
    filter: brightness(1) grayscale(0%);
    transform: scale(1.03);
}

/* =========================================
   HERO SECTION POSITION FIX
   (needed for absolute canvas overlay)
   ========================================= */
.section-hero {
    position: relative;
    overflow: hidden;
}

/* =========================================
   SECTION BG PATTERNS  
   ========================================= */
.section-services {
    background: linear-gradient(180deg, var(--color-bg) 0%, #0a0a0a 100%);
}

.section-threats {
    background: linear-gradient(180deg, #0a0a0a 0%, var(--color-bg) 100%);
}

/* =========================================
   SMOOTH PAGE TRANSITIONS
   ========================================= */
.site-main {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =========================================
   ADSENSE COMPLIANCE — Footer Sitemap
   ========================================= */
.footer-sitemap {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #222;
}

.footer-sitemap h4 {
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-sitemap ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-sitemap li {
    margin-bottom: 8px;
}

.footer-sitemap a {
    color: #888;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

.footer-sitemap a:hover {
    color: var(--color-primary);
    text-shadow: 0 0 5px var(--color-primary-dim);
}

/* =========================================
   ADSENSE COMPLIANCE — Editorial Content Blocks
   ========================================= */
.editorial-intro {
    margin-bottom: 30px;
}

.editorial-block {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--color-primary);
    padding: 30px;
    font-family: var(--font-body);
}

.editorial-block h2 {
    color: var(--color-primary);
    font-family: var(--font-mono);
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.editorial-block p {
    color: var(--color-text-main);
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.editorial-block a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.analyst-note {
    background: rgba(0, 255, 65, 0.05);
    border: 1px solid rgba(0, 255, 65, 0.15);
    padding: 15px 20px;
    margin: 15px 0;
}

.threat-level-badge {
    display: inline-block;
    background: rgba(255, 200, 0, 0.15);
    color: #ffcc00;
    border: 1px solid #ffcc00;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 3px 10px;
    letter-spacing: 2px;
    margin-left: 8px;
    vertical-align: middle;
}

/* Per-card analyst commentary */
.analyst-commentary {
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(0, 206, 209, 0.05);
    border-left: 2px solid var(--color-accent);
    font-size: 0.82rem;
}

.analyst-commentary .commentary-label {
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.analyst-commentary p {
    color: #999;
    margin: 5px 0 0 0;
    line-height: 1.5;
}

.analyst-commentary a {
    color: var(--color-accent);
}

/* =========================================
   ADSENSE COMPLIANCE — Header Search Form
   ========================================= */
.header-search-static {
    background: var(--color-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
    text-align: center;
}

.header-search-static form {
    display: inline-flex;
    gap: 8px;
    max-width: 400px;
    width: 100%;
}

.header-search-static input[type="search"] {
    background: #000;
    border: 1px solid #333;
    color: var(--color-text-main);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 6px 12px;
    flex: 1;
    outline: none;
}

.header-search-static input[type="search"]:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 5px var(--color-primary-dim);
}

.header-search-static button {
    background: var(--color-primary);
    color: #000;
    border: none;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 0.8rem;
    padding: 6px 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-search-static button:hover {
    background: #fff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .footer-sitemap {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .editorial-block {
        padding: 20px;
    }
}

