/* --- CSS VARIABLES & THEME --- */
:root {
    /* Dark Theme (Default) */
    --bg-body: #0a0e1a;       
    --bg-card: #1a1f2e;       
    --bg-nav: rgba(10, 14, 26, 0.95);
    
    --text-main: #f8fafc;     
    --text-muted: #94a3b8;    
    
    --accent-primary: #38bdf8; 
    --accent-secondary: #818cf8; 
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    
    --border-color: #2d3748;
    
    --radius: 16px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.2);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* Light Theme */
[data-theme="light"] {
    --bg-body: #f8fafc;       
    --bg-card: #ffffff;       
    --bg-nav: rgba(248, 250, 252, 0.95);
    
    --text-main: #1e293b;     
    --text-muted: #64748b;    
    
    --accent-primary: #0ea5e9; 
    --accent-secondary: #6366f1; 
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    
    --border-color: #e2e8f0;
    
    --shadow-glow: 0 0 30px rgba(14, 165, 233, 0.15);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .skills-section {
    background: #f1f5f9;
}

[data-theme="light"] .services-section {
    background: radial-gradient(circle at center, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="light"] .terminal-box {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(30, 41, 59, 0.3);
}

[data-theme="light"] .captcha-text {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #1e293b;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .refresh-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
}

[data-theme="light"] header.scrolled {
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] footer {
    background: linear-gradient(180deg, transparent 0%, rgba(241, 245, 249, 0.5) 100%);
}

[data-theme="light"] .form-control {
    background: rgba(241, 245, 249, 0.8);
    color: var(--text-main);
}

[data-theme="light"] .form-control:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1), var(--shadow-glow);
}

[data-theme="light"] .project-img {
    background-color: #e2e8f0;
}

[data-theme="light"] .hero::before {
    background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(248, 250, 252, 0) 70%);
}

[data-theme="light"] .hero::after {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, rgba(248, 250, 252, 0) 70%);
}

/* Fix all text colors for light theme */
[data-theme="light"] .hero h1,
[data-theme="light"] .hero p,
[data-theme="light"] .about-text h2,
[data-theme="light"] .about-text p,
[data-theme="light"] .section-header h2,
[data-theme="light"] .section-header p,
[data-theme="light"] .timeline-content h3,
[data-theme="light"] .timeline-content h4,
[data-theme="light"] .timeline-content li,
[data-theme="light"] .project-info h3,
[data-theme="light"] .project-info p,
[data-theme="light"] .service-item h3,
[data-theme="light"] .service-item p,
[data-theme="light"] .contact-info h3,
[data-theme="light"] .contact-item div,
[data-theme="light"] footer p {
    color: var(--text-main);
}

[data-theme="light"] .stat-item p,
[data-theme="light"] .timeline-date,
[data-theme="light"] .contact-item small {
    color: var(--text-muted);
}

[data-theme="light"] .tech-stack span {
    color: var(--accent-primary);
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.2);
}

[data-theme="light"] .tag {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.1);
}

[data-theme="light"] .skill-card:hover .tag {
    background: rgba(14, 165, 233, 0.15);
    color: var(--accent-primary);
}

[data-theme="light"] .highlight-box {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%) !important;
    border-color: rgba(14, 165, 233, 0.2) !important;
}

[data-theme="light"] .highlight-box ul li {
    color: var(--text-muted) !important;
}

[data-theme="light"] .badge {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: rgba(14, 165, 233, 0.3);
    color: var(--accent-primary);
}

[data-theme="light"] .captcha-right .form-control::placeholder {
    color: var(--text-muted);
}

[data-theme="light"] small {
    color: #dc2626;
}

/* Additional light theme fixes */
[data-theme="light"] .timeline-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
}

[data-theme="light"] .skill-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 250, 252, 0.95) 100%);
}

[data-theme="light"] .project-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
}

[data-theme="light"] .service-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(248, 250, 252, 0.9) 100%);
}

[data-theme="light"] .contact-wrapper {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.99) 100%);
}

[data-theme="light"] .terminal-box .code-line {
    color: #c9d1d9;
}

/* Ensure all text uses theme variables */
[data-theme="light"] * {
    color: inherit;
}

/* Profile image placeholder */
.profile-placeholder {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
    opacity: 0.3;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 20px 60px rgba(56, 189, 248, 0.3), 0 0 0 8px rgba(56, 189, 248, 0.1);
}

[data-theme="light"] .profile-placeholder {
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.2), 0 0 0 8px rgba(14, 165, 233, 0.1);
}

/* Profile Image Styles */

.profile-image {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-primary);
    box-shadow: 0 20px 60px rgba(56, 189, 248, 0.3), 0 0 0 8px rgba(56, 189, 248, 0.1);
    transition: var(--transition);
    position: relative;
    z-index: 1;
}

.profile-image:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 80px rgba(56, 189, 248, 0.4), 0 0 0 12px rgba(56, 189, 248, 0.15);
}

@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.15;
    }
    100% {
        transform: scale(0.95);
        opacity: 0.1;
    }
}

[data-theme="light"] .profile-image {
    border-color: var(--accent-primary);
    box-shadow: 0 20px 60px rgba(14, 165, 233, 0.2), 0 0 0 8px rgba(14, 165, 233, 0.1);
}

[data-theme="light"] .profile-image:hover {
    box-shadow: 0 25px 80px rgba(14, 165, 233, 0.3), 0 0 0 12px rgba(14, 165, 233, 0.15);
}

/* Button colors in light theme */
[data-theme="light"] .btn-primary {
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.3);
}

[data-theme="light"] .btn-primary:hover {
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.4);
}

[data-theme="light"] .btn-outline {
    background: #ffffff;
    color: #0ea5e9; /* primary accent */
    border: 1.5px solid #0ea5e9;
    box-shadow: 0 4px 15px rgba(14, 165, 233, 0.15);
}

[data-theme="light"] .btn-outline:hover {
    background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.35);
}

/* Ensure contact section text is visible */
[data-theme="light"] .contact-info p {
    color: var(--text-muted);
}

[data-theme="light"] .contact-item div div {
    color: var(--text-main);
}

[data-theme="light"] .contact-item small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.section-padding {
    padding: 100px 0;
}

.text-gradient {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    /* Force White Text for readability */
    color: #ffffff !important; 
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.4);
    color: #ffffff !important; /* Ensure white on hover too */
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
    transition: left 0.5s ease;
}

.btn-outline:hover::before {
    left: 100%;
}

.btn-outline:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.2);
}

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-nav);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 25px 0; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dynamic Scrolled State */
header.scrolled {
    padding: 12px 0;
    background: rgba(10, 14, 26, 0.98);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header.scrolled .logo {
    font-size: 1.3rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

/* FIX: Exclude button from generic text link hover effects */
.nav-links a:not(.btn):hover, 
.nav-links a:not(.btn).active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* FIX: Exclude button from the underline animation */
.nav-links a:not(.btn)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    transition: var(--transition);
    border-radius: 2px;
}

.nav-links a:not(.btn):hover::after {
    width: 60%;
}

.nav-links a:not(.btn).active::after {
    width: 100%;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.nav-links a:not(.btn).active {
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-main);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    margin-left: 20px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
}

.theme-toggle:hover::before {
    opacity: 0.1;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.theme-toggle i {
    position: relative;
    z-index: 1;
    transition: transform 0.4s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

[data-theme="light"] .theme-toggle .fa-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
    display: block;
}

.theme-toggle .fa-sun {
    display: none;
}

.theme-toggle .fa-moon {
    display: block;
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    padding-top: 180px;
    padding-bottom: 120px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(10, 14, 26, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, rgba(10, 14, 26, 0) 70%);
    border-radius: 50%;
    z-index: -1;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -30px) scale(1.1); }
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15) 0%, rgba(129, 140, 248, 0.15) 100%);
    color: var(--accent-primary);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 28px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.1);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 650px;
}

.hero-stats {
    display: flex;
    gap: 60px;
    margin-top: 70px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.hero-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--accent-gradient);
}

.stat-item {
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-item h4 {
    font-size: 2.2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
}

.stat-item p {
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- ABOUT --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.section-subtitle {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 700;
}

.about-text h2 {
    font-size: 2.6rem;
    margin-bottom: 25px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.terminal-box {
    background: linear-gradient(135deg, #0a0e14 0%, #0d1117 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(48, 54, 61, 0.8);
    padding: 25px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #c9d1d9;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.terminal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.terminal-header {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

.code-line {
    display: block;
    margin-bottom: 5px;
}
.code-key { color: #ff7b72; }
.code-str { color: #a5d6ff; }
.code-val { color: #79c0ff; }

/* --- SKILLS --- */
.skills-section {
    background: #111c2e; 
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
    position: relative;
}

.section-header h2 {
    font-size: 2.8rem;
    margin-bottom: 15px;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 25px;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.skill-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8) 0%, rgba(20, 25, 38, 0.9) 100%);
    padding: 35px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-card:hover {
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
}

.skill-card h3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 1.25rem;
}

.skill-card i {
    color: var(--accent-primary);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: rgba(255,255,255,0.05);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.skill-card:hover .tag {
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-primary);
}

/* --- EXPERIENCE --- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px; 
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    padding-left: 60px;
}

.timeline-dot {
    position: absolute;
    left: 11px;
    top: 5px;
    width: 20px;
    height: 20px;
    background: var(--bg-body);
    border: 4px solid var(--accent-primary);
    border-radius: 50%;
    z-index: 2;
}

.timeline-content {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 38, 0.95) 100%);
    padding: 35px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(56, 189, 248, 0.4);
}

.timeline-date {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.timeline-content h4 {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 20px;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.timeline-content li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--accent-secondary);
}

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

.project-card {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9) 0%, rgba(20, 25, 38, 0.95) 100%);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    padding: 2px;
    background: var(--accent-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.project-card:hover::after {
    opacity: 1;
}

.project-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover), 0 0 40px rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
}

.project-img {
    height: 350px;
    background-color: #2c3546;
    overflow: hidden;
    position: relative;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img img {
    transform: scale(1.05);
}

.project-info {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.project-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-stack span {
    font-size: 0.75rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
    color: var(--accent-primary);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    font-weight: 600;
    transition: var(--transition);
}

.project-card:hover .tech-stack span {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateY(-2px);
}

/* --- SERVICES / WHY ME --- */
.services-section {
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
}

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

.service-item {
    text-align: center;
    padding: 45px 25px;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.6) 0%, rgba(20, 25, 38, 0.8) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    transition: var(--transition);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.service-item::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-item:hover::before {
    opacity: 1;
}

.service-item:hover {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.8) 0%, rgba(20, 25, 38, 0.9) 100%);
    border-color: rgba(56, 189, 248, 0.5);
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    margin-bottom: 20px;
}

/* --- CONTACT --- */
.contact-wrapper {
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.95) 0%, rgba(20, 25, 38, 0.98) 100%);
    border-radius: var(--radius);
    padding: 60px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover), 0 0 60px rgba(56, 189, 248, 0.1);
    position: relative;
    overflow: hidden;
}

.contact-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; 
    gap: 50px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-methods {
    margin-top: 30px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.contact-item i {
    width: 40px;
    height: 40px;
    background: rgba(56, 189, 248, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.form-group {
    margin-bottom: 20px;
}

.form-control {
    width: 100%;
    background: rgba(10, 14, 26, 0.6);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 10px;
    color: white;
    font-family: inherit;
    transition: var(--transition);
    font-size: 0.95rem;
}

.form-control::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(10, 14, 26, 0.9);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1), var(--shadow-glow);
    transform: translateY(-2px);
}

/* --- FOOTER --- */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 50px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    background: linear-gradient(180deg, transparent 0%, rgba(10, 14, 26, 0.5) 100%);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--accent-gradient);
}

footer p {
    font-weight: 500;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1.1rem; }
    .nav-links { display: none; } 
    .mobile-toggle { display: block; }
    
    /* Show mobile theme toggle, hide desktop one */
    #themeToggle {
        display: none !important;
    }
    
    #themeToggleMobile {
        display: flex !important;
    }
    
    .nav-links.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, rgba(26, 31, 46, 0.98) 0%, rgba(20, 25, 38, 0.98) 100%);
        padding: 25px;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(20px);
        gap: 20px;
    }

    [data-theme="light"] .nav-links.active {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%);
    }

    .theme-toggle {
        width: 45px;
        height: 45px;
        margin-left: 0;
        align-self: center;
    }

    .nav-links.active li {
        width: 100%;
    }

    .nav-links.active .btn {
        width: 100%;
        justify-content: center;
    }

    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }
    
    .timeline::before { left: 10px; }
    .timeline-item { padding-left: 40px; }
    .timeline-dot { left: 1px; }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 30px;
    }

    .contact-wrapper {
        padding: 40px 25px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-container {
        grid-template-columns: 1fr;
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.view-project{
    width: 100%;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    z-index: 10;
}

.send-message-btn{
    width: 100%;
    justify-content: center;
}
.captcha-wrapper {
    display: flex;
    gap: 12px;
    width: 100%;
}

.captcha-right {
    width: 50%;
}

.captcha-left {
    width: 50%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-text {
    flex: 1;
    user-select: none;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.95));
    color: #fff;
    padding: 12px;
    font-size: 18px;
    letter-spacing: 4px;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    border: 1px solid var(--border-color);
}

.refresh-btn {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(26, 31, 46, 0.9), rgba(20, 25, 38, 0.95));
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 600px) {

    .captcha-wrapper {
        flex-direction: column;
        gap: 10px;
    }

    .captcha-right {
        width: 100%;
        order: 1;
    }

    .captcha-left {
        width: 100%;
        order: 2;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .captcha-text {
        white-space: nowrap;
        flex: 1;
        font-size: 16px;
        letter-spacing: 3px;
    }

    .refresh-btn {
        width: 44px;
        height: 44px;
        flex-shrink: 0;
    }

    .send-message-btn {
        width: 100%;
        margin-top: 12px;
    }
}

small {
    color: red;
    font-size: 12px;
    display: none;
}

#toast, #showToast {
    position: fixed;
    right: 30px;
    bottom: 30px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.95) 0%, rgba(129, 140, 248, 0.95) 100%);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(56, 189, 248, 0.4);
    font-weight: 500;
    z-index: 10000;
    backdrop-filter: blur(10px);
    transform: translateY(20px);
}

#toast.show, #showToast.show {
    opacity: 1;
    transform: translateY(0);
}

.contact-item i.fa-map-marker-alt {
    background: rgba(129, 140, 248, 0.15);
    color: var(--accent-secondary);
}

.custom-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
}

/* ================================
   PORTFOLIO MODAL (THEME MATCHED)
================================ */
/* ================================
   PORTFOLIO MODAL – FULL CSS
================================ */

/* Overlay */
.portfolio-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;

    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    padding: 16px;
    align-items: center;
    justify-content: center;
}

/* Light theme overlay */
[data-theme="light"] .portfolio-modal {
    background: rgba(248, 250, 252, 0.8);
}

/* ================================
   MODAL BOX
================================ */
.portfolio-modal-content {
    width: 100%;
    max-width: 680px;
    max-height: 90vh;

    display: flex;
    flex-direction: column;

    background: linear-gradient(
        135deg,
        rgba(26, 31, 46, 0.96) 0%,
        rgba(20, 25, 38, 0.98) 100%
    );

    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-hover), var(--shadow-glow);

    padding: 24px 26px;
    position: relative;

    animation: modalFadeUp 0.35s ease;
}

/* Light theme modal */
[data-theme="light"] .portfolio-modal-content {
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(248, 250, 252, 0.99) 100%
    );
    box-shadow: var(--shadow-card);
}

/* ================================
   MODAL HEADER
================================ */
.modal-header {
    position: sticky;
    top: 0;
    z-index: 20;

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

    padding-bottom: 10px;
    background: inherit;
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin: 0;
    flex: 1;
    letter-spacing: -0.5px;
}

/* ================================
   CLOSE BUTTON
================================ */
.modal-close {
    width: 42px;
    height: 42px;

    border-radius: 50%;
    border: 1px solid var(--border-color);

    background: var(--bg-card);
    color: var(--text-main);

    font-size: 22px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: var(--transition);
}

.modal-close:hover {
    background: var(--accent-gradient);
    color: #ffffff;
    transform: rotate(90deg);
    box-shadow: var(--shadow-glow);
}

/* Light theme close */
[data-theme="light"] .modal-close {
    background: #ffffff;
    color: var(--accent-primary);
}

/* ================================
   MODAL BODY (SCROLLABLE)
================================ */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;

    margin-top: 10px;
    margin-bottom: 16px;

    scroll-behavior: smooth;
}

/* ================================
   DESCRIPTION
================================ */
#modalDescription {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 18px;
}

/* ================================
   FEATURES LIST
================================ */
#modalFeatures {
    padding: 0;
    margin: 0;
}

#modalFeatures li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;

    font-size: 0.9rem;
    color: var(--text-muted);
}

#modalFeatures li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-weight: bold;
}

/* ================================
   TECH STACK
================================ */
.modal-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;

    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.modal-tech span {
    padding: 6px 14px;
    border-radius: 999px;

    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;

    color: var(--accent-primary);

    background: linear-gradient(
        135deg,
        rgba(56, 189, 248, 0.15),
        rgba(129, 140, 248, 0.15)
    );

    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);

    transition: var(--transition);
}

.modal-tech span:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 18px rgba(56, 189, 248, 0.35),
        0 0 12px rgba(56, 189, 248, 0.25);
}

/* ================================
   MOBILE OPTIMIZATION
================================ */
@media (max-width: 600px) {

    .portfolio-modal-content {
        padding: 20px;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-close {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}

/* ================================
   ANIMATION
================================ */
@keyframes modalFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* SCROLL TIMELINE */
.scroll-timeline {
    position: fixed;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
}

/* vertical line */
.timeline-line {
    position: absolute;
    top: 14px;
    bottom: 14px;
    width: 3px;
    background: var(--border-color);
    z-index: -1;
}

.timeline-fill {
    width: 100%;
    height: 0%;
    background: var(--accent-gradient);
    transition: height 0.3s ease;
}

/* icons */
.scroll-timeline span {
    width: 34px;
    height: 34px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

/* active */
.scroll-timeline span.active {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    box-shadow: 0 0 14px rgba(56,189,248,0.6);
    transform: scale(1.15);
    background: var(--bg-body);
}
@media (max-width: 1024px) {
    .scroll-timeline {
        display: none;
    }
}
/* ===============================
   SOCIAL ICONS (GLOBAL)
================================ */
.social-links,
.footer-social {
    display: flex;
    gap: 18px;
    margin-top: 30px;
}

.footer-social {
    justify-content: center;
    margin-top: 20px;
}

.social-links a,
.footer-social a {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(56, 189, 248, 0.15),
        rgba(129, 140, 248, 0.15)
    );
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.2rem;
    transition: var(--transition);
    box-shadow: var(--shadow-card);
}

.social-links a:hover,
.footer-social a:hover {
    background: var(--accent-gradient);
    color: #ffffff;
    transform: translateY(-4px) scale(1.1);
    box-shadow: var(--shadow-glow);
}

/* Light Theme Fix */
[data-theme="light"] .social-links a,
[data-theme="light"] .footer-social a {
    background: #ffffff;
    color: var(--accent-primary);
    border-color: rgba(14, 165, 233, 0.4);
}

[data-theme="light"] .social-links a:hover,
[data-theme="light"] .footer-social a:hover {
    background: var(--accent-gradient);
    color: #ffffff;
}
