/* ============================================
    REFINED DESIGN SYSTEM 2025
    TechVision - Redesign
    ============================================ */

:root {
    /* Palette */
    --c-text-headline: #0B0D12;
    --c-text-body: #0B0D12;
    --c-text-secondary: #5A5F6A;
    --c-link: #4F46E5;
    --c-link-hover: #4338CA;
    --c-bg-body: #FCFCFD;
    --c-bg-alt: #F6F6FA;
    --c-bg-card: #FFFFFF;
    --c-border: rgba(15, 23, 42, 0.12);
    
    /* UI Elements */
    --nav-height: 48px;

    --nav-bg: rgba(252, 252, 253, 0.96);
    --nav-backdrop: none;
    

    /* Typography */
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    
    /* Spacing & Radius */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    
    /* Shadows */
    --shadow-card: 2px 4px 12px rgba(0,0,0,0.08);
    --shadow-hover: 2px 8px 24px rgba(0,0,0,0.12);
}

/* ============================================
   RESET & BASE
   ============================================ */

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

html {
    font-family: var(--font-stack);
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
    color: var(--c-text-body);
    background-color: var(--c-bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
}

body.nav-open {
    overflow: hidden;
}

body.consent-locked {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--c-text-headline);
    font-weight: 600;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 56px;
    line-height: 1.07143;
    letter-spacing: -0.005em;
    font-weight: 700;
}

h2 {
    font-size: 48px;
    line-height: 1.08349;
    letter-spacing: -0.003em;
}

h3 {
    font-size: 32px;
    line-height: 1.125;
}

p {
    margin-bottom: 1em;
    color: var(--c-text-secondary);
    font-size: 18px;
    line-height: 1.55;
    font-weight: 400;
}

a {
    color: var(--c-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--c-link-hover);
    text-decoration: underline;
}

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

img {
    border-radius: var(--radius-lg);
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Buttons */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border-radius: 14px;
    font-size: 17px;
    line-height: 1;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none !important;
    min-width: 120px;
}

.btn-primary {
    background-color: var(--c-link);
    color: #fff;
    border: 1px solid var(--c-link);
}

.btn-primary:hover {
    background-color: var(--c-link-hover);
    color: #fff;
}

.btn-secondary {
    background-color: transparent;
    color: var(--c-link);
    border: 1px solid var(--c-border);
}

.btn-secondary.btn-secondary--on-dark {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
}

.btn-secondary.btn-secondary--on-dark:hover {
    color: #fff;
    border-color: var(--c-link);
}

.btn-secondary:hover {
    background-color: var(--c-link);
    color: #fff;
    border-color: var(--c-link);
}

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

.section {
    padding: 100px 0;
}

/* Scroll reveal (enabled via JS by adding .reveal) */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 600ms cubic-bezier(0.4, 0, 0.2, 1), transform 600ms cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

.section--tinted {
    background-color: var(--c-bg-alt);
}

/* ============================================
   HEADER & NAV
   ============================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: var(--nav-backdrop);
    -webkit-backdrop-filter: var(--nav-backdrop);
    z-index: 9999;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.navbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo img {
    height: 20px; /* Subtle logo */
    width: auto;
    opacity: 0.8;
    transition: opacity 0.2s;
    border-radius: 0;
}

.logo img:hover {
    opacity: 1;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    font-size: 12px;
    color: rgba(0,0,0,0.8);
    opacity: 0.8;
    transition: opacity 0.2s;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.nav-links a:hover {
    opacity: 1;
    color: #000;
    text-decoration: none;
}

.menu-toggle {
    display: none;
    font-size: 20px;
    cursor: pointer;
}

.mobile-nav-header {
    display: none;
}

.mobile-nav-backdrop {
    display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 80px;
    background: #fff;
}

/* Page hero (internal pages) */
.hero--page {
    padding-top: calc(var(--nav-height) + 54px);
    padding-bottom: 54px;
}

.hero-inner--page {
    max-width: 980px;
}

.hero--page .hero-title {
    font-size: 54px;
    margin-bottom: 12px;
}

.hero--page .hero-lead {
    font-size: 20px;
    margin-bottom: 0;
}

.hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.hero-copy {
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
    margin-bottom: 14px;
}

.hero-title {
    font-size: 64px;
    line-height: 1.02;
    letter-spacing: -0.025em;
    color: var(--c-text-headline);
    margin: 0 0 16px;
}

.hero-lead {
    font-size: 22px;
    line-height: 1.35;
    color: var(--c-text-secondary);
    margin: 0 auto 28px;
    max-width: 62ch;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 0;
}

.hero-frame {
    max-width: 1400px;
    margin: 40px auto 0;
    padding: 0 20px;
}

.hero-video {
    aspect-ratio: 21 / 9;
    height: clamp(360px, 56vh, 720px);
    background: #000;
}

/* Prototipazione: show the whole video (no crop) */
.hero-video.hero-video--prototipazione {
    aspect-ratio: 16 / 9;
    height: auto;
    background: #fff;
    box-shadow: none;
    border: none;
}

.hero-video.hero-video--prototipazione,
.hero-video.hero-video--prototipazione video {
    border: 0;
    outline: 0;
}

.hero-video.hero-video--prototipazione video {
    object-fit: contain;
    background: #fff;
    width: 100%;
    height: 100%;
    display: block;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.hero-video.img-card {
    box-shadow: none;
    border: none;
}

.hero-video.img-card:hover {
    transform: none;
    box-shadow: none;
}

/* Bento Grid for Hero Images */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    max-width: 1080px;
    margin: 0 auto;
}

.img-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    height: 100%;
    background: #000;
}

.img-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

.img-card img, .img-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image placeholders (temporary) */
.img-card--placeholder {
    background: var(--c-bg-alt);
    border: 1px dashed var(--c-border);
    height: auto;
}

.media-placeholder {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 220px;
    max-height: 560px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px;
    color: var(--c-text-secondary);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.media-placeholder--sm {
    aspect-ratio: 1 / 1;
    min-height: 160px;
    max-height: 240px;
}

.media-placeholder--md {
    aspect-ratio: 4 / 3;
    min-height: 240px;
    max-height: 420px;
}

.media-placeholder--lg {
    aspect-ratio: 21 / 9;
    min-height: 320px;
    max-height: 560px;
}

.legal-media {
    margin: 18px 0 22px;
}

.legal-media--flush {
    margin: 0;
}

.legal-media .media-placeholder {
    border-radius: var(--radius-lg);
    border: 1px dashed var(--c-border);
    background: var(--c-bg-alt);
}

.legal-item {
    margin-top: 26px;
}

.legal-item-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 22px;
    align-items: start;
}

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

.media-caption {
    margin-top: 10px;
    font-size: 14px;
    color: var(--c-text-secondary);
}

.left-stack, .right-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.center-stage {
    height: 500px;
}

.left-stack .img-card, .right-stack .img-card {
    height: 240px;
}

/* ============================================
   SECTIONS & CARDS
   ============================================ */

/* Legal pages */
.legal-card {
    max-width: 980px;
    margin: 0 auto;
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-card);
}

.legal-card h2 {
    font-size: 26px;
    line-height: 1.2;
    margin: 0 0 12px;
}

.legal-h2 {
    margin-top: 28px;
}

.legal-note {
    margin-top: 28px;
    font-size: 14px;
    color: var(--c-text-secondary);
}

.legal-card ul,
.legal-card ol {
    margin: 12px 0 18px;
    padding-left: 22px;
}

.legal-card li {
    margin: 8px 0;
    color: var(--c-text-secondary);
    font-size: 17px;
    line-height: 1.55;
}

.legal-card strong {
    color: var(--c-text-headline);
    font-weight: 600;
}

.legal-divider {
    border: 0;
    height: 1px;
    background: rgba(15, 23, 42, 0.10);
    margin: 26px 0;
}

.home-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

/* About page helpers */
.about-split {
    margin-top: 28px;
}

.about-media {
    background: #000;
}

.home-split__text h2 {
    margin-bottom: 20px;
}

.home-list {
    list-style: none;
    margin: 30px 0;
}

.home-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--c-text-secondary);
    font-size: 17px;
}

.home-list li::before {
    content: "•";
    color: var(--c-link);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Stats Grid - Bento Style */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Generic cards (used by internal pages too) */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px;
    margin-top: 28px;
}

.card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-card);
}

.card-kicker {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 12px;
}

.card h3 {
    margin-bottom: 10px;
}

.card p {
    margin-bottom: 14px;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 18px;
}

.badge {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--c-text-secondary);
    background: var(--c-bg-alt);
    border: 1px solid rgba(15, 23, 42, 0.08);
    letter-spacing: 0.01em;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* Rich text inside cards (lists, emphasis) */
.card.rich-text p {
    font-size: 16px;
    margin-bottom: 12px;
}

.card.rich-text strong {
    color: var(--c-text-headline);
    font-weight: 600;
}

.card.rich-text ul {
    margin: 0 0 12px 18px;
    color: var(--c-text-secondary);
}

.card.rich-text li {
    margin: 8px 0;
    font-size: 16px;
    line-height: 1.55;
}

/* Teleinformatics page refinements (content-heavy) */
.page--teleinformatics .section {
    padding: 84px 0;
}

.page--teleinformatics .section > .container > h2 {
    font-size: 40px;
    line-height: 1.12;
    letter-spacing: -0.004em;
}

.page--teleinformatics .card-kicker {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-secondary);
}

.page--teleinformatics .card h3 {
    font-size: 22px;
    line-height: 1.25;
}

.page--teleinformatics .card.rich-text ul {
    margin-left: 16px;
}

.stat-card {
    background: #fff;
    padding: 40px 30px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 17px;
    color: var(--c-text-secondary);
}

/* Carousel (used on mobile where enabled by JS) */
.carousel-container {
    width: 100%;
}

.carousel-track {
    display: flex;
    will-change: transform;
}

/* Clients Grid */
.clients-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0;
    flex-wrap: nowrap;
    width: 100%;
    gap: 40px; /* Added spacing */
}

.client-item {
    flex: 1; /* Equal width for all items */
    font-size: 21px;
    font-weight: 600;
    color: var(--c-text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
    cursor: default;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px; /* Increased height */
}

.client-item:hover {
    color: var(--c-text-headline);
    transform: scale(1.05);
}

.client-logo-img {
    width: 100%;
    max-width: 160px; /* Fixed max width for uniformity */
    height: 80px; /* Fixed height */
    object-fit: contain; /* Maintain aspect ratio */
    filter: grayscale(100%);
    transition: filter 0.3s ease;
}

.client-logo-img:hover {
    filter: grayscale(0%);
}

@media (max-width: 768px) {
    .clients-carousel {
        overflow: hidden;
    }

    .clients-carousel .clients-grid {
        justify-content: flex-start;
        gap: 16px;
        padding: 18px 0;
    }

    .clients-carousel .client-item {
        flex: 0 0 auto;
        height: 80px;
    }
}

/* Clients Grid (compact variant for cards/pages) */
.clients-grid--compact {
    padding: 18px 0 0;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.clients-grid--compact .client-item {
    flex: 0 0 auto;
    width: 140px;
    height: 64px;
    cursor: pointer;
}

.clients-grid--compact .client-logo-img {
    max-width: 130px;
    height: 52px;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background-color: var(--c-bg-alt);
    padding: 60px 0 40px;
    font-size: 12px;
    color: var(--c-text-secondary);
    border-top: 0;
    position: relative;
    z-index: 3;
}

/* ============================================
   CONTACTS
   ============================================ */

.desktop-only {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .desktop-only {
        display: block;
    }
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 18px;
}

/* ============================================
   PRODOTTI - PROTOTIPAZIONE PINNED VIDEO
   ============================================ */

.prototipazione-section {
    background: #fff;
    /* Creates scroll distance while content stays pinned */
    min-height: 220vh;
    padding-top: 0;
    padding-bottom: 0;
}

.prototipazione-pin h2 {
    font-size: clamp(32px, 7vw, 40px);
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
}

#teleinformatics-section h2 {
    font-size: clamp(30px, 6.5vw, 38px);
    line-height: 1.2;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: manual;
}

.prototipazione-pin {
    position: sticky;
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 40px;
}

/* JS pin fallback (for browsers/scenarios where sticky isn't reliable) */
.prototipazione-pin.is-js-pinned {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    width: calc(100% - 40px);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    transform: none;
    z-index: 0;
}

/* Ensure the next section can visually cover the pinned prototipazione content */
#teleinformatics-section {
    position: relative;
    z-index: 2;
}

#teleinformatics-section .teleinformatics-media {
    max-width: 980px;
    margin: 0 auto 34px;
}

#teleinformatics-section .teleinformatics-media-card {
    height: auto;
}

#teleinformatics-section .teleinformatics-media-card img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.prototipazione-pin .hero-frame {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    margin-left: auto;
    margin-right: auto;
}

.prototipazione-pin .hero-video.hero-video--prototipazione {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    background: #fff;
    box-shadow: none;
    border: 0;
}

@media (max-width: 768px) {
    /* iOS/WebKit can show 1px seams around video when composited while scrolling */
    .prototipazione-pin .hero-video.hero-video--prototipazione {
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        backface-visibility: hidden;
        transform: translateZ(0);
    }

    .prototipazione-pin .hero-video.hero-video--prototipazione video {
        transform: translateZ(0);
    }
}

.prototipazione-pin .hero-video.hero-video--prototipazione,
.prototipazione-pin .hero-video.hero-video--prototipazione video {
    background: #fff;
}

.hero-video.hero-video--prototipazione video {
    object-position: center;
}

@media (max-width: 768px) {
    .prototipazione-section {
        min-height: 180vh;
    }

    .prototipazione-pin {
        padding-top: 28px;
        padding-bottom: 28px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .prototipazione-pin.is-js-pinned {
        width: calc(100% - 24px);
    }
}

.contact-list li {
    margin: 10px 0;
    color: var(--c-text-secondary);
    font-size: 16px;
    line-height: 1.55;
}

.contact-list strong {
    color: var(--c-text-headline);
    font-weight: 600;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.contact-field label {
    display: block;
    font-size: 13px;
    color: var(--c-text-secondary);
    margin: 0 0 6px;
}

.contact-input,
.contact-textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--c-border);
    background: var(--c-bg-body);
    color: var(--c-text-body);
    font-size: 16px;
}

.contact-textarea {
    resize: vertical;
}

.contact-input:focus,
.contact-textarea:focus {
    outline: none;
    border-color: rgba(79, 70, 229, 0.55);
}

.contact-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.contact-note {
    margin: 0;
    font-size: 14px;
    color: var(--c-text-secondary);
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo {
    height: 30px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid #d2d2d7;
}

.footer-links a {
    color: #424245;
    text-decoration: none;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .cards-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .section {
        padding: 28px 0 36px 0;
    }

    .navbar-inner {
        padding: 0 15px;
    }
    
    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10000;
        flex-direction: column;
        padding: 18px 18px 28px;
        background: rgba(252, 252, 253, 0.96);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        opacity: 0;
        transform: translateY(-10px);
        pointer-events: none;
        transition: opacity 220ms ease, transform 220ms ease;
        gap: 8px;
    }
    
    .nav-links.active {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li:not(.mobile-nav-header) {
        opacity: 0;
        transform: translateY(10px);
        transition: opacity 240ms ease, transform 240ms ease;
    }

    .nav-links.active li:not(.mobile-nav-header) {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links.active li:nth-child(2) { transition-delay: 40ms; }
    .nav-links.active li:nth-child(3) { transition-delay: 70ms; }
    .nav-links.active li:nth-child(4) { transition-delay: 100ms; }
    .nav-links.active li:nth-child(5) { transition-delay: 130ms; }
    .nav-links.active li:nth-child(6) { transition-delay: 160ms; }
    .nav-links.active li:nth-child(7) { transition-delay: 190ms; }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 16px 14px;
        font-size: 19px;
        font-weight: 500;
        letter-spacing: -0.01em;
        color: rgba(0,0,0,0.9);
        text-decoration: none;
        border-radius: 16px;
        background: rgba(255,255,255,0.8);
        border: 1px solid rgba(15, 23, 42, 0.10);
        box-shadow: var(--shadow-card);
        position: relative;
    }

    .nav-links a::after {
        content: '›';
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(0,0,0,0.35);
        font-size: 20px;
        line-height: 1;
    }

    .nav-links a:hover {
        text-decoration: none;
        color: #000;
    }

    .nav-links a:active {
        transform: scale(0.99);
        box-shadow: var(--shadow-hover);
    }

    .mobile-nav-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 6px 14px;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        margin-bottom: 10px;
    }

    .mobile-nav-title {
        font-size: 13px;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: rgba(0,0,0,0.55);
    }

    .menu-close {
        appearance: none;
        background: transparent;
        border: 1px solid rgba(0,0,0,0.14);
        border-radius: 999px;
        width: 40px;
        height: 40px;
        font-size: 22px;
        line-height: 1;
        cursor: pointer;
        color: rgba(0,0,0,0.8);
    }

    .mobile-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 9998;
        background: rgba(0,0,0,0.35);
        opacity: 0;
        pointer-events: none;
        transition: opacity 220ms ease;
    }

    body.nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: 999px;
        border: 1px solid rgba(0,0,0,0.12);
        background: rgba(255,255,255,0.7);
        font-size: 18px;
        cursor: pointer;
    }
    
    .hero {
        padding-top: calc(var(--nav-height) + 28px);
        padding-bottom: 64px;
    }

    .hero-inner {
        max-width: 720px;
    }

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

    .hero-title {
        font-size: 40px;
        line-height: 1.08;
    }

    .hero-lead {
        font-size: 18px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero--page {
        padding-top: calc(var(--nav-height) + 34px);
        padding-bottom: 36px;
    }

    .hero--page .hero-title {
        font-size: 40px;
    }

    .hero--page .hero-lead {
        font-size: 18px;
    }
    
    .hero-video {
        aspect-ratio: 16 / 10;
        height: auto;
    }

    .hero-video.hero-video--prototipazione {
        /* Make the pinned video visually larger on mobile */
        height: clamp(320px, 62vh, 640px);
    }
    
    .home-split {
        grid-template-columns: 1fr;
    }

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

    .page--teleinformatics .section > .container > h2 {
        font-size: 32px;
    }

    .page--teleinformatics .card h3 {
        font-size: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid #d2d2d7;
    padding: 20px;
    z-index: 10000;
    display: none; /* JS toggles this */
}

.cookie-banner.show {
    display: block;
}

.cookie-content {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cookie-text p {
    font-size: 12px;
    margin: 0;
    color: var(--c-text-secondary);
}

.cookie-actions {
    display: flex;
    gap: 10px;
}

.btn-cookie {
    padding: 8px 16px;
    border-radius: 980px;
    font-size: 12px;
    cursor: pointer;
    border: none;
}

.btn-accept {
    background: var(--c-link);
    color: #fff;
}

.btn-reject {
    background: #f5f5f7;
    color: #1d1d1f;
}

/* ============================================
   COOKIE MODAL & SETTINGS
   ============================================ */

.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 10001;
    display: none; /* JS toggles this */
    align-items: center;
    justify-content: center;
}

.cookie-modal.active {
    display: flex;
}

.cookie-modal-content {
    background: #fff;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2xl);
    padding: 40px;
    position: relative;
}

.cookie-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 20px;
}

.cookie-modal-header h3 {
    font-size: 24px;
    margin: 0;
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--c-text-secondary);
}

.cookie-category {
    margin-bottom: 25px;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.cookie-category h4 {
    font-size: 17px;
    margin-bottom: 5px;
}

.cookie-category p {
    font-size: 14px;
    color: var(--c-text-secondary);
    margin: 0;
}

.cookie-divider {
    height: 1px;
    background: #e5e5e5;
    margin: 20px 0;
}

/* Toggle Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 30px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e5e5;
    transition: .4s;
    border-radius: 34px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .cookie-slider {
    background-color: var(--c-link);
}

input:focus + .cookie-slider {
    box-shadow: 0 0 1px var(--c-link);
}

input:checked + .cookie-slider:before {
    transform: translateX(20px);
}

input:disabled + .cookie-slider {
    background-color: #d1d1d6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    margin-top: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #e5e5e5;
    padding-top: 20px;
}

.btn-settings {
    background: transparent;
    color: var(--c-link);
    border: 1px solid var(--c-border);
}

/* ============================================
   APPLE STYLE SECTIONS
   ============================================ */

.section-apple {
    padding: 80px 0;
    /* overflow: hidden; Removed to allow sticky positioning */
}

/* Sections that intentionally use sticky text next to media */
.section-apple--sticky-text .apple-grid--sticky {
    /* Ensure there is enough scroll space for sticky to engage */
    min-height: calc(100vh + 280px);
}

.section-apple--sticky-text .apple-media {
    align-self: stretch;
    min-height: calc(100vh - var(--nav-height) - 24px);
}

.section-apple--sticky-text .apple-media img {
    height: 100%;
    object-fit: cover;
}

.section-apple--dark {
    background-color: #000;
    color: #fff;
}

.section-apple--dark h2,
.section-apple--dark h3,
.section-apple--dark p,
.section-apple--dark li {
    color: #f5f5f7;
}

.section-apple--dark .hero-eyebrow {
    color: #86868b;
}

.apple-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    overflow: visible;
}

.apple-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.apple-content,
.apple-media {
    min-width: 0;
}

.apple-grid--reverse .apple-content {
    order: 2;
}

.apple-grid--reverse .apple-media {
    order: 1;
}

.apple-grid--sticky {
    /* Use flex for better sticky support across browsers (notably Safari) */
    display: flex;
    align-items: flex-start;
    gap: 80px;
}

.apple-grid--sticky .apple-content {
    position: sticky;
    top: 60px;
    align-self: flex-start;
}

.apple-content {
    max-width: 560px;
}

.apple-content h2 {
    font-size: 56px;
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin-bottom: 24px;
}

.apple-content p {
    font-size: 21px;
    line-height: 1.4;
    color: var(--c-text-secondary);
    font-weight: 500;
}

.section-apple--dark .apple-content p {
    color: #86868b;
}

.apple-media img {
    width: 100%;
    height: auto;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.apple-feature-list {
    list-style: none;
    margin-top: 32px;
}

.apple-feature-list li {
    font-size: 19px;
    margin-bottom: 16px;
    padding-left: 30px;
    position: relative;
    color: var(--c-text-secondary);
}

.section-apple--dark .apple-feature-list li {
    color: #a1a1a6;
}

.apple-feature-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--c-link);
    font-weight: bold;
}

/* Apple Hero Variant */
.apple-hero {
    text-align: center;
    padding: 160px 0 100px;
    background: #fff;
}

.apple-hero h1 {
    font-size: 80px;
    line-height: 1.05;
    letter-spacing: -0.015em;
    margin-bottom: 20px;
}

.apple-hero .hero-lead {
    font-size: 28px;
    max-width: 800px;
    margin: 0 auto 40px;
    font-weight: 500;
}

/* Feature Grid (3 columns) */
.apple-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 60px;
}

.apple-feature-card {
    text-align: left;
}

.apple-feature-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
}

.apple-feature-card p {
    font-size: 17px;
}

@media (max-width: 1024px) {
    .apple-grid {
        gap: 40px;
    }
    
    .apple-content h2 {
        font-size: 42px;
    }
    
    .apple-hero h1 {
        font-size: 56px;
    }
}

@media (max-width: 900px) {
    .apple-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .apple-grid--sticky {
        flex-direction: column;
        gap: 40px;
    }

    .apple-grid--sticky .apple-content {
        position: static;
        top: auto;
    }

    .section-apple--sticky-text .apple-grid--sticky {
        min-height: 0;
    }

    .section-apple--sticky-text .apple-media {
        min-height: 0;
    }

    .section-apple--sticky-text .apple-media img {
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 768px) {
    .apple-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .apple-grid--reverse .apple-content {
        order: 1;
    }
    
    .apple-grid--reverse .apple-media {
        order: 2;
    }
    
    .apple-container {
        padding: 0 20px;
    }
    
    .apple-hero {
        padding: 120px 0 60px;
    }
    
    .apple-hero h1 {
        font-size: 42px;
    }
    
    .apple-hero .hero-lead {
        font-size: 21px;
    }

    .apple-content h2 {
        font-size: clamp(32px, 7vw, 38px);
        line-height: 1.15;
        word-break: normal;
        overflow-wrap: normal;
        hyphens: manual;
    }

    .apple-content p,
    .apple-feature-list li {
        word-break: normal;
        overflow-wrap: normal;
        hyphens: manual;
    }
    
    .apple-features-grid {
        grid-template-columns: 1fr;
    }
}

.apple-divider {
    border: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    max-width: 1320px; /* Matches container minus padding roughly, or just keep it simple */
    width: calc(100% - 80px); /* Account for container padding */
}

@media (max-width: 768px) {
    .apple-divider {
        width: calc(100% - 40px);
    }
}

/* ============================================
   MAP SECTION
   ============================================ */

.map-section {
    padding: 0;
    width: 100%;
    height: 600px;
    position: relative;
}

.map-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
}

.map-wrapper iframe {
    width: 100%;
    height: 100%;
    display: block;
    filter: grayscale(0.2); /* Slight desaturation for elegance */
}

.map-overlay-card {
    position: absolute;
    top: 50%;
    left: 10%; /* Positioned to the left like Apple maps cards often are */
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 320px;
    z-index: 10;
    border: 1px solid rgba(0,0,0,0.05);
}

.map-overlay-card h3 {
    margin-bottom: 10px;
    font-size: 24px;
}

.map-address {
    font-size: 16px;
    color: var(--c-text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.map-actions .btn-primary {
    width: 100%;
    font-size: 15px;
    padding: 10px 20px;
}

@media (max-width: 768px) {
    .map-section {
        height: 500px;
    }
    
    .map-overlay-card {
        position: absolute;
        bottom: 20px;
        left: 20px;
        right: 20px;
        top: auto;
        transform: none;
        max-width: none;
        width: auto;
    }
}
