@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

/* --- COLOR VARIABLES --- */
:root {
    /* LIGHT MODE */
    --bg-body: #f9f9f9;
    --bg-navbar-scrolled: #ffffff;
    --text-main: #171717;
    --text-muted: #4a4a4a;
    --text-nav-scrolled: #171717;
    --bg-section-alt: #ebebeb;
    --bg-media: #e0e0e0;
    --border-color: #eaeaea;
    --logo-filter-scrolled: invert(1); 
    --hamburger-scrolled: #171717;
    --menu-bg: #ffffff;
}

body.dark-mode {
    /* DARK MODE */
    --bg-body: #0a0a0a;
    --bg-navbar-scrolled: #171717;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --text-nav-scrolled: #ffffff;
    --bg-section-alt: #121212;
    --bg-media: #1f1f1f;
    --border-color: #333333;
    --logo-filter-scrolled: none;
    --hamburger-scrolled: #ffffff;
    --menu-bg: #0a0a0a;
}

/* --- BASE STYLES --- */
html {
    scroll-behavior: smooth;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
    cursor: pointer;
}

a:hover {
    opacity: 0.7;
}

img {
    max-width: 100%;
    display: block;
}

/* --- THEME SWITCHER --- */
.theme-switcher {
    cursor: pointer;
    margin-left: 20px;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-switcher:hover {
    transform: rotate(15deg);
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-body);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loader-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-logo {
    width: 60px;
    filter: var(--logo-filter-scrolled); 
    z-index: 2;
    transition: filter 0.3s ease;
}

.loader-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid rgba(125, 125, 125, 0.1);
    border-top: 2px solid var(--text-main);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- BACK TO TOP (BTT) --- */
.btt-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    mix-blend-mode: difference;
}

.btt-container.visible {
    opacity: 1;
    pointer-events: all;
}

.btt-icon {
    width: 40px;
    height: 40px;
    filter: invert(1); 
}

.btt-text {
    font-size: 10px;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    z-index: 1000;
    transition: background-color 0.4s ease, padding 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
    color: #ffffff;
}

.navbar.scrolled {
    background-color: var(--bg-navbar-scrolled);
    padding: 0 30px;
    color: var(--text-nav-scrolled);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar.menu-open .hamburger span {
    background-color: var(--text-main) !important;
}

.navbar.menu-open .nav-logo {
    filter: var(--logo-filter-scrolled);
    opacity: 1;
}

.nav-links-desktop {
    display: flex;
    gap: 30px;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 1px;
    width: 300px;
    align-items: center;
}

.nav-right {
    justify-content: flex-end;
}

.nav-logo-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
}

.nav-logo {
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s ease;
    width: 40px;
    filter: none; 
}

.navbar.scrolled .nav-logo {
    opacity: 1;
    transform: translateY(0);
    filter: var(--logo-filter-scrolled); 
}

.lang-switcher span { cursor: pointer; }
.lang-active {
    text-decoration: underline;
    text-underline-offset: 4px;
    font-weight: 600;
}

/* --- HAMBURGER MENU --- */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #ffffff;
    transition: 0.3s;
}

.navbar.scrolled .hamburger span {
    background-color: var(--hamburger-scrolled);
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--menu-bg); 
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    transform: translateY(-100%);
    transition: transform 0.4s ease-in-out;
    z-index: 999;
}

.mobile-menu.active {
    transform: translateY(0);
}

.mobile-menu a {
    font-size: 1.1rem;
    letter-spacing: 1.5px;
    font-weight: 400;
}

/* --- HERO SECTION --- */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    color: #ffffff;
}

/* Current image container */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
}

/* Next image pseudo-element (cross-fade buffer) */
.hero-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1; 
    opacity: 0;  
    transition: opacity 1.5s ease-in-out;
    background-image: var(--next-bg-image);
}

.hero-bg.fading::before {
    opacity: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    z-index: 0;
}

/* --- HERO CONTENT --- */
.hero-content {
    z-index: 2; 
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-content.hidden {
    opacity: 0;
    transform: translateY(-50px);
    pointer-events: none;
}

.hero-logo {
    width: 120px;
    margin-bottom: 25px;
    filter: none; 
    transition: width 0.3s ease;
}

.hero h1 {
    font-size: 2.5rem;
    letter-spacing: 6px;
    font-weight: 400;
    margin-bottom: 12px; 
    text-transform: uppercase;
    transition: font-size 0.3s ease;
}

.hero h2 {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 3px;
    opacity: 0.9;
    transition: font-size 0.3s ease;
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 10;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-10px);}
    60% {transform: translateX(-50%) translateY(-5px);}
}

/* --- SHARED LAYOUT FOR ABOUT & PROJECTS --- */
.split-layout {
    display: flex;
    height: 90vh; 
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--bg-body);
}

.split-layout.reverse {
    flex-direction: row-reverse;
}

.split-half-media {
    flex: 0 0 50%;
    width: 50%;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-media);
}

.split-half-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* --- GALLERY SPECIFICS --- */
.project-gallery { 
    cursor: pointer; 
}
.project-gallery:active { 
    cursor: grabbing; 
}

.gallery-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    object-fit: cover;
}

.gallery-slide.active { 
    opacity: 1; 
    z-index: 1; 
}

.dots-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.dot.active { 
    background-color: rgba(255, 255, 255, 1); 
}

.split-half-text {
    flex: 0 0 50%;
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px;
    background-color: var(--bg-body);
    transition: background-color 0.3s ease;
}

.split-half-text h2, .split-half-text h3 {
    font-size: 2.2rem;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 20px;
    color: var(--text-main);
}

.split-half-text p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 550px;
}

/* --- SECTION HEADER --- */
.section-header {
    text-align: center;
    padding: 100px 20px;
    background-color: var(--bg-section-alt); 
    transition: background-color 0.3s ease;
}

.section-header h3 {
    font-size: 2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--text-main);
}

.section-header p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1rem;
    color: var(--text-muted);
}

/* --- CONTACT SECTION --- */
.contact-section {
    text-align: center;
    background-color: var(--bg-section-alt);
    padding: 140px 20px;
    transition: background-color 0.3s ease;
}

.contact-section h3 {
    font-size: 2rem;
    margin-bottom: 25px;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-main);
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 60px;
    margin-top: 60px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    color: var(--text-main);
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-item:hover {
    transform: translateY(-5px);
    opacity: 0.7;
}

.contact-item i {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--bg-body);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.footer-links {
    margin-top: 15px;
    margin-bottom: 30px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: underline;
}

.ds-logo {
    width: 120px;
    margin: 0 auto;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

body.dark-mode .ds-logo {
    filter: invert(1);
}

.ds-logo:hover { opacity: 1; }

/* --- PRIVACY PAGE STYLES --- */
.privacy-page {
    padding: 120px 20px 60px;
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--bg-body);
}

.privacy-page h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-main);
}

.privacy-page h2 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-main);
}

.privacy-page p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.privacy-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.back-link {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- RESPONSIVE & DESKTOP OVERRIDES --- */

/* Desktop Specifics (min-width: 1024px) */
@media (min-width: 1024px) {
    .hero-content {
        position: absolute;
        right: 15%; 
        top: 50%;
        transform: translateY(-50%);
        align-items: center; 
        text-align: center;     
    }

    .hero-content.hidden {
        transform: translateY(-50%) translateY(-30px); 
        opacity: 0;
    }

    .hero-logo {
        width: 90px;
        margin-bottom: 20px;
    }

    .hero h1 {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }

    .hero h2 {
        font-size: 0.9rem;
        letter-spacing: 2px;
    }
}

/* Tablet & Mobile Specifics (max-width: 1024px) */
@media (max-width: 1024px) {
    .navbar { padding: 0 20px; }
    .nav-links-desktop { display: none; }
    .hamburger { display: flex; }
    .nav-right { display: none; }
    .nav-logo-container { position: absolute; left: 50%; transform: translateX(-50%); }

    .split-layout, .split-layout.reverse { flex-direction: column; height: auto; }
    .split-half-media { flex: none; width: 100%; height: 50vh; }
    .split-half-text { flex: none; width: 100%; padding: 60px 20px; }
    
    .btt-container { bottom: 20px; right: 20px; }
    .btt-icon { width: 35px; height: 35px; }
}

@media (max-width: 600px) {
    .hero h1 { font-size: 1.8rem; letter-spacing: 3px; }
    .hero h2 { font-size: 0.9rem; }
    .contact-grid { flex-direction: column; gap: 40px; }
}