/* ==========================================================================
   FlowMade Studio — Design System
   Consulenza, automazione e soluzioni digitali per le PMI
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    /* Brand — derivati dal logo FM */
    --navy-950: #0d1826;
    --navy-900: #142338;
    --navy-800: #1b2f4a;
    --navy-700: #224469;
    /* colore esatto del logo FM */
    --navy-600: #34568a;
    --navy-500: #4a72ac;
    --navy-300: #7fb2f5;
    --navy-200: #9fc4f5;

    --accent: #2f80ed;
    --accent-strong: #1b64d1;
    --accent-soft: #e8f1fe;
    --teal: #12b3a8;
    --teal-soft: #e2f7f5;
    --amber: #f0a500;

    /* Semantici */
    --danger: #d64545;
    --danger-soft: #fdeceb;
    --success: #0f8f6c;

    /* Neutri */
    --ink: #101828;
    --ink-2: #475467;
    --ink-3: #8a94a6;
    --line: #e6e9ef;
    --line-strong: #d3d9e3;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --surface-3: #eef2f8;

    /* Effetti */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-sm: 0 2px 8px rgba(16, 24, 40, .06);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
    --shadow-lg: 0 24px 60px rgba(16, 24, 40, .12);
    --shadow-glow: 0 20px 50px rgba(34, 68, 105, .28);

    --maxw: 1180px;
    --nav-h: 72px;
    --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 16px);
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--surface);
    color: var(--ink);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

ul {
    list-style: none;
}

::selection {
    background: var(--navy-700);
    color: #fff;
}

/* ---------- Tipografia ---------- */
h1,
h2,
h3,
h4 {
    line-height: 1.12;
    letter-spacing: -.025em;
    font-weight: 700;
    color: var(--ink);
    text-wrap: balance;
}

h1 {
    font-size: clamp(2.4rem, 5.6vw, 4.1rem);
    letter-spacing: -.035em;
}

h2 {
    font-size: clamp(1.9rem, 3.7vw, 2.85rem);
}

h3 {
    font-size: clamp(1.15rem, 1.7vw, 1.4rem);
    line-height: 1.25;
}

h4 {
    font-size: 1.02rem;
    letter-spacing: -.01em;
}

p {
    color: var(--ink-2);
    text-wrap: pretty;
}

strong {
    color: var(--ink);
    font-weight: 600;
}

.lead {
    font-size: clamp(1.05rem, 1.5vw, 1.28rem);
    color: var(--ink-2);
    line-height: 1.6;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
}

.section {
    padding: clamp(72px, 9vw, 128px) 0;
    position: relative;
}

.section--tight {
    padding: clamp(56px, 6vw, 88px) 0;
}

.section--alt {
    background: var(--surface-2);
    border-block: 1px solid var(--line);
}

.section--dark {
    background: linear-gradient(160deg, var(--navy-950), var(--navy-800) 60%, var(--navy-700));
    color: #fff;
}

.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark strong {
    color: #fff;
}

.section--dark p {
    color: rgba(255, 255, 255, .72);
}

.section-head {
    max-width: 720px;
    margin-bottom: clamp(40px, 5vw, 64px);
}

.section-head--center {
    margin-inline: auto;
    text-align: center;
}

.section-head p {
    margin-top: 16px;
    font-size: clamp(1.02rem, 1.35vw, 1.18rem);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
}

.eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
}

.section--dark .eyebrow {
    color: var(--navy-300);
}

.section-head--center .eyebrow::before {
    display: none;
}

/* ---------- Bottoni ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 100px;
    border: 1px solid transparent;
    font-size: .97rem;
    font-weight: 600;
    letter-spacing: -.01em;
    cursor: pointer;
    transition: transform .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease), color .25s var(--ease);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--navy-700);
    color: #fff;
    box-shadow: 0 8px 22px rgba(34, 68, 105, .28);
}

.btn-primary:hover {
    background: var(--navy-800);
    box-shadow: 0 14px 32px rgba(34, 68, 105, .34);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 8px 22px rgba(47, 128, 237, .32);
}

.btn-accent:hover {
    background: var(--accent-strong);
}

.btn-ghost {
    background: #fff;
    color: var(--ink);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
    border-color: var(--navy-600);
    color: var(--navy-700);
}

.section--dark .btn-ghost {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    border-color: rgba(255, 255, 255, .26);
    backdrop-filter: blur(6px);
}

.section--dark .btn-ghost:hover {
    background: rgba(255, 255, 255, .14);
    color: #fff;
}

.btn-sm {
    padding: 10px 20px;
    font-size: .88rem;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 600;
    color: var(--accent);
    font-size: .95rem;
}

.link-arrow svg {
    transition: transform .25s var(--ease);
}

.link-arrow:hover svg {
    transform: translateX(4px);
}

/* ---------- Navigazione ---------- */
.nav {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--nav-h);
    z-index: 900;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s var(--ease), background .3s var(--ease);
}

.nav.scrolled {
    border-bottom-color: var(--line);
    background: rgba(255, 255, 255, .9);
}

.nav-inner {
    height: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 700;
    font-size: 1.06rem;
    letter-spacing: -.03em;
    color: var(--ink);
    flex-shrink: 0;
}

.brand img {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    box-shadow: var(--shadow-xs);
}

.brand span {
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-links a {
    padding: 8px 11px;
    border-radius: 8px;
    font-size: .92rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--ink-2);
    transition: color .2s, background .2s;
}

.nav-links a:hover {
    color: var(--ink);
    background: var(--surface-3);
}

.nav-cta {
    flex-shrink: 0;
}

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

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    cursor: pointer;
    position: relative;
}

.nav-toggle span {
    position: absolute;
    left: 11px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
    transition: transform .3s var(--ease), opacity .2s;
}

.nav-toggle span:nth-child(1) {
    top: 14px;
}

.nav-toggle span:nth-child(2) {
    top: 20px;
}

.nav-toggle span:nth-child(3) {
    top: 26px;
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: calc(var(--nav-h) + clamp(56px, 8vw, 104px)) 0 clamp(56px, 7vw, 96px);
    overflow: hidden;
    background:
        radial-gradient(900px 460px at 12% -8%, var(--accent-soft), transparent 62%),
        radial-gradient(760px 420px at 92% 4%, var(--teal-soft), transparent 60%),
        linear-gradient(180deg, #fff, var(--surface-2));
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: .35;
    mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 75%);
    -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 75%);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 880px;
    margin-inline: auto;
    text-align: center;
}

.hero h1 .grad {
    background: linear-gradient(100deg, var(--navy-700), var(--accent) 55%, var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p.lead {
    margin: 24px auto 0;
    max-width: 640px;
}

.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 34px;
}

.hero-note {
    margin-top: 18px;
    font-size: .87rem;
    color: var(--ink-3);
}

/* Da processo complicato a processo semplice */
.flowvis {
    position: relative;
    z-index: 1;
    margin-top: clamp(48px, 6vw, 76px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(16px, 2.5vw, 28px);
}

.fv-card {
    margin: 0;
    padding: 24px 26px 20px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.fv-art {
    display: block;
    width: 100%;
    height: auto;
}

.fv-messy {
    fill: none;
    stroke: var(--ink-3);
    stroke-width: 3;
    stroke-linecap: round;
}

.fv-messy--faint {
    stroke: var(--line-strong);
}

.fv-clean {
    fill: none;
    stroke: var(--teal);
    stroke-width: 3;
    stroke-linecap: round;
}

.fv-dot {
    stroke: #fff;
    stroke-width: 2;
}

.fv-dot--grey {
    fill: var(--ink-3);
}

.fv-dot--teal {
    fill: var(--teal);
}

.fv-card figcaption {
    margin-top: 14px;
}

.fv-card figcaption b {
    display: block;
    font-size: 1rem;
    color: var(--ink);
}

.fv-card figcaption span {
    display: block;
    margin-top: 4px;
    font-size: .88rem;
    color: var(--ink-2);
}

.fv-mid {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fv-pill {
    padding: 12px 20px;
    border-radius: 100px;
    background: var(--navy-700);
    color: #fff;
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.fv-arrow {
    width: 26px;
    height: 2px;
    background: var(--navy-500);
    position: relative;
    flex-shrink: 0;
}

.fv-arrow::after {
    content: "";
    position: absolute;
    right: -1px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-top: 2px solid var(--navy-500);
    border-right: 2px solid var(--navy-500);
    transform: translateY(-50%) rotate(45deg);
}

/* ---------- Card generiche ---------- */
.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-xs);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--line-strong);
}

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

.card p {
    font-size: .96rem;
}

.grid {
    display: grid;
    gap: 22px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.icon-badge {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 18px;
}

.icon-badge svg {
    width: 22px;
    height: 22px;
}

.icon-badge.teal {
    background: var(--teal-soft);
    color: var(--teal);
}

.icon-badge.navy {
    background: #e9edf5;
    color: var(--navy-700);
}

/* ---------- Split (testo + visual) ---------- */
.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: center;
}

.split--reverse .split-visual {
    order: -1;
}

.split-visual img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--line);
}

/* ---------- Schema strumenti scollegati ---------- */
.tangle {
    margin: 0;
    padding: 22px 22px 16px;
    background: linear-gradient(180deg, #fff, var(--surface-2));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.tangle svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.tangle .tg-link path,
.tangle .tg-broken path {
    stroke-linecap: round;
}

.tangle .tg-node rect {
    fill: #fff;
    stroke: var(--line-strong);
    stroke-width: 1.2;
}

.tangle .tg-node text {
    font-size: 15px;
    font-weight: 600;
    fill: var(--ink);
}

.tangle .tg-hub circle {
    fill: var(--navy-700);
}

.tangle .tg-hub text {
    text-anchor: middle;
    font-size: 17px;
    font-weight: 700;
    fill: #fff;
}

.tangle .tg-hub text.tg-hub-sub {
    font-size: 11px;
    font-weight: 500;
    fill: rgba(255, 255, 255, .72);
}

.tangle .tg-note text {
    font-size: 13px;
    font-weight: 500;
    fill: var(--ink-3);
    stroke: #fff;
    stroke-width: 4;
    paint-order: stroke;
}

.tangle figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    font-size: .82rem;
    color: var(--ink-3);
}

.tangle .lg {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tangle .lg i {
    width: 26px;
    border-top: 2px solid var(--navy-500);
}

.tangle .lg.is-broken i {
    border-top-style: dashed;
    border-color: var(--danger);
}

/* ---------- Digital Waste ---------- */
.waste-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.waste-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .1);
    font-size: .95rem;
    color: rgba(255, 255, 255, .84);
    transition: background .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}

.waste-item:hover {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .22);
    transform: translateY(-3px);
}

.waste-item .dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    margin-top: 9px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(18, 179, 168, .18);
}

.callout {
    margin-top: 36px;
    padding: 22px 26px;
    border-radius: var(--radius);
    border-left: 3px solid var(--teal);
    background: rgba(255, 255, 255, .06);
}

.callout p {
    color: rgba(255, 255, 255, .82);
    font-size: 1rem;
}

/* ---------- Servizi ---------- */
.service-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: "";
    position: absolute;
    inset: auto auto 0 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--teal));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s var(--ease);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card .tag {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 4px 11px;
    border-radius: 100px;
    background: var(--surface-3);
    color: var(--ink-2);
    font-size: .73rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.service-card .tag.is-entry {
    background: var(--navy-700);
    color: #fff;
}

.service-goal {
    margin-top: auto;
    padding-top: 16px;
    font-size: .88rem;
    color: var(--ink-3);
    border-top: 1px dashed var(--line-strong);
}

.service-goal b {
    color: var(--navy-700);
    font-weight: 600;
}

/* ---------- Metodo / timeline ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 18px;
    position: relative;
}

.steps::before {
    content: "";
    position: absolute;
    top: 26px;
    left: 6%;
    right: 6%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--teal));
    opacity: .35;
}

.step {
    position: relative;
    text-align: center;
    padding-top: 0;
}

.step-dot {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #fff;
    border: 2px solid var(--line-strong);
    color: var(--navy-700);
    font-weight: 700;
    font-size: 1rem;
    position: relative;
    z-index: 1;
    transition: border-color .3s, transform .3s var(--ease), box-shadow .3s;
}

.step:hover .step-dot {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(47, 128, 237, .2);
}

.step h4 {
    margin-bottom: 8px;
}

.step p {
    font-size: .9rem;
}

/* ---------- Assessment ---------- */
.check-list {
    display: grid;
    gap: 12px;
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: .97rem;
    color: var(--ink-2);
}

.check-list li::before {
    content: "";
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312b3a8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center/12px no-repeat;
}

.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    padding: clamp(28px, 3.5vw, 44px);
    box-shadow: var(--shadow-md);
}

.panel-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
    font-size: 1.06rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.panel-title .num {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: var(--navy-700);
    color: #fff;
    font-size: .82rem;
}

/* ---------- Confronto (non facciamo / facciamo) ---------- */
.compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

.compare-col {
    padding: 30px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: #fff;
}

.compare-col.is-no {
    background: var(--surface-2);
}

.compare-col h3 {
    margin-bottom: 20px;
    font-size: 1.15rem;
}

.compare-col li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: .95rem;
    color: var(--ink-2);
}

.compare-col li:last-child {
    border-bottom: 0;
}

.mark {
    flex-shrink: 0;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 700;
    margin-top: 2px;
}

.mark.no {
    background: var(--danger-soft);
    color: var(--danger);
}

.mark.yes {
    background: var(--teal-soft);
    color: var(--teal);
}

/* ---------- Casi studio ---------- */
.case-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.case-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.case-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.case-media {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-3);
}

.case-media img.shot {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .6s var(--ease);
}

.case-card:hover .case-media img.shot {
    transform: scale(1.05);
}

.case-logo {
    position: absolute;
    left: 18px;
    bottom: 18px;
    width: 76px;
    height: 54px;
    object-fit: contain;
    padding: 6px;
    border-radius: 14px;
    border: 2px solid #fff;
    outline: 1px solid rgba(16, 24, 40, .08);
    outline-offset: -3px;
    box-shadow: var(--shadow-md);
    background: #fff;
}

.case-body {
    padding: 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.case-sector {
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.case-body p {
    font-size: .95rem;
}

.case-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.metric {
    padding: 5px 11px;
    border-radius: 100px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: .78rem;
    font-weight: 600;
}

.case-foot {
    margin-top: auto;
    padding-top: 16px;
}

/* ---------- Tecnologie ---------- */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.tech-card {
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    transition: border-color .3s, transform .3s var(--ease);
}

.tech-card:hover {
    border-color: var(--navy-600);
    transform: translateY(-3px);
}

.tech-card h4 {
    margin-bottom: 8px;
    color: var(--navy-700);
}

.tech-card p {
    font-size: .89rem;
}

/* ---------- FAQ ---------- */
.faq {
    max-width: 820px;
    margin-inline: auto;
    border-top: 1px solid var(--line);
}

.faq-item {
    border-bottom: 1px solid var(--line);
}

.faq-q {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 22px 4px;
    background: none;
    border: 0;
    text-align: left;
    font-size: 1.02rem;
    font-weight: 600;
    letter-spacing: -.015em;
    color: var(--ink);
    cursor: pointer;
    transition: color .2s;
}

.faq-q:hover {
    color: var(--accent);
}

.faq-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface-3);
    display: grid;
    place-items: center;
    position: relative;
    transition: background .25s, transform .3s var(--ease);
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    background: var(--navy-700);
    border-radius: 2px;
}

.faq-icon::before {
    width: 11px;
    height: 2px;
}

.faq-icon::after {
    width: 2px;
    height: 11px;
    transition: transform .3s var(--ease);
}

.faq-item.open .faq-icon {
    background: var(--accent-soft);
}

.faq-item.open .faq-icon::after {
    transform: scaleY(0);
}

.faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .35s var(--ease);
}

.faq-item.open .faq-a {
    grid-template-rows: 1fr;
}

.faq-a>div {
    overflow: hidden;
}

.faq-a p {
    padding: 0 4px 24px;
    font-size: .97rem;
}

/* ---------- CTA finale / contatti ---------- */
.contact-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 64px);
    align-items: start;
}

.contact-list {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.contact-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    color: #fff;
    font-weight: 500;
    font-size: .97rem;
    transition: background .25s, transform .25s var(--ease);
}

.contact-row:hover {
    background: rgba(255, 255, 255, .12);
    transform: translateX(4px);
}

.contact-row svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    opacity: .8;
}

.form-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: clamp(26px, 3vw, 38px);
    box-shadow: var(--shadow-lg);
}

.form-card h3 {
    margin-bottom: 6px;
}

.form-card>p {
    font-size: .94rem;
    margin-bottom: 24px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    font-size: .84rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 7px;
}

.field input,
.field textarea {
    width: 100%;
    padding: 13px 15px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--ink);
    font-size: .97rem;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--ink-3);
}

.field input:focus,
.field textarea:focus {
    outline: none;
    background: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(47, 128, 237, .12);
}

.field textarea {
    resize: vertical;
    min-height: 118px;
}

.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .82rem;
    color: var(--ink-2);
    margin-bottom: 20px;
}

.consent input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--navy-700);
    flex-shrink: 0;
}

.consent a {
    color: var(--accent);
    text-decoration: underline;
}

.form-msg {
    margin-top: 14px;
    font-size: .9rem;
    font-weight: 500;
    display: none;
}

.form-msg.ok {
    display: block;
    color: var(--success);
}

.form-msg.err {
    display: block;
    color: var(--danger);
}

/* ---------- Footer ---------- */
footer {
    background: var(--navy-950);
    color: rgba(255, 255, 255, .6);
    padding: 64px 0 32px;
    font-size: .92rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
}

footer .brand {
    color: #fff;
    margin-bottom: 14px;
}

footer p {
    color: rgba(255, 255, 255, .58);
    font-size: .92rem;
}

.footer-col h4 {
    color: #fff;
    font-size: .82rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.footer-col a {
    display: block;
    padding: 5px 0;
    color: rgba(255, 255, 255, .6);
    transition: color .2s;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .85rem;
}

.footer-bottom a {
    color: rgba(255, 255, 255, .6);
}

.footer-bottom a:hover {
    color: #fff;
}

/* ---------- Legal ---------- */
.legal {
    background: var(--surface-2);
    border-top: 1px solid var(--line);
    padding: 48px 0;
}

.legal-item {
    max-width: 840px;
    margin: 0 auto 12px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.legal-item>button {
    width: 100%;
    padding: 18px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: 0;
    font-weight: 600;
    font-size: .98rem;
    cursor: pointer;
    text-align: left;
}

.legal-body {
    display: none;
    padding: 0 22px 22px;
}

.legal-item.open .legal-body {
    display: block;
}

.legal-body h4 {
    margin: 18px 0 6px;
    color: var(--navy-700);
}

.legal-body p,
.legal-body li {
    font-size: .9rem;
    color: var(--ink-2);
}

.legal-body ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 8px;
}

/* ---------- Cookie banner ---------- */
.cookie {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translate(-50%, 140%);
    z-index: 1000;
    width: min(620px, calc(100% - 32px));
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    border-radius: var(--radius);
    background: rgba(20, 35, 56, .96);
    backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, .85);
    box-shadow: var(--shadow-lg);
    font-size: .88rem;
    transition: transform .45s var(--ease);
}

.cookie.show {
    transform: translate(-50%, 0);
}

.cookie button {
    flex-shrink: 0;
    padding: 9px 20px;
    border-radius: 100px;
    border: 0;
    background: #fff;
    color: var(--navy-900);
    font-weight: 600;
    font-size: .86rem;
    cursor: pointer;
}

/* ---------- Lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(10, 16, 26, .92);
    backdrop-filter: blur(8px);
    display: none;
    place-items: center;
    padding: 24px;
}

.lightbox.active {
    display: grid;
}

.lightbox img {
    max-width: min(1100px, 94vw);
    max-height: 88vh;
    width: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.zoomable {
    cursor: zoom-in;
}

/* ---------- Scroll reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

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

/* ---------- Case study page ---------- */
.cs-hero {
    padding: calc(var(--nav-h) + 72px) 0 64px;
    background:
        radial-gradient(800px 400px at 20% 0%, var(--accent-soft), transparent 60%),
        linear-gradient(180deg, #fff, var(--surface-2));
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.cs-hero img.cs-logo {
    width: auto;
    max-width: 220px;
    height: 96px;
    object-fit: contain;
    padding: 12px 20px;
    background: #fff;
    border-radius: 24px;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
}

.cs-hero .badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 100px;
    background: var(--navy-700);
    color: #fff;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

.cs-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 44px;
    text-align: left;
}

.cs-fact {
    padding: 20px;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--line);
}

.cs-fact .k {
    font-size: .74rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 600;
}

.cs-fact .v {
    margin-top: 6px;
    font-weight: 600;
    font-size: .96rem;
    color: var(--ink);
}

.quote {
    padding: 24px 28px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border-left: 3px solid var(--accent);
    margin-top: 26px;
}

.quote p {
    font-size: 1.03rem;
    font-style: italic;
    color: var(--ink);
}

.quote cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-size: .86rem;
    color: var(--ink-3);
    font-weight: 600;
}

.scroller {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 18px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.scroller img {
    flex: 0 0 auto;
    width: 230px;
    border-radius: 18px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--line);
    scroll-snap-align: start;
}

.scroller::-webkit-scrollbar {
    height: 8px;
}

.scroller::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 100px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.gallery img {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

/* ---------- Floating CTA ---------- */
.float-cta {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 800;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 20px;
    border-radius: 100px;
    background: var(--navy-700);
    color: #fff;
    font-size: .9rem;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity .35s var(--ease), transform .35s var(--ease), background .25s;
}

.float-cta.show {
    opacity: 1;
    pointer-events: auto;
    transform: none;
}

.float-cta:hover {
    background: var(--navy-800);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {

    .grid-4,
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3,
    .case-grid,
    .waste-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }

    .steps::before {
        display: none;
    }

    .cs-facts {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 860px) {
    .flowvis {
        grid-template-columns: 1fr;
    }

    .fv-mid {
        flex-direction: column;
        gap: 10px;
    }

    .fv-arrow {
        transform: rotate(90deg);
    }

    .nav-links {
        position: fixed;
        inset: var(--nav-h) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 14px 20px 22px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow-md);
        transform: translateY(-12px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .25s var(--ease), transform .25s var(--ease);
    }

    .nav-links.open {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 13px 12px;
        font-size: 1rem;
    }

    .nav-toggle {
        display: block;
        order: 3;
    }

    .nav-cta {
        display: none;
    }

    .nav-cta-mobile {
        display: inline-flex;
        margin-top: 12px;
        justify-content: center;
    }

    .split,
    .contact-wrap,
    .compare {
        grid-template-columns: 1fr;
    }

    .split--reverse .split-visual {
        order: 0;
    }
}

@media (max-width: 680px) {

    body {
        font-size: 16px;
    }

    .tangle {
        padding: 14px 12px 12px;
    }

    .tangle .tg-node text {
        font-size: 17px;
    }

    .tangle .tg-note text {
        font-size: 15px;
    }

    .tangle .tg-hub text {
        font-size: 20px;
    }

    .tangle .tg-hub text.tg-hub-sub {
        font-size: 13px;
    }

    .grid-2,
    .grid-3,
    .grid-4,
    .case-grid,
    .waste-grid,
    .tech-grid,
    .gallery,
    .cs-facts {
        grid-template-columns: 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .step {
        display: grid;
        grid-template-columns: 52px 1fr;
        gap: 16px;
        text-align: left;
        align-items: start;
    }

    .step-dot {
        margin: 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .float-cta {
        right: 12px;
        bottom: 12px;
        padding: 12px 18px;
        font-size: .85rem;
    }

    .cookie {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
