/* SMOOTH SCROLL ATTIVATO */
html {
    scroll-behavior: smooth;
}

/* 1. VARIABILI DI TEMA (ARANCIONE DORATO / AMBRA JACOBSON) */
:root[data-theme="dark"] {
    --bg-color: #0d0d0f;
    --card-bg: rgba(22, 22, 26, 0.75);
    --text-color: #f1f1f1;
    --border-color: rgba(255, 255, 255, 0.1);
    --card-divider: #ffffff; /* LINEA DIVISORIA BIANCA IN DARK MODE */
    --accent-color: #ff9900;
    --accent-glow: #ffad33;
}

:root[data-theme="light"] {
    --bg-color: #f5f5f7;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-color: #1d1d1f;
    --border-color: rgba(0, 0, 0, 0.1);
    --card-divider: #000000; /* LINEA DIVISORIA NERA IN LIGHT MODE */
    --accent-color: #ff9900;
    --accent-glow: #ffad33;
}

/* 2. BASE PAGINA */
body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* 3. FONT CUSTOM */
@font-face {
    font-family: 'VictorianStd';
    src: url('victorian.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* 4. BARRA DI NAVIGAZIONE PRINCIPALE (INCASTONATA IN CIMA) */
.mac-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 100;
    box-sizing: border-box;
    background: transparent;
}

/* BARRA STICKY A TENDINA */
.mac-nav-sticky {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    z-index: 999;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    
    transform: translateY(-100%);
    opacity: 0;
    
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    pointer-events: none;
}

/* QUANDO ENTRA IN AZIONE DA PORTFOLIO IN GIÙ */
.mac-nav-sticky.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* CENTRO ASSOLUTO E ALLINEAMENTO VERTICALE TOTALE */
.nav-brand-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* Scritta Centrale HEISENSERVICE */
.brand-link {
    font-family: 'VictorianStd', serif;
    color: var(--accent-color);
    font-size: 1.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255, 153, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.9);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin: 0;
    padding: 22px 0;
}

.brand-link:hover {
    color: #ffffff;
    text-shadow: 0 0 22px rgba(255, 153, 0, 1), 0 0 10px rgba(255, 255, 255, 0.9);
}

/* Gruppi di Link agganciati ai lati del brand centrale */
.nav-group {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 22px;
    white-space: nowrap;
}

.nav-left {
    right: 100%;
    margin-right: 45px;
    justify-content: flex-end;
}

.nav-right {
    left: 100%;
    margin-left: 45px;
    justify-content: flex-start;
}

/* Pulsante Light/Dark */
.mac-btn-theme {
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0;
    width: 78px;
    height: 28px;
    box-sizing: border-box;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin: 0;
}

.mac-btn-theme:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.04);
}

/* STILE BASE LINK NAVIGAZIONE */
.nav-link {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: color 0.25s ease, text-shadow 0.25s ease, opacity 0.25s ease;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 22px 0;
}

.nav-link:hover {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    opacity: 1;
}

.nav-link.active {
    color: #ffffff !important;
    text-shadow: 0 0 14px rgba(255, 255, 255, 0.9), 0 0 8px rgba(255, 153, 0, 0.8), 0 1px 4px rgba(0, 0, 0, 0.8) !important;
    opacity: 1 !important;
}

/* 5. HERO SECTION */
.hero {
    position: relative;
    height: 80vh; 
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px 20px 0 20px;
    box-sizing: border-box;

    background-image: url('https://images.unsplash.com/photo-1598488035139-bdbb2231ce04?q=80&w=1600&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(13, 13, 15, 0.4) 0%, rgba(13, 13, 15, 0.88) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

/* CONTAINER SVG */
.curved-title-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
}

.curved-title-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* 1. TITOLO CURVO HEISENSERVICE (VICTORIAN ENORME) */
.arc-text {
    font-family: 'VictorianStd', serif;
    font-size: 108px;
    letter-spacing: 8px;
    fill: #ffffff !important;
    stroke: rgba(0, 0, 0, 0.85) !important;
    stroke-width: 1px !important;
    filter: drop-shadow(4px 8px 14px rgba(0, 0, 0, 0.95)) !important;
}

/* 2. SOTTOTITOLO CURVO (MONTSERRAT EXTRABOLD - 30px) */
.arc-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 3.5px;
    fill: #ffffff !important;
    filter: drop-shadow(0px 3px 10px rgba(0, 0, 0, 0.95)) !important;
}

/* 3. TAGLINE CURVA */
.arc-tagline {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 30px;
    letter-spacing: 2px;
    fill: #ffffff !important;
    filter: drop-shadow(0px 3px 10px rgba(0, 0, 0, 0.95)) !important;
}

/* LINEE DIVISORIE DI PAGINA DINAMICHE (BIANCA IN DARK / NERA IN LIGHT CON FADE FLUIDO) */
.section-divider {
    width: 100%;
    max-width: 1200px;
    margin: 15px auto 45px auto;
    border: none;
    border-top: 2px solid var(--card-divider);
    transition: border-color 0.3s ease;
}

/* 6. GRID E SCHEDE CARD (ABBASSATE DI POCHISSIMI PIXEL PER NASCONDERE IL TESTO) */
.services-section {
    padding-top: 115px; /* Spinto di pochissimo verso il basso */
    padding-bottom: 220px;
    padding-left: 25px;
    padding-right: 25px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 35px;
    max-width: 1200px;
    margin: 0 auto;
}

/* CARD CENTRATA AL CENTRO DELLA SECONDA RIGA (SOTTO IL BOX 2) */
.card-centered {
    grid-column: 2 / 3;
}

.mac-window {
    background: #141416;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.mac-window:hover {
    transform: translateY(-6px);
    border-color: var(--accent-color) !important;
    box-shadow: 0 12px 25px rgba(255, 153, 0, 0.35) !important;
}

.window-header {
    position: relative;
    height: 220px;
    min-height: 220px;
    background-color: #1e1e22;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;

    /* LINEA DIVISORIA CON TRANSIZIONE FLUIDA FADE IN / FADE OUT */
    border-bottom: 2px solid var(--card-divider);
    transition: border-color 0.3s ease;
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(20, 20, 22, 0.9) 100%);
    z-index: 1;
}

.window-header .title {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: 1.28rem;
    font-weight: 700;
    color: #ffffff;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.window-body {
    padding: 26px 22px;
    background: #141416;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.window-body p {
    margin: 0;
    color: #a0a0a0;
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
    width: 100%;
}

.header-music {
    background-image: url('https://images.unsplash.com/photo-1598488035139-bdbb2231ce04?q=80&w=800&auto=format&fit=crop');
}

.header-ai {
    background-image: url('https://images.unsplash.com/photo-1589254065878-42c9da997008?q=80&w=800&auto=format&fit=crop');
}

.header-editorial {
    background-image: url('https://images.unsplash.com/photo-1455390582262-044cdead277a?q=80&w=800&auto=format&fit=crop');
}

.header-visual {
    background-image: url('https://images.unsplash.com/photo-1507238691740-187a5b1d37b8?q=80&w=800&auto=format&fit=crop');
}

/* STILI PLACEHOLDER SEZIONI (DIVISORI SUPERIORI DINAMICI) */
.placeholder-section {
    min-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 2px solid var(--card-divider);
    transition: border-color 0.3s ease;
}

.placeholder-section h2 {
    font-size: 2rem;
    letter-spacing: 3px;
    color: var(--accent-color);
}

/* 7. ADATTAMENTO MOBILE */
@media screen and (max-width: 992px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-centered {
        grid-column: span 2;
        justify-self: center;
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .mac-nav, .mac-nav-sticky {
        height: 60px;
    }

    .brand-link {
        font-size: 1.1rem;
        letter-spacing: 1.5px;
        padding: 15px 0;
    }

    .nav-group {
        display: none;
    }

    .hero {
        height: auto;
        min-height: 500px;
        padding: 90px 15px 40px 15px;
    }

    .hero-content {
        margin-top: 0;
    }

    .curved-title-container {
        max-width: 98%;
    }

    .arc-text {
        font-size: 46px;
        letter-spacing: 3px;
    }

    .arc-subtitle {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .arc-tagline {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .services-section {
        padding: 40px 15px 120px 15px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .card-centered {
        grid-column: span 1;
    }
}
