:root {
    --bg-body: #fdfcf9;
    --bg-card: #ffffff;
    --text-main: #1a2e1a;
    --text-dim: #5c715c;
    --primary: #2d6a4f;
    --primary-light: #d8f3dc;
    --accent: #ff6b35;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-lg: 0 15px 40px rgba(26, 46, 26, 0.12);
    --transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

@font-face {
    font-family: 'Font Awesome 5 Free';
    font-display: swap; 
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Plus Jakarta Sans', sans-serif; background: var(--bg-body); color: var(--text-main); overflow-x: hidden; line-height: 1.8; top: 0 !important; }

#progress-container { position: fixed; top: 0; width: 100%; height: 4px; z-index: 2000; background: rgba(0,0,0,0.05); }
#progress-bar { height: 100%; width: 0; background: var(--accent); transition: width 0.1s; }
.goog-te-banner-frame { display: none !important; }
#google_translate_element { display: none; }

#loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;

    background-color: #0d1a0d;
    background-image:
            radial-gradient(at 0% 0%, rgba(45, 106, 79, 0.3) 0px, transparent 50%),
            radial-gradient(at 100% 100%, rgba(255, 107, 53, 0.15) 0px, transparent 50%),
            linear-gradient(135deg, #0d1a0d 0%, #050a05 100%);

    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.8s;
}

.loader-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.loader-logo {
    width: 110px;
    height: 110px;
    margin-bottom: 30px;
    filter: drop-shadow(0 0 15px rgba(82, 183, 136, 0.3));
    animation: loaderPulse 2.5s infinite ease-in-out;
}

.loader-name {
    color: #ffffff;
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 35px 0;
    letter-spacing: 4px;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.progress-wrapper {
    width: 350px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #2d6a4f, #52b788, #ff6b35);
    box-shadow: 0 0 15px rgba(82, 183, 136, 0.4);
}

#progress-text {
    color: #ff6b35;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 1px;
}

@keyframes loaderPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.9; }
}

.nut-container {
    width: 80px; height: 80px; position: relative;
    transform-style: preserve-3d;
    animation: nutRotate 4s infinite linear;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

@keyframes nutRotate {
    0% { transform: rotateX(-20deg) rotateY(0deg); }
    100% { transform: rotateX(-20deg) rotateY(360deg); }
}

.nut-part {
    position: absolute; width: 100%; height: 100%;
    background: #bdc3c7;
    backface-visibility: visible;
    border: 2px solid #95a5a6;
}

.nut-part:nth-child(1) { transform: translateZ(20px); background: #ecf0f1; }
.nut-part:nth-child(2) { transform: translateZ(-20px) rotateY(180deg); background: #bdc3c7; }

.nut-part:nth-child(3) { width: 40px; transform: translateX(60px) rotateY(90deg); background: #95a5a6; }
.nut-part:nth-child(4) { width: 40px; transform: translateX(-20px) rotateY(-90deg); background: #95a5a6; }
.nut-part:nth-child(5) { height: 40px; transform: translateY(60px) rotateX(90deg); background: #7f8c8d; }
.nut-part:nth-child(6) { height: 40px; transform: translateY(-20px) rotateX(-90deg); background: #7f8c8d; }

.nut-part:nth-child(1)::after {
    content: ''; position: absolute; inset: 20px;
    background: #1a2e1a; border-radius: 50%;
    box-shadow: inset 0 5px 10px rgba(0,0,0,0.5);
}

.progress-circle-svg {
    position: absolute; inset: 0;
    transform: rotate(-90deg);
}

.progress-circle-back { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 8; }
.progress-circle-bar {
    fill: none; stroke: var(--accent); stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 0.1s linear;
}

.load-text { margin-top: 20px; color: white; font-weight: 800; font-size: 1.2rem; letter-spacing: 2px; opacity: 0.8; }

header { position: fixed; top: 0; width: 100%; z-index: 1000; padding: 30px 0; transition: var(--transition); }
header:not(.scrolled) .logo, header:not(.scrolled) nav a { color: white; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
header.scrolled { padding: 15px 0; background: rgba(253, 252, 249, 0.98); backdrop-filter: blur(15px); box-shadow: var(--shadow-lg); }
.nav-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 5%; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary); text-decoration: none; letter-spacing: 2px; }
.logo span { color: var(--accent); }
nav ul { display: flex; gap: 35px; list-style: none; align-items: center; }
nav a { font-weight: 700; color: var(--primary); text-decoration: none; font-size: 0.9rem; transition: 0.3s; text-transform: uppercase; }
nav a:hover { color: var(--accent) !important; }

.lang-selector { position: relative; margin-right: 15px; }
.lang-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 8px 15px; border-radius: 50px; cursor: pointer; font-weight: 700; font-size: 0.8rem; display: flex; align-items: center; gap: 8px; }
header.scrolled .lang-btn { color: var(--primary); border-color: var(--primary-light); background: rgba(45,106,79,0.05); }
.lang-dropdown { position: absolute; top: 120%; right: 0; background: white; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 10px; display: none; grid-template-columns: 1fr 1fr; gap: 5px; min-width: 240px; z-index: 3000; }
.lang-dropdown.active { display: grid; }
.lang-opt { padding: 8px 12px; font-size: 0.8rem; color: var(--text-main); border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.lang-opt:hover { background: var(--primary-light); color: var(--primary); }

.hero { min-height: 100vh; display: flex; align-items: center; position: relative; padding: 120px 0; }
.hero-bg { position: absolute; inset: 0; background: url('../images/background.webp') center/cover; filter: brightness(0.4); z-index: 1; }
.hero-grid { position: relative; z-index: 3; color: white; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; align-items: center; max-width: 1200px; margin: 0 auto; padding: 0 5%; }
.hero-text h1 { font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1.2; margin-bottom: 30px; }
.hero-text h1 span { color: var(--accent); }
.hero-text p { font-size: 1.3rem; margin-bottom: 45px; opacity: 0.9; font-weight: 300; }

.hero-visual .main-logo-frame {
    width: 100%; max-width: 350px; aspect-ratio: 1/1; background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4); box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    display: flex; align-items: center; justify-content: center; margin: 0 auto; overflow: hidden; padding: 5px;
}
.hero-visual img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.container { max-width: 1300px; margin: 0 auto; padding: 0 5%; }
h2 { font-size: 2.8rem; color: var(--primary); margin-bottom: 60px; display: flex; align-items: center; gap: 25px; font-weight: 800; }
h2::after { content: ''; height: 2px; flex-grow: 1; background: var(--primary-light); }

#skills { padding: 40px 0 40px 0; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; }
#projects {
    padding: 40px 0 0 0;
    background: #f4f7f4;
}
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 40px; }

.card { background: var(--bg-card); padding: 40px; border-radius: var(--radius-lg); box-shadow: 0 10px 30px rgba(45, 106, 79, 0.05); border: 1px solid rgba(45,106,79,0.03); transition: var(--transition); }
.card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.tag { background: var(--primary-light); color: var(--primary); padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; margin: 3px; display: inline-block; font-weight: 600; }
.project-header { display: flex; align-items: center; gap: 20px; margin-bottom: 25px; }
.project-icon { width: 70px; height: 70px; border-radius: 18px; object-fit: cover; border: 2px solid var(--primary-light); background: #fff; }

.contact-form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.contact-form input, .contact-form textarea { width: 100%; padding: 15px; border-radius: 12px; border: 1px solid #e0e0e0; font-family: inherit; }

.btn-submit { background: var(--primary); color: white; border: none; padding: 18px 40px; border-radius: 50px; font-weight: 800; cursor: pointer; transition: 0.3s; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.btn-submit:hover { background: var(--accent); transform: translateY(-3px); color: white; }

footer {
    background: linear-gradient(180deg, #1a2e1a, #294a29);
    color: white;
    padding: 80px 0 40px;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; margin-bottom: 50px; }
.social-icon { width: 45px; height: 45px; background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; text-decoration: none; transition: 0.3s; margin-right: 10px; }
.social-icon:hover { background: var(--accent); transform: translateY(-5px); }

#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #ff6b35;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

#backToTop:hover {
    background-color: #e55a2b;
    transform: translateY(-5px);
}

#backToTop.show {
    display: flex;
}

.carousel-container {
    position: relative;
    padding: 20px 0 60px 0;
    margin: 0 auto;
    width: 100%;
}

.carousel-viewport {
    overflow: hidden;
    padding: 20px 5px;
}

.carousel-track {
    display: flex;
    flex-wrap: nowrap;
    gap: 25px;
    transition: transform 0.7s cubic-bezier(0.19, 1, 0.22, 1);
}

.carousel-track .card {
    min-width: calc((100% - 50px) / 3);
    max-width: calc((100% - 50px) / 3);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: 585px;
    background: white;
    padding: 30px;
    position: relative;
    overflow: hidden;
}

@media (max-width: 1100px) {
    .carousel-track .card {
        min-width: calc((100% - 25px) / 2);
        max-width: calc((100% - 25px) / 2);
    }
}

@media (max-width: 768px) {
    .carousel-track .card {
        min-width: 100%;
        max-width: 100%;
    }
    .carousel-nav { display: none; }
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: var(--shadow-lg);
    color: var(--primary);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.carousel-nav.prev { left: -30px; }
.carousel-nav.next { right: -30px; }

.carousel-nav:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.project-preview-img {
    width: calc(100% + 60px);
    margin: -30px -30px 25px -30px;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.project-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
}

.project-badge.pro {
    background: #ffffff !important;
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

.dot-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 6px #2ecc71;
}

.project-badge.pro .dot-status {
    background: #e74c3c;
    box-shadow: 0 0 6px #e74c3c;
}

.btn-simple {
    color: var(--primary) !important;
    text-decoration: none;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    position: relative;
    padding: 8px 0;
    margin-top: auto;
}

.btn-simple::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.btn-simple:hover { color: var(--accent) !important; }
.btn-simple:hover::after { transform: scaleX(1); transform-origin: left; }
.btn-simple i { font-size: 0.8rem; transition: transform 0.3s ease; }
.btn-simple:hover i { transform: translateX(4px); }

.carousel-nav {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: var(--primary);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.carousel-nav:hover {
    background: var(--primary);
    color: white;
}

.carousel-nav.prev { left: -25px; }
.carousel-nav.next { right: -25px; }

/* --- RESPONSIVE --- */
.menu-toggle { display: none; }
.menu-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px); opacity: 0; visibility: hidden;
    transition: 0.3s; z-index: 1500;
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }
    .hero-visual { order: -1; }
    .hero-text { display: flex; flex-direction: column; align-items: center; }

    .projects-grid { grid-template-columns: 1fr; }
    h2 { font-size: 2.2rem; }
}

@media (max-width: 900px) {
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 20px;
        cursor: pointer;
        z-index: 3000;
        margin-left: 25px;
    }

    .bar {
        width: 100%;
        height: 3px;
        background-color: white;
        border-radius: 10px;
        transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    }

    header.scrolled .bar { background-color: var(--primary); }

    .menu-toggle.is-active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--accent); }
    .menu-toggle.is-active .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.is-active .bar:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); background-color: var(--accent); }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;

        background-color: #ffffff;
        padding: 120px 40px;
        transition: right 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        z-index: 2500;
        display: block !important;

        -webkit-font-smoothing: antialiased;
    }

    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        backdrop-filter: none;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 2000;
    }

    nav.active { right: 0; }

    nav ul {
        flex-direction: column;
        gap: 30px;
        align-items: flex-start;
    }

    nav a {
        color: #333 !important;
        font-size: 1.3rem;
        font-weight: 600;
        text-shadow: none !important;
        opacity: 1 !important;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 576px) {
    .container { padding: 0 20px; }

    .hero { padding: 100px 0 60px; }
    .hero-text h1 { font-size: 2.2rem; }
    .hero-text p { font-size: 1.1rem; margin-bottom: 30px; }

    .hero-visual .main-logo-frame { max-width: 260px; }

    h2 { font-size: 1.8rem; flex-direction: column; align-items: flex-start; gap: 10px; }
    h2::after { width: 50px; flex-grow: 0; }

    .card { padding: 30px 20px; }

    .projects-grid { gap: 25px; }
    .project-header { flex-direction: column; align-items: flex-start; gap: 15px; }

    .form-row { grid-template-columns: 1fr; }

    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-links { justify-content: center; }
}

@media (max-width: 360px) {
    :root { --radius-lg: 16px; }

    .logo { font-size: 1.2rem; }
    .lang-btn { padding: 6px 10px; font-size: 0.7rem; }

    .hero-text h1 { font-size: 1.8rem; }

    .hero-text div[style*="display:flex"] {
        flex-direction: column;
        width: 100%;
    }
    .hero-text .btn-submit { width: 100%; justify-content: center; }

    nav { width: 100%; }
}