/* --- FONT OPTIMIZATION --- */
@font-face {
    font-family: 'Minecraft';
    /* PRO TIP: If you convert your .ttf to .woff2 (using a tool like CloudConvert),
       uncomment the line below for 30% faster loading:
       src: url('Minecraft.woff2') format('woff2'), url('Minecraft.ttf') format('truetype');
    */
    src: url('Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap; /* CRITICAL: Prevents invisible text during load */
}

/* Ensure the title uses the optimized font with a fallback */
.minecraft-title {
    font-family: 'Minecraft', 'Courier New', monospace;
}
:root {
    --bg-color: #0d0d0d;
    --card-bg: #161616;
    --text-main: #ffffff;
    --text-muted: #a1a1a1;
    --accent: #4cd964; /* Matching my System Online dot */
    --accent-glow: rgba(76, 217, 100, 0.25);
    --font-head: 'JetBrains Mono', monospace;
    --font-body: 'Inter', sans-serif;
    
    /* Language Colors */
    --js-color: #f1e05a;
    --css-color: #563d7c;
    --html-color: #e34c26;
    --ts-color: #2b7489;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-body);
    padding: 20px;
    min-height: 100vh;
}

/* Nav */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-muted);
    font-family: var(--font-head);
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-btn:hover { color: var(--text-main); }

.status-indicator {
    font-family: var(--font-head);
    font-size: 0.8rem;
    color: #4cd964;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator .dot {
    width: 8px;
    height: 8px;
    background: #4cd964;
    border-radius: 50%;
    box-shadow: 0 0 8px #4cd964;
}

/* Bento Grid Layout */
.bento-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(3, minmax(180px, auto));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Card Styling */
.card {
    background: var(--card-bg);
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    border-color: #444;
}

h3 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-family: var(--font-head);
}

/* 1. Hero */
.hero {
    grid-column: span 2;
    grid-row: span 2;
    justify-content: center;
    background: radial-gradient(circle at top right, #222, var(--card-bg));
}

.hero h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin: 10px 0;
    font-family: var(--font-head);
}

.highlight { color: var(--accent); }

.cta-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-head);
}

/* 3. Project Main */
.project-main {
    grid-column: span 2;
}

.link-btn {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 2px;
}

.tag {
    background: #4cd964; color: black; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; float: right;
}

/* 4. Socials */
.social {
    grid-column: span 1;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-icon {
    color: var(--text-main);
    text-decoration: none;
    padding: 8px;
    background: #222;
    border-radius: 8px;
    text-align: center;
}

.social-icon:hover { background: #333; }

/* 5. About */
.about {
    grid-column: span 2;
    justify-content: flex-start; /* This fixes the large gap */
    gap: 15px; /* Adds a small, clean space between title and text */
}

.about strong { 
    color: #FFBD44; /* macOS Minimize Yellow */
    font-weight: 700;
}

/* 6. Chat Link */
.chat-link {
    grid-column: span 1;
    flex-direction: row;
    align-items: center;
}

.circle-btn {
    width: 40px;
    height: 40px;
    background: var(--text-main);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
}

/* --- MOBILE OPTIMIZATION (Restored & Fixed) --- */
@media (max-width: 768px) {
    
    /* 1. Global Layout Fixes */
    body {
        padding: 10px; /* Tighter outer spacing to save screen space */
    }

    .bento-container {
        grid-template-columns: 1fr; /* Force single column stack */
        gap: 12px; /* Reduce gap between cards */
    }
    
    .card {
        padding: 15px; /* Shrink padding inside ALL cards */
        min-height: auto; /* Remove forced heights */
    }

    /* Force all cards to span full width */
    .hero, .stats, .project-main, .social, .about, .chat-link, .terminal-card {
        grid-column: span 1 !important; 
        grid-row: auto;
    }

    /* 2. TERMINAL FIX: Fluid Scaling (The "Don't Cut Lines" Fix) */
    .terminal-card {
        width: 100%;
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    .terminal-body {
        /* MAGIC LINE: Font size shrinks as screen shrinks (min ~10px, max ~13px) */
        font-size: clamp(0.65rem, 3.5vw, 0.85rem); 
        padding: 10px;
        line-height: 1.4;
    }

    .terminal-line {
        white-space: pre-wrap; /* CRITICAL: Allows code to wrap to next line if needed */
        word-break: break-word; /* Breaks long words so they don't overflow */
    }

    /* 3. PROJECTS PLATTER FIX: Reduce "Bigness" */
    .project-main h2 {
        font-size: 1.4rem; /* Smaller heading */
        margin-top: 5px;
    }

    .project-main p {
        font-size: 0.9rem; /* Smaller body text */
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    /* Fix Button Alignment (Centering the text) */
    .cta-btn {
        width: 100%; 
        display: flex !important; /* Force Flexbox */
        justify-content: center;
        align-items: center;
        padding: 14px 0;
        font-size: 0.9rem;
        height: auto;
    }

    /* 4. HERO SECTION FIXES */
    .glitch-header {
        /* Fluid scaling for your name */
        font-size: clamp(2rem, 10vw, 3rem); 
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    /* 5. Social Grid Tweak */
    .social-grid {
        gap: 8px;
    }
}

/* --- NEW TERMINAL STYLES (Added) --- */
.terminal-card {
    grid-column: span 2; 
    background: #0c0c0c;
    border: 1px solid #333;
    padding: 0; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.terminal-header {
    background: #1c1c1c;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
}

.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span { width: 12px; height: 12px; border-radius: 50%; }
.terminal-dots span:nth-child(1) { background: #ff5f56; } 
.terminal-dots span:nth-child(2) { background: #ffbd2e; } 
.terminal-dots span:nth-child(3) { background: #27c93f; } 

.terminal-title { 
    margin: 0 auto; 
    font-family: var(--font-head); 
    font-size: 0.8rem; 
    color: #666; 
    transform: translateX(-18px); 
}

.terminal-body {
    flex-grow: 1;
    padding: 15px;
    font-family: var(--font-head);
    font-size: 0.75rem;
    color: #4cd964; 
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.terminal-body::-webkit-scrollbar { display: none; }

.terminal-line { margin-bottom: 4px; white-space: nowrap; }

.typing-cursor::after { 
    content: '_'; 
    animation: blink 1s infinite; 
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
/* --- ASK CARLOS AI RENOVATION --- */

/* 1. Load the Minecraft Font */
@font-face {
    font-family: 'Minecraft';
    src: url('Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* 2. Redefine the Card Layout to Vertical */
.chat-link {
    grid-column: span 1; /* Keep it square */
    display: flex;
    flex-direction: column !important; /* Force vertical stacking */
    justify-content: space-between;
    align-items: flex-start !important; /* Align content to left */
    position: relative;
    overflow: hidden;
}

/* 3. Branding Styles */
.chat-header h3 {
    margin-bottom: 2px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.carlos-brand {
    font-family: 'Minecraft', monospace; /* Uses the custom font */
    font-size: 1.8rem;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: 0.5px;
}

.carlos-brand sup {
    font-family: 'Minecraft', monospace;
    font-size: 0.5em; /* Smaller 'ai' */
    color: var(--text-main);
    vertical-align: super;
    margin-left: 2px;
}

/* 4. Status Indicator (Visual Filler) */
.chat-status {
    font-size: 0.75rem;
    color: #4cd964; /* Green */
    background: rgba(76, 217, 100, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-head);
    margin-top: 10px;
}

.status-dot-blink {
    width: 6px;
    height: 6px;
    background: #4cd964;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* 5. Footer Layout */
.chat-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: auto; /* Pushes footer to bottom */
}

.chat-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 80px;
    line-height: 1.4;
    margin: 0;
}
.circle-btn i {
    color: #000000;
}
/* --- RENOVATED SOCIAL CARD --- */

.social {
    /* Keep it spanning 1 column */
    grid-column: span 1;
    display: flex;
    flex-direction: column;
}

.social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 buttons per row */
    gap: 12px;
    height: 100%; /* Fill the card */
    margin-top: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1f1f1f;
    border: 1px solid #333;
    border-radius: 12px;
    font-size: 1.5rem; /* Big Icons */
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Base Hover Effect: Lift and Brighten */
.social-btn:hover {
    transform: translateY(-4px);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
}

/* Specific Brand Glows */

/* GitHub: White Glow */
.social-btn.github:hover {
    box-shadow: 0 8px 16px rgba(255, 255, 255, 0.1);
    background: #24292e;
}

/* X (Twitter): Black/Grey Glow */
.social-btn.twitter:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    background: #000;
}

/* LinkedIn: Blue Glow */
.social-btn.linkedin:hover {
    box-shadow: 0 8px 16px rgba(0, 119, 181, 0.25);
    background: #0077b5;
}

/* Instagram: Gradient Background */
.social-btn.instagram:hover {
    box-shadow: 0 8px 16px rgba(193, 53, 132, 0.25);
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
}
/* --- HERO RENOVATION (Typewriter Edition) --- */

.hero {
    position: relative;
    overflow: hidden;
    z-index: 1;
    /* Ensure the card keeps its height during typing */
    min-height: 250px; 
}

/* 1. Cyber Grid Background */
.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: -1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* 2. Glitch Name Styling */
.glitch-header {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 10px 0;
    text-shadow: 0 0 20px rgba(76, 217, 100, 0.3)
}

/* 3. Typewriter Text Styling */
.hero-subtitle {
    font-size: 1.1rem;
    color: #ccc;
    font-family: var(--font-head); /* Monospace font looks best for typing */
    min-height: 1.6em; /* Prevents layout jump */
}

.typewriter-text {
    color: var(--accent); /* Makes the typing text yellow */
    font-weight: 600;
}

/* The Blinking Cursor */
.cursor {
    display: inline-block;
    width: 2px;
    background-color: var(--accent);
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 4. Enhanced Button */
.hero .cta-btn {
    margin-top: 25px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hero .cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}
/* --- BRUTALIST INDEX DESIGN (Professional Edition) --- */

.index-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 20px;
}

.index-header {
    border-bottom: 4px solid #fff; 
    padding-bottom: 30px;
    margin-bottom: 0;
}

/* CHANGED: Switched to Inter for maximum readability and "Pro" look */
.minecraft-title {
    font-family: 'Inter', sans-serif; /* Clean, bold font */
    font-weight: 800; /* Extra Bold */
    font-size: 3.5rem;
    color: #fff;
    margin-bottom: 10px;
    line-height: 1;
    letter-spacing: -2px; /* Tight tracking for modern feel */
}

.index-meta {
    font-family: 'JetBrains Mono', monospace;
    color: #888;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* The Project Row */
.project-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 10px;
    border-bottom: 1px solid #333;
    text-decoration: none !important;
    color: #fff !important;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    background: transparent;
}

/* Hover Effect */
.project-row:hover {
    background: #fff;
    color: #000 !important;
    padding-left: 20px;
    padding-right: 20px;
}

.row-left {
    display: flex;
    align-items: baseline;
    gap: 50px;
}

.p-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    color: #444;
    font-weight: 700;
}

.project-row:hover .p-id { color: #000; }

/* CHANGED: Switched Project Titles to Inter (Clean & Bold) */
.minecraft-heading {
    font-family: 'Inter', sans-serif; 
    font-weight: 700; 
    font-size: 2rem;
    color: #fff;
    margin: 0 0 8px 0;
    letter-spacing: -1px;
}

.project-row:hover .minecraft-heading { color: #000; }

/* Descriptions - Kept Monospace for "Tech" feel */
.p-desc {
    font-family: 'JetBrains Mono', monospace; 
    color: #888;
    font-size: 0.85rem; 
    margin: 0;
    font-weight: 400;
}

.project-row:hover .p-desc { color: #333; }

/* Right Side */
.row-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

.tech-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 1px;
}

.project-row:hover .tech-mono { color: #000; }

.arrow-icon {
    font-size: 1.5rem;
    color: #fff;
    transform: rotate(-45deg);
    transition: transform 0.3s;
}

.project-row:hover .arrow-icon {
    color: #000;
    transform: rotate(0deg) scale(1.1);
}

/* Mobile Fixes */
@media (max-width: 768px) {
    .minecraft-title { font-size: 2.2rem; }
    
    .project-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 25px 0;
    }
    
    .project-row:hover {
        background: transparent;
        color: #fff !important;
        padding-left: 0;
        padding-right: 0;
    }

    .row-left { gap: 0; width: 100%; flex-direction: column; }
    .p-id { display: none; }
    .row-right { width: 100%; justify-content: space-between; margin-top: 10px; }
    
    /* Disable hover colors on mobile */
    .project-row:hover .minecraft-heading,
    .project-row:hover .p-desc,
    .project-row:hover .tech-mono,
    .project-row:hover .arrow-icon {
        color: inherit;
    }
}