/* assets/css/style.css - Cyber-Industrial & Hardware Engineering Theme (v2) */

:root {
    --sidebar-w: 280px; 
    
    /* Hardware Accent Palette */
    --accent-red: #d32f2f;     
    --accent-gold: #f5a623;    
    --accent-glow: rgba(211, 47, 47, 0.15);
    
    /* Deep Industrial Dark Mode */
    --bg-body: #050507;        
    --bg-sidebar: #0a0b0e;     
    --bg-card: #0d0f12;        
    --bg-hover: #13161c;
    
    --primary-text: #ffffff;
    --body-text: #8b949e;
    
    --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
    --border-highlight: 1px solid rgba(255, 255, 255, 0.15);
    --box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8);
    
    --radius-soft: 0px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Reset & Base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { 
    scroll-behavior: smooth; 
    /* Firefox Support */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) var(--bg-body);
}
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-body); border-left: var(--border-subtle); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-red); }

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-body);
    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),
        radial-gradient(circle at top right, var(--accent-glow) 0%, transparent 40%);
    background-size: 30px 30px, 30px 30px, 100% 100%;
    background-attachment: fixed;
    color: var(--body-text);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* Custom Keyboard Focus State */
*:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 4px;
    border-radius: 2px;
}

/* Remove default focus from non-keyboard clicks */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ---------- Sidebar ---------- */
.navbar {
    width: var(--sidebar-w);
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    background: var(--bg-sidebar);
    border-right: var(--border-subtle);
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo { display: flex; align-items: center; gap: 15px; margin-bottom: 50px; }
.logo img { width: 50px; height: 50px; border-radius: 0; }
.logo-text { color: var(--primary-text); font-size: 1.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }

.nav-links { display: flex; flex-direction: column; list-style: none; gap: 12px; }
.nav-links a {
    display: block; 
    margin-bottom: 8px; 
    color: var(--body-text); 
    font-weight: 600; 
    padding: 14px 20px;
    text-decoration: none; 
    transition: var(--transition-smooth);
    background: transparent; 
    text-align: left; 
    font-size: 1.05rem;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: ''; position: absolute; left: 0; top: 0;
    height: 100%; width: 3px;
    background: var(--accent-red);
    transform: scaleY(0); transform-origin: bottom;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links a:hover { color: var(--primary-text); background: rgba(255, 255, 255, 0.03); }
.nav-links a:hover::before { transform: scaleY(1); transform-origin: top; }
.nav-links a.active { background: linear-gradient(90deg, rgba(211, 47, 47, 0.1) 0%, transparent 100%); color: #ffffff; }
.nav-links a.active::before { transform: scaleY(1); }

.mobile-menu-btn { display: none; }

/* ---------- Layout & Typography ---------- */
.main-content { margin-left: var(--sidebar-w); width: calc(100% - var(--sidebar-w)); padding-bottom: 60px; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.section { padding: 60px 0 30px 0; overflow: hidden; } 

h1, h2, h3 { color: var(--primary-text); font-weight: 700; text-transform: uppercase; }
h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 1rem; }
h2 { 
    font-size: 2.2rem; 
    padding-bottom: 15px; 
    letter-spacing: 1px; 
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}
h2::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 60px; height: 2px; background: var(--accent-red);
}
p { font-size: 1rem; } 

/* ---------- Seamless Hero & Banner ---------- */
.hero-wrapper {
    background: #000000; /* Pure black perfectly hides the image seams */
    width: 100%;
    margin-bottom: 40px;
    border-bottom: var(--border-subtle);
}
.top-banner-img { 
    width: 100%; height: 200px; object-fit: cover; display: block; 
    border-bottom: none; 
}
.hero-split { 
    display: grid; grid-template-columns: 1fr 1fr; min-height: 400px; align-items: stretch; 
}
.hero-text-half { 
    padding: 60px; display: flex; flex-direction: column; justify-content: center; 
}
.hero-image-half { 
    width: 100%; height: 100%; display: block; 
}
.hero-image-half img { 
    width: 100%; height: 100%; object-fit: cover; display: block; 
}

/* ---------- Hardware Project Cards ---------- */
.project-list { 
    display: grid; gap: 20px; 
    /* Changed auto-fill to auto-fit for perfect grid alignment */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
}
.highlight-container { display: grid; gap: 20px; }

.project-card {
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-soft);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-gold));
    transform: scaleX(0); transform-origin: left; transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
}

.project-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    background: var(--bg-hover);
    box-shadow: var(--box-shadow);
}
.project-card:hover::before { transform: scaleX(1); }

/* Changed: Removed opacity dimming */
.card-image { height: 240px; overflow: hidden; position: relative; border-bottom: var(--border-subtle); background: #000; }
.card-image img { 
    width: 100%; height: 100%; object-fit: cover; 
    opacity: 1; /* Fully visible */
    transform: translateZ(0); will-change: transform;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); 
}
.project-card:hover .card-image img { transform: scale(1.05); }

.card-content { padding: 30px; display: flex; flex-direction: column; flex-grow: 1; }
.card-title { margin-bottom: 15px; }

/* Changed: Added pre-wrap to fix JSON \n\n newlines */
.card-description { opacity: 0.85; margin-bottom: 25px; flex-grow: 1; white-space: pre-wrap; }

.card-tech { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 25px; }
.tech-tag {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--body-text);
    padding: 6px 12px; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
    transition: var(--transition-smooth);
}
.project-card:hover .tech-tag { border-color: rgba(255,255,255,0.15); color: var(--primary-text); }

.btn {
    display: inline-block; padding: 12px 28px; border-radius: 0;
    font-weight: 700; font-size: 0.9rem; text-decoration: none; cursor: pointer;
    transition: var(--transition-smooth); text-align: center; border: 1px solid transparent;
    text-transform: uppercase; letter-spacing: 1.5px;
}
.btn-primary { background: var(--accent-red); color: white !important; }
.btn-primary:hover { background: #b71c1c; box-shadow: 0 0 15px rgba(211,47,47,0.4); }
.btn-outline { background: transparent; border: 1px solid var(--body-text); color: var(--primary-text) !important; }
.btn-outline:hover { border-color: var(--primary-text); background: rgba(255,255,255,0.05); }

.highlight-card { flex-direction: row; grid-column: 1 / -1; }
.highlight-body { flex: 1; padding: 50px; display: flex; flex-direction: column; justify-content: center; border-right: var(--border-subtle); }
.highlight-card .card-image { flex: 1; height: auto; min-height: 400px; border-bottom: none; }

.form-control {
    width: 100%; padding: 18px; margin-bottom: 20px; border-radius: 0;
    background: rgba(0,0,0,0.4); border: var(--border-subtle); color: var(--primary-text);
    font-family: 'JetBrains Mono', monospace; transition: var(--transition-smooth); font-size: 0.9rem;
}
.form-control::placeholder { color: #555; }
.form-control:focus { outline: none; border-color: var(--accent-red); background: #000; box-shadow: inset 2px 0 0 var(--accent-red); }

/* ---------- Tech Stack & Creative Grid ---------- */
.tech-container { display: grid; gap: 30px; grid-template-columns: 1fr; }
.tech-category-card { background: var(--bg-card); border: var(--border-subtle); padding: 40px; transition: var(--transition-smooth); }
.tech-category-card:hover { border-color: var(--border-highlight); }
.tech-category-card h3 { color: var(--accent-red); margin-bottom: 25px; border-bottom: 1px dashed rgba(255,255,255,0.1); padding-bottom: 15px; }
.tech-pill-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.tech-pill {
    font-family: 'JetBrains Mono', monospace; background: #000; border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary-text); padding: 8px 16px; font-size: 0.85rem; transition: var(--transition-smooth); cursor: default;
}
.tech-pill:hover { background: var(--accent-red); border-color: var(--accent-red); transform: translateY(-2px); }

.creative-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.creative-item {
    position: relative; overflow: hidden; border: var(--border-subtle); aspect-ratio: 16/9; background: #000; transition: var(--transition-smooth);
}
.creative-item img {
    width: 100%; height: 100%; object-fit: cover; opacity: 1; /* Fully visible */
    transform: translateZ(0); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s;
}
.creative-item:hover { border-color: var(--accent-red); }
.creative-item:hover img { transform: scale(1.05); }

/* ---------- Industrial Footer ---------- */
.footer { background: var(--bg-sidebar); border-top: var(--border-subtle); padding: 60px 0 30px 0; margin-top: 80px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 50px; margin-bottom: 50px; }
.footer-brand { display: flex; flex-direction: column; gap: 20px; }
.footer-brand-header { display: flex; align-items: center; gap: 15px; }
.footer-brand-header img { width: 50px; height: 50px; filter: grayscale(100%); transition: filter 0.3s; }
.footer-brand-header:hover img { filter: grayscale(0%); }
.footer-title { font-size: 1.4rem; font-weight: 700; color: var(--primary-text); text-transform: uppercase; letter-spacing: 2px; }

.social-links { display: flex; gap: 12px; }
.social-links a {
    display: flex; justify-content: center; align-items: center;
    width: 40px; height: 40px; 
    min-width: 40px; max-width: 40px; /* Hard cage */
    background: rgba(255,255,255,0.02); border: var(--border-subtle);
    color: var(--body-text); transition: var(--transition-smooth);
}
.social-links a:hover { 
    background: var(--accent-red); border-color: var(--accent-red); color: white; transform: translateY(-3px); 
}
/* Secondary Social Highlight */
.social-links a.social-gold:hover { 
    background: var(--accent-gold); 
    border-color: var(--accent-gold); 
    color: #000; /* Black icon against gold looks super sharp */
}
.social-links svg { 
    width: 20px !important; height: 20px !important; 
    flex-shrink: 0; fill: currentColor; 
}
.footer-col h4 { color: #fff; text-transform: uppercase; letter-spacing: 1px; font-size: 0.95rem; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 10px;}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--body-text); text-decoration: none; transition: all 0.2s; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent-red); padding-left: 5px; }

.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 25px; border-top: var(--border-subtle);
    font-size: 0.8rem; color: #555; font-family: 'JetBrains Mono', monospace;
}

/* ---------- Animations ---------- */
.fade-up { opacity: 0; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1); }
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive Breakpoints ---------- */
@media (max-width: 1200px) {
    .hero-split { grid-template-columns: 1fr; gap: 0; }
    .hero-image-half { height: 300px; display: block; }
}

@media (max-width: 992px) {
    body { flex-direction: column; }
    .navbar { 
        width: 100%; height: auto; position: sticky; flex-direction: row; 
        justify-content: space-between; align-items: center; padding: 15px 20px; z-index: 1000;
        border-right: none; border-bottom: var(--border-subtle);
    }
    .main-content { margin-left: 0; width: 100%; }
    .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--bg-sidebar); padding: 20px; border-bottom: var(--border-subtle); }
    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; background: transparent; border: 1px solid var(--primary-text); color: var(--primary-text); padding: 10px 20px; border-radius: 0; font-family: inherit; font-weight: bold;}
    
    .highlight-card { flex-direction: column-reverse; }
    .highlight-body { border-right: none; border-top: var(--border-subtle); padding: 30px;}
    .container { padding: 0 15px; }
    h1 { font-size: 2.8rem; }
    
    .footer-grid { grid-template-columns: 1fr; gap: 40px; }
    .footer-bottom { flex-direction: column; text-align: left; gap: 15px; align-items: flex-start;}
}

/* ---------- System Update Banner ---------- */
.system-banner {
    background: rgba(245, 166, 35, 0.08);
    border-bottom: 1px solid rgba(245, 166, 35, 0.3);
    color: var(--primary-text);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    width: 100%;
}
.system-banner.hidden { 
    display: none !important; 
}
.system-banner a { 
    color: var(--accent-gold); 
    text-decoration: none; 
    font-weight: bold; 
    border-bottom: 1px dashed var(--accent-gold); 
    transition: var(--transition-smooth); 
}
.system-banner a:hover { 
    color: #fff; 
    border-bottom-color: #fff; 
}
.close-banner-btn {
    background: transparent; 
    border: none; 
    color: var(--body-text);
    cursor: pointer; 
    font-size: 1.2rem; 
    padding: 0 10px; 
    transition: color 0.2s;
    line-height: 1;
}
.close-banner-btn:hover { 
    color: var(--accent-red); 
}

@media (max-width: 992px) {
    .system-banner { padding: 12px 15px; font-size: 0.75rem; }
}

/* ---------- Card Button Spacing Fix ---------- */
.card-links {
    display: flex;
    flex-wrap: wrap;  /* Allows buttons to stack neatly on small screens */
    gap: 15px;        /* Exact horizontal and vertical spacing */
    margin-top: auto; /* Pushes buttons to the bottom of the card uniformly */
}

/* ---------- Store Grid & Modal Fix ---------- */
.store-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.modal-overlay {
    position: fixed; 
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(5, 5, 7, 0.95); /* Deep industrial black */
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; 
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(5px);
}

.modal-overlay.active { 
    opacity: 1; pointer-events: auto; 
}

.modal-content {
    background: var(--bg-card);
    border: var(--border-highlight); 
    border-radius: var(--radius-soft);
    width: 90%; max-width: 900px; max-height: 90vh;
    display: flex; flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,1);
    transform: scale(0.98) translateY(10px); 
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-content { 
    transform: scale(1) translateY(0); 
}

.modal-header {
    padding: 20px 30px; 
    border-bottom: var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
    background: #000;
}

.modal-header h2 { margin: 0; padding: 0; }
.modal-header h2::after { display: none; } /* Removes the red underline inside the modal */

.close-btn {
    background: transparent; border: 1px solid var(--body-text);
    color: var(--primary-text); padding: 8px 16px; cursor: pointer;
    font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    transition: var(--transition-smooth); font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
}

.close-btn:hover { background: var(--accent-red); border-color: var(--accent-red); color: white; }

.modal-body { 
    padding: 30px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; 
}

.cursor-blink {
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ==========================================================================
   MOBILE OVERHAUL (Phones & Small Tablets)
   Triggers automatically on screens 768px and smaller
   ========================================================================== */

@media (max-width: 768px) {
    
    /* 1. Remove Hero Image & Tighten Spacing */
    .hero-image-half { display: none !important; }
    .hero-split { grid-template-columns: 1fr; min-height: auto; }
    .hero-text-half { padding: 40px 20px; }
    h1 { font-size: 2.2rem; }

    /* 2. Force 2x2 Grid for Projects and Creative */
    .project-list, .creative-grid {
        grid-template-columns: 1fr 1fr !important; 
        gap: 12px;
    }

    /* 3. Compact the Project Cards */
    .card-description { 
        display: none !important; /* Hides description to save vertical space */
    }
    .card-content { 
        padding: 15px; 
    }
    .card-title { 
        font-size: 1rem; 
        margin-bottom: 10px; 
        line-height: 1.2;
    }
    .card-image { 
        height: 120px; /* Shorter images for mobile */
    }

    /* 4. Shrink Tags to fit 2-column mobile layout */
    .card-tech { 
        gap: 4px; 
        margin-bottom: 15px; 
    }
    .tech-tag {
        padding: 4px 6px;
        font-size: 0.6rem;
    }

    /* 5. Stack Buttons Vertically inside small cards */
    .card-links {
        flex-direction: column; /* Stacks buttons on top of each other */
        gap: 6px;
    }
    .btn {
        padding: 8px 10px;
        font-size: 0.7rem;
        width: 100%; /* Makes buttons stretch to fill the card */
        letter-spacing: 0.5px;
    }

    /* 6. Highlight Card adjustments */
    .highlight-body { 
        padding: 25px 20px; 
    }
    .highlight-card h1 { 
        font-size: 1.6rem !important; 
    }
    .highlight-card .card-image { 
        min-height: 200px; 
    }

    /* 7. Contact Grid Mobile Overrides */
    .contact-grid {
        grid-template-columns: 1fr !important; /* Stack contact vertically */
        gap: 20px !important;
    }
    .contact-card {
        padding: 25px !important;
    }
}