@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&display=swap');

:root {
    --c-white: #ffffff;
    --c-anthracite: #1a1c1e;
    --c-anthracite-light: #2b2d31;
    --c-gray-light: #f8f9fa;
    --c-gray: #6c757d;
    --c-orange: #f97316;
    --c-orange-hover: #ea580c;
    --transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--c-anthracite);
    background-color: var(--c-white);
    line-height: 1.8;
    overflow-x: hidden;
    font-weight: 300;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    transition: var(--transition);
}

.nav-link {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin: 0 15px;
    color: var(--c-anthracite) !important;
}

.nav-link:hover, .nav-link.active { color: var(--c-orange) !important; }

/* Typography */
.display-1 { font-weight: 600; letter-spacing: -1.5px; line-height: 1.1; }
.display-4 { font-weight: 600; letter-spacing: -1px; }
h2, h3, h4, h5 { font-weight: 500; letter-spacing: -0.5px; }
.lead { font-weight: 300; letter-spacing: 0.5px; }

/* Buttons */
.btn-brand {
    background: var(--c-orange);
    color: white !important;
    border-radius: 0;
    padding: 16px 36px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: none;
    transition: var(--transition);
    display: inline-block;
    text-decoration: none;
}

.btn-brand:hover {
    background: var(--c-anthracite);
    transform: translateY(-3px);
}

.btn-outline-dark {
    border: 1px solid var(--c-anthracite);
    border-radius: 0;
    padding: 15px 35px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: var(--transition);
    color: var(--c-anthracite);
    text-decoration: none;
    display: inline-block;
}

.btn-outline-dark:hover { background: var(--c-anthracite); color: var(--c-white); }

/* Feature Cards */
.feature-card {
    padding: 40px;
    background: var(--c-white);
    border: 1px solid rgba(0,0,0,0.05);
    height: 100%;
    transition: var(--transition);
}

.feature-card:hover {
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    transform: translateY(-5px);
}

/* Sections */
.section-padding { padding: 140px 0; }
.bg-soft { background-color: var(--c-gray-light); }

/* =========================================
   PROJECT LOOKBOOK MODAL (CORRECTED)
   ========================================= */
.project-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 28, 30, 0.98);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s ease;
}

.project-modal.active { opacity: 1; pointer-events: all; }

.modal-close {
    position: absolute; top: 30px; right: 40px;
    background: transparent; border: none; color: var(--c-white);
    font-size: 2rem; cursor: pointer; transition: var(--transition); z-index: 10000;
}

.modal-close:hover { color: var(--c-orange); transform: rotate(90deg); }

.book-container {
    width: 95%; max-width: 1400px; height: 85vh;
    background: var(--c-white); border-radius: 8px;
    overflow: hidden; position: relative;
    box-shadow: 0 40px 100px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
}

.book-page {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; opacity: 0; visibility: hidden;
    transform: translateX(20px);
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.book-page.active { opacity: 1; visibility: visible; transform: translateX(0); }

.page-intro {
    flex-direction: column; align-items: center; justify-content: center;
    text-align: center; padding: 60px; width: 100%; height: 100%; display: flex;
}

/* THE FIX: Forcing strict Side-by-Side layout */
.page-split { 
    display: flex; 
    flex-direction: row; 
    width: 100%; 
    height: 100%; 
}

.split-left {
    width: 35%; height: 100%; padding: 60px; 
    background: var(--c-white);
    display: flex; flex-direction: column; justify-content: center;
    border-right: 1px solid rgba(0,0,0,0.05);
    overflow-y: auto;
}

.split-right {
    width: 65%; height: 100%; 
    background: var(--c-gray-light);
    display: flex; align-items: center; justify-content: center; 
}

/* THE FIX: Forcing iframe to show properly */
.browser-mockup {
    width: 90%; height: 80%;
    background: var(--c-white); border-radius: 8px;
    overflow: hidden; box-shadow: 0 30px 60px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
}

.browser-bar {
    height: 32px; background: #e9ecef; flex-shrink: 0;
    display: flex; align-items: center; padding: 0 15px; gap: 8px;
}

.browser-dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.browser-content { 
    flex-grow: 1; 
    width: 100%; 
    height: 100%; 
    display: flex; 
    background: #fff;
}

.browser-content iframe { 
    flex-grow: 1; 
    width: 100%; 
    height: 100%; 
    border: none; 
}

.book-nav {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 80px;
    background: var(--c-white); border-top: 1px solid rgba(0,0,0,0.05);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; z-index: 10;
}

.nav-btn {
    background: transparent; border: none; font-family: 'Outfit', sans-serif;
    font-weight: 500; text-transform: uppercase; letter-spacing: 2px;
    color: var(--c-anthracite); cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; gap: 10px;
}

.nav-btn:hover:not(:disabled) { color: var(--c-orange); }
.nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-indicator { font-weight: 500; color: var(--c-gray); letter-spacing: 2px; font-size: 0.9rem; }

/* =========================================
   MOBILE & TABLET OPTIMIZATION (FINAL)
   ========================================= */
@media (max-width: 992px) {
    /* Navbar: Logo più piccolo e menu pulito */
    .navbar-brand img { height: 50px !important; }
    .navbar { padding: 10px 0; }
    
    /* Typography: Ridimensionamento armonioso */
    .display-1 { font-size: 2.4rem; letter-spacing: -1px; }
    .display-4 { font-size: 1.8rem; }
    .section-padding { padding: 60px 0; }

    /* Lookbook Modal: Adattamento per schermi verticali */
    .book-container { 
        width: 100%; 
        height: 100%; 
        border-radius: 0; 
        max-width: none;
    }

    .modal-close { top: 15px; right: 15px; font-size: 1.5rem; }

    /* Layout Split: Da orizzontale a verticale */
    .page-split { 
        flex-direction: column; 
        overflow-y: auto; 
    }

    .split-left { 
        width: 100%; 
        height: auto; 
        padding: 40px 25px; 
        border-right: none; 
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .split-right { 
        width: 100%; 
        height: 400px; /* Altezza fissa per l'iframe su mobile */
        min-height: 400px;
        background: var(--c-gray-light);
        padding: 20px 0;
    }

    /* Mockup Browser: Più largo su mobile */
    .browser-mockup { 
        width: 92%; 
        height: 90%; 
    }

    .book-nav { 
        height: 70px; 
        padding: 0 20px; 
    }

    .nav-btn { font-size: 0.7rem; letter-spacing: 1px; }

    /* Margini per l'ultima pagina del libro su mobile per non coprire il testo con la nav */
    .book-page { padding-bottom: 80px; }
}

/* Ottimizzazione extra per telefoni molto piccoli */
@media (max-width: 576px) {
    .display-1 { font-size: 2rem; }
    .btn-brand { width: 100%; text-align: center; }
}