/* 
   ========================================================
   GNDME SYS.CORE // STYLE MATRIX
   --------------------------------------------------------
   AESTHETIC: TECHNICAL MINIMALISM / BRUTALISM
   
   - Approach: Utility-lite, focused on pure CSS variables.
   - Vitals: Zero heavy frameworks to ensure max performance.
   - Typography: Mono-spaced hierarchy for the terminal vibe.
   ========================================================
*/

   :root {
    /* Color Palette */
    --bg-dark: #070707;
    --text-main: #E0E0E0;
    --text-dim: #777777;
    --accent: #D4FF00; /* Chartreuse Neon */
    --accent-alt: #00E5FF; /* Cyan */
    --grid-color: rgba(255, 255, 255, 0.03);
    --border-dim: #222222;
    --border-active: #444444;

    /* Typography */
    --font-heading: 'Archivo Black', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Metrics */
    --pad-section: 6rem;
    --pad-global: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none; /* Hide default cursor */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-mono);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    /* Hide scrollbar for a cleaner look */
    scrollbar-width: none; 
}
body::-webkit-scrollbar { display: none; }

/* =========================================
   CUSTOM CURSOR
   ========================================= */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    mix-blend-mode: difference;
}

.cursor-crosshair {
    width: 24px;
    height: 24px;
    border: 1px solid var(--accent);
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
}
.cursor-crosshair::before, .cursor-crosshair::after {
    content: '';
    position: absolute;
    background: var(--accent);
}
.cursor-crosshair::before { top: 50%; left: -5px; right: -5px; height: 1px; transform: translateY(-50%); }
.custom-cursor.hovering .cursor-crosshair::before { display: none; }
.cursor-crosshair::after { left: 50%; top: -5px; bottom: -5px; width: 1px; transform: translateX(-50%); }
.custom-cursor.hovering .cursor-crosshair::after { display: none; }

.cursor-label {
    position: absolute;
    top: 30px;
    left: 15px;
    font-size: 0.6rem;
    color: var(--accent);
    letter-spacing: 1px;
    white-space: nowrap;
}

.custom-cursor.hovering .cursor-crosshair {
    width: 40px;
    height: 40px;
    background: rgba(212, 255, 0, 0.2);
    border-radius: 0; /* Square when hovering */
}

/* =========================================
   BACKGROUND & OVERLAYS
   ========================================= */
.tech-grid {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    pointer-events: none;
}

/* Corner Frames */
.frame-corner {
    position: fixed;
    width: 30px; height: 30px;
    border: 2px solid var(--border-active);
    z-index: 100;
    pointer-events: none;
}
.frame-tl { top: 20px; left: 20px; border-right: none; border-bottom: none; }
.frame-tr { top: 20px; right: 20px; border-left: none; border-bottom: none; }
.frame-bl { bottom: 20px; left: 20px; border-right: none; border-top: none; }
.frame-br { bottom: 20px; right: 20px; border-left: none; border-top: none; }

/* =========================================
   GLOBAL ELEMENTS
   ========================================= */
.section-padding {
    padding: var(--pad-section) var(--pad-global);
    max-width: 1400px;
    margin: 0 auto;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--border-active), var(--border-active) 10px, transparent 10px, transparent 20px);
    opacity: 0.5;
}

/* System Status Top Bar */
.sys-status {
    position: fixed;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.7rem;
    color: var(--text-dim);
    z-index: 90;
    letter-spacing: 2px;
}
.status-dot {
    width: 6px; height: 6px;
    background-color: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; box-shadow: 0 0 5px var(--accent); }
    50% { opacity: 0.2; box-shadow: 0 0 0px var(--accent); }
    100% { opacity: 1; box-shadow: 0 0 5px var(--accent); }
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 60px var(--pad-global) 20px;
    max-width: 1400px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border-dim);
}

.logo {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    line-height: 1;
    color: var(--text-main);
    letter-spacing: -1px;
    text-transform: uppercase;
}

.nav-metrics {
    display: flex;
    flex-direction: column;
    text-align: right;
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 60vh;
}

.hero-left .pronunciation {
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 6vw, 6rem);
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0;
}

.title-outline {
    color: transparent;
    -webkit-text-stroke: 1px var(--text-main);
}

.data-block {
    margin-bottom: 2.5rem;
    border-left: 2px solid var(--accent);
    padding-left: 1.5rem;
}
.data-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}
.data-value {
    font-size: 1.1rem;
    color: var(--text-main);
    max-width: 400px;
}
.directory-list {
    list-style: none;
    font-size: 0.9rem;
}
.directory-list li { margin-bottom: 0.5rem; }
.directory-list a,
.directory-list a:visited,
.directory-list a:active {
    color: var(--accent-alt) !important;
    text-decoration: none !important;
    font-weight: bold;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}
.directory-list a::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}
.directory-list a:hover { 
    color: var(--accent); 
    text-shadow: 0 0 8px rgba(212, 255, 0, 0.4);
}
.directory-list a:hover::after {
    transform: scaleX(1);
}
.cta-link {
    margin-top: 1.5rem !important;
}
.cta-link a {
    color: var(--accent) !important;
}
.cta-link a::after {
    background: var(--accent) !important;
}
.cta-link a:hover {
    text-shadow: 0 0 8px rgba(212, 255, 0, 0.4) !important;
}

/* =========================================
   ECOSYSTEM MODULES
   ========================================= */
.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 4rem;
}
.section-title {
    font-size: 1.2rem;
    color: var(--accent);
    font-weight: normal;
    letter-spacing: 3px;
    white-space: nowrap;
}
.header-line {
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-dim);
}

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

.module-card {
    position: relative;
    padding: 2rem;
    background: transparent;
    border: 1px solid var(--border-dim);
    transition: all 0.3s ease;
    overflow: hidden;
}

.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: var(--accent);
    transform: scaleY(0);
    transform-origin: bottom;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.module-card:hover {
    border-color: var(--accent);
    color: var(--bg-dark);
}
.module-card:hover::before {
    transform: scaleY(1);
}

.module-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 0.5rem;
    transition: border-color 0.3s, color 0.3s;
}
.module-card:hover .module-meta {
    border-color: rgba(0,0,0,0.2);
    color: var(--bg-dark);
}

.module-name {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    line-height: 1.2;
    min-height: 4.4rem; /* Exactly space for 2 lines */
    margin-bottom: 1rem;
}

.module-desc {
    font-size: 0.9rem;
    margin-bottom: 3rem;
    color: var(--text-dim);
    transition: color 0.3s;
}
.module-card:hover .module-desc {
    color: var(--bg-dark);
}

.module-footer {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    font-size: 0.75rem;
    font-weight: bold;
}
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--text-dim);
    transition: all 0.3s;
}
.module-card:hover .status-badge {
    border-color: var(--bg-dark);
}

/* =========================================
   FOOTER TERMINAL
   ========================================= */
.footer-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: end;
}

.terminal-box {
    border: 1px solid var(--border-active);
    background: #0a0a0a;
}
.terminal-header {
    background: var(--border-dim);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.term-btn {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--text-dim);
}
.term-title {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-main);
}
.terminal-body {
    padding: 1.5rem;
    font-size: 0.85rem;
}
.term-line {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}
.prompt {
    color: var(--accent);
    margin-right: 8px;
}
.term-link {
    color: var(--accent-alt);
    text-decoration: none;
}
.term-link:hover {
    text-decoration: underline;
    background: var(--accent-alt);
    color: var(--bg-dark);
}
.cursor-blink {
    animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.footer-meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.barcode {
    font-family: 'Libre Barcode 39', 'Courier New', Courier, monospace;
    font-size: 4rem;
    color: var(--text-main);
    margin-bottom: 0.8rem;
    letter-spacing: normal;
    font-weight: 400;
    position: relative;
    display: inline-block;
    padding: 0 10px;
}
.barcode::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--accent-alt);
    box-shadow: 0 0 10px var(--accent-alt), 0 0 20px var(--accent-alt);
    animation: scan-laser 2.5s ease-in-out infinite alternate;
    opacity: 0.8;
}
@keyframes scan-laser {
    0% { top: 0%; opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}
.copyright {
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 1px;
    border-top: 1px dashed var(--border-active);
    padding-top: 8px;
}

/* =========================================
   CASE STUDY MODAL SYSTEM
   ========================================= */
.clickable-card {
    cursor: none;
}
.clickable-card:hover .card-borders {
    border-color: var(--accent);
    box-shadow: inset 0 0 20px rgba(212, 255, 0, 0.05);
}

.cs-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cs-modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cs-modal-window {
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: var(--bg-main);
    border: 1px solid var(--border-active);
    box-shadow: 0 0 30px rgba(212, 255, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.cs-modal-overlay.active .cs-modal-window {
    transform: translateY(0);
}

.cs-modal-header {
    background: #0a0a0a;
    border-bottom: 1px solid var(--border-active);
    padding: 10px 15px;
    display: flex;
    align-items: center;
}
.cs-modal-controls {
    display: flex;
    gap: 8px;
    margin-right: 20px;
}
.cs-btn {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #333;
    cursor: none;
    transition: 0.2s;
}
.close-btn { background: #ff5f56; }
.min-btn { background: #ffbd2e; }
.max-btn { background: #27c93f; }
.close-btn:hover { box-shadow: 0 0 10px #ff5f56; }

.cs-modal-title {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.85rem;
    letter-spacing: 2px;
}

.cs-modal-body {
    padding: 2.5rem;
    overflow-y: auto;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
}
/* Custom Scrollbar for Modal Body */
.cs-modal-body::-webkit-scrollbar {
    width: 8px;
}
.cs-modal-body::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.cs-modal-body::-webkit-scrollbar-thumb {
    background: var(--border-active);
}

.cs-title {
    font-family: var(--font-heading);
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border-active);
    padding-bottom: 0.5rem;
    text-transform: uppercase;
}
.cs-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}
.cs-heading {
    color: var(--accent-alt);
    font-size: 1.2rem;
    margin: 2rem 0 1rem;
}
.cs-text {
    margin-bottom: 1.5rem;
}
.cs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.cs-card {
    border: 1px solid var(--border-dim);
    padding: 1rem;
    background: rgba(255,255,255,0.02);
}
.cs-card h4 {
    color: var(--text-main);
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}
.cs-card ul {
    list-style: none;
    color: var(--text-dim);
    font-size: 0.85rem;
}
.cs-card li { margin-bottom: 0.5rem; }
.cs-card li::before {
    content: "> ";
    color: var(--accent);
}
.cs-code-block {
    background: #050505;
    border: 1px solid var(--border-active);
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 2rem;
    color: var(--accent-alt);
    font-size: 0.85rem;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    cursor: none; /* Hide default, we will handle it with custom cursor */
}
/* Hide scrollbar for Chrome/Safari */
.cs-code-block::-webkit-scrollbar {
    display: none;
}
.cs-code-block.is-dragging {
    user-select: none;
}
.cs-code-block pre {
    margin: 0;
    font-family: inherit;
    pointer-events: none; /* Let the block handle events */
}
.cs-list {
    list-style: none;
}
.cs-list li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-dim);
}
.cs-list li::before {
    content: "[*]";
    position: absolute;
    left: 0;
    color: var(--accent);
}
.highlight {
    color: var(--text-main);
    font-weight: bold;
}

/* =========================================
   RESPONSIVE & TOUCH DEVICES
   ========================================= */
@media (max-width: 900px) {
    :root {
        --pad-section: 4rem;
        --pad-global: 1.5rem;
    }
    
    .navbar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding-top: 80px;
        gap: 15px;
    }
    
    .nav-metrics {
        text-align: center;
    }

    .hero-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .data-block {
        text-align: left;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .frame-corner { display: none; }
    
    /* Make title fit on mobile */
    .title {
        font-size: clamp(2.5rem, 8vw, 4rem);
    }
    
    .sys-status {
        width: 100%;
        justify-content: center;
        top: 15px;
    }
}

@media (max-width: 600px) {
    :root {
        --pad-section: 3rem;
        --pad-global: 1rem;
    }
    
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .module-name {
        font-size: 1.5rem;
        min-height: auto; /* Allow natural height on tiny screens */
    }
    
    .module-desc {
        font-size: 0.85rem;
    }
    
    .footer-meta {
        text-align: center;
        margin-top: 1rem;
    }
    
    .barcode {
        font-size: 1.5rem;
    }
    
    .terminal-body {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

/* Disable custom cursor on touch devices to improve responsiveness */
@media (pointer: coarse) {
    .custom-cursor { display: none !important; }
    * { cursor: auto !important; }
    a, button { cursor: pointer !important; }
}
