/* ============================================
   FixIA - AI Technology. Human Insight.
   Main Stylesheet
   ============================================ */

/* --- CSS Variables / Design Tokens --- */
:root {
    /* Brand Colors — extracted from logo SVG */
    --purple-deep: #3D1844;     /* logo stop 0%   */
    --purple-medium: #51255F;   /* logo stop 22%  */
    --purple-light: #7F2E62;    /* logo stop 42%  */
    --rose: #B43A5C;            /* logo stop 62%  */
    --coral-deep: #E63B49;      /* logo stop 82%  */
    --coral: #F14A54;           /* logo stop 100% */
    --coral-light: #F47A82;     /* lighter tint of coral */
    --salmon: #F8A8AD;          /* lightest tint */

    /* Gradients — 6-stop curve matching the logo */
    --gradient-brand: linear-gradient(135deg, #3D1844 0%, #51255F 22%, #7F2E62 42%, #B43A5C 62%, #E63B49 82%, #F14A54 100%);
    --gradient-brand-reverse: linear-gradient(135deg, #F14A54 0%, #E63B49 18%, #B43A5C 38%, #7F2E62 58%, #51255F 78%, #3D1844 100%);
    --gradient-subtle: linear-gradient(135deg, #F8A8AD, #F14A54);
    --gradient-dark: linear-gradient(180deg, #2D1228, #1A0A16);
    --gradient-glow: radial-gradient(circle, rgba(241, 74, 84, 0.15) 0%, transparent 70%);

    /* Neutrals */
    --bg-light: #FFFFFF;
    --bg-section: #F7F7F7;
    --bg-dark: #1A0A16;
    --bg-dark-alt: #2D1228;
    --text-primary: #1A0A16;
    --text-secondary: #6B5A65;
    --text-light: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border-light: rgba(61, 24, 68, 0.08);
    --border-dark: rgba(255, 255, 255, 0.1);

    /* Spacing */
    --section-padding: clamp(80px, 12vw, 160px);
    --container-width: 1200px;
    --container-padding: clamp(20px, 4vw, 40px);

    /* Typography */
    --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --transition-fast: 0.3s var(--ease-out-quart);
    --transition-medium: 0.6s var(--ease-out-expo);
    --transition-slow: 1s var(--ease-out-expo);

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Container --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

/* --- Section --- */
.section {
    padding: var(--section-padding) 0;
    position: relative;
    overflow: hidden;
}

.section-dark {
    background: var(--gradient-dark);
    color: var(--text-light);
}

.section-accent {
    background: var(--bg-dark-alt);
    color: var(--text-light);
    position: relative;
}

.section-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* --- Section Headers --- */
.section-header {
    text-align: center;
    margin-bottom: clamp(48px, 6vw, 80px);
}

.section-label {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--coral);
    margin-bottom: 16px;
    padding: 6px 16px;
    border: 1px solid rgba(241, 74, 84, 0.3);
    border-radius: 100px;
}

.section-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.section-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

.section-dark .section-subtitle {
    color: var(--text-muted);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    transition: all var(--transition-fast);
}

.navbar.scrolled {
    padding: 12px 0;
    background: rgba(255, 255, 255, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
}

.nav-container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    flex-shrink: 0;
}

/* Wrapper sized to the placeholder; the video sits centered inside it at
   its original 64×36, so when the video fades in it shares the same
   center point as the placeholder it replaces — no shift. */
.nav-logo-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 75px;
    height: 42px;
    line-height: 0;
    flex-shrink: 0;
}

.nav-logo-img {
    height: 36px;
    width: auto;
    max-width: none;
    transition: opacity var(--transition-fast);
}

.nav-logo-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    opacity: 1;
}

.nav-logo-video {
    display: block;
    object-fit: contain;
    pointer-events: none;
    background: transparent;
    opacity: 0;
}

.nav-logo-icon.is-ready .nav-logo-fallback {
    opacity: 0;
}

.nav-logo-icon.is-ready .nav-logo-video {
    opacity: 1;
}

/* Some visitors run a "video speed controller" browser extension that
   injects a playback overlay onto every <video> on the page. The navbar
   logo is a <video>, so that overlay would appear over the page. The logo
   is the only <video> on the site, so hiding the injected node site-wide
   is safe and has no effect for visitors without such an extension. */
.vsc-controller {
    display: none !important;
}

/* The two text PNGs sit in the same wrapper but only the "active" one
   participates in layout — the other is absolutely positioned and does
   not contribute to the link's clickable area. This means the <a>
   wraps only the currently visible text. */
.nav-logo-text {
    position: relative;
    display: inline-block;
    line-height: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-logo-text-img {
    display: block;
    width: auto;
    max-width: none;
    height: 30px;
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    /* Hidden by default — only the .is-active text is visible at first
       paint. The scroll script later overrides this via inline style to
       drive the crossfade with infinity_worker. */
    opacity: 0;
}

.nav-logo-text-img.is-active {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
}

/* Pull fixia closer to the logo without affecting infinity_worker. */
#navTextStart {
    transform: translateX(-10px);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-brand);
    border-radius: 1px;
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--purple-deep);
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   LANGUAGE SWITCHER (IT / EN)
   ============================================ */
.nav-lang {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-left: 4px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 4px 4px;
    margin: 0;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    cursor: pointer;
    text-transform: uppercase;
    transition: color var(--transition-fast);
}

.lang-btn:hover {
    color: var(--purple-deep);
}

.lang-btn.is-active {
    color: var(--coral);
}

.lang-divider {
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 0.78rem;
    user-select: none;
}

@media (max-width: 1000px) {
    .nav-lang {
        margin-top: 16px;
        padding-left: 0;
        align-self: flex-start;
    }
}

.nav-cta {
    background: var(--purple-deep);
    color: var(--text-light) !important;
    padding: 10px 24px;
    border-radius: 100px;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.nav-cta::after {
    display: none;
}

.nav-cta:hover {
    background: var(--coral);
    transform: translateY(-1px);
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   HERO
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg-light);
    overflow: hidden;
}

.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 var(--container-padding);
}

.hero-badge {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--coral);
    margin-bottom: 24px;
    padding: 8px 20px;
    border: 1px solid rgba(241, 74, 84, 0.3);
    border-radius: 100px;
    background: rgba(241, 74, 84, 0.05);
}

.hero-title {
    font-size: clamp(3rem, 7.5vw, 5.5rem);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin-bottom: 28px;
    color: var(--purple-deep);
}

.hero-title .title-line {
    display: block;
}

.hero-title em {
    font-style: normal;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 1.8vw, 1.3rem);
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 48px;
    line-height: 1.75;
    font-weight: 400;
}

.hero-subtitle strong {
    color: var(--purple-deep);
    font-weight: 600;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Scroll indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: var(--coral);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.4; }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 32px;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--purple-deep);
    color: var(--text-light);
}

.btn-primary:hover {
    background: var(--coral);
    box-shadow: 0 8px 32px rgba(241, 74, 84, 0.3);
}

.btn-primary svg {
    transition: transform var(--transition-fast);
}

.btn-primary:hover svg {
    transform: translate(2px, -2px);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--purple-deep);
    border: 1.5px solid var(--purple-deep);
}

.btn-secondary:hover {
    background: var(--purple-deep);
    color: var(--text-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover {
    border-color: var(--coral);
    color: var(--coral);
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.05rem;
}

/* ============================================
   PROBLEM CARDS
   ============================================ */
.problems-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    perspective: 1000px;
}

.problem-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    overflow: hidden;
    transition: all var(--transition-medium);
    cursor: default;
}

.problem-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.06);
}

/* Animated AI border on hover */
.problem-card-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(
        var(--border-angle, 0deg),
        transparent 30%,
        rgba(241, 74, 84, 0.5) 50%,
        rgba(240, 160, 140, 0.3) 55%,
        transparent 70%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-fast);
    animation: borderRotate 4s linear infinite;
}

.problem-card:hover .problem-card-border {
    opacity: 1;
}

@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes borderRotate {
    to { --border-angle: 360deg; }
}

.problem-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(241, 74, 84, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.problem-card:hover .problem-card-glow {
    opacity: 1;
}

.problem-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(241, 74, 84, 0.1);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    color: var(--coral);
    position: relative;
    z-index: 1;
}

.problem-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.problem-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.problem-card p strong {
    color: var(--coral-light);
}

/* ============================================
   PRODUCT SECTION
   ============================================ */
.product-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(40px, 6vw, 80px);
    align-items: center;
}

.product-tagline {
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 500;
    color: var(--purple-medium);
    margin-bottom: 20px;
    line-height: 1.5;
}

.product-tagline em {
    font-style: normal;
    color: var(--coral);
}

.product-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 40px;
}

.product-description strong {
    color: var(--purple-deep);
}

.product-stats {
    display: flex;
    gap: 40px;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Workflow Visual Demo */
.workflow-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 48px 40px;
    background: var(--bg-section);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    position: relative;
    box-shadow: 0 8px 40px rgba(61, 24, 68, 0.06);
}

.workflow-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 32px;
    background: white;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(61, 24, 68, 0.08);
    position: relative;
    width: 220px;
    justify-content: center;
    will-change: transform, opacity, box-shadow, border-color, background;
    animation: nodeFlash 5.5s infinite;
}

.workflow-node:hover {
    box-shadow: 0 8px 28px rgba(61, 24, 68, 0.14);
}

/* Sequential illumination — one node lit at a time, looping */
.node-input  { animation-delay: 0s; }
.node-ai     { animation-delay: 1.1s; }
.node-action { animation-delay: 2.2s; }
.node-output {
    animation-delay: 3.3s;
    animation-name: nodeFlashFinal;
}

@keyframes nodeFlash {
    0% {
        border-color: transparent;
        background: white;
        box-shadow: 0 4px 16px rgba(61, 24, 68, 0.08);
        transform: none;
    }
    6%, 16% {
        border-color: var(--coral);
        background: rgba(241, 74, 84, 0.06);
        box-shadow: 0 0 26px rgba(241, 74, 84, 0.45), 0 6px 20px rgba(61, 24, 68, 0.1);
        transform: translateY(-2px);
    }
    27%, 100% {
        border-color: transparent;
        background: white;
        box-shadow: 0 4px 16px rgba(61, 24, 68, 0.08);
        transform: none;
    }
}

/* Final node: lights up a bit longer and with a stronger "completed" pulse */
@keyframes nodeFlashFinal {
    0% {
        border-color: transparent;
        background: white;
        box-shadow: 0 4px 16px rgba(61, 24, 68, 0.08);
        transform: none;
    }
    6%, 22% {
        border-color: var(--coral);
        background: rgba(241, 74, 84, 0.09);
        box-shadow: 0 0 34px rgba(241, 74, 84, 0.55), 0 8px 24px rgba(61, 24, 68, 0.12);
        transform: translateY(-3px) scale(1.03);
    }
    35%, 100% {
        border-color: transparent;
        background: white;
        box-shadow: 0 4px 16px rgba(61, 24, 68, 0.08);
        transform: none;
    }
}

.node-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.node-input .node-dot { background: var(--purple-light); }
.node-ai .node-dot { background: var(--coral); }
.node-action .node-dot { background: var(--coral-light); }
.node-output .node-dot { background: var(--purple-deep); }

.workflow-connector {
    width: 2px;
    height: 32px;
    background: linear-gradient(to bottom, var(--coral-light), var(--coral));
    position: relative;
    border-radius: 2px;
}

.workflow-connector::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--coral);
}

/* ============================================
   FEATURE CARDS
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    perspective: 1200px;
}

.feature-card {
    position: relative;
    padding: 40px 36px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    transition: all var(--transition-medium);
    overflow: hidden;
    cursor: default;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(
        var(--border-angle, 0deg),
        transparent 30%,
        rgba(241, 74, 84, 0.5) 50%,
        rgba(240, 160, 140, 0.3) 55%,
        transparent 70%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-fast);
    animation: borderRotate 4s linear infinite;
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-4px);
}

.feature-card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(241, 74, 84, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-medium);
    pointer-events: none;
}

.feature-card:hover .feature-card-glow {
    opacity: 1;
}

.feature-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--coral);
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    opacity: 0.6;
    position: relative;
    z-index: 1;
}

.feature-icon {
    color: var(--coral);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.feature-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

/* ============================================
   ADVANTAGES
   ============================================ */
.advantages-list {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.advantage-item {
    position: relative;
    padding: 32px 36px;
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
    cursor: default;
}

.advantage-item:hover {
    transform: translateX(8px);
    background: white;
    box-shadow: 0 4px 24px rgba(61, 24, 68, 0.06);
}

.advantage-border {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-brand);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.advantage-item:hover .advantage-border {
    opacity: 1;
}

.advantage-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.advantage-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.advantage-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--coral);
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.advantage-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.advantage-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 40px;
}

/* ============================================
   HOW IT WORKS
   ============================================ */
.how-it-works {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.hiw-step {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.hiw-step-number {
    width: 56px;
    height: 56px;
    min-width: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-brand);
    color: white;
    border-radius: 50%;
}

.hiw-step-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.hiw-step-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================================
   CLIENT CARDS
   ============================================ */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    perspective: 1000px;
}

.client-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.client-card:hover {
    transform: translateY(-8px);
}

.client-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform var(--transition-fast);
    z-index: 2;
    pointer-events: none;
}

.client-card:hover::before {
    transform: scaleX(1);
}

.client-card-inner {
    padding: 40px 32px;
    background: var(--bg-section);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    height: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.client-card:hover .client-card-inner {
    border-color: rgba(241, 74, 84, 0.3);
    box-shadow: 0 12px 48px rgba(61, 24, 68, 0.08);
}

.client-icon {
    color: var(--coral);
    margin-bottom: 24px;
}

.client-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.client-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}

.client-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.client-tags li {
    font-size: 0.78rem;
    font-weight: 500;
    padding: 4px 12px;
    background: rgba(241, 74, 84, 0.08);
    color: var(--coral);
    border-radius: 100px;
}

/* ============================================
   PARTNERS GRID
   ============================================ */
.partners-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    perspective: 1000px;
}

/* ============================================
   CLIENTS SUBSECTIONS (Partner / Clienti finali)
   ============================================ */
.clients-subsection + .clients-subsection {
    margin-top: 72px;
}

.subsection-header {
    text-align: center;
    margin-bottom: 32px;
}

.subsection-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.subsection-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 720px;
    margin: 0 auto;
}

/* ============================================
   TEAM
   ============================================ */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    perspective: 1000px;
}

.team-card {
    position: relative;
    text-align: center;
    padding: 48px 32px 40px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-fast);
}

.team-card:hover {
    transform: translateY(-4px);
    background: rgba(255, 255, 255, 0.07);
}

.team-card-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 1px;
    background: linear-gradient(
        var(--border-angle, 0deg),
        transparent 40%,
        var(--coral) 50%,
        var(--coral-light) 55%,
        transparent 60%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-fast);
    animation: borderRotate 4s linear infinite;
}

.team-card:hover .team-card-border {
    opacity: 1;
}

.team-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-role {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--coral);
    display: block;
    margin-bottom: 16px;
}

.team-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================================
   INTEGRATIONS CAROUSEL
   ============================================ */
.carousel-wrapper {
    overflow: hidden;
    padding: 20px 0;
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.carousel-track {
    display: flex;
    gap: 16px;
    width: max-content;
}

.carousel-track-left {
    animation: scrollLeft 60s linear infinite;
    margin-bottom: 16px;
}

.carousel-track-right {
    animation: scrollRight 60s linear infinite;
}

@keyframes scrollLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-25%); }
}

@keyframes scrollRight {
    0% { transform: translateX(-25%); }
    100% { transform: translateX(0); }
}

.carousel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.carousel-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(241, 74, 84, 0.3);
}

.carousel-item img {
    width: 24px;
    height: 24px;
    opacity: 0.7;
    filter: brightness(0) invert(1);
}

.carousel-item span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Gold-accented item — used for Computer Use, the "versatile" capability */
.carousel-item--highlight {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.10), rgba(232, 184, 100, 0.04));
    border-color: rgba(212, 175, 55, 0.38);
    box-shadow: 0 0 22px rgba(212, 175, 55, 0.10);
    color: #e8c876;
}

.carousel-item--highlight:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(232, 184, 100, 0.08));
    border-color: rgba(212, 175, 55, 0.6);
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.18);
}

.carousel-item--highlight span {
    color: #e8c876;
    font-weight: 600;
}

.carousel-item--highlight svg {
    color: #e8c876;
    opacity: 1;
}

/* ============================================
   PLATFORM SHOWCASE - Alternating
   ============================================ */
.showcase-row {
    display: grid;
    grid-template-columns: 2fr 3fr;
    gap: clamp(48px, 8vw, 100px);
    align-items: center;
    margin-bottom: clamp(80px, 10vw, 140px);
}

.showcase-row:last-child {
    margin-bottom: 0;
}

.showcase-row-reverse {
    grid-template-columns: 3fr 2fr;
}

.showcase-row-reverse .showcase-text {
    order: 2;
}

.showcase-row-reverse .showcase-image {
    order: 1;
}

.showcase-text h3 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.showcase-text p {
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.8;
}

.showcase-image {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(61, 24, 68, 0.1), 0 6px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-light);
}

.showcase-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-medium);
}

.showcase-image:hover img {
    transform: scale(1.02);
}

/* ============================================
   CTA
   ============================================ */
/* CTA + Footer unified wrapper */
.cta-footer-wrapper {
    position: relative;
    background: var(--bg-light);
    overflow: hidden;
}

.cta-footer-wrapper > .section-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.section-cta {
    background: transparent;
    color: var(--text-primary);
    text-align: center;
    position: relative;
    overflow: visible;
    z-index: 2;
}

.cta-content {
    position: relative;
    z-index: 3;
}

.cta-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.cta-subtitle {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.cta-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-email {
    margin-top: 24px;
    font-size: 0.95rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-email-link {
    color: var(--text-light);
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.cta-email-link:hover {
    color: var(--coral-light);
    border-bottom-color: var(--coral-light);
}

.cta-email-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 100px;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cta-email-copy:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-light);
    border-color: rgba(255, 255, 255, 0.25);
}

.cta-email-copy.copied {
    background: rgba(241, 74, 85, 0.15);
    border-color: rgba(241, 74, 85, 0.45);
    color: var(--text-light);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: transparent;
    color: var(--text-primary);
    padding-top: clamp(60px, 8vw, 100px);
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: clamp(40px, 6vw, 80px);
    border-bottom: 1px solid var(--border-light);
}

.footer-tagline {
    display: flex;
    flex-direction: column;
    font-size: clamp(1.2rem, 2vw, 1.5rem);
    font-weight: 300;
    line-height: 1.5;
    color: var(--text-secondary);
}

.footer-links-grid {
    display: flex;
    gap: 80px;
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    font-weight: 500;
}

.footer-col a:hover {
    color: var(--coral);
}

/* Big logo */
.footer-big-logo {
    padding: clamp(40px, 6vw, 80px) 0;
    text-align: center;
    overflow: visible;
}

.footer-logo-large {
    width: clamp(300px, 60vw, 700px);
    height: auto;
    margin: 0 auto;
    opacity: 0.9;
    overflow: visible;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-top: 1px solid var(--border-light);
}

.footer-copy {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-logo-icon {
    width: 24px;
    height: 24px;
}

.footer-legal {
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.footer-cookie-link {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition-fast);
}

.footer-cookie-link:hover,
.footer-cookie-link:focus-visible {
    color: var(--coral);
    outline: none;
}

/* ============================================
   COOKIE BANNER
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 16px;
    left: 50%;
    width: min(calc(100% - 32px), 760px);
    box-sizing: border-box;
    z-index: 1100;
    background: rgba(255, 255, 255, 0.98);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 60px rgba(26, 10, 22, 0.18);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translate(-50%, 20px);
    opacity: 0;
    transition: transform var(--transition-medium), opacity var(--transition-medium);
}

.cookie-banner.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-banner-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cookie-banner-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.cookie-banner-body {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.cookie-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-section);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.cookie-options[hidden] {
    display: none;
}

.cookie-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    line-height: 1.5;
}

.cookie-option input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: var(--purple-deep);
    cursor: pointer;
}

.cookie-option input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.cookie-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cookie-option-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

.cookie-option-text span {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.cookie-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 10px 20px;
    font-size: 0.88rem;
}

.cookie-btn[hidden] {
    display: none;
}

@media (max-width: 600px) {
    .cookie-banner {
        bottom: 8px;
        width: calc(100% - 16px);
    }
    .cookie-banner-inner {
        padding: 20px;
    }
    .cookie-banner-actions {
        flex-direction: column;
    }
    .cookie-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
}

/* ============================================
   ANIMATIONS - GSAP handles initial states
   Content visible by default for accessibility
   ============================================ */

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .problems-grid,
    .clients-grid,
    .partners-grid,
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-intro {
        grid-template-columns: 1fr;
    }

    .product-visual {
        order: -1;
    }

    .showcase-row,
    .showcase-row-reverse {
        grid-template-columns: 1fr;
    }

    .showcase-row-reverse .showcase-text {
        order: 0;
    }

    .showcase-row-reverse .showcase-image {
        order: 0;
    }
}

@media (max-width: 1000px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 360px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 100px 40px 40px;
        gap: 24px;
        transition: right var(--transition-medium);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    }

    .nav-links.open {
        right: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-cta {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .problems-grid,
    .features-grid,
    .clients-grid,
    .partners-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: clamp(2.2rem, 8vw, 3.5rem);
    }

    .product-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .footer-links-grid {
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .hiw-step {
        flex-direction: column;
        gap: 16px;
    }

    .advantage-item p {
        padding-left: 0;
    }

    .workflow-demo {
        padding: 24px;
    }

    .workflow-node {
        width: 170px;
        padding: 12px 20px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .cta-actions {
        flex-direction: column;
    }
}

/* ============================================
   UTILITY - Smooth scroll offset
   ============================================ */
:target {
    scroll-margin-top: 100px;
}

/* Selection color */
::selection {
    background: rgba(241, 74, 84, 0.2);
    color: var(--purple-deep);
}

