:root {
    --color-primary: #1A1A1A;
    --color-secondary: #2B4F81;
    --color-accent: #4C8BF5;
    --color-background: #F4F4F4;
    --color-text: #111111;
    --color-light-gray: #E8E8E8;
    --color-border: #D0D0D0;
    --color-white: #FFFFFF;
    --color-success: #10B981;
    --color-error: #EF4444;

    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;

    --spacing-unit: 8px;
    --spacing-xs: calc(var(--spacing-unit) * 0.5);
    --spacing-sm: var(--spacing-unit);
    --spacing-md: calc(var(--spacing-unit) * 2);
    --spacing-lg: calc(var(--spacing-unit) * 3);
    --spacing-xl: calc(var(--spacing-unit) * 4);
    --spacing-2xl: calc(var(--spacing-unit) * 6);

    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

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

html {
    scroll-behavior: smooth;
}

:root {
    --color-primary: #1A1A1A;
    --color-secondary: #2B4F81;
    --color-accent: #4C8BF5;
    --color-background: #F4F4F4;
    --color-text: #111111;
    --color-light-gray: #E8E8E8;
    --color-border: #D0D0D0;
    --color-white: #FFFFFF;
    --color-success: #10B981;
    --color-error: #EF4444;

    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;

    --spacing-unit: 8px;
    --spacing-xs: calc(var(--spacing-unit) * 0.5);
    --spacing-sm: var(--spacing-unit);
    --spacing-md: calc(var(--spacing-unit) * 2);
    --spacing-lg: calc(var(--spacing-unit) * 3);
    --spacing-xl: calc(var(--spacing-unit) * 4);
    --spacing-2xl: calc(var(--spacing-unit) * 6);

    --transition-fast: 150ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-sans);
    color: var(--color-text);
    background-color: var(--color-background);
    line-height: 1.6;
    font-size: 16px;
}

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

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

h1 {
    font-size: 3rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-md);
    line-height: 1.65;
    color: #555;
}

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

a:hover {
    color: var(--color-secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.main-content {
    min-height: calc(100vh - 80px);
    padding-top: 0;
}

.navbar {
    background-color: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    flex-shrink: 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-2xl);
    align-items: center;
}

.nav-link {
    color: var(--color-text);
    font-weight: 500;
    font-size: 1rem;
    transition: color var(--transition-normal);
    position: relative;
}

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

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

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle svg {
    color: var(--color-text);
    transition: transform var(--transition-normal);
}

.mobile-menu-toggle:hover svg {
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: calc(var(--spacing-xl) * 6) var(--spacing-xl) calc(var(--spacing-xl) * 4);
    text-align: center;
    animation: fadeIn 0.8s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.hero-content {
    animation: slideUp 0.8s ease-in-out 0.2s both;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -1px;
    color: var(--color-white);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
    color: rgba(255, 255, 255, 0.9);
}

.hero-tagline {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-2xl);
    color: var(--color-accent);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
/* Buttons */
.button {
    padding: var(--spacing-md) var(--spacing-xl);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* Hero Primary: White with dark text, pops against gradient */
.btn-hero-primary {
    background-color: var(--color-white);
    color: var(--color-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-hero-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Hero Secondary: Glassmorphism */
.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white);
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--color-white);
    transform: translateY(-4px);
}

/* Modern Dark: For Contact Page (High Contrast) */
.btn-modern-dark {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: 16px 48px;
    font-size: 1.1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-modern-dark:hover {
    background-color: #000;
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn-modern-dark svg {
    transition: transform 0.3s ease;
}

.btn-modern-dark:hover svg {
    transform: rotate(15deg) scale(1.1);
}

/* Sections */
.intro-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-white);
}

.intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-2xl);
}

.intro-card {
    padding: var(--spacing-2xl);
    background-color: var(--color-background);
    border-radius: 8px;
    transition: all var(--transition-normal);
    animation: fadeIn 0.6s ease-in-out;
}

.intro-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.intro-card h3 {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
}

.intro-card p {
    color: #666;
    margin-bottom: 0;
}

/* Page Hero */
.page-hero {
    background: linear-gradient(135deg, #2B2B2B 0%, var(--color-secondary) 100%);
    color: var(--color-white);
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    text-align: center;
}

.page-title {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    color: var(--color-white);
}

.page-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0;
}

/* About Section */
.about-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-white);
}

.about-grid {
    max-width: 800px;
    margin: 0 auto;
}

.about-text h2 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-lg);
}

.about-text p {
    margin-bottom: var(--spacing-lg);
    color: #555;
    line-height: 1.8;
}

/* Education Section */
.education-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-background);
}

.education-section h2 {
    text-align: center;
    margin-bottom: calc(var(--spacing-xl) * 2);
    color: var(--color-primary);
}

/* Skills Section */
.skills-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-background);
}

.section-title {
    text-align: center;
    margin-bottom: calc(var(--spacing-xl) * 2);
    color: var(--color-primary);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
}

.skill-category {
    background-color: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.skill-category h3 {
    color: var(--color-secondary);
    margin-bottom: var(--spacing-lg);
}

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

.skill-list li {
    padding: var(--spacing-sm) 0;
    color: #666;
    position: relative;
    padding-left: var(--spacing-lg);
}

.skill-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--color-accent);
    font-weight: bold;
}

/* Timeline */
.timeline-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-white);
}

.timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding: var(--spacing-2xl) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--color-accent), var(--color-secondary));
}

.timeline-item {
    margin-bottom: calc(var(--spacing-xl) * 2);
    padding-left: 100px;
    position: relative;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    background-color: var(--color-accent);
    border: 3px solid var(--color-white);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--color-background);
}

.timeline-content h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.timeline-date {
    color: var(--color-secondary);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    display: block;
}

.timeline-content p {
    color: #666;
    margin-bottom: 0;
}

/* Projects Section */
.projects-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-white);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-2xl);
}

.project-card {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--spacing-2xl);
    transition: all var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

.project-header h3 {
    color: var(--color-primary);
    margin-bottom: var(--spacing-md);
}

.project-description {
    color: #666;
    margin-bottom: var(--spacing-lg);
    flex-grow: 1;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.tech-badge {
    display: inline-block;
    background-color: var(--color-white);
    color: var(--color-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--color-secondary);
}

.project-links {
    display: flex;
    gap: var(--spacing-lg);
}

.project-link {
    color: var(--color-accent);
    font-weight: 600;
    transition: color var(--transition-normal);
    position: relative;
}

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

.project-link:hover::after {
    width: 100%;
}

/* Contact Section */
.contact-section {
    padding: calc(var(--spacing-xl) * 4) var(--spacing-xl);
    background-color: var(--color-background);
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(var(--spacing-xl) * 3);
    max-width: 1000px;
    margin: 0 auto;
}

.contact-info h2 {
    margin-bottom: var(--spacing-lg);
    color: var(--color-primary);
}

.contact-info p {
    color: #666;
    line-height: 1.8;
}

.contact-links {
    background-color: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: 8px;
    margin-top: var(--spacing-2xl);
}

.contact-links p {
    margin-bottom: var(--spacing-md);
}

.contact-links a {
    color: var(--color-accent);
    font-weight: 600;
}

/* Contact Form */
.contact-form-container {
    background-color: var(--color-white);
    padding: var(--spacing-2xl);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--spacing-sm);
}

.form-group input,
.form-group textarea {
    padding: var(--spacing-md);
    border: 2px solid var(--color-border);
    border-radius: 6px;
    font-family: var(--font-family-sans);
    font-size: 1rem;
    color: var(--color-text);
    transition: border-color var(--transition-normal);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
}

.error-message.show {
    display: block;
}

.success-message {
    color: var(--color-success);
    font-weight: 600;
    text-align: center;
    padding: var(--spacing-md);
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
    display: none;
}

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

/* Footer */
.footer {
    background-color: var(--color-primary);
    color: var(--color-white);
    padding: var(--spacing-2xl) var(--spacing-xl);
    margin-top: calc(var(--spacing-xl) * 4);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.copyright {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0;
}

.footer-links {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    transition: color var(--transition-normal);
}

.footer-link:hover {
    color: var(--color-accent);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navbar-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--color-white);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }

    .navbar-menu.active {
        max-height: 400px;
        border-bottom: 1px solid var(--color-border);
    }

    .navbar-menu li {
        width: 100%;
        padding: var(--spacing-md) 0;
        border-bottom: 1px solid var(--color-border);
    }

    .navbar-menu li a {
        display: block;
        padding: var(--spacing-md) var(--spacing-xl);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-2xl);
    }

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

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

    .timeline-item {
        padding-left: 60px;
    }

    .timeline-marker {
        left: -5px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .container {
        padding: 0 var(--spacing-lg);
    }

    /* Spacing Adjustments */
    .hero,
    .intro-section,
    .about-section,
    .education-section,
    .skills-section,
    .timeline-section,
    .projects-section,
    .contact-section {
        padding-top: calc(var(--spacing-xl) * 2);
        padding-bottom: calc(var(--spacing-xl) * 2);
    }

    .hero {
        padding-top: calc(var(--spacing-xl) * 4);
        /* Keep hero slightly larger */
    }

    /* Timeline Adjustments */
    .timeline::before {
        left: 15px;
    }

    .timeline-item {
        padding-left: 45px;
        margin-bottom: var(--spacing-xl);
    }

    .timeline-marker {
        left: 6px;
    }

    /* Project Card Adjustments */
    .project-card {
        padding: var(--spacing-lg);
    }

    /* Contact Form Adjustments */
    .contact-form-container {
        padding: var(--spacing-lg);
    }

    .contact-links {
        padding: var(--spacing-lg);
        margin-top: var(--spacing-xl);
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-unit: 6px;
        /* Scale down spacing unit slightly */
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .button {
        width: 100%;
        padding: 12px 24px;
        /* Larger touch target */
    }

    .page-title {
        font-size: 1.75rem;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-xl);
    }

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

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

    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-xl);
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    /* Ensure inputs are easy to tap */
    .form-group input,
    .form-group textarea {
        padding: 12px;
        font-size: 16px;
        /* Prevent zoom on iOS */
    }

    .navbar-menu .lang-switch {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 32px;
        /* Generous spacing for a clean look */
        padding: 24px 0;
        margin-top: 16px;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        /* Very subtle separator */
        width: 100%;
    }

    .navbar-menu .lang-switch a {
        font-family: var(--font-family-sans);
        font-size: 0.9rem;
        font-weight: 500;
        color: #999;
        /* Muted text by default */
        text-decoration: none;
        padding: 8px 12px;
        transition: all 0.3s ease;
        letter-spacing: 1px;
        text-transform: uppercase;
        position: relative;
    }

    .navbar-menu .lang-switch a:hover {
        color: var(--color-primary);
        /* Darken on hover */
    }

    /* Optional: Add a small dot for the active state if you want */
    .navbar-menu .lang-switch a:active {
        color: var(--color-primary);
        font-weight: 600;
    }

    .navbar-menu .lang-switch span {
        display: none;
        /* Hide the pipe separator */
    }
}