/* --- VARIABLES & RESET --- */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --secondary-text: #888888;
    --accent-color: #000000;
    --font-primary: 'Inter', sans-serif;
    --header-height: 100px;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- LAYOUT COMPONENTS --- */
header {
    padding: 15px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    width: 100%;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 100;
}

main {
    padding: 80px 40px 20px;
    transition: opacity 0.5s ease-in-out;
}

.site-footer {
    max-width: 1600px;
    margin: 40px auto 20px;
    padding-top: 20px;
    text-align: center;
}

/* --- NAVIGATION --- */
nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    text-decoration: none;
    color: var(--secondary-text);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.15em;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
    color: var(--text-color);
}

/* --- FOOTER ELEMENTS --- */

.copyright {
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--secondary-text);
    text-transform: uppercase;
}

/* --- HOME PAGE STYLES --- */
.home-container {
    max-width: 1600px;
    margin: 0 auto;
}

.home-hero {
    position: relative;
    height: 80vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

.hero-image-wrapper {
    position: absolute;
    inset: 0;
}

.hero-image-item {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    mix-blend-mode: luminosity;
    filter: brightness(0.6);
    transition: opacity 2s ease-in-out;
}

.hero-image-item.active {
    opacity: 0.7;
}

.hero-overlay-dark {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
}

.hero-text {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: clamp(32px, 5vw, 64px);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 30px;
    line-height: 1.1;
}

.hero-name {
    font-weight: 500;
    letter-spacing: 0.25em;
}

.hero-role {
    font-size: 0.4em;
    letter-spacing: 0.6em;
    opacity: 0.9;
    font-weight: 300;
}

.hero-subtitle {
    display: flex;
    flex-direction: column;
    gap: 1px;
    font-size: clamp(10px, 1.5vw, 18px);
    font-weight: 300;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    opacity: 0.8;
    margin-bottom: 40px;
}

.hero-cta {
    display: inline-block;
    padding: 15px 40px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50px;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.2em;
    transition: all 0.4s ease;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.hero-cta:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-5px);
}

.hero-socials {
    margin-top: 30px;
}

.hero-socials .social-icon-link {
    color: #fff;
    opacity: 0.5;
}

.hero-socials .social-icon-link:hover {
    opacity: 1;
}

/* --- PROJECTS GRID --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.card-image {
    width: 100%;
    aspect-ratio: 1/1;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(100%);
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1), filter 0.8s ease;
}

.card-info {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 30px;
    text-align: center;
}

.project-card:hover .card-info {
    opacity: 1;
}

.project-card:hover .card-image img {
    transform: scale(1.1);
    filter: grayscale(0%) blur(2px);
}

.card-info .card-year {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--secondary-text);
    margin-bottom: 12px;
    transform: translateY(20px);
    transition: transform 0.5s ease;
}

.card-info h3.card-title {
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    transform: translateY(20px);
    transition: transform 0.5s ease 0.05s;
}

.card-info .card-location {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--secondary-text);
    transform: translateY(20px);
    transition: transform 0.5s ease 0.1s;
}

.project-card:hover .card-info .card-year,
.project-card:hover .card-info h3.card-title,
.project-card:hover .card-info .card-location {
    transform: translateY(0);
}

/* --- PROJECT DETAIL / SLIDER --- */
.project-container {
    max-width: 100%;
    margin: 0 auto;
    height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding: 0 80px;
}

.project-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-content {
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
    position: absolute;
    pointer-events: none;
}

.slide-content.active {
    opacity: 1;
    pointer-events: auto;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slider-nav {
    position: absolute;
    width: calc(100% - 40px);
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

.slider-arrow {
    width: 60px;
    height: 60px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 0.4;
}

.slider-arrow:hover {
    opacity: 1;
    transform: scale(1.1);
}

.slider-arrow svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-color);
    stroke-width: 1.5;
    fill: none;
}

.slider-arrow.prev svg {
    transform: rotate(180deg);
}

/* --- PROJECT FOOTER --- */
.project-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    font-size: 13px;
    letter-spacing: 0.02em;
    z-index: 100;
}

.footer-left,
.footer-center,
.footer-right {
    flex: 1;
}

.footer-center {
    text-align: center;
    font-weight: 500;
}

.footer-right {
    text-align: right;
}

.project-footer a {
    text-decoration: none;
    color: var(--text-color);
    transition: opacity 0.3s ease;
}

.project-footer a:hover {
    opacity: 0.5;
}

.footer-nav-link {
    cursor: pointer;
}

.footer-separator {
    margin: 0 5px;
    color: #ccc;
}

/* --- OVERLAY STYLES --- */
.info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.98);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* Aling to start to allow proper scrolling */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    padding: 120px 40px;
    /* Increased top/bottom padding for better spacing */
    overflow-y: auto;
    /* Enable scrolling */
    scroll-behavior: smooth;
}

.info-overlay.active {
    opacity: 1;
    visibility: visible;
}

.info-content {
    max-width: 900px;
    width: 100%;
    position: relative;
    padding-bottom: 60px;
    /* Ensure space at the bottom when scrolled */
}

.close-info {
    position: fixed;
    /* Keep close button visible while scrolling */
    top: 40px;
    right: 40px;
    cursor: pointer;
    font-size: 24px;
    font-weight: 300;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    z-index: 1001;
}

.info-header {
    margin-bottom: 60px;
}

.info-header .meta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--secondary-text);
    margin-bottom: 20px;
}

.info-header h2 {
    font-size: 56px;
    font-weight: 300;
    line-height: 1.1;
}

.info-body {
    display: block;
    max-width: 800px;
}

.info-body p {
    font-size: 18px;
    line-height: 1.8;
    font-weight: 300;
    margin-bottom: 30px;
}

.info-footer {
    margin-top: 60px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary-text);
}

/* --- PROFILE / CV STYLES --- */
.profile-page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 40px;
}

.profile-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 100px;
    align-items: start;
}

.profile-sidebar {
    position: sticky;
    top: 150px;
}

.profile-image-wrapper {
    width: 100%;
    margin-bottom: 40px;
    overflow: hidden;
    background: #f5f5f5;
}

.profile-image {
    width: 100%;
    height: auto;
    display: block;
    mix-blend-mode: luminosity;
    transition: mix-blend-mode 0.5s ease;
}

.profile-image:hover {
    mix-blend-mode: normal;
}

.profile-name {
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.profile-role {
    font-size: 13px;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: 40px;
}

.profile-contact-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-item .label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--secondary-text);
}

.contact-item .value {
    font-size: 13px;
}

.contact-item .value a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.contact-item .value a:hover {
    border-bottom-color: var(--text-color);
}

.cv-section {
    margin-bottom: 80px;
}

.cv-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--secondary-text);
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.cv-text-highlight {
    font-size: 22px;
    line-height: 1.5;
    font-weight: 300;
    color: var(--text-color);
    max-width: 800px;
}

.cv-item {
    margin-bottom: 40px;
}

.cv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.cv-item-company {
    font-size: 16px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cv-item-date {
    font-size: 12px;
    color: var(--secondary-text);
    font-variant-numeric: tabular-nums;
}

.cv-item-role {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    color: #444;
}

.cv-item-desc {
    font-size: 14px;
    color: var(--secondary-text);
    max-width: 700px;
}

.cv-item-simple p {
    font-size: 14px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.cv-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
}

.cv-tags span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--secondary-text);
}

/* --- CONTACT PAGE STYLES --- */
.contact-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 40px 100px;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-container-grid {
    width: 100%;
    display: flex;
    justify-content: center;
}

.contact-sections {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    text-align: center;
}

.contact-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.contact-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--secondary-text);
    margin-bottom: 20px;
}

.contact-group-text {
    font-size: 16px;
    line-height: 1.6;
}

.contact-group-text a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    transition: border-color 0.3s ease;
}

.contact-group-text a:hover {
    border-bottom-color: var(--text-color);
}

.social-icons-wrapper {
    display: flex;
    gap: 20px;
    justify-content: center;
    /* Centrado global */
}

.social-icon-link {
    color: var(--text-color);
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.social-icon-link:hover {
    opacity: 1;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 968px) {

    .profile-content,
    .contact-container-grid {
        grid-template-columns: 1fr;
        gap: 60px;
        text-align: center;
    }

    .profile-sidebar {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-image-wrapper {
        max-width: 300px;
    }

    .cv-text-highlight {
        font-size: 18px;
        margin: 0 auto;
    }

    .cv-item-header {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }

    .cv-item-date {
        order: -1;
    }

    .cv-item-desc {
        margin: 0 auto;
    }

    .contact-sections {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }

    .social-icons-wrapper {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px;
    }

    nav ul {
        gap: 15px;
    }

    nav a {
        font-size: 9px;
    }

    main {
        padding: 80px 15px 80px;
    }

    .home-hero {
        height: 60vh;
    }

    .hero-title {
        font-size: clamp(24px, 8vw, 40px);
    }

    .hero-subtitle {
        font-size: 10px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-info {
        padding: 15px;
    }

    .card-info h3.card-title {
        font-size: 11px;
    }

    .card-info .card-year,
    .card-info .card-location {
        font-size: 9px;
    }

    .project-container {
        height: auto;
        padding: 0;
    }

    .project-slider {
        display: block;
        height: auto;
    }

    .slide-content {
        position: static;
        opacity: 1;
        pointer-events: auto;
        margin-bottom: 10px;
        width: 100%;
    }

    .slide-image {
        height: auto;
        max-height: 70vh;
        object-fit: cover;
    }

    .slider-nav {
        display: none;
    }

    .project-footer {
        padding: 15px;
        font-size: 10px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
        position: relative;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        text-align: center;
        flex: none;
        width: 100%;
    }

    .info-overlay {
        padding: 30px 20px;
    }

    .info-header h2 {
        font-size: 28px;
    }

    .info-body {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .info-body p {
        font-size: 15px;
    }
}