/* --- Variables & Reset --- */
:root {
    --primary-color: #5ce1e6;
    /* Cyan accent from Canva */
    --secondary-color: #004aad;
    /* Blue accent */
    --bg-color: #0C0A20;
    /* Dark background */
    --bg-darker: #060510;
    /* Darker section bg */
    --text-color: #ffffff;
    --text-muted: #cccccc;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #000;
    /* Ensure overscroll/bottom is black */
}

/* Chi Siamo Grid */
.about-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 50px;
    align-items: center;
}

/* Specific grid for Rebranding page (more text, smaller image) */
.rebranding-grid {
    grid-template-columns: 1.4fr 0.6fr;
}

/* Specific grid for Sito Web page (larger image than rebranding) */
.sito-web-grid {
    grid-template-columns: 1fr 1fr;
}

.about-image img {
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    width: 100%;
}

/* Image Frame for Grid Pages (Rebranding, Chi Siamo, etc) */
.about-grid .image-frame {
    padding: 15px;
    border: 2px solid var(--primary-color);
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(92, 225, 230, 0.2);
    /* Soft glow matching primary color */
}

/* Ensure image inside frame fits well */
.about-grid .image-frame img {
    box-shadow: none;
    /* Remove duplicate shadow if frame has it, or keep it */
    display: block;
    /* Remove bottom space */
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
}

/* Intro Overlay / Background Video */
#intro-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    /* Moved further back */
}

/* Video Dark Overlay */
#video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0;
    z-index: -1;
    /* Above video, below content */
    transition: opacity 1s ease-in;
}

#video-overlay.darken {
    opacity: 0.75;
}

/* Darker overlay specifically for Rebranding page */
.rebranding-page #video-overlay.darken {
    opacity: 0.85;
}

/* Content Wrapper Visibility */
.hidden-content {
    opacity: 0;
    transform: scale(0.8);
    /* Start smaller for zoom effect */
    transition: opacity 3s ease-in, transform 3s ease-out;
    /* Increased to 3s */
}

.visible-content {
    opacity: 1;
    transform: scale(1);
}

/* Header specific visibility (No transform to keep position:fixed working) */
.hidden-opacity {
    opacity: 0;
    transition: opacity 3s ease-in;
}

.visible-opacity {
    opacity: 1;
}

/* Navigation Bar */
a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-transform: uppercase;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(92, 225, 230, 0.3);
}

.text-center {
    text-align: center;
}

/* --- Layout Utilities --- */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-padding {
    padding: 80px 0;
}

.bg-darker {
    background-color: var(--bg-darker);
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 74, 173, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 74, 173, 0.6);
}

.btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--bg-color);
}

.btn-block {
    display: block;
    width: 100%;
}

/* --- Header --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    /* White background */
    backdrop-filter: blur(10px);
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    /* Lighter shadow */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 60px;
    /* Adjust based on logo aspect ratio */
    width: auto;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    /* Slightly bolder for visibility */
    color: var(--bg-color);
    /* Dark text */
    position: relative;
}

.nav-links a:not(.btn-nav)::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    /* Blue underline */
    transition: var(--transition);
}

.nav-links a:not(.btn-nav):hover::after {
    width: 100%;
}

.btn-nav {
    padding: 8px 20px;
    border: 1px solid var(--secondary-color);
    /* Blue border */
    border-radius: 20px;
    color: var(--secondary-color) !important;
    /* Blue text */
}

.btn-nav:hover {
    background-color: var(--secondary-color);
    color: #fff !important;
    /* White text on hover */
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--bg-color);
    /* Dark icon */
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    /* Removed background-image and overlay as video is now fixed background */
}

/*
.hero-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(12, 10, 32, 0.9), rgba(12, 10, 32, 0.7));
    z-index: 1;
}
*/

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin-top: 50px;
    /* Push content down slightly if needed */
}

.hero-logo {
    max-width: 375px;
    margin: -60px auto 30px auto;
    /* Moved up by approx 60px total */
    display: block;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    max-width: 600px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
}

/* --- About Section --- */
.about-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.about-content p {
    margin-bottom: 20px;
}

.about-content strong {
    color: var(--primary-color);
}

/* Specific styles for Chi Siamo and Rebranding text */
.about-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

/* Specific text size for Sito Web page */
.sito-web-grid .about-text p,
.sito-web-grid .about-text ul {
    font-size: 1rem;
    line-height: 1.6;
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.service-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px 30px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    text-align: center;
    display: block;
    /* Ensure it behaves like a box */
    text-decoration: none;
    /* Remove underline from link */
    color: inherit;
    /* Inherit text color */
}

.service-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.icon-box {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.service-card h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Why Us Section --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
}

.feature-item i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

.feature-item h4 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--primary-color);
}

.feature-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* --- Contact Section --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 50px;
    margin-top: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 20px;
}

.info-item i {
    width: 50px;
    height: 50px;
    background: rgba(92, 225, 230, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.info-item h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.info-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: var(--bg-color);
    transform: translateY(-3px);
}

.contact-form {
    background: rgba(255, 255, 255, 0.03);
    padding: 40px;
    border-radius: 15px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 8px;
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group input {
    width: auto;
}

.checkbox-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.checkbox-group a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* --- Footer --- */
footer {
    background-color: #000;
    padding: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 15px;
}

.separator {
    color: rgba(255, 255, 255, 0.2);
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation: fadeUp 1s ease forwards;
    opacity: 0;
    /* Start hidden */
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

/* --- Responsive --- */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 3rem;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        background-color: var(--bg-darker);
        flex-direction: column;
        justify-content: center;
        transition: var(--transition);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    /* Fix for mobile menu links visibility (was dark on dark) */
    .nav-links a {
        color: var(--text-color);
        font-size: 1.2rem;
        margin: 15px 0;
    }

    /* Keep the button style for contact in menu */
    .btn-nav {
        margin-top: 10px;
        display: inline-block;
        /* Ensure it doesn't span full width if not desired, or let it inherit */
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    /* Fix for hero buttons alignment on mobile */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Stack grids on mobile */
    .about-grid,
    .rebranding-grid,
    .sito-web-grid,
    .rebranding-services-grid {
        grid-template-columns: 1fr;
    }

    /* Adjust page header spacing */
    .page-header {
        margin-top: 120px !important;
        /* Override inline style if possible, or adjust HTML */
        padding-bottom: 30px !important;
    }

    /* Stack horizontal images row */
    .images-row {
        flex-direction: column;
    }

    /* Reduce section padding */
    .section-padding {
        padding: 50px 0;
    }

    /* Ensure images fit */
    .about-image {
        margin-top: 30px;
    }
}

/* --- Scroll to Top Button --- */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollTopBtn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-5px);
}

/* --- Rebranding Page Specifics --- */

/* Signal Section */
.signal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.signal-card {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: var(--transition);
}

.signal-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.signal-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(92, 225, 230, 0.4);
}

.signal-card p {
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Zig-Zag Section (Method) */
.zigzag-item {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 80px;
}

.zigzag-item:nth-child(even) {
    flex-direction: row-reverse;
}

.zigzag-text {
    flex: 1;
}

.zigzag-image {
    flex: 1;
}

.zigzag-image img {
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Services Cards (Expansion) */
.rebranding-services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 40px;
}

.service-detail-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.service-detail-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 15px 40px rgba(92, 225, 230, 0.15);
}

.card-image {
    height: 200px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-detail-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 25px;
}

.card-content h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.card-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Bento Grid (Coordinated Image) */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 250px);
    gap: 20px;
    margin-top: 40px;
}

.bento-item {
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bento-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bento-item:hover img {
    transform: scale(1.05);
}

/* Bento spans */
.bento-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item.medium {
    grid-column: span 2;
}

/* FAQ Accordion */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    margin-top: 40px;
}

.faq-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: 20px 0;
    text-align: left;
    color: var(--text-color);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-question i {
    transition: transform 0.3s ease;
}

.faq-question.active i {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.faq-answer p {
    padding-bottom: 20px;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .zigzag-item {
        flex-direction: column !important;
        gap: 30px;
    }

    .bento-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .bento-item {
        height: 250px;
    }

    .bento-item.large,
    .bento-item.medium {
        grid-column: auto;
        grid-row: auto;
    }

    .signal-grid,
    .rebranding-services-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 2.5rem;
    }
}

/* --- FAQ Section --- */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: var(--transition);
}

.faq-item.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-color);
}

.faq-question {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.faq-question h4 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color);
}

.faq-question i {
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 20px;
}

.faq-answer p {
    padding-bottom: 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    /* Adjust if needed */
}