:root {
    --max-width: 1400px;
    --background-color: #35312b;
    --text-color: #e3d5b9;
    --text-color-bright: #ffffff;
    --text-color-muted: rgba(227, 213, 185, 0.7);
    --accent-color: #cf6140;
    --font-primary: 'Calps', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 6rem;
}

/* Font embedding with WOFF2 for better browser support */
@font-face {
    font-family: 'Calps';
    src: url("../assets/fonts/Calps-Sans-Regular.woff2") format("woff2"),
         url("../assets/fonts/Calps-Sans-Regular.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url("../assets/fonts/Inter-Medium.woff2") format("woff2"),
         url("../assets/fonts/Inter-Medium.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url("../assets/fonts/Inter-Bold.woff2") format("woff2"),
         url("../assets/fonts/Inter-Bold.ttf") format("truetype");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

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

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-secondary);
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

body.modal-open {
    overflow: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../assets/noise-pattern.png');
    pointer-events: none;
    z-index: 1000;
    mix-blend-mode: overlay;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: transparent;
    transition: background-color 0.3s ease;
}

nav.scrolled {
    background-color: var(--background-color);
}

.logo,
.logo:visited {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: auto;
}

.nav-links a,
.nav-links a:visited {
    color: var(--accent-color);
    text-decoration: none;
    font-family: var(--font-primary);
    font-size: 21px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-color);
}

.language-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.current-language,
.dropdown-content img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: block;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: -8px;
    background-color: var(--background-color);
    min-width: 24px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1;
    border-radius: 8px;
    padding: var(--spacing-xs);
    margin-top: var(--spacing-xs);
}

.language-dropdown:hover .dropdown-content,
.language-dropdown:focus-within .dropdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    pointer-events: auto;
}

/* Add padding around dropdown to increase hover area */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    z-index: -1;
}

.dropdown-content img {
    width: 24px;
    height: 24px;
    padding: var(--spacing-xs);
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}

.dropdown-content img:hover {
    transform: scale(1.1);
}

h1#recent-experience-title {
    font-family: var(--font-primary);
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
    font-weight: normal;
    line-height: 1;
}

.subtitle {
    color: var(--text-color-muted);
    margin-bottom: var(--spacing-lg);
}

.experience-item {
    display: grid;
    grid-template-columns: 250px 400px 1fr;
    gap: var(--spacing-lg);
    padding-top: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    align-items: flex-start;
}

.experience-years {
    font-family: var(--font-primary);
    font-size: 3.3rem;
    line-height: 1;
    color: var(--text-color-muted);
    white-space: nowrap;
    font-weight: normal;
    width: 250px;
    padding-right: var(--spacing-lg);
}

.position-info {
    width: 400px;
    padding-right: var(--spacing-lg);
}

.position-title,
.employer-name {
    font-family: var(--font-primary);
    font-size: 3.3rem;
    line-height: 0.9;
    margin-bottom: var(--spacing-xs);
    font-weight: normal;
}

.employer-name {
    color: var(--accent-color);
}

.position-details {
    flex: 1;
}

.functions-title,
.responsibilities-title,
.projects-title {
    font-family: var(--font-primary);
    font-size: 2rem;
    line-height: 1.2;
    color: var(--text-color-muted);
    margin-bottom: var (--spacing-xs);
    font-weight: normal;
}

.functions-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-lg);
}

.project-info-box .functions-list {
    margin-top: var(--spacing-md);
    margin-bottom: 0;
}

.functions-list span {
    padding: 4px 12px;
    border: 1px solid rgba(227, 213, 185, 0.5);
    border-radius: 10px;
    font-size: 0.9rem;
}

.responsibilities-text {
    font-size: 1rem;
    color: var (--text-color-muted);
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

.projects-list {
    font-size: 1rem;
    line-height: 1.5;
    list-style: disc;
    padding-left: 1.2rem;
    color: var (--text-color-muted);
}

.project-title {
    color: var (--accent-color);
    cursor: pointer;
    font-weight: bold;
}

.project-title:hover {
    opacity: 0.8;
}

/* Project Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(53, 49, 43, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-modal {
    background: var(--text-color);
    color: var(--background-color);
    max-width: 1024px;
    width: 90%;
    margin: 2rem;
    position: relative;
    border-radius: 4px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content {
    padding: calc(var(--spacing-lg) * 2);
    padding-left: calc(var(--spacing-lg) * 3);
    display: flex;
    gap: calc(var(--spacing-lg) * 2);
}

.project-modal-main {
    flex: 1 1 60%;
}

.project-modal-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    color: var(--background-color);
    margin-bottom: var(--spacing-md);
    font-weight: normal;
    line-height: 0.9;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--background-color);
    border: none;
    color: var(--text-color);
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: var(--accent-color);
}

.divider {
    height: 2px;
    background-color: var(--accent-color);
    margin: var(--spacing-md) 0;
}

.project-modal-description {
    color: var(--background-color);
    margin-bottom: var(--spacing-lg);
    white-space: pre-line;
}

.project-info-box {
    flex: 0 0 40%;
    background: var(--background-color);
    color: var(--text-color);
    border-radius: 10px;
    padding: var(--spacing-lg) 2.5rem;
    align-self: flex-start;
}

.project-info-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    position: relative;
}

.project-info-label {
    font-family: var(--font-primary);
    font-size: 2rem;
    color: var(--text-color);
    font-weight: normal;
    padding-right: 1rem;
}

.project-info-value {
    font-family: var(--font-secondary);
    font-size: 1rem;
    text-align: left;
    min-width: 120px;
}

.project-info-item:last-child {
    display: block;
}

.project-info-item:last-child .project-info-value {
    min-width: 100%;
    margin-top: var(--spacing-sm);
}

.project-info-item .functions-list {
    display: block;
}

.project-info-item .functions-list span {
    display: inline-block;
    margin-bottom: var(--spacing-xs);
    margin-right: var(--spacing-xs);
}

.project-media {
    margin-top: calc(var(--spacing-lg) * 2);
    display: grid;
    gap: var(--spacing-lg);
}

.project-media img,
.project-media video {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.project-media embed {
    width: 100%;
    height: 600px;
    border-radius: 4px;
}

/* Hero Section */
.hero-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    background-color: var(--background-color);
}

.hero-section.loading {
    background-color: var(--background-color);
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--background-color);
    opacity: 0;
    transition: opacity 0.5s ease;
    will-change: opacity;
    filter: blur(10px);
}

.hero-video.loaded {
    opacity: 1;
}

@media (max-aspect-ratio: 16/9) {
    .hero-video {
        width: 300%;
        left: -100%;
    }
}

@media (max-aspect-ratio: 9/16) {
    .hero-video {
        width: 500%;
        left: -200%;
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: var(--spacing-lg) var(--spacing-lg) calc(var(--spacing-lg) * 4) var(--spacing-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: right;
    width: 100%;
}

.hero-title {
    font-family: var(--font-primary);
    font-size: 60px;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
    line-height: 1;
    white-space: nowrap;
    max-width: max-content;
    font-weight: normal;
    text-align: right;
    width: fit-content;
    margin-left: auto;
    overflow-wrap: break-word;
}

.hero-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: flex-end;
    text-align: right;
    width: fit-content;
    margin-left: auto;
    white-space: nowrap;
    max-width: max-content;
}

.hero-item {
    background-color: var(--background-color);
    color: var(--accent-color);
    font-family: var(--font-secondary);
    font-size: 19px;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    display: inline-block;
    width: fit-content;
    transition: transform 0.3s ease;
    white-space: nowrap;
}

.hero-clients {
    position: absolute;
    bottom: var(--spacing-lg);
    left: 0;
    right: 0;
    overflow: visible;
    height: 60px;
    z-index: 3;
    width: 100vw;
}

.client-scroll {
    display: flex;
    gap: calc(var(--spacing-lg) * 3);
    animation: scrollLogos 45s linear infinite;
    padding: 0 calc(var(--spacing-lg) * 2);
    will-change: transform;
    width: max-content;
}

.client-scroll .client-logo-link {
    animation: none;
}

.client-logo {
    height: 40px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.3s;
    filter: brightness(0) invert(1);
    flex-shrink: 0;
}

.client-logo:hover {
    opacity: 1;
}

@keyframes scrollLogos {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-50% - var(--spacing-lg) * 1.5)); }
}

.client-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xs);
    text-decoration: none;
}

.client-logo-link:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .client-logo-link {
        padding: var(--spacing-sm);
    }

    .client-logo {
        height: 24px;
    }

    .hero-title {
        font-size: 40px;
        max-width: 100%;
        white-space: normal;
    }

    .hero-content {
        padding: var(--spacing-lg);
    }

    .hero-clients {
        width: 100%;
        overflow: hidden;
    }
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, 
        rgba(53, 49, 43, 0) 0%,
        rgba(53, 49, 43, 0.5) 50px,
        var(--background-color) 100px
    );
    margin-top: 100vh;
    padding-top: 100px;
    min-height: 100vh;
}

/* Profile Section */
.profile-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg);
    display: grid;
    grid-template-columns: 600px 1fr;
    gap: calc(var(--spacing-lg) * 3);
    margin-bottom: calc(var(--spacing-lg) * 3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    scroll-margin-top: 80px;
}

.profile-image {
    width: 600px;
    height: 600px;
    object-fit: cover;
    border-radius: 4px;
}

.profile-content {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-lg) * 2);
}

.profile-name {
    font-family: var(--font-primary);
    font-size: 60px;
    color: var(--text-color-bright);
    margin-bottom: var(--spacing-md);
    line-height: 1;
    font-weight: normal;
}

.profile-location {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-family: var(--font-primary);
    color: var(--text-color);
    font-size: 32px;
    font-weight: normal;
}

.profile-subtitle {
    font-family: var(--font-primary);
    font-size: 32px;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
    font-weight: normal;
}

.profile-bullets {
    list-style: none;
    padding-left: 24px;
    color: var(--text-color-muted);
    font-size: 16px;
    line-height: 1.6;
}

.profile-bullets li {
    position: relative;
    margin-bottom: var(--spacing-md);
}

.profile-day-to-day-bullets li,
.profile-soft-skills-bullets li {
    margin-bottom: var(--spacing-sm);
}

.profile-bullets li:last-child {
    margin-bottom: 0;
}

.profile-bullets li::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 10px;
    width: 6px;
    height: 6px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.profile-soft-skills {
    grid-column: 1;
    margin-top: calc(var(--spacing-lg) * 2);
    padding-right: calc(var(--spacing-lg) * 2);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .profile-section {
        grid-template-columns: 400px 1fr;
        gap: calc(var(--spacing-lg) * 2);
    }

    .profile-image {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 768px) {
    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: var(--spacing-lg);
    }

    .profile-image {
        width: 100%;
        height: auto;
        max-width: 400px;
        max-height: 400px;
        margin: 0 auto;
    }

    .profile-name {
        font-size: 48px;
        text-align: left;
    }

    .profile-location {
        align-items: center;
        font-size: 28px;
        text-align: left;
    }

    .profile-subtitle {
        font-size: 28px;
        text-align: left;
    }

    .profile-bullets {
        text-align: left;
        padding-left: 20px;
    }

    .profile-bullets li::before {
        left: -20px;
        top: 8px;
        width: 5px;
        height: 5px;
    }
}

/* Map Section */
.map-section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--spacing-lg);
    margin-bottom: calc(var(--spacing-lg) * 3);
}

.map-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 57.14%;
    margin-bottom: calc(var(--spacing-lg) * 2);
}

.world-map {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Contact Section */
.contact-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-top: calc(var(--spacing-lg) * 2);
}

.contact-button {
    width: 100%;
    display: flex;
    align-items: center;
    padding: var(--spacing-lg);
    background: var(--text-color);
    color: var(--background-color);
    border: none;
    border-top: 2px solid var(--background-color);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.contact-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-color);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: -1;
}

.contact-button:hover::before {
    transform: translateY(0);
}

.contact-button-content {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    transition: transform 0.3s ease;
}

.contact-icon {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.contact-text {
    font-family: var(--font-primary);
    font-size: 32px;
}

.contact-button:hover {
    background: var(--background-color);
    color: var(--text-color);
    border-top: 2px solid var(--text-color);
}

.contact-button:hover .contact-button-content {
    transform: translateX(10px);
}

.loading, .error {
    color: var(--text-color-muted);
    text-align: center;
    padding: var(--spacing-lg);
    font-family: var (--font-secondary);
}

.error {
    color: var (--accent-color);
}

.hero-clients.loading,
.map-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-container.loading {
    min-height: 300px;
}

@media (max-width: 768px) {
    .experience-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    nav {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }

    .nav-links {
        display: flex;
        justify-content: space-between;
        width: 100%;
        overflow-x: auto;
        padding-bottom: var(--spacing-xs);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-behavior: smooth;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        flex: 0 0 auto;
        font-size: 18px;
        padding: var(--spacing-xs) var(--spacing-xs);
        position: relative;
    }

    .nav-links a:focus-visible {
        outline: 2px solid var(--accent-color);
        outline-offset: 2px;
        border-radius: 4px;
    }

    .language-dropdown {
        position: absolute;
        top: var(--spacing-md);
        right: var(--spacing-md);
    }

    .project-modal {
        width: 100%;
        margin: 0;
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }

    .hero-content {
        padding: var(--spacing-lg);
        align-items: flex-start;
    }

    .hero-title {
        font-size: 40px;
        max-width: 100%;
    }

    .hero-items {
        max-width: 100%;
    }

    .hero-item {
        font-size: 16px;
        white-space: normal;
        word-break: break-word;
    }

    .profile-section {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-image {
        margin: 0 auto;
    }
    
    .profile-location {
        justify-content: flex-start;
    }

    .profile-bullets {
        text-align: left;
    }

    .client-logo {
        height: 30px;
    }

    .client-scroll {
        gap: calc(var(--spacing-lg) * 2);
        padding: 0 calc(var(--spacing-lg) * 1.5);
    }

    .map-container {
        padding-bottom: 75%;
    }

    .map-pin {
        width: 6px;
        height: 6px;
    }

    .pin-tooltip {
        font-size: 12px;
        padding: 2px 6px;
        opacity: 1;
        background: rgba(53, 49, 43, 0.9);
    }

    .contact-button {
        padding: var(--spacing-md);
    }

    .contact-icon {
        width: 24px;
        height: 24px;
    }

    .contact-text {
        font-size: 24px;
    }

    .modal-content {
        flex-direction: column;
        padding: var(--spacing-lg);
    }

    .project-modal-title {
        font-size: 2rem;
    }

    .project-info-box {
        margin-top: var(--spacing-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-item:hover {
        transform: none;
    }

    .contact-button:hover .contact-button-content {
        transform: none;
    }

    .client-scroll {
        animation: none;
        justify-content: center;
    }

    .hero-video {
        transform: none;
    }
}

.location-icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
    position: relative;
    top: -2px;
}