/* =========================================================
   Federico Caruso — Technology & Growth Partner
   Direzione: "Misurato, non dichiarato."
   Strumento di misura / libro mastro: promessa (display)
   in tensione con prova (dati mono), risolta in un verdetto.
   Tutte le variabili sono in :root.
   ========================================================= */

:root {
  /* --- Palette "ledger" --- */
  --paper:        #F4F5F1;   /* carta fredda (ground) */
  --paper-card:   #FFFFFF;   /* card che staccano sul ground */
  --paper-alt:    #EAECE4;   /* sezioni alternate */
  --ink:          #0C1A14;   /* inchiostro verde-nero (primario) */
  --ink-2:        #39473F;   /* testo secondario */
  --muted:        #5E6C63;   /* didascalie (contrasto ok) */
  --line:         #D6DAD0;   /* hairline */
  --line-2:       #C2C8BA;   /* hairline marcata */

  --signal:       #0F8A52;   /* VERDETTO: sì / dopo / risparmio */
  --signal-d:     #0B6B40;   /* verde scuro (testo/hover, contrasto) */
  --signal-wash:  rgba(15,138,82,.10);
  --alarm:        #B23A2E;   /* prima / no */
  --alarm-wash:   rgba(178,58,46,.07);

  /* --- Misure --- */
  --maxw:         1140px;
  --maxw-narrow:  760px;
  --radius:       6px;       /* crisp, "strumento" — non pill */
  --radius-sm:    4px;
  --gap:          clamp(1.5rem, 4vw, 3rem);

  /* --- Type --- */
  --f-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --f-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* --------------------------- Reset --------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--f-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--signal); color: #fff; }

/* Focus visibile (quality floor) */
:focus-visible {
  outline: 2px solid var(--signal-d);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --------------------------- Utility --------------------------- */
.accent { color: var(--signal-d); }
.neg { color: var(--alarm); }

.mono {
  font-family: var(--f-mono);
  font-feature-settings: "tnum" 1;   /* cifre tabulari */
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(1.2rem, 5vw, 2rem);
}
.container--narrow { max-width: var(--maxw-narrow); }

/* Etichetta-strumento (eyebrow mono) */
.eyebrow {
  font-family: var(--f-mono);
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--signal-d);
}
.eyebrow::before { content: "// "; color: var(--line-2); }

/* --------------------------- Buttons --------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1;
  padding: .95rem 1.55rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .14s ease, background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

/* Primario = inchiostro (l'operatore deciso). Verde resta un segnale. */
.btn--primary { background: var(--ink); color: var(--paper); }
.btn--primary:hover { background: #000; box-shadow: 0 6px 22px rgba(12,26,20,.18); }
.btn--primary .arr { transition: transform .18s ease; }
.btn--primary:hover .arr { transform: translateX(3px); }

/* "Dark" allineato al primario per coerenza d'azione */
.btn--dark { background: var(--ink); color: var(--paper); }
.btn--dark:hover { background: #000; box-shadow: 0 6px 22px rgba(12,26,20,.18); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(12,26,20,.03); }

.btn--small { padding: .55rem 1rem; font-size: .9rem; }
.btn--lg { padding: 1.1rem 2rem; font-size: 1.08rem; }
.btn--block { width: 100%; margin-top: auto; }

/* --------------------------- Nav --------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav__logo {
  font-family: var(--f-display);
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 1.08rem;
}
.nav__logo::before {
  content: "";
  display: inline-block;
  width: 9px; height: 9px;
  margin-right: .5rem;
  border-radius: 2px;
  background: var(--signal);
  transform: translateY(-1px);
}
.nav__links { display: flex; align-items: center; gap: 1.7rem; }
.nav__links a:not(.btn) {
  color: var(--ink-2);
  font-weight: 500;
  font-size: .92rem;
}
.nav__links a:not(.btn):hover { color: var(--ink); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .22s ease, opacity .18s ease;
}
/* Hamburger -> X quando aperto */
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------- Hero --------------------------- */
.hero {
  position: relative;
  padding: clamp(3.5rem, 9vw, 6.5rem) 0 clamp(3rem, 7vw, 5rem);
  text-align: center;
  overflow: hidden;
}
/* Righello/baseline: motivo "misura" sottile in fondo all'hero */
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 14px;
  background:
    linear-gradient(var(--line-2), var(--line-2)) bottom/100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line-2) 0 1px, transparent 1px 28px) bottom/100% 8px no-repeat;
  opacity: .6;
}
.hero__eyebrow {
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .76rem;
  font-weight: 500;
  color: var(--signal-d);
  margin-bottom: 1.4rem;
}
.hero__eyebrow::before { content: "// "; color: var(--line-2); }
.hero__title {
  font-family: var(--f-display);
  font-size: clamp(2.3rem, 6.1vw, 4rem);
  line-height: 1.04;
  letter-spacing: -.02em;
  font-weight: 700;
  margin-inline: auto;
  max-width: 17ch;
}
.hero__title .accent { color: var(--signal-d); }
.hero__sub {
  margin: 1.7rem auto 0;
  max-width: 58ch;
  font-size: clamp(1.05rem, 2.3vw, 1.22rem);
  color: var(--ink-2);
}
.hero__sub strong { color: var(--ink); font-weight: 600; box-shadow: inset 0 -.5em 0 var(--signal-wash); }
.hero__cta {
  display: flex;
  gap: .9rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.1rem;
}

/* Emblema del modello — SIGNATURE */
.emblem {
  margin: 2.4rem auto 0;
  max-width: 480px;
  text-align: left;
  background: var(--paper-card);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 var(--line);
  font-family: var(--f-mono);
  overflow: hidden;
}
.emblem__tag {
  display: block;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .55rem .9rem;
  border-bottom: 1px dashed var(--line-2);
  background: var(--paper);
}
.emblem__row {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem .9rem;
  font-size: clamp(.82rem, 2.4vw, .95rem);
}
.emblem__row + .emblem__row { border-top: 1px solid var(--line); }
.emblem__cond { color: var(--ink-2); }
.emblem__arr { color: var(--line-2); font-weight: 600; }
.emblem__out { color: var(--ink); margin-left: auto; font-weight: 600; }
.emblem__out--pos { color: var(--signal-d); }
.hero__trust {
  margin-top: 1.6rem;
  font-family: var(--f-mono);
  font-size: .82rem;
  color: var(--muted);
}
.hero__trust strong { color: var(--ink-2); font-weight: 600; }

/* --------------------------- Sections --------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--alt { background: var(--paper-alt); }
.section__title {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 700;
  text-align: center;
}
.section__lead {
  text-align: center;
  color: var(--muted);
  max-width: 64ch;
  margin: 1rem auto 0;
}
.section--alt .section__lead { color: var(--ink-2); }

/* Lead del metodo come "flusso" mono */
#metodo .section__lead {
  font-family: var(--f-mono);
  font-size: clamp(.82rem, 2.2vw, .95rem);
  letter-spacing: .01em;
  color: var(--ink-2);
}

/* --------------------------- Value cards --------------------------- */
.cards-2 {
  display: grid;
  gap: var(--gap);
  margin-top: 3rem;
}
.vcard {
  display: flex;
  flex-direction: column;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.6rem, 4vw, 2.4rem);
  box-shadow: 0 1px 2px rgba(12,26,20,.04);
  position: relative;
}
/* filo segnale in alto = "questo è il percorso a risparmio" */
.vcard::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--signal);
}
.vcard:nth-child(2)::before { background: var(--ink); }  /* startup = partnership */
.vcard__tag {
  align-self: flex-start;
  font-family: var(--f-mono);
  font-size: .72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--signal-d);
  background: var(--signal-wash);
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
}
.vcard__tag--alt { color: var(--ink); background: #e6e9e1; }
.vcard__title {
  font-family: var(--f-display);
  font-size: 1.42rem;
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: 1.1rem 0 1.1rem;
}
.vcard__list { list-style: none; display: grid; gap: .65rem; }
.vcard__list li { position: relative; padding-left: 1.5rem; color: var(--ink-2); }
.vcard__list li::before {
  content: "?"; position: absolute; left: 0;
  font-family: var(--f-mono); color: var(--signal); font-weight: 600;
}
.vcard__how {
  margin: 1.7rem 0 .9rem;
  font-family: var(--f-mono);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted);
}
.vcard__how::before { content: "— "; color: var(--line-2); }
.vcard__steps { list-style: none; counter-reset: step; display: grid; gap: .7rem; margin-bottom: 1.9rem; }
.vcard__steps li { position: relative; padding-left: 2rem; color: var(--ink-2); }
.vcard__steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: .05em;
  font-family: var(--f-mono); font-size: .72rem; font-weight: 600;
  width: 1.35rem; height: 1.35rem;
  display: grid; place-items: center;
  color: var(--ink); background: var(--paper-alt);
  border-radius: var(--radius-sm);
}
.vcard__steps strong { color: var(--signal-d); }
.vcard__steps em { color: var(--muted); font-style: normal; font-family: var(--f-mono); font-size: .82em; }

/* --------------------------- Method --------------------------- */
.method {
  list-style: none;
  max-width: 760px;
  margin: 3rem auto 0;
}
.method__step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1.3rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
.method__step:first-child { border-top: 0; }
.method__num {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-weight: 600;
  font-size: 1rem;
}
.method__body h3 {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.18rem;
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
}
.method__time {
  font-family: var(--f-mono);
  font-size: .68rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em;
  color: var(--signal-d); background: var(--signal-wash);
  padding: .22rem .55rem; border-radius: var(--radius-sm);
}
.method__body p { color: var(--ink-2); margin-top: .45rem; }
.method__out {
  font-size: .95rem;
  border-left: 2px solid var(--line-2);
  padding-left: .8rem;
}
.method__out strong { font-family: var(--f-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.method__out .accent { color: var(--signal-d); }
.method__out .neg { color: var(--alarm); }

/* --------------------------- Tabs / cases --------------------------- */
.tabs {
  display: inline-flex;
  gap: .25rem;
  margin: 2.6rem auto 2rem;
  padding: .25rem;
  background: var(--paper-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.section .tabs { display: flex; justify-content: center; flex-wrap: wrap; width: max-content; max-width: 100%; margin-inline: auto; }
.tab {
  font-family: var(--f-mono);
  font-weight: 500;
  font-size: .88rem;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  padding: .55rem 1.05rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { background: var(--ink); color: var(--paper); }

.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.case {
  display: grid;
  gap: var(--gap);
  align-items: start;
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}
.case__h {
  font-family: var(--f-mono);
  font-size: .74rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin: 1.4rem 0 .7rem;
}
.case__h:first-child { margin-top: 0; }
.case__col ul { list-style: none; display: grid; gap: .55rem; }
.case__col ul li { position: relative; padding-left: 1.4rem; color: var(--ink-2); }
.case__col ul li::before { content: "›"; position: absolute; left: 0; color: var(--signal); font-weight: 700; font-family: var(--f-mono); }

/* Tabella = libro mastro prima/dopo (la prova) */
.case__table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.case__table th, .case__table td { text-align: left; padding: .72rem .55rem; border-bottom: 1px solid var(--line); }
.case__table thead th {
  font-family: var(--f-mono);
  font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 500;
}
.case__table thead th:nth-child(2), .case__table thead th:nth-child(3) { text-align: right; }
.case__table td:nth-child(2), .case__table td:nth-child(3) { text-align: right; font-family: var(--f-mono); font-feature-settings: "tnum" 1; }
.case__table td:nth-child(2) { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.case__table td.g { color: var(--signal-d); font-weight: 600; }
.case__table tbody tr:last-child td { border-bottom: 0; }

.case__model {
  margin-top: 1.3rem;
  padding: .9rem 1rem;
  background: var(--signal-wash);
  border-radius: var(--radius-sm);
  font-family: var(--f-mono);
  font-size: .86rem; color: var(--ink-2); line-height: 1.8;
}
.case__model strong { color: var(--signal-d); }
.case__note {
  margin-top: .9rem; font-size: .9rem; font-style: italic;
  color: var(--muted); border-left: 2px solid var(--signal); padding-left: .9rem;
}

/* --------------------------- FAQ --------------------------- */
.faq { margin-top: 2.5rem; display: grid; gap: .6rem; }
.faq__item {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 1.3rem;
  transition: border-color .18s;
}
.faq__item[open] { border-color: var(--line-2); }
.faq__item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  padding: 1.1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-family: var(--f-mono);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--signal);
  transition: transform .22s;
  flex: none;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item p { padding: 0 0 1.2rem; color: var(--ink-2); }

/* --------------------------- CTA finale --------------------------- */
.cta {
  background: var(--ink);
  color: var(--paper);
  text-align: center;
  padding: clamp(3.5rem, 8vw, 6rem) 0;
  position: relative;
}
.cta::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--signal);
}
.cta__title {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700; letter-spacing: -.02em;
}
.cta__text { max-width: 54ch; margin: 1.2rem auto 2.2rem; color: #c2cbc4; font-size: 1.08rem; }
/* Unico momento da protagonista del verde: la conversione */
.cta .btn--primary { background: var(--signal-d); color: #fff; border-color: var(--signal-d); }
.cta .btn--primary:hover { background: var(--signal); box-shadow: 0 8px 26px rgba(15,138,82,.35); }

/* --------------------------- Footer --------------------------- */
.footer { padding: 2.5rem 0; border-top: 1px solid var(--line); }
.footer__inner { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.footer__name { font-family: var(--f-display); font-weight: 600; }
.footer__role { color: var(--muted); font-size: .9rem; font-family: var(--f-mono); }
.footer__meta { display: flex; gap: 1.4rem; flex-wrap: wrap; align-items: center; font-size: .9rem; color: var(--muted); }
.footer__meta a { font-family: var(--f-mono); }
.footer__meta a:hover { color: var(--ink); }

/* =========================================================
   Desktop (≥ 760px)
   ========================================================= */
@media (min-width: 760px) {
  .cards-2 { grid-template-columns: 1fr 1fr; }
  .case { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   Hero: stagger d'ingresso (un solo momento orchestrato)
   ========================================================= */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .container > * { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.hero .container > *:nth-child(1) { animation-delay: .02s; }
.hero .container > *:nth-child(2) { animation-delay: .10s; }
.hero .container > *:nth-child(3) { animation-delay: .18s; }
.hero .container > *:nth-child(4) { animation-delay: .26s; }
.hero .container > *:nth-child(5) { animation-delay: .34s; }
.hero .container > *:nth-child(6) { animation-delay: .42s; }

/* =========================================================
   Mobile nav (≤ 720px)
   ========================================================= */
@media (max-width: 720px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.2rem 1.2rem;
    transform: translateY(-120%);
    transition: transform .25s ease;
    box-shadow: 0 16px 30px rgba(12,26,20,.10);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a:not(.btn) { padding: .9rem 0; border-bottom: 1px solid var(--line); }
  .nav__links .btn { margin-top: .8rem; }
}

/* =========================================================
   Reduced motion: niente animazioni, contenuto sempre visibile
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
