/* =========================================
   VARIABLES & THEME
========================================= */
:root {
    --bg-dark: #09090b;       
    --bg-card: #18181b;       
    --accent: #4ade80;        
    --accent-glow: rgba(74, 222, 128, 0.2);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    --font: 'Inter', sans-serif;
}

/* =========================================
   RESET & BASE STYLES
========================================= */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

html { 
    scroll-behavior: smooth; 
}

body { 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    font-family: var(--font); 
    overflow-x: hidden; 
}

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; 
    position: relative;
    z-index: 1;
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary {
    display: inline-block;
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--accent-glow);
    transform: translateY(-2px);
}

/* =========================================
   HERO SECTION
========================================= */
.hero { 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    position: relative; 
    overflow: hidden; 
}

/* Ambient "Juice" glow behind the header */
.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.08) 0%, transparent 65%);
    z-index: 0;
    pointer-events: none;
    animation: pulseGlow 8s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    0% { transform: translateX(-50%) scale(1); opacity: 0.6; }
    100% { transform: translateX(-50%) scale(1.1); opacity: 1; }
}

.brand-logo { 
    width: 100%; 
    max-width: 320px; 
    margin-bottom: 2rem; 
}

.hero h1 { 
    font-size: 4rem; 
    font-weight: 900; 
    margin-bottom: 1rem; 
    letter-spacing: -1px; 
}

.hero .subtitle { 
    font-size: 1.2rem; 
    color: var(--text-muted); 
    max-width: 600px; 
    margin: 0 auto 2.5rem; 
    line-height: 1.6; 
}

/* =========================================
   ABOUT SECTION
========================================= */
.about-section { 
    padding: 100px 0; 
    background: linear-gradient(to bottom, var(--bg-dark), var(--bg-card)); 
}

.about-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 50px; 
    align-items: center; 
}

.about-text h2 { 
    font-size: 2.5rem; 
    margin-bottom: 1.5rem; 
    color: var(--accent); 
}

.about-text p { 
    font-size: 1.1rem; 
    line-height: 1.8; 
    color: var(--text-muted); 
    margin-bottom: 1rem; 
}

.skills-container { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
}

.skill-tag { 
    background: rgba(255,255,255,0.05); 
    padding: 10px 20px; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.1); 
    transition: all 0.3s; 
    cursor: default; 
}

.skill-tag:hover { 
    background: var(--accent-glow); 
    border-color: var(--accent); 
    color: var(--accent); 
    transform: scale(1.05); 
}

/* =========================================
   PORTFOLIO GRID
========================================= */
.portfolio-section { 
    padding: 100px 0; 
}

.section-title { 
    font-size: 2.5rem; 
    text-align: center; 
    margin-bottom: 3rem; 
}

.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 
    gap: 30px; 
}

.card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
}

.card:hover { 
    transform: translateY(-10px); 
    border-color: var(--accent); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.5); 
}

.card-img-wrapper { 
    position: relative; 
    width: 100%;
    aspect-ratio: 2 / 1; 
    overflow: hidden; 
}

.card-bg { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s; 
    opacity: 0.6; 
}

.card:hover .card-bg { 
    transform: scale(1.1); 
    opacity: 1; 
}

/* Content area is positioned relatively */
.card-content { 
    position: relative;
    padding: 35px 20px 20px; 
    z-index: 5;
}

/* Logo pulls upwards by exactly half its height */
.card-logo { 
    position: absolute; 
    top: -30px; 
    left: 20px; 
    width: 60px; 
    height: 60px; 
    border-radius: 12px; 
    border: 3px solid var(--bg-card); 
    background: #fff; 
    z-index: 10; 
    object-fit: contain;
}

.card-content h3 { 
    font-size: 1.5rem; 
    margin-bottom: 10px; 
}

.card-content p { 
    color: var(--text-muted); 
    font-size: 0.95rem; 
    line-height: 1.5; 
}

/* --- BADGES (NEW HIERARCHY) --- */
.badges { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 8px; 
    margin-bottom: 15px; 
}

.badge { 
    font-size: 0.70rem; 
    text-transform: uppercase; 
    padding: 5px 10px; 
    border-radius: 6px; 
    font-weight: 800; 
    letter-spacing: 0.5px;
}

/* Solid Green for Category/Industry */
.badge-category {
    background: var(--accent);
    color: var(--bg-dark);
}

/* Outlined for Platforms */
.badge-platform {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* =========================================
   MODALS (SLIDE-OUT PANELS)
========================================= */
.modal-overlay { 
    position: fixed; 
    inset: 0; 
    background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); 
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.3s; 
    z-index: 100; 
}

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

.project-modal {
    position: fixed; 
    top: 0; 
    right: -100%; 
    width: 100%; 
    max-width: 650px; 
    height: 100vh;
    background: var(--bg-card); 
    z-index: 101; 
    overflow-y: auto;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.project-modal.active { 
    right: 0; 
}

.close-modal { 
    position: absolute; 
    top: 20px; 
    right: 20px; 
    background: rgba(0,0,0,0.5); 
    color: #fff; 
    border: none; 
    width: 40px; 
    height: 40px; 
    border-radius: 50%; 
    font-size: 1.5rem; 
    cursor: pointer; 
    z-index: 15; 
    transition: background 0.2s; 
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.close-modal:hover { 
    background: var(--accent); 
    color: var(--bg-dark); 
}

.modal-body { 
    padding: 40px; 
    position: relative; 
}

.modal-logo { 
    position: absolute; 
    top: -40px; 
    left: 40px; 
    width: 80px; 
    height: 80px; 
    border-radius: 16px; 
    border: 4px solid var(--bg-card); 
    background: #fff; 
    object-fit: contain;
}

.modal-body h2 { 
    font-size: 2.5rem; 
    margin-bottom: 10px; 
}

.modal-tech { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 10px; 
    margin-bottom: 25px; 
    align-items: center;
}

.tech-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 5px;
}

.tech-tag { 
    background: #333; 
    padding: 5px 12px; 
    border-radius: 4px; 
    font-size: 0.85rem; 
    color: #ddd; 
}

.modal-desc p { 
    color: var(--text-muted); 
    line-height: 1.8; 
    font-size: 1.1rem; 
    margin-bottom: 1.5rem; 
}

/* =========================================
   SLIDESHOW (INSIDE MODALS)
========================================= */
.slideshow-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    background: #000;
}

.slide { 
    display: none; 
    width: 100%; 
    height: 100%; 
}

.slide.active { 
    display: block; 
    animation: fadeSlide 0.4s ease-in-out; 
}

.modal-hero-img { 
    width: 100%; 
    height: 100%;
    object-fit: cover; 
}

@keyframes fadeSlide { 
    from { opacity: 0.4; } 
    to { opacity: 1; } 
}

.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.prev-slide { left: 15px; }
.next-slide { right: 15px; }
.slide-nav:hover { background: var(--accent); color: var(--bg-dark); transform: translateY(-50%) scale(1.1); }


/* =========================================
   CONTACT SECTION
========================================= */
.contact-section { 
    padding: 100px 0; 
    text-align: center; 
    background: var(--bg-card); 
}

.contact-section h2 { 
    margin-bottom: 40px; 
    font-size: 2.5rem; 
}

.contact-form { 
    max-width: 600px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}

.contact-form input, 
.contact-form textarea { 
    width: 100%; 
    padding: 15px; 
    border-radius: 8px; 
    border: 1px solid rgba(255,255,255,0.1); 
    background: var(--bg-dark); 
    color: #fff; 
    font-size: 1rem; 
    font-family: inherit; 
    transition: border-color 0.3s; 
}

.contact-form input:focus, 
.contact-form textarea:focus { 
    outline: none; 
    border-color: var(--accent); 
}

/* =========================================
   ANIMATIONS & EFFECTS
========================================= */
.fade-in-up { 
    animation: fadeInUp 1s ease forwards; 
}

@keyframes fadeInUp { 
    from { opacity: 0; transform: translateY(30px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.scroll-anim { 
    opacity: 0; 
    transform: translateY(30px); 
    transition: opacity 0.6s ease-out, transform 0.6s ease-out; 
}

.scroll-anim.visible { 
    opacity: 1; 
    transform: translateY(0); 
}

noscript .scroll-anim {
    opacity: 1;
    transform: translateY(0);
}

/* =========================================
   RESPONSIVE DESIGN (MOBILE)
========================================= */
@media (max-width: 768px) {
    .brand-logo { 
        max-width: 220px; 
    }
    
    .about-grid { 
        grid-template-columns: 1fr; 
    }
    
    .hero h1 { 
        font-size: 2.5rem; 
    }
    
    .project-modal { 
        right: 0; 
        top: 100%; 
        max-width: 100%; 
        transition: top 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    }
    
    .project-modal.active { 
        top: 0; 
    }
}