/* =========================================
   1. TYPOGRAPHY & IMPORTS
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@600&family=Inter+Tight:wght@700&family=Inter:wght@400;500;600&family=Dancing+Script:wght@600;700&display=swap');

/* =========================================
   2. THEME VARIABLES
   ========================================= */
:root {
    --bg: #ffffff;
    --surface: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary: #0f766e;
    --primary-hover: #115e59;
    --border: #e2e8f0;
    --hero-bg: #f0fdfa;
    --hero-text: #0f172a;
    --hero-accent: #0f766e;
    --accent-amber: #f59e0b;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --surface: #020617;
    --text-primary: #e5e7eb;
    --text-secondary: #94a3b8;
    --primary: #2dd4bf;
    --primary-hover: #14b8a6;
    --border: #1e293b;
    --hero-bg: #020617;
    --hero-text: #e5e7eb;
    --hero-accent: #2dd4bf;
}

/* =========================================
   3. GLOBAL RESET & BASE
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ADD THIS BLOCK: */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* Ensures title isn't hidden behind the Sticky Header */
}

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 { font-family: 'Inter Tight', sans-serif; color: var(--text-primary); }
p { color: var(--text-secondary); }

.container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

/* =========================================
   4. HEADER & NAV (Sticky with Scroll Effect)
   ========================================= */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

/* Wrapper for Image + Text */
.logo-wrapper {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
}

/* The Mini Avatar (Hidden by default) */
.nav-avatar {
    width: 0; 
    height: 40px;
    border-radius: 50%;
    
    object-fit: cover;
    object-position: center 20%;
    transform: scale(1.2) translateX(-20px);
    
    /* MATCH HERO STYLE: */
    /* 1. Use Background Color for the "Gap" */
    border: 2px solid var(--bg); 
    
    /* 2. Use Teal Shadow for the "Ring" */
    box-shadow: 0 0 0 1.5px var(--primary); /* Slightly thinner ring for small icon */
    
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    margin-right: 0;
}

/* ACTIVE SCROLL STATE */
.main-header.scrolled .nav-avatar {
    width: 40px; 
    opacity: 1;
    /* Reset translate but KEEP scale to stay zoomed */
    transform: scale(1.2) translateX(0); 
    margin-right: 12px; /* Add spacing here instead of parent gap */
}

.logo-signature {
    font-family: 'Dancing Script', cursive;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    line-height: 1;
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Unified Pill Shape Buttons */
.btn-dashboard, .theme-toggle {
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: max-content;
}

.btn-dashboard:hover, .theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff;
    transform: translateY(-1px);
}

/* =========================================
   5. HERO SECTION & DANTE LOGO
   ========================================= */
.hero {
    padding: 35px 0;
    text-align: center;
    background: linear-gradient(180deg, var(--hero-bg) 0%, var(--bg) 70%);
}

[data-theme="dark"] .hero {
    background: radial-gradient(1200px circle at top, rgba(45, 212, 191, 0.08), var(--bg) 60%);
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.35rem;
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: var(--hero-text);
}

.hero h1 span { color: var(--hero-accent); font-style: italic; }
.hero p { font-size: 1.20rem; max-width: 600px; margin: 0 auto; }

.profile-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--surface);
    box-shadow: 0 0 0 4px var(--primary), 0 10px 20px rgba(0,0,0,0.1);
}

.hero-value {
    font-size: 1.15rem;
    font-weight: 500;
    color: #2b3a3f;
    max-width: 640px;
    margin: 1rem auto 0.5rem;
}

.hero-cred {
    font-size: 0.95rem;
    color: #6b7c80;
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

/* Dante Logo */
.dante-link {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    text-decoration: none;
    margin: 0 6px;
    transform: translateY(-2px);
}
.dante-link:hover { opacity: 0.8; }
.dante-logo { height: 22px; width: auto; }

.light-logo { display: block; }
.dark-logo { display: none; }
[data-theme="dark"] .light-logo { display: none; }
[data-theme="dark"] .dark-logo { display: block; }

/* =========================================
   6. BUTTONS (Global)
   ========================================= */
.btn-group { display: flex; gap: 15px; justify-content: center; margin-top: 1rem; }

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    border: none;
    cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(15, 118, 110, 0.25);
}

[data-theme="dark"] .btn-primary { background-color: var(--primary); color: #022c22; }
[data-theme="dark"] .btn-primary:hover { background-color: var(--primary-hover); box-shadow: 0 10px 20px rgba(45, 212, 191, 0.25); }

.btn-secondary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease;
}
.btn-secondary:hover { background-color: rgba(15, 118, 110, 0.08); }

/* =========================================
   7. PROJECT CARDS (FINAL FIXED VERSION)
   ========================================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    padding: 0;
}

.card {
    /* Fixed: Removed undefined --glass-bg variable */
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    
    /* 3D Tilt Setup */
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="dark"] .card {
    background: rgba(15, 23, 42, 0.6); /* Dark Blue Transparent */
}

.card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* --- 1. Icon Header --- */
.card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    transform: translateZ(20px);
}

.project-icon {
    font-size: 2.2rem;
    color: var(--primary);
    background: var(--surface);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.card:hover .project-icon {
    background: var(--primary);
    color: #fff;
    transform: rotate(-10deg) scale(1.1);
    border-color: var(--primary);
}

/* --- 2. Typography --- */
.card h2 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.4rem;
    transform: translateZ(30px);
}

.card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    transform: translateZ(30px);
    flex-grow: 1; 
}

/* --- 3. Tech Stack Pills --- */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
    transform: translateZ(30px);
}

.tech-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--surface); 
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: 0.2s;
}

.card:hover .tech-pill {
    border-color: var(--primary);
    color: var(--primary);
}

/* --- 4. Bottom Button --- */
.card-action {
    margin-top: auto;
    transform: translateZ(40px);
}

/* =========================================
   8. EXPERIENCE TIMELINE
   ========================================= */
.section-title {
    font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; margin-bottom: 2rem; border-bottom: 2px solid var(--border); padding-bottom: 10px; display: inline-block;
}

.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::after {
    content: ''; position: absolute; width: 2px; background-color: var(--border); top: 0; bottom: 0; left: 24px; z-index: -1;
}

.timeline-item { position: relative; margin-bottom: 3rem; padding-left: 70px; }

.company-logo {
    position: absolute; left: 0; top: 0; width: 48px; height: 48px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--border); z-index: 1; padding: 2px;
}

.timeline-date { font-size: 0.85rem; color: var(--accent-amber); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.timeline-role { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
.timeline-company { font-size: 1rem; color: var(--primary); font-weight: 600; margin-bottom: 12px; }

/* Bullet Points Fix */
.timeline-content ul { padding-left: 0; margin: 0; }
.timeline-content li {
    list-style: none; /* Removes default black dot */
    position: relative; padding-left: 18px; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.95rem; line-height: 1.5;
}
.timeline-content li::before {
    content: '•'; color: var(--primary); position: absolute; left: 0; top: -1px; font-size: 1.2em; font-weight: bold; line-height: 1.5;
}

/* =========================================
   9. LOGIN MODAL (Themed)
   ========================================= */
.modal-overlay {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.6); 
    backdrop-filter: blur(5px); 
    display: none; 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
    opacity: 0; 
    transition: opacity 0.3s ease;
}
.modal-overlay.active { display: flex; opacity: 1; }

.login-card {
    /* CHANGED: Uses theme variable instead of 'white' */
    background: var(--surface); 
    /* ADDED: Border helps define the card in Dark Mode */
    border: 1px solid var(--border);
    
    width: 400px; 
    padding: 2.5rem; 
    border-radius: 12px; 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); 
    border-top: 5px solid var(--primary); 
    position: relative; 
    transform: translateY(20px); 
    transition: transform 0.3s ease, background-color 0.3s ease;
}
.modal-overlay.active .login-card { transform: translateY(0); }

.login-header { text-align: center; margin-bottom: 2rem; }

.login-header h2 { 
    font-family: 'Inter', sans-serif; 
    font-size: 1.5rem; 
    /* CHANGED: Uses theme variable */
    color: var(--text-primary); 
    margin-top: 10px; 
}

/* Subtext in header */
.login-header p {
    color: var(--text-secondary) !important;
}

.login-logo { 
    font-family: 'Dancing Script', cursive; 
    font-size: 2.5rem; 
    color: var(--primary); 
    font-weight: bold; 
}

/* Inputs */
.input-group { margin-bottom: 1.25rem; text-align: left; }

.input-label { 
    display: block; 
    font-size: 0.9rem; 
    font-weight: 600; 
    /* CHANGED: Uses theme variable */
    color: var(--text-secondary); 
    margin-bottom: 0.5rem; 
}

.input-wrapper { position: relative; display: flex; align-items: center; }

.custom-input { 
    width: 100%; 
    padding: 12px 16px; 
    padding-right: 40px; 
    
    /* CHANGED: Uses background variable so it's dark in dark mode */
    background-color: var(--bg); 
    border: 1px solid var(--border);
    color: var(--text-primary);
    
    border-radius: 8px; 
    font-size: 0.95rem; 
    transition: all 0.2s; 
}

.custom-input:focus { 
    border-color: var(--primary); 
    outline: none; 
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1); 
}

/* Password Eye Icon */
.password-toggle { 
    position: absolute; 
    right: 12px; 
    color: var(--text-secondary); 
    cursor: pointer; 
    font-size: 1.2rem; 
}
.password-toggle:hover { color: var(--primary); }

.btn-login { 
    width: 100%; 
    background-color: var(--primary); 
    color: white; /* Keep white because button is always Teal */
    padding: 12px; 
    border-radius: 8px; 
    border: none; 
    font-weight: 600; 
    font-size: 1rem; 
    cursor: pointer; 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    transition: 0.2s; 
}
.btn-login:hover { background-color: var(--primary-hover); }

.login-footer { margin-top: 1.5rem; text-align: center; font-size: 0.9rem; color: var(--text-secondary); }

.login-footer a, .view-link { 
    color: var(--primary); 
    text-decoration: none; 
    font-weight: 500; 
    cursor: pointer;
}
.login-footer a:hover, .view-link:hover { text-decoration: underline; }

.close-modal { 
    position: absolute; 
    top: 10px; 
    right: 15px; 
    font-size: 1.5rem; 
    color: var(--text-secondary); 
    cursor: pointer; 
}
.close-modal:hover { color: var(--primary); }

/* 14. CONTACT SECTION */
.contact-footer {
background-color: var(--surface);
border-top: 1px solid var(--border);
padding: 4rem 0;
margin-top: 4rem;
text-align: center;
}

.contact-grid {
display: flex;
justify-content: center;
gap: 3rem;
margin-top: 2rem;
flex-wrap: wrap;
}

.contact-item {
display: flex;
align-items: center;
gap: 10px;
font-size: 1.1rem;
color: var(--text-primary);
text-decoration: none;
font-weight: 500;
}
.contact-item:hover { color: var(--primary); }

/* --- FIX: Dark Mode Hover State --- */
    [data-theme="dark"] .btn-dashboard:hover, 
    [data-theme="dark"] .theme-toggle:hover {
        background-color: transparent; /* Removes the white background */
        border-color: var(--primary);  /* Keeps the teal border */
        color: var(--primary);         /* Keeps the teal text */
    }

/* =========================================
   11. MOBILE RESPONSIVENESS (Combined)
   ========================================= */
@media (max-width: 768px) {
    /* Header Stack & Layout */
    .header-content { flex-direction: row; padding: 10px 15px; }
    .header-actions { gap: 10px; }
    
    /* Logo Size */
    .logo-signature { font-size: 1.5rem; }

    /* Avatar Mobile */
    .main-header.scrolled .nav-avatar { width: 32px; height: 32px; }

    /* Button Icons Only - FIXED */
    /* Only hide the TEXT span, keep the ICON span visible */
    .btn-dashboard .btn-text, .theme-toggle .btn-text { display: none; }
    
    .btn-dashboard, .theme-toggle { 
        padding: 0; 
        width: 40px; 
        height: 40px; 
        justify-content: center; 
    }

    /* Hero & Layout Adjustments */
    .hero h1 { font-size: 2.5rem; }
    .hero p { font-size: 1rem; padding: 0 10px; }
    .btn-group { flex-direction: column; width: 100%; }
    .btn-primary, .btn-secondary { width: 100%; text-align: center; }
    
    /* Modal & Profile Image */
    .login-card { width: 90%; padding: 1.5rem; }
    .profile-img { width: 140px; height: 140px; }
    
    /* 11. ABOUT SECTION */
    .about-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    margin-bottom: 4rem;
    }
    @media (max-width: 768px) { .about-split { grid-template-columns: 1fr; } }
}

/* 13. SKILLS & CERTIFICATIONS */
.skills-container {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-bottom: 3rem;
}

.skill-tag {
background: var(--surface);
border: 1px solid var(--border);
padding: 8px 16px;
border-radius: 50px;
font-size: 0.9rem;
font-weight: 500;
transition: 0.2s;
}
.skill-tag:hover { border-color: var(--primary); color: var(--primary); }

/* 11. ABOUT SECTION */
.about-split {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 4rem;
align-items: center;
margin-bottom: 4rem;
}
@media (max-width: 768px) { .about-split { grid-template-columns: 1fr; } }

/* =========================================
   12. BACK TO TOP BUTTON
   ========================================= */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 900; /* Below Modal (1000) but above content */
    
    /* Flex Center Icon */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Hidden State */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Visible State (Added by JS) */
.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px); /* Lift effect */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile Tweak: Move it slightly in */
@media (max-width: 768px) {
    .back-to-top { bottom: 20px; right: 20px; width: 45px; height: 45px; }
}

/* =========================================
   THEME TRANSITION ANIMATION
   ========================================= */
.theme-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none; /* Allows clicking through when hidden */
    transform: translateY(110%); /* Start hidden below screen */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0s; /* No transition by default */
}

/* Icons inside the curtain */
.theme-curtain .curtain-content i {
    font-size: 5rem;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

/* ANIMATION STATE: Curtain is active */
.theme-curtain.animating {
    pointer-events: all; /* Block clicks while animating */
    animation: curtainSwipe 1.2s cubic-bezier(0.75, 0, 0.25, 1) forwards;
}

/* While animating, pop the icon */
.theme-curtain.animating .curtain-content i {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.3s; /* Wait for curtain to rise slightly */
}

/* COLORS SPECIFIC TO MODE */
/* If we are going TO Dark Mode */
.theme-curtain.to-dark {
    background-color: #0f172a; /* Your Dark BG color */
    color: #f8fafc; /* Moon color */
}

/* If we are going TO Light Mode */
.theme-curtain.to-light {
    background-color: #f1f5f9; /* Your Light BG color */
    color: #f59e0b; /* Sun color (Orange-ish) */
}

/* THE KEYFRAME: Up, Pause, Away */
@keyframes curtainSwipe {
    0% { transform: translateY(110%); }
    40% { transform: translateY(0%); }   /* Covers screen */
    60% { transform: translateY(0%); }   /* Pauses briefly */
    100% { transform: translateY(-110%); } /* Exits top */
}

/* =========================================
   FIX: DARK MODE LOGIN BUTTON
   ========================================= */
/* Override the neon variable with a solid darker teal for better contrast */
[data-theme="dark"] .btn-login {
    background-color: #0f766e; /* Darker Teal (Standard Light Mode Color) */
    color: #ffffff;
}

[data-theme="dark"] .btn-login:hover {
    background-color: #115e59; /* Even darker on hover */
}

/* Optional: Make the input text brighter in dark mode inputs */
[data-theme="dark"] .custom-input {
    color: #f1f5f9; /* Make typed text very bright/white */
}