/* Base Reset and Variables */
:root {
    --bg-color: #0d0d0d;
    --text-color: #f5f5f5;
    --text-muted: #9e9e9e;
    --accent-color: #e64a19;
    /* Derived from Landing Page Esempio 2 */
    --accent-hover: #ff5722;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    --card-bg: #1a1a1a;
}

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

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    display: block;
    text-align: center;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.section-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--accent-color);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 3rem;
    margin-top: 3rem;
    display: block;
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
    border-radius: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
}

.btn-primary {
    background-color: var(--accent-color);
    color: #fff;
    border: 2px solid var(--accent-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--accent-color);
}

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

.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-outline-small {
    background-color: transparent;
    color: #fff;
    border: 1px solid #fff;
    padding: 8px 18px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-outline-small:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Typography styles matching the "premium" requirement */
p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 0;
    z-index: 1000;
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 1px;
}

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

.nav-links a {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--text-color);
}

.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--accent-color);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--accent-color);
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #1a1a1a 0%, #0d0d0d 70%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background-image: url('assets/img/Logo.jpg');
    /* Just referencing something similar if needed, else plain gradient */
    opacity: 0.05;
    background-size: cover;
    background-position: center;
    pointer-events: none;
}

.hero-content {
    text-align: center;
    z-index: 2;
    padding: 0 20px;
    animation: fadeInUp 1s ease 0.5s both;
}

.hero-logo {
    width: 250px;
    margin: 0 auto 2rem;
    display: block;
    mix-blend-mode: screen;
    /* Useful if logo has a black background */
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    font-weight: 400;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--accent-color);
    margin-bottom: 2.5rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

/* --- Generalized Section Inner --- */
.section-inner {
    padding: 100px 20px;
}

/* --- About Me Section --- */
.about {
    background-color: var(--card-bg);
}

.about-inner {
    display: flex;
    align-items: center;
    gap: 60px;
}

.about-images {
    flex: 1;
    position: relative;
    min-height: 500px;
}

.about-img-wrapper {
    position: absolute;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    transition: transform 0.5s ease;
}

.img-back {
    width: 70%;
    top: 0;
    left: 0;
    z-index: 1;
    opacity: 0.8;
}

.img-front {
    width: 65%;
    bottom: 0;
    right: 0;
    z-index: 2;
    border: 10px solid var(--card-bg);
}

.about-images:hover .img-back {
    transform: translate(-10px, -10px);
}

.about-images:hover .img-front {
    transform: translate(10px, 10px);
}

.about-text {
    flex: 1;
}

/* --- Services Section --- */
.services {
    background-color: var(--bg-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-top: 50px;
}

.service-card {
    padding: 40px 30px;
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-color);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    color: var(--accent-color);
}

.service-card h4 {
    font-size: 1.3rem;
    font-weight: 500;
    margin-bottom: 15px;
    font-family: var(--font-heading);
}

.service-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* --- Portfolio Section --- */
.portfolio {
    background-color: var(--card-bg);
}

/* Collage */
.portfolio-collage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 100px;
    margin-bottom: 120px;
    width: 100%;
}

.collage-group {
    position: relative;
    width: 90%;
    max-width: 500px;
    aspect-ratio: 4/5;
}

/* Eccezione per il Gruppo 3 (Orizzontale) */
.collage-group.group-3 {
    max-width: 750px;
    aspect-ratio: 16/9;
    margin-top: 60px;
    /* Stacca maggiormente il gruppo 3 dal precedente */
}

.collage-img {
    position: absolute;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
    filter: grayscale(15%) contrast(1.05);
    border-radius: 4px;
    object-fit: cover;
}

.collage-group:hover .collage-img {
    filter: grayscale(0%) contrast(1.05);
}

.collage-group:hover .img-a {
    transform: scale(1.03) translate(-10px, -10px);
    z-index: 5;
}

.collage-group:hover .img-b {
    transform: scale(1.03) translate(10px, 10px);
    z-index: 5;
}

/* Group 1 */
.group-1 .img-a {
    width: 75%;
    top: 0;
    left: 0;
    z-index: 2;
}

.group-1 .img-b {
    width: 65%;
    bottom: 5%;
    right: -5%;
    z-index: 1;
    opacity: 0.95;
}

/* Group 2 */
.group-2 .img-a {
    width: 80%;
    top: 10%;
    right: 0;
    z-index: 1;
}

.group-2 .img-b {
    width: 60%;
    bottom: -5%;
    left: -5%;
    z-index: 2;
    border: 8px solid var(--card-bg);
}

/* Group 3 (Orizzontale) */
.group-3 .img-b {
    width: 75%;
    top: 5%;
    left: 0;
    z-index: 1;
    opacity: 0.9;
}

.group-3 .img-a {
    width: 70%;
    bottom: -5%;
    right: 0;
    z-index: 2;
    border: 8px solid var(--bg-color);
}

/* Grid (Broken Square Selection style like Landing Page_Esempio2) */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.grid-card {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
}

.grid-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    filter: brightness(0.8) contrast(1.1);
}

.grid-card:hover img {
    transform: scale(1.05);
    filter: brightness(1) contrast(1.1);
}

/* The Broken Square Selection Frame */
.broken-frame {
    position: absolute;
    inset: 15px;
    pointer-events: none;
    z-index: 3;
}

.broken-frame::before,
.broken-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, 0.7);
    border-style: solid;
    transition: all 0.4s ease;
}

.broken-frame::before {
    top: 0;
    left: 0;
    border-width: 1px 0 0 1px;
}

.broken-frame::after {
    bottom: 0;
    right: 0;
    border-width: 0 1px 1px 0;
}

/* Adding the other two corners */
.grid-card::before,
.grid-card::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, 0.7);
    border-style: solid;
    transition: all 0.4s ease;
    z-index: 3;
    pointer-events: none;
}

.grid-card::before {
    top: 15px;
    right: 15px;
    border-width: 1px 1px 0 0;
}

.grid-card::after {
    bottom: 15px;
    left: 15px;
    border-width: 0 0 1px 1px;
}

.grid-card:hover .broken-frame::before,
.grid-card:hover .broken-frame::after,
.grid-card:hover::before,
.grid-card:hover::after {
    border-color: var(--accent-color);
    width: 40px;
    height: 40px;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 4;
}

.grid-card:hover .card-overlay {
    opacity: 1;
}

/* Videos Section */
.section-divider {
    width: 1px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 60px auto 40px;
}

.portfolio-videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.video-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

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

.video-wrapper .broken-frame {
    inset: 10px;
}

.video-wrapper::before,
.video-wrapper::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    border-color: rgba(255, 255, 255, 0.7);
    border-style: solid;
    transition: all 0.4s ease;
    z-index: 3;
    pointer-events: none;
}

.video-wrapper::before {
    top: 10px;
    right: 10px;
    border-width: 1px 1px 0 0;
}

.video-wrapper::after {
    bottom: 10px;
    left: 10px;
    border-width: 0 0 1px 1px;
}

/* --- Contact Section --- */
.contact {
    background-color: var(--bg-color);
}

.contact-desc {
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 30px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.contact-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
}

.contact-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.contact-card h4 {
    font-size: 1.1rem;
    font-family: var(--font-heading);
    margin-bottom: 10px;
    font-weight: 500;
}

.contact-card span {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Footer --- */
.footer {
    background-color: #050505;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.footer-logo h3 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    margin-bottom: 5px;
    letter-spacing: 1px;
}

.footer-logo p {
    color: var(--accent-color);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 40px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.footer-bottom p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 992px) {
    .about-inner {
        flex-direction: column;
    }

    .about-images {
        min-height: 400px;
        width: 100%;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.8rem;
    }

    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: rgba(13, 13, 13, 0.98);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        z-index: 999;
    }

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

    .nav-links a {
        font-size: 1.5rem;
        margin: 15px 0;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 10px;
    }

    .collage-group {
        width: 100%;
        max-width: none;
        height: auto;
        margin-bottom: 20px;
    }

    .portfolio-collage {
        gap: 80px;
        margin-bottom: 80px;
    }

    .group-1 .img-b {
        right: 0;
    }

    .group-2 .img-b {
        left: 0;
    }

    .group-3 .img-a {
        right: 0;
        bottom: 0;
    }
}