:root {
    /* Default Dark Mode */
    --bg-color: #0c0c0c;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #888888;
    --accent-color: #a6ff00;
    --accent-glow-weak: rgba(166, 255, 0, 0.3);
    --accent-shadow-weak: rgba(166, 255, 0, 0.2);
    --glitch-1: hsl(150, 79%, 46%);
    --glitch-2: #affa00;
    --btn-border: #ffffff;
    --btn-bg-hover: #ffffff;
    --btn-text-hover: #000000;
    --nav-opacity: 0.9;
    --nav-hover: #affa00;
}

[data-theme="light"] {
    /* Light Mode - Premium & Visible */
    --bg-color: #ced8f3;
    /* Cool gray 50 */
    --text-color: #111827;
    /* Gray 900 */
    --text-secondary: #4b5563;
    /* Gray 600 */
    --text-muted: #6b7280;
    /* Gray 500 */
    --accent-color: #0A2844;
    /* Deep Blue requested by user */
    --accent-glow-weak: #0a284366;
    --accent-shadow-weak: rgba(10, 40, 67, 0.2);
    --glitch-1: #2563eb;
    /* Blue 600 */
    --glitch-2: #db2777;
    /* Pink 600 */
    --btn-border: var(--text-color);
    --btn-bg-hover: var(--text-color);
    --btn-text-hover: #ffffff;
    --nav-opacity: 1;
    --nav-hover: #073b17;
}

[data-theme="light"] nav ul li a:hover {
    font-weight: bold;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none !important;
}

/* =========================================
   FIGMA-STYLE CUSTOM CURSOR
   ========================================= */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 999999;
    display: flex;
    align-items: flex-start;
    will-change: transform;
    transform: translate(-999px, -999px);
}

#custom-cursor svg {
    display: block;
    transition: filter 0.3s ease;
}

/* Light mode: freccia chiara su sfondo chiaro → si inverte */
[data-theme="light"] #custom-cursor svg path {
    fill: var(--accent-color);
    stroke: #ffffff;
}

[data-theme="light"] .ghost-label {
    color: #ffffff;
}

[data-theme="light"] .dist-tooltip {
    color: #ffffff !important;
}

/* =========================================
   GHOST CURSOR + FIGMA SELECTION BOX
   ========================================= */
#ghost-cursor {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
    /* Superiore all'hero (1) ma inferiore alle sezioni (10) */
    display: flex;
    align-items: flex-start;
    will-change: transform;
    transform: translate(-999px, -999px);
    transition: opacity 0.3s ease;
}

.ghost-label {
    background: var(--accent-color);
    color: #000000;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    margin-top: 16px;
    margin-left: 3px;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ghost-chat-bubble {
    position: absolute;
    top: 36px;
    left: 10px;
    background: white;
    color: #111;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 12px;
    border-top-left-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.8);
    transform-origin: top left;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 99999;
}

@media (max-width: 768px) {
    .ghost-chat-bubble {
        white-space: normal;
        /* Permette il ritorno a capo su schermi stretti */
        max-width: 150px;
        /* Impedisce di uscire lateralmente dal viewport */
        font-size: 11px;
        /* Leggermente più piccolo per densità mobile */
        left: -10px;
        /* Leggero spostamento per bilanciare la larghezza */
    }
}

[data-theme="dark"] .ghost-chat-bubble {
    background: #222;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

#ghost-selection {
    position: fixed;
    border: 2px solid var(--accent-color);
    pointer-events: none;
    z-index: 5;
    /* Come sopra, scompare sotto le sezioni che salgono */
    opacity: 0;
    border-radius: 2px;
    transition: opacity 0.3s ease, background 0.2s ease;
}

#ghost-selection.ghost-hidden,
#ghost-cursor.ghost-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#ghost-selection:hover {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .ghost-sel-label {
    color: #ffffff;
}


.ghost-sel-label {
    position: absolute;
    top: 0;
    left: -2px;
    /* Allineato elegantemente a sinistra come in vero Figma */
    transform: translateY(-50%);
    /* Dividendo la linea a metà in verticale */
    background: var(--accent-color);
    color: #000000;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
}

.sel-handle {
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 1px;
}

.sel-handle.tl {
    top: -4px;
    left: -4px;
}

.sel-handle.tr {
    top: -4px;
    right: -4px;
}

.sel-handle.bl {
    bottom: -4px;
    left: -4px;
}

.sel-handle.br {
    bottom: -4px;
    right: -4px;
}

/* Cursore per i soli spigoli */
.sel-handle.tl,
.sel-handle.br {
    cursor: url("nwse.svg") 12 12, nwse-resize !important;
}

.sel-handle.tr,
.sel-handle.bl {
    cursor: url("nesw.svg") 12 12, nesw-resize !important;
}

.sel-handle.ml {
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
}

.sel-handle.mr {
    top: 50%;
    right: -4px;
    transform: translateY(-50%);
}

.sel-handle.tm {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.sel-handle.bm {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.cursor-label {
    background: #ffffff;
    color: #111111;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    margin-top: 16px;
    margin-left: 3px;
    letter-spacing: 0.01em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}


#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0c0c0c;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.7s ease-out, visibility 0.7s;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Letters */
.loader-letters {
    display: flex;
    gap: 0.05em;
}

.loader-letters span {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(2.5rem, 7vw, 6rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: lowercase;
    color: #ffffff;
    opacity: 0;
    transform: translateY(20px);
    animation: loader-letter-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * 0.07s + 0.1s);
}

@keyframes loader-letter-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar */
.loader-bar-track {
    width: clamp(120px, 20vw, 220px);
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 1px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: #ffffff;
    border-radius: 1px;
    animation: loader-bar-fill 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

@keyframes loader-bar-fill {
    to {
        width: 100%;
    }
}


.loader-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}


#grid-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(var(--cols), 74px);
    grid-template-rows: repeat(var(--rows), 74px);
    pointer-events: none;
    position: fixed;
    transition: opacity 0.8s ease-out;
}

.grid-hidden {
    opacity: 0;
}

.grid-cell {
    width: 74px;
    height: 74px;
    border: none;
    padding: 0;
    display: block;
    pointer-events: all;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 60;
    /* Above grid (1), below header/main (10) - UPDATED to 60 */
    pointer-events: none;
    /* Let clicks pass through, we use window listener for hover */
    transition: opacity 1s ease-out;
    opacity: 0;
    /* Starts hidden, revealed by JS */
}

.canvas-visible {
    opacity: 1 !important;
    /* Force visibility when class added */
}

.triangle {
    fill: transparent;
    stroke: transparent;
    stroke-width: 1;
    transition: stroke 1.5s ease-out, filter 1.5s ease-out;
    cursor: crosshair;
}

.triangle:hover {
    stroke: var(--accent-color);
    filter: drop-shadow(0 0 5px var(--accent-color));
    transition: stroke 0s, filter 0s;
    z-index: 10;
}

.triangle.glow-weak {
    stroke: var(--accent-glow-weak);
    filter: drop-shadow(0 0 2px var(--accent-shadow-weak));
    transition: stroke 0s, filter 0s;
    z-index: 5;
}

/* =========================================
   GLASS HEADER - APPLE STYLE
   ========================================= */

.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    pointer-events: none;
}

.glass-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;

    /* Glassmorphism Effect */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;

    /* Shadow for depth */
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    pointer-events: auto;
    position: relative;
    z-index: 1005;
    /* Assicura che l'hamburger sia cliccabile SOPRA il mobile menu (999) */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode glass effect */
[data-theme="light"] .glass-nav {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    display: block;
    padding: 0.625rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-menu li a:hover {
    color: var(--accent-color);
}

[data-theme="light"] .nav-menu li a:hover {
    color: var(--text-color);
}

/* Right Side Controls */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

/* Theme Toggle Glass */
.theme-toggle-glass {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-color);
    transition: all 0.2s ease;
    padding: 0;
}

.theme-toggle-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

[data-theme="light"] .theme-toggle-glass {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle-glass:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Contact Button Glass */
.contact-btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    /* Altezza compressa per far figurare aria sopra e sotto */
    padding: 0 1rem;
    /* Manteniamo la larghezza confortevole laterale */
    background: var(--accent-color);
    color: var(--btn-text, #000);
    text-decoration: none;
    font-size: 1rem;
    /* Dimensione maestosa originale mantenuta per contrasto */
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px var(--accent-shadow-weak);
    position: relative;
    overflow: hidden;
}

.contact-btn-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transition: left 0.5s ease;
}

.contact-btn-glass:hover::before {
    left: 100%;
}

.contact-btn-glass:hover {
    background: var(--btn-hover-bg, var(--accent-color)) !important;
    color: var(--btn-text-hover, var(--btn-text, #000)) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-glow, var(--accent-shadow-weak));
}

[data-theme="light"] .contact-btn-glass {
    color: var(--btn-text, #fff);
}

/* Hamburger Glass (Mobile) */
.hamburger-glass {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-glass span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-glass.active span:nth-child(1) {
    transform: translateY(3.5px) rotate(45deg);
}

.hamburger-glass.active span:nth-child(2) {
    transform: translateY(-3.5px) rotate(-45deg);
}

[data-theme="light"] .hamburger-glass {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Glass */
.mobile-menu-glass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.85, 0, 0.15, 1), opacity 0.4s ease;
    pointer-events: none;
    opacity: 0;
}

.mobile-menu-glass.active {
    transform: translateX(0);
    pointer-events: auto;
    opacity: 1;
}

[data-theme="light"] .mobile-menu-glass {
    background: rgba(255, 255, 255, 0.95);
}

.mobile-menu-glass ul {
    list-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
    margin: 0;
}

.mobile-menu-glass a {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
    padding: 0.5rem;
}

.mobile-menu-glass a:hover {
    color: var(--accent-color);
    transform: translateX(10px);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 0.25rem;
    }

    .nav-menu li a {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .contact-btn-glass {
        padding: 0.5rem 1.25rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .glass-header {
        padding: 0.5rem 0;
        /* Riduce l'ingombro del blocco intero dalla cima */
    }

    .glass-nav {
        padding: 0.5rem 0.5rem;
        /* Margini/padding interni strettissimi per allargarla al massimo */
        justify-content: center;
        margin: 0 0.5rem;
        /* Aumentiamo la larghezza totale trattenendola a un capello dal bordo */
    }

    .nav-menu {
        display: none;
    }

    .hamburger-glass {
        display: flex;
    }

    .contact-btn-glass {
        display: none;
    }

    .nav-controls {
        margin-left: 0;
        width: 100%;
        /* Estendiamo il contenitore dei due bottoncini a tutta la Navbar */
        justify-content: space-between;
        /* E li "sparapendiamo" agli opposti */
    }
}

main {
    position: relative;
    width: 100%;
    z-index: 10;
}

main>section:not(#hero) {
    position: relative;
    z-index: 10;
}

/* =========================================
   HERO SECTION - ANDY REFF STYLE
   ========================================= */

#hero {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    /* Fissato in cima durante lo scroll */
    top: 0;
    z-index: 1;
    /* Livello base, verrà sovrapposto dalle sezioni successive */
    overflow: hidden;
    background-color: var(--bg-color);
    transition: background-color 0.3s ease;
}

.hero-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    user-select: none;
    position: relative;
    z-index: 2;
}

.hero-tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.6rem, 1.1vw, 1rem);
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

.drag-hint {
    animation: pulse-hint 3s infinite ease-in-out;
    pointer-events: none;
    /* Lascia il focus agli elementi sottostanti se serve */
    color: var(--accent-color);
    /* Lo rendiamo un po' più visibile in stile UI */
    opacity: 0.8;
}

@keyframes pulse-hint {

    0%,
    100% {
        opacity: 0.4;
        transform: translateY(0);
    }

    50% {
        opacity: 0.9;
        transform: translateY(-4px);
    }
}

.hero-name-block {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
}

.hero-name-filled {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(2.5rem, 7vw, 7rem);
    font-weight: 900;
    color: var(--hero-title-color, var(--text-color));
    letter-spacing: -0.04em;
    text-transform: uppercase;
    line-height: 0.9;
}

.hero-subtitle {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: clamp(0.8rem, 1.2vw, 1.1rem);
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2rem;
    text-align: center;
    letter-spacing: 0.04em;
}

/* Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 10;
    /* Animation removed */
}

.hero-scroll-indicator svg {
    opacity: 0.6;
}

/* Light Mode Adjustments */
[data-theme="light"] .gradient-bg {
    opacity: 0.4;
}

[data-theme="light"] .gradient-orb-1 {
    background: radial-gradient(circle, #2563eb 0%, transparent 70%);
}

[data-theme="light"] .gradient-orb-2 {
    background: radial-gradient(circle, #db2777 0%, transparent 70%);
}

[data-theme="light"] .gradient-orb-3 {
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
}

/* Responsive Design */
@media (max-width: 768px) {
    #hero {
        padding-bottom: 6rem;
    }

    .gradient-orb {
        filter: blur(40px);
    }

    .gradient-orb-1,
    .gradient-orb-2,
    .gradient-orb-3 {
        width: 300px;
        height: 300px;
    }

    .hero-name-liquid {
        font-size: clamp(3rem, 12vw, 6rem);
    }
}

.giant-name {
    font-size: 15vw;
    /* Match services adjustment */
    font-weight: 800;
    color: var(--title-bg-color, var(--text-color));
    line-height: 0.85;
    letter-spacing: -0.05em;
    text-align: center;
    /* Centered */
    padding-left: 0;
    width: 100%;
    margin-bottom: 4rem;
    pointer-events: none;
    display: block;
    /* Animation Props */
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.giant-name.visible {
    opacity: 1;
    transform: translateY(0);
}

#about {
    min-height: 100vh;
    background-color: var(--bg-color);
    padding: 2rem 0;
    display: flex;
    align-items: flex-start;
    position: relative;
    z-index: 100;
    transition: background-color 0.3s ease;
}

.about-container {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 0 2vw;
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: auto;
}

.about-visible .about-container {
    opacity: 1;
    transform: translateY(0);
}

.about-label {
    font-size: 1rem;
    color: var(--text-color);
    margin-top: 1rem;
    font-weight: 400;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 5rem;
}

.about-headline {
    font-size: 32px;
    line-height: 1.1;
    font-weight: 500;
    text-transform: uppercase;
    max-width: 100%;
    color: var(--text-color);
}

@media (min-width: 1024px) {
    .about-headline {
        font-size: 44px;
    }
}

/* Designer Carousel Styles */
.designer-carousel {
    font-weight: 700;
    color: var(--accent-color);
    display: inline-block;
    position: relative;
    min-width: 250px;
    text-align: left;
}

.designer-carousel::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: var(--accent-color);
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

/* Light mode color override */
[data-theme="light"] .designer-carousel {
    color: var(--accent-color);
}

[data-theme="light"] .designer-carousel::after {
    background-color: var(--accent-color);
}

/* Designer Carousel in Description */
.designer-carousel-desc {
    font-weight: 700;
    color: var(--accent-color);
    display: inline-block;
    position: relative;
    min-width: 100px;
    text-align: left;
}

.designer-carousel-desc::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 0.9em;
    background-color: var(--accent-color);
    margin-left: 3px;
    animation: blink 1s infinite;
    vertical-align: middle;
}

/* Light mode color override for description carousel */
[data-theme="light"] .designer-carousel-desc {
    color: var(--accent-color);
}

[data-theme="light"] .designer-carousel-desc::after {
    background-color: var(--accent-color);
}

/* Static Designer text (same style as carousel but no animation) */
.designer-static {
    font-weight: 700;
    color: var(--accent-color);
    display: inline-block;
}

/* Light mode color override for static designer text */
[data-theme="light"] .designer-static {
    color: var(--accent-color);
}




.about-description {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-self: flex-end;
    margin-right: 20%;
    max-width: 500px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.about-description p:hover {
    color: var(--text-color);
    transition: color 0.3s ease;
}

/* --- Figma UI Overlays (nascosti finché non inspect-active) --- */
.figma-label-top-left,
.figma-number-top,
.figma-handles {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.inspect-active .figma-label-top-left,
.inspect-active .figma-number-top,
.inspect-active .figma-handles {
    opacity: 1;
}

.figma-label-top-left {
    position: absolute;
    top: -24px;
    left: -1.5px;
    background-color: #b982ff;
    color: #000;
    font-family: 'Inter', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    white-space: nowrap;
    z-index: 20;
}

.figma-number-top {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    color: #d1ff4d;
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    z-index: 20;
}

.figma-handles .handle {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #fff;
    border: 1.5px solid #b982ff;
    z-index: 20;
}

.figma-handles .tl { top: -4px;    left: -4px;   }
.figma-handles .tr { top: -4px;    right: -4px;  }
.figma-handles .bl { bottom: -4px; left: -4px;   }
.figma-handles .br { bottom: -4px; right: -4px;  }

/* --- About Card Text (large typewriter) --- */
.about-card-text {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 600;
    line-height: 1.35;
    color: var(--text-color);
    text-align: left;
    min-height: 4rem; /* riserva spazio mentre si digita */
}

.about-card-text::after {
    content: '|';
    display: inline;
    opacity: 0;
    animation: blink 0.9s step-end infinite;
    font-weight: 200;
}

.about-card-text.typing::after {
    opacity: 1;
}

/* --- Figma cursor label (bottom-right of card) --- */
.figma-editing-label {
    position: absolute;
    bottom: -26px;
    right: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 20;
}

.inspect-active .figma-editing-label {
    opacity: 1;
}

.figma-editing-label .fel-icon {
    width: 14px; height: 14px; color: #b982ff;
    display: flex; align-items: center; justify-content: center;
}

.figma-editing-label .fel-text {
    font-family: 'Inter', monospace;
    font-size: 11px;
    color: #fff;
    background: #1e1e1e;
    border: 1px solid #333;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}

/* PROJECTS - HORIZONTAL GALLERY */
.horizontal-section {
    position: relative;
    height: 400vh;
    /* Determines the scroll length */
    background: var(--bg-color);
    z-index: 100;
    pointer-events: auto;
    /* Ensure scrolls are captured */
}

@media (max-width: 768px) {
    .about-container {
        display: flex;
        /* Stack vertically instead of grid */
        flex-direction: column;
        padding: 0 1.5rem;
        /* Better horizontal padding */
        gap: 1rem;
    }

    .about-label {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    .about-content {
        gap: 3rem;
        /* Reduce gap between Headline and Desc */
    }

    .about-headline {
        font-size: 2rem;
        /* Slightly smaller for mobile safety */
        line-height: 1.2;
        word-wrap: break-word;
    }

    .about-description {
        margin-right: 0;
        /* Remove the right margin that pushes text */
        max-width: 100%;
        align-self: flex-start;
        /* Align left */
    }
}

.sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    perspective: 1000px;
    /* For 3D text layers if needed */
}

/* Background Title */
.works-bg-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20vw;
    font-weight: 900;
    color: var(--title-bg-color, var(--text-color));
    /* Subtle watermark green fill */
    pointer-events: none;
    z-index: 1;
    white-space: nowrap;
    will-change: transform;
    /* Optional: Slight parallax stroke effect */
    opacity: 1;
    letter-spacing: -0.05em;
}

/* Moving Track */
.scroll-track {
    display: flex;
    gap: 0;
    /* Seamless, no gaps between cards */
    padding-left: 100vw;
    /* Push start to the right to reveal title first */
    will-change: transform;
    /* Transformation handled by JS */
    z-index: 10;
    align-items: center;
}

/* Gallery Items */
.gallery-item {
    position: relative;
    width: 35vw;
    /* Large, premium size */
    height: 50vh;
    min-width: 300px;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    /* We will use a custom cursor or pointer */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Image skew logic will target the container */
    pointer-events: auto;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    z-index: 20;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.1);
    /* Pre-zoomed for parallax hover */
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.0);
}

/* Info overlay on hover */
.gallery-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-info {
    opacity: 1;
    transform: translateY(0);
}

.gallery-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.gallery-desc {
    font-size: 0.9rem;
    color: #ccc;
    font-family: monospace;
}


/* LIGHTBOX OVERLAY (Gallery Mode) */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-counter {
    color: #fff;
    margin-top: 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    transition: transform 0.2s ease, color 0.2s ease;
    z-index: 100000;
}

.lightbox-close {
    top: 20px;
    right: 30px;
    font-size: 3rem;
}

.lightbox-prev {

    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: var(--primary-color, #00F2FF);
    transform: scale(1.1);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Grid */
/* Responsive Grid */
@media (max-width: 1024px) {
    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .giant-name {
        font-size: 15vw;
        /* Smaller on mobile */
    }
}

/* --- SERVICES SECTION --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1200px;
    margin: 4rem auto 0;
}

.service-card {
    background: rgba(20, 20, 20, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    transition: transform 0.3s ease, border-color 0.3s ease;
    /* Animation Props */
    opacity: 0;
    transform: translateY(100px);
    /* Bottom to top */
    transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for second card handled in JS or nth-child */
.service-card:nth-child(2) {
    transition-delay: 0.2s;
    /* Native Stagger */
}

.service-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.service-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.service-icon {
    width: 60px;
    height: 60px;
    color: var(--accent-color);
}

.service-title {
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-color);
    margin: 0;
    line-height: 1;
}

.service-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.service-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: #ccc;
    font-weight: 600;
    text-transform: uppercase;
}

.service-action {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    color: var(--accent-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.service-card:hover .service-action {
    background: var(--accent-color);
    color: #000;
}

/* --- SERVICES TYPEWRITER ANIMATION --- */
@keyframes typing {
    from {
        width: 0
    }

    to {
        width: 100%
    }

    /* Fits content table */
}

/* Generalized Centered Typewriter Title -- REPLACED WITH SMOOTH FADE */
.giant-name.bg-center-title {
    opacity: 0;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    margin: 0 auto;
    transform: translateY(-50%) translateY(30px);
    /* Start slightly lower */
    z-index: 0;
    text-align: center;
    padding-left: 0;
    display: block;
    width: 100%;
    /* Full width */
    font-size: 15vw;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.giant-name.bg-center-title.visible {
    opacity: 1;
    transform: translateY(-50%) translateY(0);
}

/* Specific override for Works to stay fixed on screen until fade */
#works-title.giant-name.bg-center-title {
    position: sticky;
    /* Stuck in section, scrolls away after */
    top: 50vh;
    /* Center of viewport */
    z-index: 5;
    transition: opacity 0.3s ease;
    margin-bottom: 0;
    /* Remove margin to avoid layout offset */
}

/* Service Cards Delay - wait for typewriter (0.8s) */
.services-grid {
    position: relative;
    z-index: 2;
    /* In front of text */
    margin: 0 auto;
    /* Reset margin */
    width: 100%;
    max-width: 1200px;
}

.projects-grid {
    position: relative;
    z-index: 200;
    /* Higher than snake (100) so snake goes behind grid */
    pointer-events: auto;
    /* Ensure clickable */
}

.services-grid .service-card {
    /* Transition delay removed - now scroll-driven */
    transition-delay: 0s;
}

.services-grid .service-card:nth-child(2) {
    /* Transition delay removed - now scroll-driven */
    transition-delay: 0s;
}


/* --- SERVICES SECTION (Sticky Scroll-Controlled) --- */
.services-section {
    position: relative;
    height: 300vh;
    /* Extended height for scroll control - 3 steps: title + card1 + card2 */
    background: var(--bg-color);
    z-index: 100;
}

.services-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 5vw;
}

/* --- SECTION UTILITIES (Standard Spacing) --- */
.phases-section,
#contatti {
    min-height: 100vh;
    /* Increased vertical spacing "breath" */
    padding: 200px 5vw;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.phases-title {
    margin-bottom: 2rem;
}

/* --- DEV PHASES (Horizontal Scroll) --- */
.phases-horizontal-section {
    position: relative;
    height: 300vh;
    /* Scroll travel */
    background: var(--bg-color);
    /* Maintain continuity */
    z-index: 100;
    pointer-events: auto;
    /* Ensure scrolls are captured */
}

.phases-sticky-wrapper {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.phases-bg-title {
    position: absolute;
    top: 15%;
    /* Positioned nicely at top */
    left: 5vw;
    font-size: 8vw;
    /* Large fluid title */
    font-weight: 800;
    color: var(--title-bg-color, var(--text-color));
    z-index: 5;
    /* Behind track? Or keep static? Static is fine */
    text-transform: uppercase;
    line-height: 1;
}

.phases-track {
    display: flex;
    gap: 50px;
    padding-left: 30vw;
    /* Start entering relative to title */
    will-change: transform;
    height: 100%;
    align-items: center;
    z-index: 10;
}

.phase-card {
    position: relative;
    width: 30vw;
    /* Compact enough to see multiple or focused */
    min-width: 370px;
    height: 50vh;
    background: rgba(15, 15, 15, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    /* Sharp modern look or slight radius? User likes modern. */
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.phase-card:hover {
    border-color: var(--accent-color);
    background: rgba(20, 20, 20, 0.6);
    transform: scale(1.02);
}

.phase-card-num {
    font-size: 4rem;
    font-family: monospace;
    font-weight: 700;
    color: var(--accent-color);
    opacity: 1;
    margin-bottom: 1rem;
}

.phase-card-content h3 {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-transform: uppercase;
    font-weight: 800;
}

.phase-card-content p {
    font-size: 1rem;
    line-height: 1.5;
    color: #888;
}

/* Service Action Interactive Elements */
.service-action-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

.service-req-text {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
    pointer-events: none;
}

.service-action {
    cursor: pointer;
}

/* Service Action Interactive Elements */
.service-action-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

.service-req-text {
    opacity: 0;
    transition: opacity 0.3s ease;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.9rem;
    pointer-events: none;
}

.service-action {
    cursor: pointer;
}

/* ========================================
   CONTACTS SECTION
   ======================================== */

.contacts-section {
    min-height: 100vh;
    padding: 100px 5vw;
    position: relative;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.contacts-title {
    margin-bottom: 4rem;
}

.contacts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* Contact Info Card */
.contact-info-card,
.booking-card {
    background: rgba(20, 20, 20, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    /* Enable interaction */
}

.booking-card {
    animation: bounce 3s ease-in-out infinite;
}

.contact-info-card:hover,
.booking-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.contact-info-card h3,
.booking-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.contact-item:last-child {
    margin-bottom: 0;
}

.contact-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.contact-item a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--accent-color);
}

/* Booking Card */
.booking-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.booking-trigger {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--accent-color);
    color: var(--btn-text, #000);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    pointer-events: auto;
    /* Enable clicks */
}

.booking-trigger:hover {
    background: var(--btn-hover-bg, var(--accent-color)) !important;
    color: var(--btn-text-hover, var(--btn-text, #000)) !important;
    transform: scale(1.02);
    box-shadow: 0 10px 30px var(--hover-glow, var(--accent-shadow-weak));
}

.booking-trigger svg {
    flex-shrink: 0;
}

/* Booking Modal */
.booking-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    pointer-events: none;
    /* Let touches pass through to content */
}

.booking-modal.active {
    display: flex;
    opacity: 1;
}

.booking-modal-content {
    background: var(--card-bg, rgba(10, 10, 13, 0.2));
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 3rem;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    /* Safer height to ensure buttons are visible */
    /* Flex Column for Header - Content(scroll) - Footer */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Hide outer scroll */
    position: relative;
    animation: modalSlideIn 0.4s ease-out;
    pointer-events: auto;
    /* Re-enable for content */
}

[data-theme="light"] .booking-modal-content {
    background: var(--card-bg, rgba(255, 255, 255, 0.9)) !important;
    border: 1px solid rgba(17, 24, 39, 0.15);
    /* Gray 900 at 15% */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

/* Ensure Primary Buttons/Next Buttons follow the rule: 
   Dark Mode -> Black Text
   Light Mode -> White Text 
*/
.booking-nav-btn.next,
.primary-btn {
    color: var(--btn-text, #000000);
}

.booking-nav-btn.next svg,
.primary-btn svg {
    stroke: var(--btn-text, #000000);
    /* Assuming stroke based icons */
    fill: none;
    /* Or currentColor if fill based */
}

[data-theme="light"] .booking-nav-btn.next,
[data-theme="light"] .primary-btn {
    color: var(--btn-text, #ffffff) !important;
}

[data-theme="light"] .booking-nav-btn.next svg,
[data-theme="light"] .primary-btn svg {
    stroke: var(--btn-text, #ffffff);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Back Button (Top-Left) */
.booking-back {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.booking-back:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

[data-theme="light"] .booking-back {
    color: var(--text-color);
}

[data-theme="light"] .booking-back:hover {
    background: #f3f4f6;
    color: var(--accent-color);
}

.booking-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    pointer-events: auto;
}

[data-theme="light"] .booking-close {
    color: var(--text-color);
}

.booking-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

[data-theme="light"] .booking-close:hover {
    background: #f3f4f6;
    color: var(--accent-color);
}

.booking-modal-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

/* Booking Steps Wrapper - THE SCROLL CONTAINER (iOS Fix) */
.booking-steps-wrapper {
    flex: 1 1 auto;
    min-height: 300px;
    /* CRITICAL: iOS needs explicit pixel height */
    max-height: calc(85vh - 250px);
    /* Ensure it fits in modal */
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
    touch-action: pan-y;
    position: relative;
    margin-bottom: 1rem;
}

/* Booking Steps - Content Container (No scroll) */
.booking-steps {
    /* Just a content container, parent handles scroll */
    padding-right: 5px;
}

.booking-step {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.booking-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.booking-step h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

[data-theme="light"] .booking-step h3 {
    color: var(--text-color);
    /* Gray 900 */
}

/* Month Grid */
.month-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.month-btn {
    padding: 1.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.month-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-color);
}

[data-theme="light"] .month-btn {
    background: #ffffff;
    color: var(--text-color);
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .month-btn:hover {
    background: transparent;
    border-color: var(--accent-color);
}

.month-btn.selected {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

[data-theme="light"] .month-btn.selected {
    color: #ffffff;
}

/* Day Grid */
.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.75rem;
}

.day-btn {
    padding: 1.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    pointer-events: auto;
}

.day-btn .day-number {
    font-size: 1.3rem;
    font-weight: 700;
}

.day-btn .day-name {
    font-size: 0.75rem;
    opacity: 0.7;
}

.day-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

[data-theme="light"] .day-btn {
    background: #ffffff;
    color: var(--text-color);
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .day-btn:hover:not(.disabled) {
    background: transparent;
    border-color: var(--accent-color);
}

.day-btn.selected {
    background: var(--accent-color);
    color: #000000;
    /* Black text in Dark Mode */
    border-color: var(--accent-color);
}

.day-btn.selected svg,
.day-btn.selected i {
    color: #000000;
    fill: #000000;
}

[data-theme="light"] .day-btn.selected {
    color: #ffffff !important;
    /* White text in Light Mode */
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

[data-theme="light"] .day-btn.selected svg,
[data-theme="light"] .day-btn.selected i {
    color: #ffffff;
    fill: #ffffff;
}

.day-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.time-slot {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    pointer-events: auto;
}

.time-slot:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

[data-theme="light"] .time-slot {
    background: #ffffff;
    color: var(--text-color);
    border: 1px solid #e5e7eb;
}

[data-theme="light"] .time-slot:hover {
    background: transparent;
    border-color: var(--accent-color);
}

.time-slot.selected {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

[data-theme="light"] .day-btn.selected,
[data-theme="light"] .month-btn.selected,
[data-theme="light"] .time-slot.selected {
    background: var(--accent-color) !important;
    color: #ffffff !important;
    border-color: var(--accent-color) !important;
}

/* Booking Confirmation */
.booking-confirmation {
    text-align: center;
    padding: 1rem 0;
}

.success-icon {
    width: 60px;
    height: 60px;
    color: var(--accent-color);
    margin: 0 auto 1rem;
    animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    25% {
        transform: translateY(-10px);
    }

    50% {
        transform: translateY(0);
    }

    75% {
        transform: translateY(-5px);
    }
}

.booking-confirmation h3 {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.booking-summary {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}

.booking-summary p {
    margin: 0.75rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.booking-summary strong {
    color: var(--text-color);
}

.booking-note {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Navigation Buttons */
.booking-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 50;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--btn-text, #000000);
}

.btn-primary:hover:not(:disabled) {
    background: var(--btn-hover-bg, var(--accent-color)) !important;
    color: var(--btn-text-hover, var(--btn-text, #000000)) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-glow, var(--accent-shadow-weak));
}

[data-theme="light"] .btn-primary {
    background: var(--accent-color);
    color: var(--btn-text, #ffffff);
}

[data-theme="light"] .btn-primary:hover:not(:disabled) {
    background: var(--btn-hover-bg, var(--accent-color)) !important;
    color: var(--btn-text-hover, var(--btn-text, #ffffff)) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--hover-glow, var(--accent-shadow-weak));
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
}

/* Responsive */
@media (max-width: 768px) {
    .booking-modal-content {
        padding: 2rem 1.5rem;
    }

    .month-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .day-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }

    .time-slots {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
}

/* Booking Form Styles */
.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

[data-theme="light"] .form-group label {
    color: var(--form-text-color, var(--text-color, var(--text-color)));
    /* Dark text for light mode forms */
}

.form-input,
.form-textarea {
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--form-text-color, var(--text-color));
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-textarea {
    background: rgba(255, 255, 255, 0.7);
    color: var(--form-text-color, var(--text-color));
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-input:focus,
[data-theme="light"] .form-textarea:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--accent-color);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Light Mode - Services & Contacts Text Improvements */
[data-theme="light"] .service-card h3,
[data-theme="light"] .service-title {
    color: var(--text-color) !important;
    /* Dark gray for better readability */
}

[data-theme="light"] .service-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(17, 24, 39, 0.15);
}

[data-theme="light"] .service-card:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--accent-color);
}

[data-theme="light"] .tag {
    background: rgba(10, 40, 68, 0.1);
    color: var(--accent-color);
    border-color: rgba(10, 40, 68, 0.3);
}

[data-theme="light"] .contact-info-card h3,
[data-theme="light"] .booking-card h3,
[data-theme="light"] .contact-item,
[data-theme="light"] .booking-subtitle {
    color: var(--text-color) !important;
}

[data-theme="light"] .contact-info-card,
[data-theme="light"] .booking-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(17, 24, 39, 0.15);
}

[data-theme="light"] .contact-info-card:hover,
[data-theme="light"] .booking-card:hover {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .contact-item a:hover {
    color: var(--nav-hover);
}

[data-theme="light"] .booking-trigger {
    background: var(--accent-color);
    color: var(--btn-text, #fff);
}

[data-theme="light"] .booking-trigger:hover {
    background: var(--btn-hover-bg, var(--accent-color)) !important;
    color: var(--btn-text-hover, var(--btn-text, #fff)) !important;
    box-shadow: 0 10px 30px var(--hover-glow, var(--accent-shadow-weak));
}

[data-theme="light"] .phase-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(17, 24, 39, 0.15);
}

[data-theme="light"] .phase-card:hover {
    background: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .phase-card-header h3,
[data-theme="light"] .phase-card-content p {
    color: var(--text-color) !important;
}



/* Fix Service Action Icon Color in Light Mode */
[data-theme="light"] .service-card:hover .service-action {
    color: #ffffff;
}

/* =========================================
   404 PAGE STYLES
   ========================================= */

.error-section {
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

.big-error .glitch {
    font-size: 15rem;
    line-height: 1;
    margin-bottom: 1rem;
    position: relative;
    z-index: 100;
}

@media (max-width: 768px) {
    .big-error .glitch {
        font-size: 8rem;
    }
}

.error-subtitle {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    font-weight: 700;
}

.error-text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Buttons General */
.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: #000000;
    /* Black text in dark mode */
    background: var(--accent-color);
    border: none;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

[data-theme="light"] .cta-button {
    color: #ffffff;
    /* White text in light mode */
}

.home-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    color: #000000;
    /* Black text in dark mode */
    background-color: var(--accent-color);
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="light"] .home-btn {
    color: #ffffff;
}

.home-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--accent-shadow-weak);
    background-color: #fff;
}

[data-theme="light"] .home-btn:hover {
    background-color: var(--text-color);
}

/* =========================================
   MOBILE LAYOUT OVERRIDES (Native Scroll)
   ========================================= */
@media (max-width: 768px) {

    /* RESET Horizontal Sections to standard flow */
    .horizontal-section,
    .phases-horizontal-section {
        height: auto !important;
        /* Remove the 300vh/400vh forcing */
        min-height: auto;
        overflow: hidden;
        /* Container hides overflow */
        padding: 2rem 0;
        /* Add some vertical breathing room */
    }

    /* Disable Sticky Wrapper behavior */
    .sticky-wrapper,
    .phases-sticky-wrapper {
        position: relative;
        top: auto;
        height: auto;
        width: 100%;
        display: block;
        overflow: visible;
    }

    /* Make the Track natively scrollable */
    .scroll-track,
    .phases-track {
        display: flex;
        overflow-x: auto;
        /* Native scroll */
        scroll-snap-type: x mandatory;
        padding-left: 5vw;
        /* Start padding */
        padding-right: 5vw;
        /* End padding */
        padding-top: 9rem;
        /* Increased space for title */
        padding-bottom: 2rem;
        width: 100%;
        transform: none !important;
        /* Force disable JS transform if it tries */
        gap: 1.5rem;
        /* Hiding scrollbar for cleaner look */
        scrollbar-width: none;
        /* Firefox */
        -ms-overflow-style: none;
        /* IE/Edge */
        pointer-events: auto;
        /* Enable touch scrolling */
    }

    .scroll-track::-webkit-scrollbar,
    .phases-track::-webkit-scrollbar {
        display: none;
    }

    /* Items snap */
    .gallery-item,
    .phase-card {
        scroll-snap-align: center;
        flex-shrink: 0;
        width: 85vw;
        /* Take up most of screen width */
        height: auto;
        aspect-ratio: 4/5;
        min-width: unset;
        /* Remove desktop min-width */
    }

    .phase-card {
        height: auto;
        min-height: 50vh;
        /* Ensure phases have height */
    }

    /* Fix Titles for Mobile - Position them nicely */
    .works-bg-title,
    .phases-bg-title {
        position: absolute;
        top: 1rem;
        /* Reverted/Adjusted as requested */
        left: 50%;
        transform: translateX(-50%) !important;
        font-size: 15vw;
        width: 100%;
        text-align: center;
        white-space: nowrap;
        margin: 0;
        pointer-events: none;
    }

    /* Ensure Gallery Info is visible on touch */
    .gallery-info {
        opacity: 1;
        transform: translateY(0);
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    }

    /* Adjust Gallery Item for Mobile */
    .gallery-item {
        border-radius: 16px;
    }

    /* Fix Phase Card Font Sizes for Mobile to prevent overflow */
    .phase-card {
        padding: 2rem;
        /* Reduce padding from 3rem to 2rem */
        min-height: 40vh;
        /* Adjust height */
    }

    .phase-card-content h3 {
        font-size: 1.7rem;
        /* Reduce from 2.5rem to fit "DEVELOPMENT" */
        word-wrap: break-word;
        /* Ensure it breaks if still too long */
    }

    .phase-card-num {
        font-size: 3rem;
        /* Slightly smaller number */
    }
}

/* =========================================
   CUSTOM SCROLLBAR (Side)
   ========================================= */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 6px;
    border: 2px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
    filter: brightness(1.2);
    box-shadow: 0 0 10px var(--accent-color);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) var(--bg-color);
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    z-index: 100;
    /* Superiore all'hero per sovrapporlo */
}

@media (max-width: 768px) {
    footer {
        display: none !important;
    }
}

footer p {
    margin: 0;
}

footer .highlight {
    color: var(--accent-color);
    font-weight: 600;
}

/* =========================================
   LIGHTBOX DESCRIPTION
   ========================================= */
.lightbox-desc {
    color: white;
    margin-top: 10px;
    font-family: inherit;
    font-size: 1.1em;
    text-align: center;
    max-width: 80%;
}
