/* ============================================================
   I.M.F. GROUP — style.css
   Direction: "precision engineering" — machined graphite + molten amber
   ============================================================ */
:root {
    color-scheme: dark;
    --graphite: #0e1316;
    --steel: #161e24;
    --steel-2: #1c262d;
    --line: #27343c;
    --line-soft: #1f2a31;
    --ink: #f2f5f6;
    --muted: #c4ced5;
    --faint: #94a5af;
    --amber: #ff6a1a;
    --amber-soft: #ffa268;
    --blue: #4e7ca6;
    --ok: #39c07a;
    --err: #ff6b6b;

    --display: "Archivo", system-ui, sans-serif;
    --body: "IBM Plex Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;

    --maxw: 1240px;
    --r: 3px;
}

* {
    box-sizing: border-box;
}
html {
    font-size: 18px;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
    overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
body {
    margin: 0;
    background: var(--graphite);
    color: var(--ink);
    font-family: var(--body);
    font-weight: 400;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.locked {
    overflow: hidden;
    height: 100vh;
}
a {
    color: inherit;
    text-decoration: none;
}
img {
    display: block;
    max-width: 100%;
}
::selection {
    background: var(--amber);
    color: #160a00;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 80%);
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 28px;
    position: relative;
    z-index: 1;
}

.tag {
    font-family: var(--mono);
    font-size: 0.88rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--amber);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
}
.tag::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--amber);
    display: inline-block;
}
.tag.faint {
    color: var(--faint);
}
.tag.faint::before {
    background: var(--faint);
}

h1,
h2,
h3 {
    font-family: var(--display);
    font-weight: 800;
    line-height: 1.02;
    letter-spacing: -0.02em;
    margin: 0;
}

/* =========================== LANGUAGE GATE =========================== */
#gate {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--graphite);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    transition:
        opacity 0.6s ease,
        visibility 0.6s ease;
}
#gate.hide {
    opacity: 0;
    visibility: hidden;
}
#gate .gate-grid {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image:
        linear-gradient(var(--line-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}
.gate-inner {
    position: relative;
    text-align: center;
    max-width: 680px;
    width: 100%;
}
.gate-mark {
    margin: 0 auto 26px;
    width: max-content;
}
.gate-kicker {
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 16px;
}
.gate-h {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.4rem, 4.2vw, 2.05rem);
    color: var(--ink);
    margin-bottom: 10px;
}
.gate-sub {
    color: var(--muted);
    font-size: clamp(1.08rem, 2.6vw, 1.35rem);
    line-height: 1.5;
    margin-bottom: 38px;
}
.gate-sub b {
    color: var(--amber-soft);
    font-weight: 500;
}
.flags {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}
.flag-btn {
    background: var(--steel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    width: 208px;
    padding: 24px 20px 20px;
    cursor: pointer;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    position: relative;
    transition:
        border-color 0.25s,
        transform 0.25s,
        background 0.25s;
    font-family: var(--body);
}
.flag-btn:hover,
.flag-btn:focus-visible {
    border-color: var(--amber);
    transform: translateY(-4px);
    background: var(--steel-2);
    outline: none;
}
.flag-btn .fl {
    width: 64px;
    height: 44px;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.flag-btn .lang-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}
.flag-btn .lang-go {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--faint);
}
.flag-btn:hover .lang-go,
.flag-btn:focus-visible .lang-go {
    color: var(--amber);
}
.flag-btn .corner {
    position: absolute;
    top: 8px;
    right: 10px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--faint);
    letter-spacing: 0.1em;
}

/* =========================== HEADER =========================== */
header.site {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid transparent;
    transition:
        background 0.35s,
        border-color 0.35s,
        padding 0.35s,
        backdrop-filter 0.35s;
}
header.site.scrolled {
    background: rgba(11, 15, 18, 0.86);
    backdrop-filter: blur(12px);
    border-bottom-color: var(--line);
    padding: 10px 28px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0;
    cursor: pointer;
}
nav.main {
    display: flex;
    align-items: center;
    gap: 30px;
}
nav.main a {
    white-space: nowrap;
    font-family: var(--mono);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--ink);
    text-transform: uppercase;
    transition: color 0.2s;
    position: relative;
    padding: 4px 0;
    cursor: pointer;
}
nav.main a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 1px;
    width: 0;
    background: var(--amber);
    transition: width 0.25s;
}
nav.main a:hover {
    color: var(--amber-soft);
}
nav.main a:hover::after {
    width: 100%;
}
.hdr-right {
    display: flex;
    align-items: center;
    gap: 18px;
}
.langtoggle {
    display: flex;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    font-family: var(--mono);
    font-size: 0.86rem;
}
.langtoggle button {
    background: transparent;
    border: 0;
    color: var(--ink);
    padding: 7px 12px;
    cursor: pointer;
    letter-spacing: 0.08em;
    transition: 0.2s;
    font-family: inherit;
}
.langtoggle button.active {
    background: var(--amber);
    color: #160a00;
    font-weight: 600;
}
.cta-mini {
    font-family: var(--mono);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--amber);
    color: var(--amber);
    padding: 9px 17px;
    border-radius: var(--r);
    transition: 0.25s;
    cursor: pointer;
}
.cta-mini:hover {
    background: var(--amber);
    color: #160a00;
}
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.burger span {
    width: 24px;
    height: 2px;
    background: var(--ink);
    transition: 0.3s;
    display: block;
}
.burger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.burger.open span:nth-child(2) {
    opacity: 0;
}
.burger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

#mobnav {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: var(--graphite);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.6, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    gap: 8px;
}
#mobnav.open {
    transform: translateX(0);
}
#mobnav a {
    font-family: var(--display);
    font-weight: 700;
    font-size: 2rem;
    color: var(--ink);
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
#mobnav a .mn-i {
    font-family: var(--mono);
    font-size: 0.88rem;
    color: var(--amber);
    margin-right: 14px;
    font-weight: 500;
}

/* =========================== HERO =========================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 0;
}
.hero-slides {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
}
.hero-slide.active {
    opacity: 1;
}
.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.05) contrast(1.03);
    animation: kb 22s ease-in-out infinite alternate;
}
@keyframes kb {
    from {
        transform: scale(1.04);
    }
    to {
        transform: scale(1.13);
    }
}
@media (prefers-reduced-motion: reduce) {
    .hero-slide img {
        animation: none;
        transform: none;
    }
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(11, 15, 18, 0.55) 0%,
        rgba(11, 15, 18, 0.35) 35%,
        rgba(11, 15, 18, 0.92) 100%
    );
}
.hero-frame {
    position: absolute;
    inset: 26px;
    z-index: 3;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.hero-frame::before,
.hero-frame::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid var(--amber);
}
.hero-frame::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
}
.hero-frame::after {
    bottom: -1px;
    right: -1px;
    border-left: 0;
    border-top: 0;
}
.hero-content {
    position: relative;
    z-index: 4;
    width: 100%;
    padding-bottom: 8vh;
}
.hero h1 {
    font-size: clamp(2.4rem, 6.4vw, 5.4rem);
    font-weight: 900;
    max-width: 16ch;
    letter-spacing: -0.03em;
}
.hero h1 em {
    font-style: normal;
    color: var(--amber);
}
.hero-lead {
    color: var(--muted);
    max-width: 54ch;
    margin: 24px 0 32px;
    font-size: clamp(1.06rem, 1.5vw, 1.25rem);
}
.btn {
    font-family: var(--mono);
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 15px 28px;
    border-radius: var(--r);
    cursor: pointer;
    transition: 0.25s;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.btn-primary {
    background: var(--amber);
    color: #160a00;
    font-weight: 600;
}
.btn-primary:hover {
    background: #fff;
    transform: translateY(-2px);
}
.btn-ghost {
    border-color: var(--line);
    color: var(--ink);
}
.btn-ghost:hover {
    border-color: var(--ink);
}
.slide-idx {
    position: absolute;
    left: 28px;
    bottom: 26px;
    z-index: 4;
    display: flex;
    gap: 8px;
}
.slide-idx i {
    width: 30px;
    height: 3px;
    background: var(--line);
    cursor: pointer;
    transition: 0.3s;
}
.slide-idx i.on {
    background: var(--amber);
    width: 40px;
}

/* =========================== SECTION SHELL =========================== */
section {
    position: relative;
    z-index: 1;
    padding: 120px 0;
}
.sec-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}
.sec-head h2 {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
}
.sec-head .h-sub {
    color: var(--muted);
    max-width: 46ch;
    font-size: 1.08rem;
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 0.8s cubic-bezier(0.2, 0.6, 0.2, 1),
        transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.reveal.in {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* =========================== AZIENDA =========================== */
.about {
    display: block;
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}
.about-copy .tag {
    justify-content: center;
}
.about-copy p {
    color: var(--muted);
    margin: 0 0 18px;
    font-size: 1.05rem;
}
.about-copy h2 {
    font-size: clamp(1.9rem, 4vw, 3rem);
    margin-bottom: 24px;
}
.about-copy h2 .acc {
    color: var(--amber);
}

/* stats */
.stats {
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}
.stat {
    padding: 38px 24px;
    border-right: 1px solid var(--line);
    position: relative;
}
.stat:last-child {
    border-right: 0;
}
.stat .v {
    font-family: var(--display);
    font-weight: 800;
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    letter-spacing: -0.02em;
}
.stat .v small {
    font-size: 0.85rem;
    color: var(--amber);
    font-weight: 600;
    font-family: var(--mono);
}
.stat .k {
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 8px;
}

/* =========================== SERVIZI =========================== */
.services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
}
.svc {
    background: var(--steel);
    padding: 42px 36px;
    position: relative;
    transition: background 0.3s;
    display: flex;
    flex-direction: column;
}
.svc:hover {
    background: var(--steel-2);
}
.svc .num {
    font-family: var(--mono);
    font-size: 0.84rem;
    color: var(--amber);
    letter-spacing: 0.14em;
    margin-bottom: 24px;
}
.svc .ic {
    margin-bottom: 20px;
    color: var(--amber);
}
.svc h3 {
    font-size: 1.45rem;
    margin-bottom: 14px;
    font-weight: 700;
}
.svc h3 .svc-note {
    font-family: var(--body);
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--faint);
    letter-spacing: 0;
    white-space: nowrap;
}
.svc p {
    color: var(--muted);
    font-size: 1.04rem;
    margin: 0;
}

/* =========================== PARCO MACCHINE =========================== */
.machines {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.mac {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--steel);
    aspect-ratio: 4/3;
}
.mac img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.6s,
        filter 0.6s;
    filter: grayscale(0.25) contrast(1.05);
}
.mac:hover img {
    transform: scale(1.07);
    filter: grayscale(0);
}
.mac .ov {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    background: linear-gradient(
        180deg,
        transparent 40%,
        rgba(8, 11, 13, 0.92) 100%
    );
}
.mac .mn {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}
.mac .mt {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--amber);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 3px;
}
.mac .corner {
    position: absolute;
    top: 10px;
    left: 10px;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.1em;
    background: rgba(8, 11, 13, 0.5);
    padding: 2px 6px;
    border-radius: 2px;
    z-index: 2;
}

/* =========================== SETTORI =========================== */
.sectors-wrap {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 60px;
    align-items: start;
}
.sectors-copy h2 {
    font-size: clamp(1.9rem, 4vw, 3rem);
    margin-bottom: 20px;
}
.sectors-copy p {
    color: var(--muted);
    font-size: 1.05rem;
}
.sectors {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-content: flex-start;
    justify-content: flex-start;
}
.sector {
    font-family: var(--mono);
    font-size: 0.94rem;
    letter-spacing: 0.04em;
    padding: 13px 20px;
    min-height: 48px;
    white-space: nowrap;
    border: 1px solid var(--line);
    border-radius: 40px;
    color: var(--muted);
    transition: 0.25s;
    cursor: default;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sector::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--amber);
    border-radius: 50%;
    flex: 0 0 auto;
}
.sector:hover {
    border-color: var(--amber);
    color: var(--ink);
    transform: translateY(-2px);
}

/* =========================== CONTATTI =========================== */
.contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
}
.contact-info h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 18px;
}
.contact-info .lead {
    color: var(--muted);
    font-size: 1.08rem;
    margin-bottom: 38px;
    max-width: 42ch;
}
.info-row {
    display: flex;
    gap: 18px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}
.info-row:last-of-type {
    border-bottom: 1px solid var(--line);
}
.info-row .ic {
    color: var(--amber);
    flex: 0 0 auto;
    margin-top: 2px;
}
.info-row .k {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 4px;
}
.info-row .vv {
    font-size: 1.02rem;
    color: var(--ink);
}
.info-row a.vv:hover {
    color: var(--amber);
}
.map {
    margin-top: 30px;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    height: 240px;
}
.map iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(0.4) invert(0.92) hue-rotate(180deg) contrast(0.9);
}

.form-card {
    background: var(--steel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    padding: 38px;
}
.form-card .fh {
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--amber);
    margin-bottom: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.form-card .fh::before {
    content: "";
    width: 24px;
    height: 1px;
    background: var(--amber);
}
.field {
    margin-bottom: 20px;
}
.field label {
    display: block;
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}
.field label .req {
    color: var(--amber);
}
.field input,
.field textarea {
    width: 100%;
    background: var(--graphite);
    border: 1px solid var(--line);
    border-radius: var(--r);
    color: var(--ink);
    padding: 13px 15px;
    font-family: var(--body);
    font-size: 0.98rem;
    transition: border-color 0.2s;
    resize: vertical;
}
.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--amber);
}
.field.row2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.field .err-msg {
    color: var(--err);
    font-family: var(--mono);
    font-size: 0.82rem;
    margin-top: 6px;
    display: none;
    letter-spacing: 0.04em;
}
.field.invalid input,
.field.invalid textarea {
    border-color: var(--err);
}
.field.invalid .err-msg {
    display: block;
}
.consent {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 6px 0 24px;
}
.consent input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--amber);
    flex: 0 0 auto;
}
.consent label {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.55;
}
.consent a {
    color: var(--amber-soft);
    text-decoration: underline;
}
.form-card .btn-primary {
    width: 100%;
    justify-content: center;
    border: 0;
    font-size: 0.85rem;
}
.form-note {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--faint);
    text-align: center;
    margin-top: 16px;
    letter-spacing: 0.05em;
}
.form-status {
    display: none;
    margin-top: 16px;
    padding: 13px 16px;
    border-radius: var(--r);
    font-size: 0.95rem;
    font-family: var(--mono);
    letter-spacing: 0.03em;
}
.form-status.ok {
    display: block;
    background: rgba(57, 192, 122, 0.12);
    border: 1px solid var(--ok);
    color: var(--ok);
}
.form-status.bad {
    display: block;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--err);
    color: var(--err);
}

/* =========================== FOOTER =========================== */
footer.site {
    border-top: 1px solid var(--line);
    padding: 64px 0 32px;
    position: relative;
    z-index: 1;
}
.foot-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
.foot-brand p {
    color: var(--muted);
    font-size: 0.98rem;
    max-width: 34ch;
    margin: 18px 0 0;
}
.foot-col h4 {
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin: 0 0 18px;
    font-weight: 500;
}
.foot-col a,
.foot-col p {
    display: block;
    color: var(--muted);
    font-size: 0.98rem;
    margin-bottom: 11px;
    transition: color 0.2s;
    cursor: pointer;
}
.foot-col a:hover {
    color: var(--amber);
}
.foot-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.foot-bottom span,
.foot-bottom a {
    font-family: var(--mono);
    font-size: 0.84rem;
    color: var(--faint);
    letter-spacing: 0.06em;
}
.foot-bottom a:hover {
    color: var(--muted);
}

/* =========================== LOGO MARK =========================== */
/* Logo reale (immagine). Se il file img/logo-imfgroup.png manca,
   JS aggiunge .failed e compare il marchio SVG di ripiego. */
/* Il logo originale ha scritta nera su fondo trasparente: per restare
   leggibile sul tema scuro lo appoggiamo su una placchetta chiara. */
.logo-real {
    height: 60px;
    width: fit-content;
    display: block;
    background: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    image-rendering: auto;
    shape-rendering: geometricPrecision;
}
.logo-real.failed {
    display: none;
}
.logo.logo-fallback {
    display: none;
}
.logo-real.failed ~ .logo.logo-fallback {
    display: flex;
}
.gate-mark .logo-real {
    height: 66px;
    margin: 0 auto;
    padding: 10px 18px;
}
header.site.scrolled .logo-real {
    height: 55px;
}
.foot-brand .logo-real {
    height: 42px;
    margin-bottom: 8px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 11px;
}
.logo .mk {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
}
.logo .tx {
    display: flex;
    flex-direction: column;
    line-height: 1;
}
.logo .tx .t1 {
    font-family: var(--display);
    font-weight: 900;
    font-size: 1.18rem;
    letter-spacing: 0.02em;
    color: var(--ink);
}
.logo .tx .t1 b {
    color: var(--amber);
}
.logo .tx .t2 {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 3px;
}
.logo.lg .mk {
    width: 54px;
    height: 54px;
}
.logo.lg .tx .t1 {
    font-size: 1.7rem;
}
.logo.lg .tx .t2 {
    font-size: 0.62rem;
    letter-spacing: 0.3em;
}

/* =========================== RESPONSIVE =========================== */
@media (max-width: 1320px) {
    nav.main {
        gap: 18px;
    }
    .hdr-right {
        gap: 12px;
    }
    nav.main a {
        font-size: 0.88rem;
    }
    .cta-mini {
        font-size: 0.8rem;
        padding: 8px 13px;
    }
}
@media (max-width: 1120px) {
    nav.main {
        gap: 12px;
    }
    nav.main a {
        font-size: 0.82rem;
    }
}
@media (max-width: 1080px) {
    .machines {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    nav.main,
    .hdr-right .cta-mini {
        display: none;
    }
    .burger {
        display: flex;
    }
    .sectors-wrap,
    .contact {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .services {
        grid-template-columns: 1fr;
    }
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .stat:nth-child(2) {
        border-right: 0;
    }
    .stat {
        border-bottom: 1px solid var(--line);
    }
    .stat:nth-last-child(-n + 1) {
        border-bottom: 0;
    }
    section {
        padding: 84px 0;
    }
}
@media (max-width: 620px) {
    .wrap {
        padding: 0 18px;
    }
    header.site {
        padding: 12px 18px;
    }
    .machines {
        grid-template-columns: 1fr;
    }
    .field.row2 {
        grid-template-columns: 1fr;
    }
    .foot-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .stats {
        grid-template-columns: 1fr;
    }
    .stat {
        border-right: 0;
    }
    .hero-frame {
        inset: 14px;
    }
    .hero h1 {
        font-size: clamp(2rem, 8.5vw, 2.7rem);
    }
    h1,
    h2,
    h3 {
        overflow-wrap: break-word;
    }
}

/* =========================== ALLEGATO (file) =========================== */
.field input[type="file"] {
    display: none;
}
.file-drop {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    background: var(--graphite);
    border: 1px dashed var(--line);
    border-radius: var(--r);
    color: var(--muted);
    padding: 13px 15px;
    font-family: var(--body);
    font-size: 0.95rem;
    transition:
        border-color 0.2s,
        color 0.2s;
}
.file-drop:hover {
    border-color: var(--amber);
    color: var(--ink);
}
.file-drop svg {
    color: var(--amber);
    flex: 0 0 auto;
}
.file-drop.dragover {
    border-color: var(--amber);
    background: var(--steel);
}
.file-name {
    font-family: var(--mono);
    font-size: 0.84rem;
    color: var(--amber-soft);
    margin-top: 8px;
    word-break: break-all;
}
.file-hint {
    font-family: var(--mono);
    font-size: 0.8rem;
    color: var(--faint);
    margin-top: 6px;
    letter-spacing: 0.04em;
}

/* =========================== LEGAL MODAL =========================== */
.foot-bottom a.legal-link {
    cursor: pointer;
    text-decoration: none;
}
.foot-bottom a.legal-link:hover {
    color: var(--amber);
}
#legalModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
#legalModal.open {
    display: flex;
}
.legal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 8, 0.78);
    backdrop-filter: blur(3px);
}
.legal-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: 84vh;
    overflow: auto;
    background: var(--steel, #12161a);
    border: 1px solid var(--line);
    border-radius: var(--r, 10px);
    padding: 34px 34px 30px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    animation: legalIn 0.22s ease;
}
@keyframes legalIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
.legal-x {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: 0;
    color: var(--muted);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s;
}
.legal-x:hover {
    color: var(--amber);
}
.legal-dialog h3 {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.45rem;
    color: var(--ink);
    margin: 0 0 6px;
    padding-right: 30px;
}
.legal-body {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}
.legal-body h4 {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    margin: 20px 0 6px;
}
.legal-body p {
    margin: 0 0 12px;
}
.legal-body a {
    color: var(--amber-soft);
}
.legal-body strong {
    color: var(--ink);
}
.legal-body h4:first-child {
    margin-top: 0;
}
.legal-body ul {
    margin: 0 0 12px;
    padding-left: 18px;
}
.legal-body li {
    margin: 4px 0;
}
.legal-updated {
    font-size: 0.82rem;
    color: var(--faint);
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.ck-table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 14px;
    font-size: 0.85rem;
}
.ck-table th,
.ck-table td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.ck-table th {
    color: var(--ink);
    font-weight: 600;
}

/* =========================== COOKIE BANNER =========================== */
#cookieBanner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9998;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
    background: rgba(12, 16, 20, 0.97);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
}
#cookieBanner.show {
    transform: translateY(0);
}
.ck-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 22px;
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.ck-text {
    max-width: 760px;
    font-size: 0.95rem;
    color: var(--muted);
    line-height: 1.55;
}
.ck-text strong {
    display: block;
    color: var(--ink);
    font-family: var(--display);
    font-size: 1rem;
    margin-bottom: 3px;
}
.ck-text .ck-policy {
    display: inline-block;
    margin-top: 6px;
    color: var(--amber-soft);
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
}
.ck-actions {
    display: flex;
    gap: 10px;
    flex: none;
}
.ck-btn {
    font-family: var(--display);
    font-weight: 600;
    font-size: 0.86rem;
    padding: 11px 20px;
    border-radius: 7px;
    cursor: pointer;
    border: 1px solid var(--line);
    transition: 0.2s;
}
.ck-reject {
    background: transparent;
    color: var(--muted);
}
.ck-reject:hover {
    border-color: var(--muted);
    color: var(--ink);
}
.ck-accept {
    background: var(--amber);
    color: #0a0d10;
    border-color: var(--amber);
}
.ck-accept:hover {
    background: var(--amber2);
    border-color: var(--amber2);
}
@media (max-width: 640px) {
    .ck-actions {
        width: 100%;
    }
    .ck-btn {
        flex: 1;
    }
}

/* map consent placeholder */
.map {
    position: relative;
}
.map-consent {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 20px;
    background: var(--steel, #12181e);
    color: var(--muted);
    filter: none;
}
.map-consent p {
    max-width: 340px;
    font-size: 0.9rem;
    line-height: 1.5;
}
.map-consent svg {
    color: var(--amber);
    opacity: 0.85;
}
.map.consented .map-consent {
    display: none;
}

/* ===================== GATE: sfondo immagine + auto-rilevamento ===================== */
#gate {
    overflow: hidden;
}
.gate-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: grayscale(0.28) contrast(1.03);
    transform: scale(1.05);
}
.gate-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(12, 17, 20, 0.8),
        rgba(12, 17, 20, 0.9) 55%,
        rgba(12, 17, 20, 0.96)
    );
}
#gate .gate-inner {
    position: relative;
    z-index: 2;
}

.gate-detect {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 22px;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--amber-soft);
}
.gate-detect[hidden] {
    display: none;
}
.gd-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 162, 104, 0.32);
    border-top-color: var(--amber);
    border-radius: 50%;
    animation: gd-rot 0.8s linear infinite;
}
@keyframes gd-rot {
    to {
        transform: rotate(360deg);
    }
}

/* ===================== PARCO MACCHINE: card cliccabile ===================== */
.mac {
    cursor: pointer;
}
.mac:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
}
.mac-open {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 3;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--ink);
    background: rgba(8, 11, 13, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    pointer-events: none;
    transition:
        background 0.25s,
        border-color 0.25s,
        color 0.25s,
        transform 0.25s;
}
.mac:hover .mac-open,
.mac:focus-visible .mac-open {
    background: var(--amber);
    border-color: var(--amber);
    color: #160a00;
    transform: scale(1.08);
}

/* ===================== MACHINE DETAIL MODAL ===================== */
#macModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
#macModal.open {
    display: flex;
}
.mac-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 8, 0.82);
    backdrop-filter: blur(3px);
}
.mac-dialog {
    position: relative;
    width: min(1120px, 100%);
    height: min(660px, 88vh);
    overflow: hidden;
    background: var(--steel);
    border: 1px solid var(--line);
    border-radius: var(--r);
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.mac-media {
    position: relative;
    background: #0b0f12;
    min-height: 440px;
}
.mac-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(0.1) contrast(1.04);
}
.mac-frame {
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}
.mac-frame::before,
.mac-frame::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--amber);
}
.mac-frame::before {
    top: -1px;
    left: -1px;
    border-right: 0;
    border-bottom: 0;
}
.mac-frame::after {
    bottom: -1px;
    right: -1px;
    border-left: 0;
    border-top: 0;
}
.mac-num {
    position: absolute;
    top: 14px;
    left: 16px;
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(8, 11, 13, 0.55);
    padding: 3px 8px;
    border-radius: 2px;
}
.mac-body {
    padding: 36px 36px 30px;
    display: flex;
    flex-direction: column;
    overflow: auto;
}
.mac-kicker {
    font-family: var(--mono);
    font-size: 0.86rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--amber);
}
.mac-body h3 {
    font-family: var(--display);
    font-weight: 800;
    font-size: 1.75rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 12px 0 16px;
}
.mac-body p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    margin: 0 0 26px;
}
.mac-body .mac-sub {
    color: var(--ink);
    font-size: 1.02rem;
    line-height: 1.5;
    margin: 2px 0 20px;
    font-weight: 500;
    opacity: 0.92;
}
.mac-specs {
    margin: 0 0 26px;
    display: grid;
    grid-template-columns: 42% 1fr;
    border-top: 1px solid var(--line);
}
.mac-specs dt,
.mac-specs dd {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--line);
}
.mac-specs dt {
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 11px 14px 11px 0;
}
.mac-specs dd {
    margin: 0;
    color: var(--ink);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.45;
    padding: 11px 0;
}
.mac-x {
    position: absolute;
    top: 12px;
    right: 14px;
    z-index: 4;
    background: rgba(8, 11, 13, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--ink);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        transform 0.25s,
        border-color 0.25s,
        color 0.25s;
}
.mac-x:hover {
    border-color: var(--amber);
    color: var(--amber);
    transform: rotate(90deg);
}
@media (max-width: 760px) {
    #macModal {
        padding: 14px;
    }
    .mac-dialog {
        display: flex;
        flex-direction: column;
        height: min(700px, 92vh);
    }
    .mac-media {
        flex: 0 0 auto;
        min-height: 230px;
        aspect-ratio: 16/10;
    }
    .mac-body {
        flex: 1 1 auto;
        overflow: auto;
        padding: 22px 22px 18px;
        -webkit-overflow-scrolling: touch;
    }
    .mac-body h3 {
        font-size: 1.42rem;
    }
    .mac-specs {
        grid-template-columns: 46% 1fr;
        margin-bottom: 18px;
    }
}

/* frecce di navigazione tra le macchine (sovrapposte alla foto) */
.mac-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(8, 11, 13, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--ink);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 4px;
    transition:
        background 0.2s,
        border-color 0.2s,
        color 0.2s;
}
.mac-nav:hover {
    background: var(--amber);
    border-color: var(--amber);
    color: #160a00;
}
.mac-prev {
    left: 14px;
}
.mac-next {
    right: 14px;
}
.mac-count {
    margin-top: auto;
    padding-top: 16px;
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.14em;
    color: var(--faint);
}
@media (max-width: 760px) {
    .mac-nav {
        width: 40px;
        height: 40px;
    }
    .mac-prev {
        left: 10px;
    }
    .mac-next {
        right: 10px;
    }
}

/* chip "e molti altri" */
.sector-more {
    border-style: dashed;
    color: var(--faint);
}
.sector-more::before {
    background: var(--faint);
}

/* =========================== PRODOTTI =========================== */
.products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.prod {
    position: relative;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: var(--r);
    overflow: hidden;
    background: var(--steel);
}
.prod img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 4/3;
    transition:
        transform 0.6s,
        filter 0.6s;
    filter: saturate(1.02) contrast(1.03);
}
.prod:hover img {
    transform: scale(1.05);
}
.prod figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 34px 18px 14px;
    pointer-events: none;
    font-family: var(--mono);
    font-size: 0.84rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink);
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(8, 11, 13, 0.88) 100%
    );
}
.prod-wide {
    grid-column: span 2;
}
.prod-wide img {
    aspect-ratio: auto;
}
@media (max-width: 1080px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
    }
    .prod-wide {
        grid-column: span 2;
    }
}
@media (max-width: 620px) {
    .products {
        grid-template-columns: 1fr;
    }
    .prod-wide {
        grid-column: auto;
    }
}

/* =========================== LIGHTBOX PRODOTTI ===========================
   Solo le foto della sezione "Alcune delle nostre lavorazioni" si aprono
   a schermo intero (in home resta tutto senza zoom, come richiesto). */
img.zoomable {
    cursor: zoom-in;
}
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 11, 13, 0.94);
    padding: 28px;
    opacity: 0;
    transition: opacity 0.25s;
}
#lightbox.open {
    display: flex;
    opacity: 1;
}
#lightbox img {
    max-width: 94vw;
    max-height: 90vh;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    cursor: default;
}
#lightbox .lb-close {
    position: absolute;
    top: 18px;
    right: 22px;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--steel);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
#lightbox .lb-close:hover {
    border-color: var(--amber);
    color: var(--amber);
    transform: rotate(90deg);
}
@media (max-width: 620px) {
    #lightbox {
        padding: 12px;
    }
    #lightbox .lb-close {
        top: 12px;
        right: 14px;
    }
}

/* logo LinkedIn cliccabile nei contatti (unico punto social del sito) */
.social-row {
    align-items: center;
}
.social-row .k {
    margin-bottom: 0;
}
.ic-link {
    display: inline-flex;
    transition:
        color 0.2s,
        transform 0.2s;
}
.ic-link:hover {
    color: var(--amber-soft);
    transform: translateY(-2px);
}
.cf-turnstile {
    display: flex;
    justify-content: center;
}
