/* ══════════════════════════════════════════════
   NIVOOLA — Dark Theme
   Color palette derived from logo gradient:
   Navy Blue → Purple → Crimson Red
   ══════════════════════════════════════════════ */

:root {
    /* Backgrounds — dark navy tones */
    --bg-deep:    #0B0F1A;
    --bg-base:    #0F1525;
    --bg-card:    #162038;
    --bg-hover:   #1C2A4A;
    --bg-nav:     rgba(11,15,26,0.88);

    /* Text */
    --text-primary:   #F0F2F8;
    --text-secondary: #A0A8C0;
    --text-muted:     #5A6380;

    /* Accents — from logo, brightened for dark-bg contrast */
    --accent-blue:    #4A7BF7;
    --accent-red:     #E63956;
    --accent-purple:  #8B5CF6;
    --accent-green:   #2a7d3f;
    --gradient-brand: linear-gradient(135deg, #4A7BF7, #8B5CF6, #E63956);

    /* Borders */
    --border:         rgba(255,255,255,0.06);
    --border-accent:  rgba(230,57,86,0.4);

    /* Fonts */
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    padding: 1.2rem 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: all 0.3s ease;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 70px;
    width: auto;
    transition: all 0.4s ease;
    animation: logo-glow 2.5s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(139,92,246,0.3))
               drop-shadow(0 0 16px rgba(230,57,86,0.1));
        transform: scale(1);
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(139,92,246,0.85))
               drop-shadow(0 0 60px rgba(230,57,86,0.5))
               drop-shadow(0 0 90px rgba(139,92,246,0.3));
        transform: scale(1.03);
    }
}

.logo-img:hover {
    animation: none;
    filter: drop-shadow(0 0 35px rgba(139,92,246,0.9))
           drop-shadow(0 0 70px rgba(230,57,86,0.5))
           drop-shadow(0 0 100px rgba(139,92,246,0.3));
    transform: scale(1.08);
}

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.nav-cta {
    background: var(--accent-red) !important;
    color: var(--text-primary) !important;
    padding: 0.55rem 1.3rem !important;
    border-radius: 2px;
    transition: background 0.2s, transform 0.2s !important;
}

.nav-cta:hover {
    background: #ff4d6a !important;
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
}

/* ── HERO ── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 2.5rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero-inner {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr minmax(320px, 520px);
    align-items: center;
    gap: 3rem;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 820px;
}

.hero-media {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(230,57,86,0.08) 0%, rgba(139,92,246,0.04) 40%, transparent 70%);
    border-radius: 50%;
}

.hero-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.hero-label::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent-red);
}

.hero h1 {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 1.8rem;
    color: var(--text-primary);
}

.hero h1 em {
    font-style: normal;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: var(--accent-red);
    color: var(--text-primary);
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.25s;
}

.hero-cta:hover {
    background: #ff4d6a;
    transform: translateY(-1px);
}

.hero-cta svg { transition: transform 0.25s; }
.hero-cta:hover svg { transform: translateX(4px); }

/* ── CREDIBILITY BAR ── */
.cred-bar {
    padding: 3rem 2.5rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.cred-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.cred-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.cred-logos {
    display: flex;
    gap: 2.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.cred-logo-item {
    display: flex;
    align-items: center;
    transition: opacity 0.2s;
    opacity: 0.45;
}

.cred-logo-item:hover { opacity: 1; }

.cred-logo-item img {
    height: auto;
    max-height: 32px;
    max-width: 120px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cred-logo-item:hover img { opacity: 1; }

.cred-logo-item span {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* ── SECTIONS ── */
section { padding: 6rem 2.5rem; }

.section-inner { max-width: 1100px; margin: 0 auto; }

.section-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-label::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent-red);
}

.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

.section-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin-bottom: 3.5rem;
}

/* ── SERVICES GRID ── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: default;
}

.service-card:hover {
    border-color: rgba(139,92,246,0.6);
    transform: translateY(-12px) scale(1.03);
    box-shadow:
        0 0 15px rgba(139,92,246,0.4),
        0 0 40px rgba(139,92,246,0.25),
        0 0 80px rgba(230,57,86,0.15),
        0 20px 60px rgba(0,0,0,0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(139,92,246,0.1) 100%);
}

/* PRIORITÀ banner (red) — applied to Fractional PM */
.service-card.featured {
    border-color: var(--border-accent);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(230,57,86,0.06) 100%);
}

.service-card.featured::after {
    content: 'PRIORITÀ';
    position: absolute;
    top: 1rem;
    right: -2rem;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 2px;
    background: var(--accent-red);
    color: var(--text-primary);
    padding: 0.25rem 2.5rem;
    transform: rotate(45deg);
}

/* NOVITÀ banner (green) — applied to Conformità CE */
.service-card.novelty {
    border-color: rgba(42,125,63,0.4);
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(42,125,63,0.06) 100%);
}

.service-card.novelty::after {
    content: 'NOVITÀ';
    position: absolute;
    top: 1rem;
    right: -2rem;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 2px;
    background: var(--accent-green);
    color: var(--text-primary);
    padding: 0.25rem 2.5rem;
    transform: rotate(45deg);
}

.service-icon {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-red);
    margin-bottom: 1.2rem;
}

.service-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.service-card p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

.service-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.service-list li {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.service-list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-red);
    font-size: 0.75rem;
}

.service-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

/* ── ABOUT ── */
.about-section {
    background: #080C16;
    color: var(--text-primary);
}

.about-section .section-label { color: var(--accent-red); }
.about-section .section-label::before { background: var(--accent-red); }

.about-section .section-sub { color: var(--text-muted); }

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.75;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    perspective: 800px;
}

.stat-item {
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent-red);
    padding: 1.5rem;
    background: rgba(22,32,56,0.5);
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
}

.stat-item:hover {
    transform: translateY(-6px) scale(1.03);
    border-color: rgba(139,92,246,0.3);
    border-left-color: var(--accent-red);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.3),
        0 0 20px rgba(139,92,246,0.1);
    background: rgba(22,32,56,0.8);
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.4rem;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ── CASE STUDIES ── */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    perspective: 1000px;
}

.case-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    z-index: 0;
}

.case-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #4A7BF7, #8B5CF6, #E63956, #8B5CF6, #4A7BF7);
    background-size: 300% 300%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
    animation: gradient-rotate 3s linear infinite paused;
}

.case-card:hover {
    border-color: transparent;
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.case-card:hover::before {
    opacity: 1;
    animation-play-state: running;
}

@keyframes gradient-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.case-sector {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-red);
    margin-bottom: 0.8rem;
}

.case-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.case-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.case-result {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    padding-top: 0.8rem;
}

.case-result strong { color: var(--text-primary); }

/* ── CONTACT ── */
.contact-section { background: var(--bg-base); }


.contact-info h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-detail-icon {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-red);
    min-width: 60px;
    letter-spacing: 1px;
}

.contact-detail-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.contact-detail-text a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.2s, color 0.2s;
}

.contact-detail-text a:hover { border-color: var(--accent-red); }

/* Click-to-reveal for email/phone */
.reveal-contact {
    cursor: pointer;
    color: var(--accent-blue) !important;
    border-bottom: 1px dashed var(--accent-blue) !important;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.reveal-contact:hover {
    color: var(--accent-purple) !important;
    border-color: var(--accent-purple) !important;
}

.reveal-contact.revealed {
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border) !important;
    cursor: default;
}


/* ── FOOTER ── */
footer {
    padding: 2.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-links { display: flex; gap: 1.5rem; }

.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 1px;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--accent-red); }

/* ── ANIMATIONS ── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    nav { padding: 1rem 1.5rem; }
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .hero-media {
        max-width: 560px;
        width: 100%;
        margin: 0 auto;
    }
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-base);
        padding: 1.5rem;
        border-bottom: 1px solid var(--border);
        gap: 1rem;
    }
    section { padding: 4rem 1.5rem; }
    .hero { padding: 7rem 1.5rem 3rem; }
    .services-grid { grid-template-columns: 1fr; }
    .about-grid { grid-template-columns: 1fr; gap: 3rem; }
    .cases-grid { grid-template-columns: 1fr; }
    .cred-logos { gap: 1.5rem; }
    footer { flex-direction: column; gap: 1rem; text-align: center; }
}

@media (max-width: 600px) {
    .hero-media { aspect-ratio: 16 / 9; }
    .stats-grid { grid-template-columns: 1fr; }
    .cred-inner { flex-direction: column; align-items: flex-start; }
}
