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

:root {
    /* Light Mode (Default) */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --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);
}

[data-theme="dark"] {
    /* Dark Mode */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --secondary-color: #94a3b8;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 1rem 0;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--primary-color);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    position: relative;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.theme-toggle-btn:hover {
    color: var(--primary-color);
}

.theme-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    opacity: 0.6;
}

[data-theme="dark"] .theme-icon.light-mode,
[data-theme="dark"] .theme-toggle-btn:hover .theme-icon.light-mode {
    opacity: 0.8;
}

[data-theme="dark"] .theme-icon.dark-mode,
[data-theme="dark"] .theme-toggle-btn:hover .theme-icon.dark-mode {
    opacity: 0.4;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    top: 8px;
}

/* Mobile Menu */
.mobile-menu-btn.active .hamburger::before {
    transform: rotate(45deg);
    top: -1px;
}

.mobile-menu-btn.active .hamburger::after {
    transform: rotate(-45deg);
    top: 6px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8rem 2rem 4rem;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

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

.greeting {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.hero-subtitle {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

/* Buttons */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.hero-social-links a {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.hero-social-links a:hover {
    color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.hero-social-links a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.hero-social-links svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.hero-social-links .github-icon {
    width: 22px;
    height: 22px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

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

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

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    background-color: rgba(37, 99, 235, 0.05);
}

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

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

/* Sections */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

/* Companies Section */
.companies {
    padding: 5rem 0;
}

.companies-content {
    max-width: 1200px;
}

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

.company-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.company-card:hover {
    transform: translateY(-5px);
}

.company-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.company-card:hover .company-logo {
    transform: scale(1.05);
}

.company-logo img {
    width: 120px;
    height: auto;
    object-fit: contain;
}

.skill-list {
    list-style: none;
}

.skill-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
}

.skill-list li:last-child {
    border-bottom: none;
}

/* Skills Section */
.skills .container {
    max-width: 1000px;
}

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

.skill-category {
    background-color: var(--bg-secondary);
    padding: 2rem;
    border-radius: 1rem;
    transition: transform 0.2s ease;
}

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

.category-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Experience Section */
.experience .container {
    max-width: 800px;
}

.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.timeline-item {
    position: relative;
    padding-left: 2.5rem;
    margin-bottom: 2.5rem;
}

.timeline-year {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    padding: 0.375rem 0.75rem;
    background-color: rgba(37, 99, 235, 0.1);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.timeline-company {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.timeline-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Software Section */
.software .container {
    max-width: 1200px;
}

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

.software-card {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.software-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.software-video-container {
    width: 100%;
    height: 200px;
    margin-top: auto;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.5rem;
}

.software-video-container iframe {
    width: 100%;
    height: 100%;
}

.software-unreleased-notice {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    box-sizing: border-box;
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
}

.software-unreleased-notice p {
    margin: 0;
}

.software-unreleased-label {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--primary-color);
    font-weight: 600;
}

.load-more-btn {
    margin-top: 1.5rem;
}

/* Projects Section */
.projects .container {
    max-width: 1200px;
}

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

.project-card {
    background-color: var(--bg-secondary);
    border-radius: 1rem;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

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

.project-image {
    width: 100%;
    height: 200px;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.placeholder-icon {
    font-size: 3rem;
}

.project-video {
    width: 100%;
    height: 200px;
    margin-top: auto;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 0.5rem;
    background-color: var(--border-color);
}

.project-video iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.project-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 4.5rem;
    flex-shrink: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 1rem;
    color: var(--text-primary);
    text-align: center;
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
    padding: 0 1.5rem 1.5rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 1rem 0 0.25rem;
    margin: 0;
}

.project-tech span {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    background-color: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border-radius: 0.375rem;
}

.project-link {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    margin: 1.5rem 1.5rem 0;
    transition: color 0.2s ease;
}

.project-link:hover {
    color: var(--primary-hover);
}

/* Contact Section */
.contact .container {
    max-width: 800px;
}

.contact-intro {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 3rem;
}

.contact-info {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.contact-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.contact-email:hover {
    opacity: 0.8;
}

.social-link {
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: background-color 0.2s ease;
}

.social-link:hover {
    background-color: rgba(37, 99, 235, 0.1);
}

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

.form-group {
    text-align: left;
}

.form-group input,
.form-group textarea {
    width: 100%;
    color: var(--text-primary);
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    font-family: inherit;
    background-color: var(--bg-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.form-group textarea {
    resize: vertical;
}

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

.footer p {
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transform: translateX(100%);
        transition: transform 0.3s ease;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hero {
        padding: 6rem 1.5rem 3rem;
        min-height: auto;
    }

    .section {
        padding: 4rem 0;
    }

    .about p {
        font-size: 1rem;
    }

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

    .timeline::before {
        left: 9px;
    }

    .timeline-item {
        padding-left: 2rem;
    }

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

    .contact-form {
        gap: 1.25rem;
    }

    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
    }

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

/* Print Styles */
@media print {
    .navbar,
    .hero-buttons,
    .social-link,
    .btn {
        display: none !important;
    }

    .section {
        padding: 2rem 0;
    }
}

/* Dark Mode Company Logos */
[data-theme="dark"] .company-logo img {
    filter: invert(1) brightness(1.2);
}