/* ==========================================================================
   Manuela Caldara Portfolio - Cinematic Dark Design System (CSS)
   ========================================================================== */

/* --- CSS Variables & Tokens --- */
:root {
    /* Colors */
    --bg-primary: #08090c;
    --bg-secondary: #0f1118;
    --bg-surface: #141722;
    --bg-glass: rgba(15, 17, 24, 0.75);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a5b8;
    --text-muted: #64687a;
    
    --accent-gold: #d4af37;
    --accent-gold-hover: #e5b842;
    --accent-gold-glow: rgba(212, 175, 55, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(212, 175, 55, 0.3);
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-cinematic: 'Libre Baskerville', serif;
    
    /* Layout */
    --header-height: 80px;
    --max-width: 1200px;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

/* --- Reset & Base Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- Global Ambient Blur Background --- */
.cinematic-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(212, 175, 55, 0.02) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(15, 17, 24, 0.1) 0%, var(--bg-primary) 100%);
    z-index: -2;
    pointer-events: none;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-surface);
    border: 2px solid var(--bg-primary);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img, video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* --- Layout Utility Classes --- */
.page-container {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--header-height) + 40px) 24px 60px 24px;
}

/* ==========================================================================
   Navigation Header
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    transition: var(--transition-smooth);
}

.header-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: 0.1em;
    font-size: 1.2rem;
}
.logo-first {
    color: var(--text-primary);
}
.logo-last {
    color: var(--accent-gold);
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    position: relative;
    padding: 8px 0;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-gold);
    transition: var(--transition-smooth);
}
.nav-link:hover {
    color: var(--text-primary);
}
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}
.nav-link.active {
    color: var(--accent-gold);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-primary {
    background-color: var(--accent-gold);
    color: var(--bg-primary);
}
.btn-primary:hover {
    background-color: var(--accent-gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-gold-glow);
}

/* ==========================================================================
   SPA Page Handling & Transitions
   ========================================================================== */
.page-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.page-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   HOMEPAGE: Hero Section
   ========================================================================== */
.hero-section {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: center;
    padding: 20px 0 80px 0;
}

.hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--accent-gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 580px;
}

.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image-wrapper {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 1;
    width: 100%;
    max-width: 440px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    background-color: var(--bg-secondary);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}
.hero-image-wrapper:hover .hero-image {
    transform: scale(1.05);
}

/* ==========================================================================
   HOMEPAGE: Featured Works
   ========================================================================== */
.featured-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    margin-bottom: 48px;
}

.section-pretitle {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
    margin-bottom: 8px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.featured-card {
    display: block;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition-smooth);
}

.card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #000;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 9, 12, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: var(--transition-smooth);
}

.play-indicator {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
    padding: 10px 24px;
    border-radius: 4px;
    transform: translateY(10px);
    transition: var(--transition-smooth);
}

.card-info {
    padding: 24px;
}

.card-meta {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: var(--transition-fast);
}

/* Hover States for Cards */
.featured-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-color-hover);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.featured-card:hover .card-image {
    transform: scale(1.05);
}
.featured-card:hover .card-overlay {
    opacity: 1;
}
.featured-card:hover .play-indicator {
    transform: translateY(0);
}
.featured-card:hover .card-title {
    color: var(--accent-gold);
}

/* ==========================================================================
   HOMEPAGE: About Section
   ========================================================================== */
.about-section {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.about-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
    align-items: center;
}

.about-visual {
    position: relative;
    height: 480px;
}

.about-gallery {
    position: relative;
    width: 100%;
    height: 100%;
}

.about-img-box {
    position: absolute;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    background-color: var(--bg-secondary);
    transition: var(--transition-smooth);
}

.about-img-box:hover {
    transform: scale(1.03) translateY(-5px);
    border-color: var(--accent-gold);
}

.img-primary {
    top: 0;
    left: 0;
    width: 65%;
    height: 80%;
    z-index: 2;
}

.img-secondary {
    bottom: 0;
    right: 0;
    width: 55%;
    height: 70%;
    z-index: 1;
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-content {
    display: flex;
    flex-direction: column;
}

.about-bio {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-family: var(--font-body);
}

.about-bio:first-of-type {
    font-family: var(--font-cinematic);
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-primary);
    font-style: italic;
    border-left: 3px solid var(--accent-gold);
    padding-left: 16px;
    margin-bottom: 28px;
}

.about-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 20px;
    padding-top: 28px;
    border-top: 1px solid var(--border-color);
}

.detail-item strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================================
   ALL PROJECTS PAGE: Filmography Table
   ========================================================================== */
.table-section-header {
    padding: 20px 0 40px 0;
    text-align: center;
}

.section-description {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 600px;
    margin: 8px auto 0 auto;
}

.table-filters {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.filter-btn {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.filter-btn.active {
    background-color: var(--accent-gold);
    color: var(--bg-primary);
    border-color: var(--accent-gold);
}

.table-wrapper {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.filmography-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.filmography-table th,
.filmography-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.filmography-table th {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background-color: rgba(255,255,255,0.01);
}

.filmography-table tr {
    transition: var(--transition-fast);
}

.filmography-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.col-title {
    font-weight: 600;
    font-size: 1.05rem;
}

.table-link {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 4px;
}
.table-link:hover {
    color: var(--accent-gold);
}

.col-specs {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.col-year {
    font-weight: 600;
    color: var(--accent-gold);
}

/* Badges for roles */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: rgba(212, 175, 55, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-secondary {
    background-color: rgba(160, 165, 184, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(160, 165, 184, 0.2);
}

.badge-accent {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.15);
}

.badge-muted {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   PROJECT DETAILS PAGE: Immersive Layout
   ========================================================================== */
.project-detail-page {
    padding-top: calc(var(--header-height) + 20px);
}

.detail-back-bar {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}
.back-link:hover {
    color: var(--accent-gold);
    transform: translateX(-4px);
}

.project-header {
    margin-bottom: 32px;
}

.project-meta-top {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.project-main-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.project-display {
    width: 100%;
    margin-bottom: 48px;
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
    border: 1px solid var(--border-color);
}

.custom-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-info-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.project-description-col h2,
.project-specs-col h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.project-description-col p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.specs-list {
    list-style: none;
}

.specs-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
}

.specs-list li:last-child {
    border-bottom: none;
}

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

.specs-list span {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    max-width: 60%;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    width: 100%;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    background-color: #050608;
    margin-top: 80px;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-credits {
    display: flex;
    align-items: center;
}

.separator {
    margin: 0 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (Media Queries)
   ========================================================================== */

/* --- Tablet / Large Mobile (max-width: 992px) --- */
@media screen and (max-width: 992px) {
    .page-container {
        padding-top: calc(var(--header-height) + 20px);
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-description {
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-visual {
        max-width: 320px;
        margin: 0 auto;
    }
    
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .about-visual {
        height: 380px;
        max-width: 440px;
        margin: 0 auto;
        width: 100%;
    }
    
    .project-info-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

/* --- Mobile Portrait (max-width: 576px) --- */
@media screen and (max-width: 576px) {
    .site-header {
        height: 70px;
    }
    :root {
        --header-height: 70px;
    }
    
    .header-container {
        padding: 0 16px;
    }
    
    .logo {
        font-size: 1rem;
    }
    
    .main-nav ul {
        gap: 16px;
    }
    
    .nav-link {
        font-size: 0.85rem;
    }
    
    .page-container {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .about-details {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .table-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 6px 14px;
        font-size: 0.8rem;
    }
    
    .filmography-table th,
    .filmography-table td {
        padding: 12px 16px;
    }
    
    .project-main-title {
        font-size: 2rem;
    }
    
    .footer-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
