:root {
    --bg-color: #f7f7f7;
    --text-color: #373636;
    --secondary-text: #867f9f;
    --accent: #fcd92c;
    --font-stack: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --transition-speed: 0.5s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    cursor: none !important;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: scroll;
    /* Force vertical scrollbar to prevent horizontal jumping when content height changes */
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-wrapper {
    padding-top: 8vh;
    /* Reduced from 12vh so it doesn't start too low on laptops */
    padding-bottom: 60px;
}

/* Header */
#site-header {
    width: 100%;
    z-index: 100;
    view-transition-name: site-header;
    /* Separate from root so it doesn't fade */
}


.header-content {
    max-width: 650px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.personal-info {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
}

.name-details {
    display: flex;
    flex-direction: column;
}

.name-details h1 {
    font-size: 24px;
    font-weight: 500;
    margin: 0 0 px 0;
}

.name-details p {
    color: var(--secondary-text);
    font-size: 14px;
    margin: 0;
    opacity: 0.5;
    /* Made lighter as requested */
}

.social-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.nav-link {
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: color 0.2s;
    display: flex;
    align-items: center;
}

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

/* Main Carousel Container */
#main-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    transition: opacity var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.carousel-container {
    width: 100%;
    margin-top: 100px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 40px 0;
    /* Add padding so hover scale and shadows don't clip */
    margin: -40px 0;
    /* Offset padding to keep layout exactly the same */
    scroll-behavior: smooth;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    align-items: center;
    gap: 120px;
    padding-left: calc(50vw - 325px);
    /* Align with header content (max-width 650) */
    padding-right: 50vw;
    /* Allow scrolling past the end */
    width: max-content;
}

.carousel-track img {
    -webkit-user-drag: none;
    /* Prevent ghost dragging when dragging carousel */
    user-select: none;
}

/* Carousel Items */
.carousel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-item:hover {
    transform: scale(1.02);
}

.device-frame.image-only {
    position: relative;
    /* No borders or background, just scaling the image properly */
}

.device-frame.image-only img {
    height: 360px;
    /* Reduced from 480px to fit on notebook screens */
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.1));
}

.carousel-item[data-id="moodslab"] .device-frame.image-only img {
    height: 350px;
    /* Kept slightly smaller as requested */
}

.item-label {
    margin-top: 24px;
    text-align: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.carousel-item:hover .item-label {
    opacity: 1;
    transform: translateY(0);
}

.item-label h2 {
    font-size: 20px;
    font-weight: 500;
}

.item-label p {
    font-size: 14px;
    color: var(--secondary-text);
    margin-top: 4px;
}

/* Project View (Detail State) */
#project-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 200;
    overflow-y: auto;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

#project-view.active {
    opacity: 1;
    pointer-events: auto;
}

#close-project {
    position: fixed;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-color);
    z-index: 210;
    transition: transform 0.2s;
}

#close-project:hover {
    transform: scale(1.1);
}

#project-content-area {
    min-height: 100vh;
    padding: 100px 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

/* View Transitions Setup */
body:not(.is-viewing) .carousel-item[data-active="true"] .device-frame {
    view-transition-name: active-project;
}

body.is-viewing .hero-device,
body.is-viewing .hero-image {
    view-transition-name: active-project;
}

::view-transition-old(active-project),
::view-transition-new(active-project) {
    animation-duration: 0.6s;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

/* Project Detail Layouts */
.project-detail-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 80px;
    max-width: 1100px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.6s 0.3s forwards cubic-bezier(0.25, 1, 0.5, 1);
}

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

.hero-device.image-only {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-device.image-only img {
    max-height: 80vh;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.15));
}

.hero-image {
    width: 400px;
    height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.text-content {
    flex: 1;
    max-width: 550px;
    text-align: left;
}

.text-content h1, .text-content h2 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 10px;
}

.text-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 24px 0 8px 0;
    color: var(--text-color);
}

.text-content .subtitle {
    font-size: 16px;
    color: var(--secondary-text);
    margin-bottom: 30px;
}

.text-content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-color);
}

.image-gallery {
    margin-top: 60px;
    width: 100%;
}

.image-gallery img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.btn {
    display: inline-block;
    margin-top: 30px;
    padding: 15px 30px;
    background-color: var(--text-color);
    color: #fff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: background-color 0.2s;
}

.btn:hover {
    background-color: #000;
}

/* Layout adjustments */
body.is-viewing #main-container {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* About Modal */
#about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(247, 247, 247, 0.95);
    backdrop-filter: blur(10px);
    color: var(--text-color);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

#about-modal.active {
    opacity: 1;
    pointer-events: auto;
}

#close-about {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s;
}

#close-about:hover {
    transform: scale(1.1);
}

.about-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    text-align: left;
    padding: 20px;
    /* Hide scrollbar for clean look */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.about-content::-webkit-scrollbar {
    display: none;
}

.about-header {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 30px;
}

.about-image-wrapper {
    position: relative;
    width: 140px; /* um pouco menor que os 180px originais pra caber bem circular */
}

.about-main-img {
    width: 100%;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
}

.about-header-text h2 {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.2;
    margin: 0 0 16px 0;
    letter-spacing: 0.5px;
    color: var(--text-color);
}

.about-info-lines {
    font-size: 14px;
    line-height: 1.5;
    color: var(--secondary-text);
    margin: 0 0 16px 0;
}

.about-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.about-tags span {
    background-color: rgba(60, 50, 150, 0.1);
    color: #3c3296;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.about-description p {
    font-size: 15px;
    line-height: 1.6;
    color: var(--secondary-text);
    margin: 0 0 24px 0;
    font-weight: 300;
}

.about-description strong {
    color: var(--text-color);
    font-weight: 500;
}

.about-languages {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.lang-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.lang-flag {
    font-size: 24px;
}

.lang-level {
    font-size: 12px;
    color: var(--secondary-text);
}

.about-section {
    margin-bottom: 40px;
}

.about-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.about-list li {
    position: relative;
    padding-left: 16px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--secondary-text);
}

.about-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-color);
}

.about-list li strong {
    color: var(--text-color);
    font-weight: 500;
}

/* Custom Cursor */
#custom-cursor {
    position: fixed;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, opacity 0.2s;
    backdrop-filter: invert(0.1) brightness(1.2) blur(5px);
    -webkit-backdrop-filter: invert(0.1) brightness(1.2) blur(5px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    opacity: 1;
    mix-blend-mode: multiply;
}

#custom-cursor.active {
    width: 60px;
    height: 60px;
}

/* Header Profile Pic */
.header-profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    /* margin-bottom removed for side-by-side layout */
}

/* Project Logo in details */
.project-logo {
    max-width: 250px;
    height: auto;
    margin: 0 0 10px 0;
    display: block;
}

/* Category Menu */
.category-menu {
    display: flex;
    gap: 40px;
    padding-left: calc(50vw - 325px);
    /* Align with header content (max-width 650) */
    margin-bottom: 40px;
    margin-top: 50px;
    /* Reduced from 100px as requested */
    view-transition-name: category-menu;
    /* Separate from root so it doesn't fade */
}

.category-btn {
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 400;
    /* Regular as requested */
    color: #ccc;
    font-family: inherit;
    transition: color 0.2s;
    padding: 0;
}

.category-btn.active {
    color: var(--text-color);
}

.category-btn:hover {
    color: var(--text-color);
}

/* Infograficos */
.infograficos-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    padding: 20px 40px 100px;
    width: 100%;
}

.infograficos-container img {
    width: 100%;
    max-width: 650px;
    /* Aligned with header content width */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}
/* Responsividade Mobile */
@media (max-width: 768px) {
    .page-wrapper {
        padding-top: 20vh; /* Empurra mais para o centro */
    }

    .header-content {
        padding: 0 24px;
        align-items: flex-start;
    }

    .personal-info {
        gap: 12px;
    }

    .name-details h1 {
        font-size: 20px;
    }

    .name-details p {
        font-size: 13px;
    }

    .social-links {
        flex-direction: column;
        align-items: flex-end;
        gap: 16px;
    }

    .carousel-container {
        margin-top: 60px !important;
    }

    .carousel-track {
        gap: 30px; /* Reduz gap entre os projetos */
        padding-left: 24px; /* Padding lateral inicial do carrossel */
        padding-right: 24px;
    }

    .device-frame.image-only img {
        height: 320px; /* Diminui um pouco para caber melhor no mobile */
    }

    .carousel-item[data-id="moodslab"] .device-frame.image-only img {
        height: 310px;
    }

    /* Ajuste da tela de detalhes do projeto */
    .project-detail-body {
        flex-direction: column;
        gap: 40px;
        padding: 20px;
        margin-top: 40px;
    }

    .text-content {
        max-width: 100%;
        order: 2; /* Texto embaixo no mobile */
    }

    .hero-device.image-only {
        order: 1; /* Imagem no topo no mobile */
    }

    .hero-device.image-only img {
        max-height: 45vh;
    }
}

@media (max-width: 768px) {
    .about-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .about-tags {
        justify-content: center;
    }
    .about-image-wrapper {
        width: 140px;
    }
}
