/* =========================================
   CSS VARIABLES & RESET
   ========================================= */
:root {
    /* Dark Mode (Default Variables) */
    --bg-dark: #050505;
    --bg-card: #0f0f11;
    --bg-card-hover: #161618;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --electric-blue: #00F0FF;
    --electric-blue-dim: rgba(0, 240, 255, 0.15);
    --border-color: #2a2a2a;
    
    --font-head: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* UI Shapes */
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 999px;
    
    /* Mobile Nav - iOS Style Variables */
    --dock-glass: rgba(20, 20, 20, 0.65);
    --dock-border: rgba(255, 255, 255, 0.1);
    --dock-shadow: 0 20px 40px rgba(0,0,0,0.4);
    --pill-bg: rgba(255, 255, 255, 0.1);
}

/* Light Mode Variables Override */
[data-theme="light"] {
    --bg-dark: #ffffff;
    --bg-card: #f8f9fa;
    --bg-card-hover: #f0f0f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --electric-blue: #007AFF;
    --electric-blue-dim: rgba(0, 122, 255, 0.1);
    --border-color: #e2e8f0;
    
    --dock-glass: rgba(255, 255, 255, 0.55);
    --dock-border: rgba(255, 255, 255, 0.6);
    --dock-shadow: 0 20px 40px rgba(0,0,0,0.15);
    --pill-bg: rgba(0, 122, 255, 0.1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevents horizontal scrollbars */
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
section { padding: 100px 20px; max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }

/* =========================================
   UTILITIES & BACKGROUND
   ========================================= */
.text-blue { color: var(--electric-blue); }

#bg-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none;
    /* Added transition to prevent flicker when switching themes/states */
    transition: opacity 0.5s ease;
}

.reveal { opacity: 0; transform: translateY(30px); transition: all 0.8s ease-out; }
.reveal.active { opacity: 1; transform: translateY(0); }

/* =========================================
   HEADER / NAVBAR
   ========================================= */
header {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(var(--bg-dark), 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
[data-theme="light"] header { border-color: rgba(0,0,0,0.05); }

nav {
    display: flex; justify-content: space-between; align-items: center;
    height: 70px; max-width: 1200px; margin: 0 auto; padding: 0 20px;
}

.logo {
    font-family: var(--font-head);
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.5px;
}
.logo span { color: var(--electric-blue); }

.nav-actions { display: flex; align-items: center; gap: 20px; }

.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a {
    font-size: 0.9rem; color: var(--text-muted); position: relative; font-weight: 500;
}
.nav-links a:hover, .nav-links a.active { color: var(--text-main); }

/* Theme Toggle */
.theme-wrapper { position: relative; display: inline-block; z-index: 1002; }
.theme-btn {
    background: transparent; border: none; color: var(--text-muted);
    width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 1.2rem;
}
.theme-btn:hover { color: var(--text-main); background: var(--bg-card-hover); }

.theme-dropdown {
    position: absolute; top: 120%; right: 0;
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 5px; min-width: 150px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s ease; z-index: 2000;
}
.theme-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }

.theme-option {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
    padding: 10px 15px; border: none; background: transparent;
    color: var(--text-muted); cursor: pointer; font-family: var(--font-body);
    font-size: 0.9rem; border-radius: var(--radius-sm); transition: var(--transition);
}
.theme-option:hover { background: var(--bg-card-hover); color: var(--text-main); }
.theme-option.active { background: rgba(0, 240, 255, 0.1); color: var(--electric-blue); font-weight: 600; }
[data-theme="light"] .theme-option.active { background: rgba(0, 122, 255, 0.1); }
.theme-option .check-icon { opacity: 0; transform: scale(0); transition: all 0.2s; font-size: 0.8rem;}
.theme-option.active .check-icon { opacity: 1; transform: scale(1); }

/* Desktop CTA Button */
.desktop-cta {
    background: var(--electric-blue); color: #000 !important;
    padding: 10px 24px; border-radius: var(--radius-full);
    font-family: var(--font-head); font-weight: 700; border: none;
    cursor: pointer; transition: var(--transition);
}
[data-theme="light"] .desktop-cta { color: #fff !important; }
.desktop-cta:hover { transform: translateY(-2px); }

/* =========================================
   GENERAL BUTTONS
   ========================================= */
.btn-primary {
    background: var(--electric-blue); color: #000 !important;
    padding: 14px 30px; border-radius: var(--radius-full);
    font-family: var(--font-head); font-weight: 700; border: none;
    cursor: pointer; transition: var(--transition); font-size: 1rem;
    display: inline-flex; justify-content: center; align-items: center;
}
[data-theme="light"] .btn-primary { color: #fff !important; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 0 25px var(--electric-blue-dim); }

/* =========================================
   MOBILE BOTTOM NAVIGATION
   ========================================= */
.mobile-bottom-nav {
    display: none; /* Hidden by default (desktop) */
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    
    background: var(--dock-glass);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    
    border: 1px solid var(--dock-border);
    border-radius: 50px;
    padding: 6px 10px;
    z-index: 2000;
    width: auto;
    box-shadow: var(--dock-shadow);
    
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.nav-item-mobile {
    display: flex; align-items: center; justify-content: center;
    height: 45px; width: 45px; border-radius: 50%;
    color: var(--text-muted); background: transparent;
    cursor: pointer; overflow: hidden;
    transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.3s ease, color 0.3s ease;
}

.nav-item-mobile i {
    font-size: 1.3rem; flex-shrink: 0; transition: transform 0.3s ease;
}

.nav-item-mobile span {
    font-family: var(--font-head); font-weight: 600; font-size: 0.85rem;
    max-width: 0; opacity: 0; white-space: nowrap; margin-left: 0;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); transform: translateX(10px);
}

/* Active State Expansion */
.nav-item-mobile.active {
    width: 120px; background: var(--pill-bg); border-radius: 30px; color: var(--text-main);
}
[data-theme="light"] .nav-item-mobile.active { color: var(--electric-blue); }
.nav-item-mobile.active i { color: inherit; }
.nav-item-mobile.active span {
    max-width: 100px; opacity: 1; margin-left: 8px; transform: translateX(0);
}

/* =========================================
   HERO SECTION
   ========================================= */
.hero {
    min-height: 90vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 50px;min-width: 0;
}

.hero-visual { display: flex; justify-content: center; perspective: 1000px; }

/* 3D Tilt Elements (Smooth return transition) */
.js-tilt {
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.portrait-placeholder {
    width: 100%;
    max-width: 450px;   /* slightly smaller */
    aspect-ratio: 1 / 1.1;
    flex-shrink: 1;     /* allow smooth shrinking */
}

/* Decorative Corners */
.portrait-placeholder::before, .portrait-placeholder::after {
    content: ''; position: absolute; width: 30px; height: 30px;
    border: 3px solid var(--electric-blue); transition: all 0.4s ease;
}
.portrait-placeholder::before {
    top: -10px; left: -10px; border-right: none; border-bottom: none; border-top-left-radius: 12px;
}
.portrait-placeholder::after {
    bottom: -10px; right: -10px; border-left: none; border-top: none; border-bottom-right-radius: 12px;
}

.portrait-text { text-align: center; color: var(--electric-blue); font-family: var(--font-head); font-size: 0.9rem; margin-top: 15px; }

.status-badge {
    display: inline-flex; align-items: center; padding: 6px 14px;
    border: 1px solid var(--electric-blue-dim); background: var(--electric-blue-dim);
    color: var(--electric-blue); font-size: 0.8rem; font-weight: 500;
    border-radius: var(--radius-full); margin-bottom: 20px;
}
.status-badge i { margin-right: 8px; font-size: 0.6rem; animation: blink 2s infinite; }

.hero-content h1 {
    font-family: var(--font-head); font-size: 4rem; line-height: 1.1; margin-bottom: 20px;
}
.hero-content h1 span { color: var(--text-muted); }
.hero-content p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 30px; max-width: 500px; }

.hero-btns { display: flex; gap: 15px; align-items: center; }

.btn-hero {
    background: transparent; color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 12px 24px; border-radius: var(--radius-full);
    font-family: var(--font-head); font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.btn-hero:hover { border-color: var(--electric-blue); color: var(--electric-blue); }

.social-icon {
    width: 45px; height: 45px; border: 1px solid var(--border-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: var(--transition); font-size: 1.2rem;
}
.social-icon:hover { border-color: var(--electric-blue); color: var(--electric-blue); transform: translateY(-3px); }

/* =========================================
   SKILLS SECTION
   ========================================= */
.section-header { margin-bottom: 50px; }
.section-header h2 { font-family: var(--font-head); font-size: 2.5rem; margin-bottom: 10px; }
.section-header h2 span { color: var(--electric-blue); }

.skills-wrapper { display: flex; flex-direction: column; gap: 40px; }
.skill-category-title {
    font-family: var(--font-head); font-size: 1rem; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 2px; margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.skill-category-title::after { content: ''; height: 1px; flex-grow: 1; background: var(--border-color); }

.skills-cloud { display: flex; flex-wrap: wrap; gap: 15px; }

.skill-pill {
    background: rgba(255, 255, 255, 0.06);                /* soft transparent layer */
    border: 1px solid rgba(255, 255, 255, 0.15);          /* subtle frosted border */
    backdrop-filter: blur(12px) saturate(180%);           /* iOS glass effect */
    -webkit-backdrop-filter: blur(12px) saturate(180%);   

    border-radius: 50px;
    padding: 12px 24px;

    display: inline-flex;
    align-items: center;
    gap: 12px;

    font-size: 1rem;
    font-weight: 500;
    color: var(--text-main);

    transition: all 0.3s ease;
    cursor: default;
border: 1px solid var(--border-color);
    /* box-shadow: 0 8px 25px rgba(0,0,0,0.25);              smooth shadow */
}

/* Hover (iOS Glow) */
.skill-pill:hover {
    background: rgba(255, 255, 255, 0.18);                /* stronger glass */
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.40);
}

.skill-pill i { font-size: 1.2rem; }
.icon-html { color: #E34F26; }
.icon-css { color: #1572B6; }
.icon-js { color: #F7DF1E; }
.icon-php { color: #777BB4; }
.icon-wp { color: #21759B; }
.icon-gsheets { color: #0F9D58; }
.icon-looker { color: #4285F4; }
.icon-apps { color: #FBBC04; }
.icon-sheet { color: #0F9D58; }

/* =========================================
   PROJECTS SECTION
   ========================================= */
.project-list-container { display: flex; flex-direction: column; gap: 20px; }

.project-item {
    display: grid; grid-template-columns: 0.5fr 2fr 1.5fr 0.5fr;
    align-items: center; padding: 35px 30px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md); 
    background: rgba(255,255,255,0.01);
    transition: var(--transition); position: relative; margin-bottom: 0;
}
.project-item:hover {
    background: var(--bg-card); border-color: var(--electric-blue-dim);
    transform: scale(1.01); box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
[data-theme="light"] .project-item:hover { box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

.pj-id { font-family: var(--font-head); color: var(--electric-blue); font-size: 2.5rem; font-weight: 700; opacity: 0.4; line-height: 1; }
.pj-title { font-family: var(--font-head); font-size: 1.5rem; font-weight: 600; margin: 0; }
.pj-desc {
    font-size: 0.9rem; color: var(--text-muted); max-width: 90%;
    max-height: 0; opacity: 0; overflow: hidden; margin-top: 0;
    transition: max-height 0.5s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.5s ease, margin-top 0.3s ease;
}
.project-item:hover .pj-desc { max-height: 100px; opacity: 1; margin-top: 8px; }

.pj-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pj-tag {
    font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--border-color);
    padding: 6px 12px; border-radius: 50px; transition: var(--transition);
}
.project-item:hover .pj-tag { color: var(--electric-blue); border-color: var(--electric-blue); }

.pj-link { display: flex; justify-content: flex-end; font-size: 1.4rem; color: var(--text-muted); transition: 0.3s; }
.project-item:hover .pj-link { color: var(--electric-blue); transform: rotate(-45deg); }

.view-more-container { margin-top: 50px; display: flex; justify-content: center; }
.btn-text {
    background: transparent; border: none; color: var(--text-muted);
    font-family: var(--font-head); font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: var(--transition);
}
.btn-text:hover { color: var(--electric-blue); gap: 12px; }

/* =========================================
   ABOUT SECTION
   ========================================= */
.about-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 60px; }
.code-block {
    background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); font-family: 'Courier New', monospace;
    font-size: 0.9rem; color: #a5b3ce; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    overflow: hidden;
}
[data-theme="light"] .code-block { background: #fff; color: #333; border-color: #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }

.mac-header {
    background: rgba(255,255,255,0.05); padding: 12px 15px;
    display: flex; gap: 8px; border-bottom: 1px solid var(--border-color);
}
.mac-dot { width: 12px; height: 12px; border-radius: 50%; }
.mac-dot.red { background: #ff5f56; }
.mac-dot.yellow { background: #ffbd2e; }
.mac-dot.green { background: #27c93f; }

.code-content { 
    padding: 20px; outline: none; min-height: 180px; 
    font-family: 'Courier New', monospace; white-space: pre-wrap;
} 

.code-line { display: block; margin-bottom: 5px; min-height: 1.2em; }

.c-kw { color: #c678dd; } .c-var { color: #e06c75; } .c-str { color: #98c379; }
[data-theme="light"] .c-kw { color: #7c3aed; } [data-theme="light"] .c-str { color: #059669; }
.typing-cursor::after { content: '|'; animation: blink 1s step-start infinite; color: var(--electric-blue); margin-left: 2px; }

.about-text p { color: var(--text-muted); margin-bottom: 20px; font-size: 1rem; }
.timeline { margin-top: 40px; border-left: 2px solid var(--border-color); padding-left: 25px; }
.timeline-item { position: relative; margin-bottom: 40px; }
.timeline-item::before {
    content: ''; position: absolute; left: -32px; top: 6px; width: 12px; height: 12px;
    background: var(--bg-dark); border: 2px solid var(--electric-blue); border-radius: 50%; transition: background 0.3s;
}
.t-year { font-size: 0.85rem; color: var(--electric-blue); font-family: var(--font-head); margin-bottom: 5px; display: block;}
.t-title { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.t-desc { font-size: 0.9rem; color: var(--text-muted); }

/* =========================================
   CONTACT & FOOTER
   ========================================= */
.contact-wrapper {
    background: var(--bg-card); margin-top: 100px; border-top: 1px solid var(--border-color);
    /* border-top-left-radius: 30px; border-top-right-radius: 30px; */
}
.contact-content {
    max-width: 1200px; margin: 0 auto; padding: 80px 20px 40px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 80px;
}
.contact-left h2 { 
    font-family: var(--font-head); 
    font-size: 3rem; 
    margin-bottom: 20px; 
    line-height: 1.1;
}
.contact-left > p {
    margin-bottom: 40px; /* Spacing between intro text and contact details */
}

/* Contact Details (Grid Alignment Fix) */
.detail-item { 
    display: grid; 
    grid-template-columns: auto 1fr; /* Auto width for icon, remaining for text */
    align-items: center; 
    gap: 20px; 
    margin-bottom: 30px; 
}

.detail-text p {
    margin-bottom: 0; /* Remove default margin to align with icon center */
}

.detail-icon {
    width: 48px; height: 48px; border: 1px solid var(--border-color);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: var(--electric-blue); font-size: 1.4rem;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.9rem; color: var(--text-muted); margin-bottom: 5px; }
.form-control {
    width: 100%; background: var(--bg-dark); border: 1px solid var(--border-color);
    padding: 16px; color: var(--text-main); 
    border-radius: var(--radius-md);
    font-family: var(--font-body); transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--electric-blue); }

/* Footer Styling */
footer { 
    border-top: 1px solid rgba(255,255,255,0.05); 
    padding: 40px 20px 100px 20px; /* Extra padding at bottom for mobile nav */
    text-align: center; 
}
footer p { color: var(--text-muted); font-size: 0.9rem; }

/* =========================================
   RESPONSIVE MEDIA QUERIES
   ========================================= */
@media (max-width: 900px) {
    contact-content {
        display: flex;
        flex-direction: column;
        gap: 60px;
        align-items: center;
        text-align: center;
    }

    .contact-left, 
    .contact-right {
        width: 100%;
        max-width: 500px;
    }

    .detail-item {
        justify-content: center;
    }
    .contact-content {
    min-width: 0;
}

    .hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 120px;
    gap: 40px; /* perfect mobile spacing */
    text-align: center;
}
    .nav-links { display: none; }
    .desktop-cta { display: none; }
    .mobile-bottom-nav { display: flex; }
    
    .theme-wrapper { position: relative; } 
    .theme-dropdown { 
        position: fixed; top: 70px; right: 20px; width: 150px; max-width: 80vw;
    }

    .hero { grid-template-columns: 1fr; text-align: center; padding-top: 150px; }
    .hero-btns { justify-content: center; }
    .contact-content { grid-template-columns: 1fr; gap: 40px; }
    .about-layout { grid-template-columns: 1fr; }
    
    .project-item { 
        grid-template-columns: 1fr; text-align: left; gap: 15px; border-radius: var(--radius-md);
    }
    .pj-link { justify-content: flex-start; transform: rotate(0) !important; }
    
    nav { justify-content: space-between; }
}

@media (min-width: 901px) {
    footer { padding: 40px 20px; } /* Normal footer padding for desktop */
}

@keyframes blink { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }