/* ==========================================================================
   CSS Variables & Theming
   ========================================================================== */
:root {
    /* Light Theme (Default) */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-alt: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    
    /* Hero specific dark variables that stay dark even in light mode */
    --hero-bg: #0b1120;
    --hero-surface: rgba(30, 41, 59, 0.7);
    --hero-text: #f8fafc;
    --hero-text-muted: #94a3b8;
    
    /* Utility */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.3);
    
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-alt: #0b1120;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* For fixed navbar */
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    transition: background-color var(--transition), color var(--transition);
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, textarea {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section-padding {
    padding: 5rem 0;
}

.bg-alt {
    background-color: var(--surface-alt);
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 600;
    color: var(--text);
}

.section-title {
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 1.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.title-icon {
    color: var(--primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

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

.btn-outline {
    background-color: transparent;
    color: var(--hero-text);
    border: 1px solid var(--hero-text-muted);
}

.btn-outline:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--hero-text);
    transform: translateY(-2px);
}

/* ==========================================================================
   Navigation
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--hero-bg);
    color: var(--hero-text);
    z-index: 1000;
    transition: background-color var(--transition), backdrop-filter var(--transition);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.navbar.scrolled {
    background-color: rgba(11, 17, 32, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hero-text);
    z-index: 1001;
}

.nav-menu {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--hero-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width var(--transition);
}

.nav-link.active::after, .nav-link:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1001;
}

.theme-toggle {
    color: var(--hero-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: var(--radius-full);
    transition: color var(--transition), background-color var(--transition);
}

.theme-toggle:hover {
    color: var(--hero-text);
    background-color: rgba(255,255,255,0.1);
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background-color: var(--hero-text);
    transition: all var(--transition);
    border-radius: 3px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    min-height: 100vh;
    background-color: var(--hero-bg);
    color: var(--hero-text);
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(37, 99, 235, 0.08) 0%, transparent 50%);
    background-size: cover;
    z-index: 1;
    pointer-events: none;
}

/* subtle circuit lines */
.hero-bg-pattern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 30px 30px;
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    z-index: 2;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-greeting {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 500;
}

.hero-name {
    font-size: 4rem;
    font-weight: 700;
    color: var(--hero-text);
    line-height: 1.1;
}

.hero-title {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 600;
}

.hero-description {
    color: var(--hero-text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin-bottom: 1rem;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hero-socials {
    display: flex;
    gap: 1.5rem;
}

.hero-socials a {
    color: var(--hero-text-muted);
    transition: color var(--transition), transform var(--transition);
}

.hero-socials a:hover {
    color: var(--hero-text);
    transform: translateY(-3px);
}

.hero-image-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-image {
    width: 380px;
    height: 380px;
    border-radius: 50%;
    padding: 12px;
    border: 2px solid var(--primary);
    box-shadow: var(--shadow-glow);
    background-color: transparent;
    position: relative;
    z-index: 2;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    display: block;
}

.hero-skills-card {
    background-color: var(--hero-surface);
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    display: flex;
    gap: 2rem;
    margin-top: -40px;
    z-index: 3;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--hero-text);
    font-size: 0.85rem;
    font-weight: 500;
}

.skill-item svg {
    color: var(--hero-text-muted);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text h2 {
    color: var(--text);
}

.about-text p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.about-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background-color: var(--surface);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.info-card h4 {
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.info-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Skills Section
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.skill-card {
    background-color: var(--surface);
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.skill-icon {
    color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.1);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.skill-icon svg {
    width: 24px;
    height: 24px;
}

.skill-card h3 {
    font-size: 0.9rem;
    color: var(--text);
}

.skill-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Experience Section (Timeline)
   ========================================================================== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

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

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    top: 5px;
    left: 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--primary);
    border: 3px solid var(--background);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.timeline-content {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-title-company h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.timeline-title-company h4 {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--primary);
    background-color: rgba(37, 99, 235, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.timeline-details {
    list-style-type: disc;
    padding-left: 1.25rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.timeline-details li {
    margin-bottom: 0.5rem;
}

.timeline-details li:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: var(--border);
}

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

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

.project-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.project-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--surface-alt);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    align-self: flex-start;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.project-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Split Section (Education & Contact)
   ========================================================================== */
.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-description {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-details {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: var(--text);
}

.contact-item svg {
    color: var(--primary);
    flex-shrink: 0;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-message {
    padding: 1rem;
    border-radius: var(--radius-md);
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background-color: var(--hero-bg);
    color: var(--hero-text-muted);
    padding: 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   Back to Top
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

/* ==========================================================================
   Animations
   ========================================================================== */
.reveal-up, .reveal-left, .reveal-right {
    opacity: 0;
    transition: all 0.8s ease;
}

.reveal-up { transform: translateY(30px); }
.reveal-left { transform: translateX(-30px); }
.reveal-right { transform: translateX(30px); }

.reveal-up.active, .reveal-left.active, .reveal-right.active {
    opacity: 1;
    transform: translate(0);
}

@media (prefers-reduced-motion: reduce) {
    *, ::before, ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal-up, .reveal-left, .reveal-right {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-name { font-size: 3rem; }
    .hero-title { font-size: 1.5rem; }
    .hero-image { width: 300px; height: 300px; }
    .split-container { gap: 2rem; }
}

@media (max-width: 768px) {
    .hamburger { display: flex; z-index: 1001; }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--hero-bg);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: left 0.3s ease;
        z-index: 1000;
    }

    .nav-menu.active { left: 0; }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .nav-link { font-size: 1.25rem; }

    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }

    .hero-content { align-items: center; }
    .hero-cta { justify-content: center; }
    .hero-socials { justify-content: center; }
    
    .hero-skills-card {
        gap: 1rem;
        padding: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .about-content { grid-template-columns: 1fr; gap: 2rem; }
    .about-text { text-align: center; }
    .split-container { grid-template-columns: 1fr; gap: 3rem; }
    
    .footer-container {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 425px) {
    .hero-name { font-size: 2.5rem; }
    .hero-image { width: 250px; height: 250px; }
    .hero-cta { flex-direction: column; width: 100%; }
    .hero-cta .btn { width: 100%; }
    .info-card { flex-direction: column; text-align: center; align-items: center; }
    .about-info { grid-template-columns: 1fr; }
    .timeline::before { left: 15px; }
    .timeline-item { padding-left: 40px; }
    .timeline-dot { left: 9px; width: 12px; height: 12px; }
}
