/* ==========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================== */
:root {
    /* Light Mode Colors (Default) */
    --color-background: #F0EEE9;
    --color-text-primary: #2F342D;
    --color-text-secondary: #41493C;
    --color-text-tertiary: #64705C;
    --color-accent: #09DF49;
    --color-border: #E4E6E1;

    /* Typography */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* Spacing */
    --spacing-none: 0;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    --spacing-3xl: 6rem;
    --spacing-4xl: 8rem;
    --spacing-5xl: 12rem;

    /* Layout */
    --container-max-width: 960px;
    --container-padding: 2rem;
    --header-height: 80px;

    /* Borders */
    --border-opacity-light: 0.08;
    --border-opacity-medium: 0.1;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --color-background: #1A1D1A;
    --color-text-primary: #E8E6E1;
    --color-text-secondary: #C5C3BE;
    --color-text-tertiary: #9B9A95;
    --color-accent: #09DF49;
    --color-border: #2F342D;
}

/* ==========================================
   RESET & BASE STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
    font-weight: var(--font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--header-height);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ==========================================
   TYPOGRAPHY
   ========================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-weight-regular);
    line-height: 1.2;
}

p {
    margin-bottom: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Specific hover states for navigation and links */
.nav-link:hover,
.view-projects-link:hover {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* ==========================================
   LAYOUT
   ========================================== */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg) 0;
    background-color: var(--color-background);
    z-index: 1000;
    border-bottom: 1px solid rgba(47, 52, 45, var(--border-opacity-light));
}

.nav {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    gap: var(--spacing-lg);
    justify-content: flex-end;
    align-items: center;
}

.nav-link {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-regular);
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

.nav-link.active {
    font-weight: var(--font-weight-semibold);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ==========================================
   THEME TOGGLE BUTTON
   ========================================== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    transition: opacity 0.2s ease, transform 0.2s ease;
    border-radius: 4px;
}

.theme-toggle:hover {
    opacity: 0.7;
    transform: rotate(15deg);
}

.theme-toggle:active {
    transform: rotate(30deg) scale(0.95);
}

.theme-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* ==========================================
   SKIP LINK (Accessibility)
   ========================================== */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-text-primary);
    color: var(--color-background);
    padding: var(--spacing-sm);
    text-decoration: none;
    z-index: 2000;
    font-weight: var(--font-weight-semibold);
}

.skip-link:focus {
    top: 0;
    opacity: 1;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */
.main {
    padding-top: var(--spacing-xl);
    padding-bottom: var(--spacing-none);
}

/* ==========================================
   HERO SECTION
   ========================================== */
.hero {
    display: flex;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-3xl);
}

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

.hero-intro {
    font-size: 1.5rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-regular);
    margin-bottom: var(--spacing-none);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.about-paragraph {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-light);
}

.about-tagline {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-regular);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

/* ==========================================
   EXPERIENCE SECTION
   ========================================== */
.experience {
    gap: var(--spacing-3xl);
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 1.5rem;
    font-weight: var(--font-weight-regular);
    color: var(--color-text-primary);
    padding-bottom: var(--spacing-sm);
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.experience-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(47, 52, 45, var(--border-opacity-medium));
}

.experience-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.experience-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.experience-role {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    font-size: 1rem;
    line-height: normal;
}

.experience-company {
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-regular);
    font-size: 1rem;
    line-height: normal;
}

.experience-period {
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-regular);
    white-space: nowrap;
    font-size: 1rem;
    line-height: normal;
}

/* ==========================================
   PROJECTS SECTION
   ========================================== */
.projects {
    margin-bottom: var(--spacing-3xl);
    margin-top: var(--spacing-3xl);
}

.projects-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.carousel-navigation {
    display: flex;
    gap: var(--spacing-sm);
}

.carousel-btn {
    background: none;
    border: 1px solid rgba(47, 52, 45, var(--border-opacity-medium));
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-text-primary);
    transition: all 0.3s ease;
}

.carousel-btn:hover {
    background-color: var(--color-text-primary);
    color: var(--color-background);
    transform: scale(1.05);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn i {
    width: 20px;
    height: 20px;
}

.projects-carousel {
    overflow: visible;
    margin-left: 0;
    margin-right: calc(-50vw + 50%);
}

.carousel-track {
    display: flex;
    gap: var(--spacing-lg);
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
    padding-bottom: var(--spacing-sm);
    padding-right: var(--container-padding);
}

.carousel-track::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.project-card {
    flex: 0 0 auto;
    width: 348px;
    background-color: var(--color-background);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-4px);
}

.project-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: rgba(47, 52, 45, 0.05);
    border-radius: 8px;
}

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

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

.project-info {
    padding: var(--spacing-md) 0;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.project-title {
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
    line-height: 1.4;
}

.project-client {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-regular);
}

.project-description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: var(--font-weight-light);
    line-height: 1.6;
    margin-top: var(--spacing-xs);
}

.project-link {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    font-weight: var(--font-weight-regular);
    text-decoration: underline;
    text-underline-offset: 3px;
    margin-top: var(--spacing-xs);
    transition: opacity 0.2s ease;
}

.project-link:hover {
    opacity: 0.7;
}

/* ==========================================
   FOOTER
   ========================================== */
.footer {
    padding: var(--spacing-md) 0;
    margin-top: var(--spacing-md);
    border-top: 1px solid var(--color-border);
}

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

.footer-text {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-light);
}

.footer-location {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    font-weight: var(--font-weight-light);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --container-padding: 1.5rem;
        --spacing-3xl: 4rem;
    }

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

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

    .view-projects-link {
        grid-column: 1;
    }

    .projects-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .project-card {
        width: 260px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --container-padding: 1.25rem;
        --spacing-2xl: 2.5rem;
        --spacing-3xl: 3rem;
    }

    .nav {
        flex-wrap: wrap;
        gap: var(--spacing-md);
        justify-content: flex-start;
    }

    .nav-link {
        font-size: 0.8125rem;
    }

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

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

    .about-paragraph {
        font-size: 0.875rem;
    }

    .experience-item {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .experience-period {
        align-self: flex-start;
    }

    .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .project-card {
        width: 240px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --container-padding: 1rem;
    }

    .header {
        padding: var(--spacing-md) 0;
    }

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

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