/* ===================================
   CSS Variables & Reset
   =================================== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary-color: #3b82f6;
    --accent-color: #0ea5e9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-accent: #eff6ff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* ===================================
   Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

/* ===================================
   Container & Section
   =================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* ===================================
   Navigation Bar
   =================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

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

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: var(--transition);
}

.nav-logo:hover {
    color: var(--primary-dark);
    transform: translateY(-2px);
}

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

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

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

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

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

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

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* ===================================
   Hero Section
   =================================== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    background: linear-gradient(135deg, var(--bg-accent) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 50%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.125rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.cta-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.hero-scroll {
    position: absolute;
    bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
    animation: float 3s ease-in-out infinite;
}

.scroll-indicator {
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
    border-radius: 2px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ===================================
   About Section
   =================================== */
.about {
    background: var(--bg-primary);
    position: relative;
    z-index: 1;
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.about-text h3:first-child {
    margin-top: 0;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-placeholder {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-xl);
    color: white;
}

.profile-placeholder svg {
    width: 150px;
    height: 150px;
}

/* ===================================
   Experience Timeline
   =================================== */
.experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    padding-left: 3rem;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
    padding-right: 3rem;
}

.timeline-content {
    width: calc(50% - 20px);
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.timeline-year {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
    margin: 0;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border: 4px solid var(--bg-secondary);
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* ===================================
   Skills Section
   =================================== */
.skills {
    background: var(--bg-primary);
}

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

.skill-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
    opacity: 0;
    transform: translateY(30px);
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.skill-card h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.skill-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.skill-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 1rem;
}

.skill-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    width: 0;
    transition: width 1s ease;
}

.skill-card.visible .skill-progress {
    width: var(--progress-width);
}

/* ===================================
   Projects Section
   =================================== */
.projects {
    background: var(--bg-secondary);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

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

.project-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.project-card h3 {
    color: var(--text-primary);
    margin: 0;
}

.project-tag {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: #ffffff;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.project-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
}

.project-link:hover {
    color: var(--primary-dark);
    transform: translateX(5px);
}

/* ===================================
   Goals Section
   =================================== */
.goals {
    background: var(--bg-primary);
}

.goals-content {
    max-width: 900px;
    margin: 0 auto;
}

.goal-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(-30px);
    transition: all 0.6s ease;
}

.goal-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.goal-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.goal-text h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.goal-text p {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ===================================
   Contact Section
   =================================== */
.contact {
    background: var(--bg-secondary);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

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

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    transition: var(--transition);
    color: var(--text-primary);
}

.contact-link:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.contact-icon {
    font-size: 1.5rem;
}

.contact-form {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--bg-primary);
}

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

.form-group textarea {
    resize: vertical;
}

.error-message {
    display: none;
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

.form-group.error .error-message {
    display: block;
}

.submit-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.form-success {
    display: none;
    background: #10b981;
    color: white;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.form-success.show {
    display: block;
}

/* ===================================
   Footer
   =================================== */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.5rem 0;
}

/* ===================================
   Back to Top Button
   =================================== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

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

.back-to-top svg {
    width: 24px;
    height: 24px;
}

/* ===================================
   Fade-in Animation
   =================================== */
.fade-in {
    animation: fadeIn 1s ease-in;
}

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

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.25rem; }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        width: 100%;
        padding: 2rem 0;
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        text-align: center;
        padding: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Sections */
    .section {
        padding: 3rem 0;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image {
        order: -1;
    }
    
    .profile-placeholder {
        width: 200px;
        height: 200px;
    }
    
    .profile-placeholder svg {
        width: 120px;
        height: 120px;
    }
    
    /* Timeline */
    .timeline::before {
        left: 20px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px;
        padding: 1.5rem;
    }
    
    .timeline-dot {
        left: 20px;
    }
    
    /* Skills */
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    /* Projects */
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    /* Goals */
    .goal-item {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Back to Top */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .hero {
        padding: 5rem 1rem 3rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .cta-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .project-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-tag {
        align-self: flex-start;
    }
}
