/*
    Griman Forensics Srl - Global Styles v2
    Stack: HTML / CSS / JS puro — Aruba Hosting
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@700;800&family=Orbitron:wght@500;700&display=swap');

/* ============================
   VARIABILI & RESET
   ============================ */
:root {
    --bg-deep: #040D21;
    --bg-darker: #020817;
    --bg-card: #0F172A;
    --bg-card-hover: #111B2E;

    --primary-blue: #004DA3;
    --accent-cyan: #00D4FF;
    --cta-blue: #1F6FEB;

    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;

    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-cyan: rgba(0, 212, 255, 0.15);

    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    --container-max: 1280px;
    --header-height: 160px;
    --header-scrolled: 100px;
    --radius: 6px;
    --section-padding: 6rem;
}

html {
    scroll-behavior: smooth;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    line-height: 1.8;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

h1,
h2,
h3,
h4 {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 800;
    line-height: 1.15;
}

.technical-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: var(--accent-cyan);
    text-transform: uppercase;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: var(--section-padding) 0;
}

/* ============================
   HEADER & NAVIGAZIONE
   ============================ */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-scrolled);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: height 0.4s ease, background 0.4s ease, box-shadow 0.35s ease;
}

/* Stili header per scroll o pagine interne (ora estesi a tutto) */
header.scrolled,
body.page-internal header {
    /* Manteniamo le proprietà per continuità, ma i valori sono già di default sopra */
}

header .container {
    padding: 0;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

/* Logo */
.upper-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
    flex-shrink: 0;
}

.upper-brand img {
    height: 80px;
    width: auto;
    transition: transform 0.3s ease;
}

header.scrolled .upper-brand img,
body.page-internal header .upper-brand img {
    /* Già impostati a 80px sopra */
}

/* Nav links */
.nav-links {
    display: flex;
    list-style: none;
    gap: 0;
    align-items: center;
}

.nav-links a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #1E293B;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition-smooth);
    border-radius: 4px;
    white-space: nowrap;
}

header .nav-links a:hover {
    color: var(--cta-blue);
    background: rgba(31, 111, 235, 0.06);
}

header .nav-links a.active {
    color: var(--cta-blue);
}

/* Mobile toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1002;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1E293B;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Overlay mobile */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 13, 33, 0.72);
    z-index: 999;
    backdrop-filter: blur(4px);
}

.nav-overlay.active {
    display: block;
}

/* ============================
   HERO (Home)
   ============================ */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: url('../assets/backgrounds/hero-bg.jpg') center/cover no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
            rgba(4, 13, 33, 0.90) 0%,
            rgba(4, 13, 33, 0.65) 45%,
            rgba(0, 77, 163, 0.50) 100%);
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
    padding-top: var(--header-height);
}

/* Badge animato nella hero */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 212, 255, 0.07);
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 100px;
    padding: 7px 18px 7px 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    color: var(--accent-cyan);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    margin-bottom: 2rem;
}

.hero-badge-dot {
    width: 7px;
    height: 7px;
    background: var(--accent-cyan);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse-dot 2.2s ease-in-out infinite;
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.5);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 8px rgba(0, 212, 255, 0);
    }
}

.subheader-text-wrapper {
    background: rgba(4, 13, 33, 0.62);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 18px 22px;
    border-radius: var(--radius);
    margin-bottom: 2.5rem;
    max-width: 680px;
    border-left: 3px solid var(--accent-cyan);
}

/* ============================
   TRUST STRIP (sotto hero)
   ============================ */
.trust-strip {
    background: var(--bg-darker);
    border-top: 1px solid var(--border-cyan);
    border-bottom: 1px solid var(--border-cyan);
    padding: 1.6rem 0;
    overflow: hidden;
}

.trust-strip-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.trust-strip-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.75rem 2rem;
    border-right: 1px solid var(--border-subtle);
    flex: 1;
    min-width: 180px;
    justify-content: center;
}

.trust-strip-item:last-child {
    border-right: none;
}

.trust-strip-icon {
    color: var(--accent-cyan);
    flex-shrink: 0;
    opacity: 0.9;
}

.trust-strip-text {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

/* ============================
   SERVICE CARDS
   ============================ */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2.2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    border-bottom: 2px solid var(--primary-blue);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0;
    transition: opacity 0.35s;
}

.service-card:hover::before {
    opacity: 1;
}

.service-card:hover {
    transform: translateY(-7px);
    border-bottom-color: var(--accent-cyan);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 212, 255, 0.07);
}

.service-card-icon {
    color: var(--accent-cyan);
    margin-bottom: 1.2rem;
    opacity: 0.88;
}

.service-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    color: white;
}

.service-card p {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* Legacy */
.card-hover {
    transition: var(--transition-smooth);
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

/* ============================
   METHOD STEPS (home)
   ============================ */
.method-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: rgba(0, 77, 163, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    border-radius: 8px;
    margin-bottom: 5rem;
}

.method-step {
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.method-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid var(--accent-cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--accent-cyan);
    margin-bottom: 0.8rem;
}

.method-step h4 {
    font-size: 0.82rem;
    color: white;
    margin-bottom: 0.4rem;
}

.method-step p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.method-arrow {
    color: rgba(0, 212, 255, 0.35);
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ============================
   CTA BAND
   ============================ */
.cta-band {
    background: linear-gradient(135deg, var(--bg-darker) 0%, rgba(0, 77, 163, 0.14) 50%, var(--bg-darker) 100%);
    border-top: 1px solid var(--border-cyan);
    border-bottom: 1px solid var(--border-cyan);
    padding: 5rem 0;
    text-align: center;
}

.cta-band h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-bottom: 1rem;
}

.cta-band p {
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto 2.5rem;
    font-size: 1rem;
}

/* ============================
   PAGE HERO (pagine interne)
   ============================ */
body.page-internal main {
    padding-top: var(--header-scrolled);
}

.page-hero {
    background: var(--bg-darker);
    padding: 4rem 0 3rem;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    overflow: hidden;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(to left, rgba(0, 77, 163, 0.07), transparent);
    pointer-events: none;
}

/* griglia sottile di sfondo */
.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.page-hero .container {
    position: relative;
    z-index: 1;
}

.page-hero h1 {
    margin: 0.8rem 0 1.2rem;
    font-size: clamp(1.5rem, 3.5vw, 2.4rem);
}

.page-hero-divider {
    width: 48px;
    height: 3px;
    background: var(--accent-cyan);
    margin-bottom: 1.2rem;
}

.page-hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 680px;
    line-height: 1.8;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.85rem 2rem;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: none;
    font-family: 'Orbitron', sans-serif;
    white-space: nowrap;
}

.btn-cta {
    background: var(--cta-blue);
    color: white;
    box-shadow: 0 4px 16px rgba(31, 111, 235, 0.28);
}

.btn-cta:hover {
    background: #3b82f6;
    box-shadow: 0 8px 28px rgba(31, 111, 235, 0.48);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    border: 1.5px solid rgba(255, 255, 255, 0.22);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 2px solid var(--accent-cyan);
    outline-offset: 3px;
}

/* ============================
   SHOWCASE LOGO
   ============================ */
.showcase-brand-container {
    max-width: 380px;
    aspect-ratio: 4 / 3;
    background: white;
    border-radius: 12px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0 auto;
}

.showcase-brand {
    width: 100%;
    height: auto;
    object-fit: contain;
    padding: 2rem;
    transition: transform 0.4s ease;
    display: block;
    max-width: 100%;
}

.showcase-brand:hover {
    transform: scale(1.04);
}

/* ============================
   FOOTER
   ============================ */
footer {
    background: var(--bg-darker);
    padding: 5rem 0 2.5rem;
    border-top: 1px solid var(--border-subtle);
}

.footer-logo-bar {
    display: inline-flex;
    align-items: center;
    background: #FFFFFF;
    padding: 1.5rem 3rem;
    border-radius: 8px;
    margin-bottom: 3.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.footer-logo-bar img {
    height: 70px;
    width: auto;
    transition: transform 0.3s ease;
}

.footer-logo-bar img:hover {
    transform: scale(1.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.footer-grid h4 {
    font-size: 0.78rem;
    margin-bottom: 1.5rem;
    color: var(--accent-cyan);
    letter-spacing: 0.12em;
}

.footer-grid p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.8;
}

.footer-grid a {
    display: block;
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.2s;
}

.footer-grid a:hover {
    color: var(--accent-cyan);
}

.footer-bottom {
    border-top: 1px solid var(--border-subtle);
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ============================
   UTILITIES
   ============================ */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    display: inline-block;
}

.section-header p {
    color: var(--text-secondary);
    margin-top: 1.2rem;
    font-size: 1rem;
}

/* ============================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================ */
@media (max-width: 1024px) {
    .nav-links {
        gap: 0;
    }

    .nav-links a {
        font-size: 0.73rem;
        padding: 0.45rem 0.55rem;
    }
}

/* ============================
   RESPONSIVE — MOBILE (≤ 880px)
   ============================ */
@media (max-width: 880px) {
    :root {
        --header-height: 110px;
        --section-padding: 4rem;
    }

    .upper-brand img {
        height: 90px;
    }

    header.scrolled .upper-brand img,
    body.page-internal header .upper-brand img {
        height: 65px;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 80vw);
        height: 100vh;
        height: 100dvh;
        background: var(--bg-deep);
        border-left: 1px solid rgba(0, 212, 255, 0.12);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.25rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1001;
    }

    .nav-links.active {
        right: 0;
    }

    /* Forza colore bianco nel menu mobile */
    .nav-links a,
    header.scrolled .nav-links a,
    body.page-internal header .nav-links a {
        color: rgba(255, 255, 255, 0.82) !important;
        background: transparent !important;
        font-size: 1rem !important;
        padding: 0.85rem 2rem;
        width: 100%;
        text-align: center;
        border-radius: 0;
    }

    .nav-links a:hover,
    .nav-links a.active,
    header.scrolled .nav-links a:hover,
    body.page-internal header .nav-links a:hover {
        color: var(--accent-cyan) !important;
        background: rgba(0, 212, 255, 0.06) !important;
    }

    .trust-strip-item {
        min-width: 50%;
    }

    .trust-strip-item:nth-child(even) {
        border-right: none;
    }

    .method-flow {
        padding: 2rem 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-logo-bar {
        justify-content: center;
    }
}

/* ============================
   RESPONSIVE — SMALL (≤ 640px)
   ============================ */
@media (max-width: 640px) {
    :root {
        --section-padding: 3rem;
    }

    .container {
        padding: 0 1.25rem;
    }

    .trust-strip-item {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        justify-content: flex-start;
        padding: 0.65rem 1.5rem;
    }

    .trust-strip-item:last-child {
        border-bottom: none;
    }

    .trust-strip-grid {
        flex-direction: column;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .method-flow {
        flex-direction: column;
    }

    .method-arrow {
        transform: rotate(90deg);
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.72rem;
    }

    .cta-band {
        padding: 3.5rem 0;
    }

    .page-hero {
        padding: 2.5rem 0 2rem;
    }

    .footer-logo-bar img {
        height: 50px;
    }
}