/* --- 1. THEME VARIABLES (Light/Dark Engine) --- */
:root {
    /* DARK MODE (Default) */
    --bg-body: #0a0a0a;
    --bg-card: #111111;
    --bg-card-alt: #0f0f0f;
    --text-main: #e0e0e0;
    --text-muted: #888888;
    --accent-orange: #ff6600;
    --border-color: #333;
    --font-heading: 'Rajdhani', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

[data-theme="light"] {
    /* LIGHT MODE */
    --bg-body: #f4f4f4;
    --bg-card: #ffffff;
    --bg-card-alt: #e8e8e8;
    --text-main: #1a1a1a;
    --text-muted: #555555;
    --accent-orange: #d95700;
    --border-color: #ccc;
}

/* --- 2. BASE RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-heading);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden; /* Prevents side-scrolling on mobile */
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 3. INDUSTRIAL SNIP EFFECT (The "Clip") --- */
.industrial-clip {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    /* The Snipped Corners Logic */
    clip-path: polygon(
        20px 0, 100% 0, 
        100% calc(100% - 20px), calc(100% - 20px) 100%, 
        0 100%, 
        0 20px
    );
    transition: transform 0.2s, box-shadow 0.2s;
}

.industrial-clip:hover {
    border-color: var(--accent-orange);
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

/* --- 4. NAVIGATION --- */
.forge-nav {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 20px 40px; 
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-body); /* Ensures nav isn't transparent */
}

.logo { font-size: 1.5rem; font-weight: 700; letter-spacing: 2px; white-space: nowrap; }
.hot-dot { color: var(--accent-orange); }

.nav-links { display: flex; list-style: none; gap: 30px; align-items: center; }
.nav-links a { font-family: var(--font-mono); font-size: 0.9rem; }

/* BUTTON STYLE */
.btn-forge {
    border: 1px solid var(--accent-orange); 
    color: var(--accent-orange);
    padding: 10px 20px; 
    text-transform: uppercase; 
    font-family: var(--font-mono);
    font-weight: bold;
    cursor: pointer;
    background: transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    
    /* The Snipped Corners for Buttons */
    clip-path: polygon(
        10px 0, 100% 0, 
        100% calc(100% - 10px), calc(100% - 10px) 100%, 
        0 100%, 
        0 10px
    );
}

.btn-forge:hover { 
    background: var(--accent-orange); 
    color: #fff; 
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.4);
}

.theme-toggle {
    background: none; border: 1px solid var(--border-color); color: var(--text-main);
    padding: 8px 12px; cursor: pointer; border-radius: 4px;
}

/* --- 5. HERO --- */
.hero { padding: 100px 0 60px; text-align: center; }
.glitch-text { font-size: 3.5rem; line-height: 1.1; margin-bottom: 20px; }
.subtitle { color: var(--text-muted); font-family: var(--font-mono); margin-bottom: 40px; }

.stat-grid { display: flex; justify-content: center; gap: 20px; margin-top: 40px; flex-wrap: wrap; }
.stat { padding: 15px 30px; text-align: center; min-width: 150px; background: var(--bg-card); }
.stat .val { display: block; font-size: 1.5rem; color: var(--accent-orange); font-weight: bold; }
.stat .label { font-size: 0.8rem; font-family: var(--font-mono); color: var(--text-muted); }

/* --- 6. GRID & CARDS --- */
/* Using minmax(300px, 1fr) usually works, but on mobile 300px might be too wide. 
   We will fix this in the Mobile Media Query section below. */
.portfolio-grid, .ai-grid, .grid-3 {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px; 
    margin-top: 40px;
    width: 100%;
}

/* Site Cards */
.site-card { display: flex; flex-direction: column; overflow: hidden; width: 100%; }
.browser-window {
    height: 200px; background: #000; border-bottom: 1px solid var(--border-color);
    overflow: hidden; position: relative;
}
.live-frame { width: 200%; height: 200%; border: 0; transform: scale(0.5); transform-origin: 0 0; pointer-events: none; }
.site-info { padding: 25px; flex-grow: 1; display: flex; flex-direction: column; }
.site-info h3 { margin-bottom: 10px; color: var(--text-main); }
.site-info p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; flex-grow: 1; }
.site-link { color: var(--accent-orange); font-weight: bold; font-family: var(--font-mono); font-size: 0.8rem; }
.git-stats { margin-bottom: 10px; font-size: 0.8rem; color: var(--text-muted); }
.git-stats span { margin-right: 15px; }
.play-btn { color: #fff; margin-right: 15px; font-size: 0.8rem; }
.action-row { margin-top: auto; }

/* AI Cards */
.ai-card { padding: 30px; text-align: center; }
.ai-icon { font-size: 2rem; color: var(--accent-orange); margin-bottom: 20px; }

/* Price Cards */
.price-card { padding: 40px; text-align: center; }
.price-tag { 
    display: inline-block; background: #333; color: #fff; 
    padding: 2px 10px; font-size: 0.8rem; margin: 10px 0; 
}
.price-card ul { list-style: none; text-align: left; margin: 20px 0; }
.price-card li { margin-bottom: 10px; color: var(--text-muted); }
.price-card i { color: var(--accent-orange); margin-right: 10px; }

/* --- 7. FOOTER & MODAL --- */
footer { margin-top: 100px; padding: 60px 0; border-top: 1px solid var(--border-color); }

.footer-newsletter {
    max-width: 600px; margin: 0 auto 60px; padding: 40px; text-align: center;
}
.newsletter-form { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-form input {
    flex-grow: 1; padding: 10px; background: var(--bg-body); 
    border: 1px solid var(--border-color); color: var(--text-main);
    min-width: 200px;
}

.footer-row { display: flex; justify-content: space-between; align-items: flex-end; }
.status .online { color: #00ff00; text-shadow: 0 0 10px #00ff00; }

/* Modal */
.modal {
    display: none; position: fixed; z-index: 1000; left: 0; top: 0;
    width: 100%; height: 100%; background-color: rgba(0,0,0,0.9);
}
.modal-content {
    margin: 10% auto; padding: 40px; max-width: 600px; width: 90%;
    background: var(--bg-card); color: var(--text-main);
}
.close { float: right; font-size: 28px; cursor: pointer; color: var(--accent-orange); }


/* --- 8. MOBILE OPTIMIZATION (THE FIX) --- */
@media (max-width: 768px) {
    
    /* 1. Navbar: Stack Vertically */
    .forge-nav {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 15px;
        width: 100%;
        text-align: center;
    }

    /* 2. Hero Text Size */
    .glitch-text { font-size: 2.5rem; }
    
    /* 3. Grid: Force 1 Column on Mobile to fix "Left Pull" */
    .portfolio-grid, .ai-grid, .grid-3 {
        grid-template-columns: 1fr; /* Takes full width available */
        margin-top: 20px;
    }

    /* 4. Footer: Stack Vertically */
    .footer-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    /* 5. Newsletter Form Stack */
    .newsletter-form {
        flex-direction: column;
    }
    .newsletter-form button {
        width: 100%; /* Full width button on mobile */
    }

    /* 6. General Spacing */
    .container { padding: 0 15px; }
    .industrial-clip { clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px); }
}