/* =====================================================================
   Bancolab — Homepage
   Tema chiaro allineato a OraZero / Reputo (palette Bancomail).
   Blocchi:
   1. Token (design system)   5. Hero + banco strumenti
   2. Reset & base            6. Prodotti
   3. Layout & utility        7. Valori
   4. Nav                     8. Origine / 9. CTA / 10. Footer
                              11. Responsive  12. Reduced motion
   ===================================================================== */

/* ============================ 1. TOKEN ============================ */
:root {
  /* Colore — palette condivisa con OraZero / Reputo / Bancomail */
  --ink: #333233;        /* testo principale */
  --paper: #f4f6f9;      /* sfondo pagina */
  --veil: #edf5ff;       /* velo azzurro in alto, stile bancomail */
  --accent: #1697fd;     /* blu: link, brand, icone */
  --accent-light: #4aabfd;
  --cta: #ff7101;        /* arancio: bottoni primari, accenti */
  --mint: #25baa5;       /* teal: stati "ok" / successo */

  /* Neutri derivati dall'ink */
  --ink-70: rgba(51, 50, 51, .70);
  --ink-55: rgba(51, 50, 51, .55);
  --ink-15: rgba(51, 50, 51, .15);
  --ink-10: rgba(51, 50, 51, .10);

  --surface: #ffffff;
  --surface-70: rgba(255, 255, 255, .70);
  --footer-bg: #eef1f6;

  /* Tipografia — Raleway su tutta la pagina */
  --font-display: "Raleway", ui-sans-serif, system-ui, sans-serif;
  --font-ui: "Raleway", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Raggi — angoli a pillola per bottoni/badge */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 9999px;

  /* Ombre tenui (colorate sotto le CTA) */
  --e1: 0 1px 2px rgba(51, 50, 51, .06);
  --e2: 0 10px 30px rgba(51, 50, 51, .08);
  --e-cta: 0 6px 18px rgba(255, 113, 1, .30);
  --e-accent: 0 22px 54px rgba(22, 151, 253, .20);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(20px, 5vw, 32px);
  --section-py: clamp(72px, 10vw, 160px);
}

/* ============================ 2. RESET & BASE ============================ */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* Velo azzurro che sfuma dall'alto, stile bancomail */
  background-image: linear-gradient(180deg, var(--veil) 0%, rgba(237, 245, 255, 0) 460px);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(22, 151, 253, .18); }

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

a { color: inherit; }

/* Titoli: extrabold con tracking stretto (stile OraZero) */
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.02em;
}

p { margin: 0; }

ul { margin: 0; padding: 0; }

/* Ancore: offset per la nav sticky */
[id] { scroll-margin-top: 88px; }

/* Focus visibile coerente */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  border-radius: var(--r-md);
  box-shadow: var(--e2);
  transition: top .2s;
}
.skip-link:focus { top: 16px; }

/* ============================ 3. LAYOUT & UTILITY ============================ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-py);
}
/* Il contenuto sta sopra ai blob decorativi */
.section > .container { position: relative; z-index: 1; }

/* Fasce: la pagina è chiara, alterniamo paper (trasparente) e superficie bianca */
.section--surface { background: var(--surface); }
.section--paper { background: transparent; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.lead {
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ink-70);
}

.section__head {
  max-width: 640px;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section__title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
}
.section__lead { margin-top: 16px; }

/* Wordmark: accento blu sul suffisso (Banco·lab, Ora·Zero) */
.wm-accent { color: var(--accent); }

/* Blob colorati sfocati (decorativi, tenui su chiaro) */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
.blob--blue {
  width: 540px; height: 540px;
  top: -160px; left: -140px;
  background: var(--accent);
  opacity: .14;
}
.blob--amber {
  width: 440px; height: 440px;
  bottom: -180px; right: -100px;
  background: var(--cta);
  opacity: .10;
}

/* Rivelazione allo scroll (solo con JS attivo) */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ============================ Bottoni (a pillola) ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-ui);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  line-height: 1;
  padding: .95em 1.5em;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s, color .2s, border-color .2s, opacity .2s;
}
.btn__arrow { transition: transform .2s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* CTA primaria: arancio con ombra colorata */
.btn--primary { background: var(--cta); color: #fff; box-shadow: var(--e-cta); }
.btn--primary:hover { transform: translateY(-1px); opacity: .92; box-shadow: 0 10px 24px rgba(255, 113, 1, .38); }

/* Secondaria: outline su superficie chiara */
.btn--outline {
  background: var(--surface-70);
  border-color: var(--ink-15);
  color: var(--ink-70);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent); }

/* Invertita: usata dentro la card CTA a gradiente */
.btn--invert { background: #fff; color: var(--accent); }
.btn--invert:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(0, 0, 0, .18); }

.btn--lg { padding: 1.05em 1.8em; font-size: .85rem; }
.btn--sm { padding: .7em 1.2em; font-size: .72rem; letter-spacing: .12em; }

/* ============================ 4. NAV ============================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background .3s, backdrop-filter .3s, border-color .3s;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, .80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--ink-10);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
}
.brand__mark { flex: none; }
.brand__liquid {
  fill: rgba(255, 113, 1, .9);
  opacity: .82;
  transform-origin: 50% 100%;
  transform-box: fill-box;
  transform: scaleY(0);
  animation: brand-fill 2.5s ease-in-out .5s forwards;
}
.brand__mark circle:last-of-type {
  animation: brand-orbit 3.2s ease-in-out infinite alternate;
  transform-origin: center center;
  transform-box: fill-box;
}
@keyframes brand-fill {
  from {
    transform: scaleY(0);
    opacity: .7;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}
@keyframes brand-orbit {
  from { transform: translate(0, 0); }
  to { transform: translate(1px, -1px); }
}
.brand__accent { color: var(--accent); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.4vw, 36px);
}
.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
}
.nav__links a {
  text-decoration: none;
  color: var(--ink-55);
  font-size: 15px;
  font-weight: 600;
  transition: color .2s;
}
.nav__links a:hover { color: var(--accent); }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0;
  background: var(--surface-70);
  border: 1px solid var(--ink-15);
  border-radius: var(--r-md);
  cursor: pointer;
}
.nav__toggle-bar {
  width: 18px; height: 2px;
  margin-inline: auto;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav.is-open .nav__toggle-bar:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.nav.is-open .nav__toggle-bar:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ============================ 5. HERO ============================ */
.hero { padding-top: clamp(48px, 7vw, 96px); overflow: hidden; }
.hero__grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
.hero__title {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.03;
  letter-spacing: -.03em;
  margin-bottom: 22px;
}
/* Keyword con "arco di conversione": underline a gradiente blu→arancio */
.hero__kw {
  background-image: linear-gradient(90deg, var(--accent), var(--cta));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% .1em;
  padding-bottom: .04em;
}
.hero__lead { max-width: 30ch; margin-bottom: 36px; }

/* Sequenza di entrata hero (solo CSS, attiva quando si rileva il JS) */
.js .hero__content > * { animation: rise .7s ease backwards; }
.js .hero__content > *:nth-child(2) { animation-delay: .08s; }
.js .hero__content > *:nth-child(3) { animation-delay: .16s; }
.js .hero__content > *:nth-child(4) { animation-delay: .24s; }
.js .hero__kw { animation: drawline .8s ease .5s backwards; }
.js .hero__bench .tool { animation: rise .7s ease backwards; }
.js .tool--orazero { animation-delay: .30s; }
.js .tool--reputo { animation-delay: .40s; }
.js .tool--soon { animation-delay: .50s; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes drawline { from { background-size: 0% .1em; } to { background-size: 100% .1em; } }

/* "Powered by Bancomail" — firma discreta in basso a destra dell'hero */
.hero__powered-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  margin-top: clamp(36px, 5vw, 60px);
}
.hero__powered {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  opacity: .6;
  transition: opacity .2s ease;
}
.hero__powered:hover,
.hero__powered:focus-visible { opacity: 1; }
.hero__powered-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-55);
}
.hero__powered-logo { height: 20px; width: auto; }

/* Banco strumenti: anteprime "vive" dei prodotti */
.hero__bench { position: relative; }
.tool {
  background: var(--surface-70);
  border: 1px solid var(--ink-15);
  border-radius: var(--r-lg);
  padding: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--e2);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.tool:hover {
  transform: translateY(-6px);
  border-color: rgba(22, 151, 253, .55);
  box-shadow: var(--e-accent);
}
.tool__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tool__brand { display: inline-flex; align-items: center; gap: 8px; }
.tool__name { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.tool__cap {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-55);
}
.tool--soon { opacity: .7; }

.countdown { margin: 0; }
.countdown__time {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(28px, 4vw, 36px);
  font-feature-settings: "tnum";
  letter-spacing: .01em;
  color: var(--ink);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .3em .7em;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge--live { color: var(--cta); background: rgba(255, 113, 1, .12); border: 1px solid rgba(255, 113, 1, .35); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cta); animation: pulse 1.8s ease-in-out infinite; }
.badge--ok { color: var(--mint); background: rgba(37, 186, 165, .14); border: 1px solid rgba(37, 186, 165, .35); }
.badge__check { font-weight: 700; }
.badge--soon { color: var(--ink-55); background: var(--ink-10); border: 1px solid var(--ink-15); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* Stato di deliverability (Reputo) */
.status { list-style: none; margin: 2px 0 0; display: grid; gap: 9px; }
.status__row { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink); }
.status__check {
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(37, 186, 165, .18);
  color: var(--mint);
  font-size: 10px; font-weight: 700;
}
.status__val { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--ink-55); }

/* ============================ 6. PRODOTTI ============================ */
.products__grid {
  display: grid;
  gap: clamp(20px, 3vw, 28px);
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--ink-15);
  border-radius: var(--r-xl);
  padding: clamp(24px, 3vw, 36px);
  box-shadow: var(--e1);
}
.product {
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.product:not(.product--soon):hover {
  transform: translateY(-4px);
  box-shadow: var(--e-accent);
  border-color: rgba(22, 151, 253, .35);
}
/* Logo di prodotto (mark OraZero / Reputo) */
.product__logo { display: block; margin-bottom: 20px; }
.product__title { font-size: clamp(20px, 2.4vw, 24px); }
.product__sub { margin-top: 8px; color: var(--ink-70); }

/* Icona generica (usata solo dalla card "coming soon") */
.product__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  color: var(--ink-55);
  background: var(--ink-10);
}

.feature-list {
  list-style: none;
  margin: 22px 0 28px;
  display: grid;
  gap: 10px;
}
.feature-list li {
  position: relative;
  padding-left: 26px;
  font-size: 15px;
  color: var(--ink-70);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .35em;
  width: 12px; height: 12px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--cta));
}
.product .btn { align-self: flex-start; margin-top: auto; }

/* Card "Coming soon": riga piena, tratteggiata, non interattiva */
.product--soon {
  flex-direction: row;
  align-items: center;
  gap: 20px;
  background: transparent;
  border-style: dashed;
  box-shadow: none;
}
.product--soon .product__icon { margin-bottom: 0; flex: none; }
.product__soon-text { flex: 1; }
.product--soon .product__title { font-size: 18px; }

/* ============================ 7. VALORI ============================ */
.values__grid {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  grid-template-columns: 1fr;
}
.value { padding: 4px; }
.value__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  color: var(--accent);
  background: rgba(22, 151, 253, .10);
  margin-bottom: 18px;
}
.value__title { font-size: 20px; }
.value__text { margin-top: 8px; color: var(--ink-70); max-width: 30ch; }

/* ============================ 8. ORIGINE ============================ */
.origin { overflow: hidden; }
.blob--origin { top: auto; bottom: -200px; left: 30%; opacity: .12; }
.origin__grid {
  display: grid;
  gap: clamp(44px, 6vw, 72px);
}
.origin__intro { max-width: 620px; }
.origin__intro .lead { margin-top: 16px; }

.stats {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
  grid-template-columns: 1fr;
  margin: 0;
}
.stat { padding-top: 24px; border-top: 1px solid var(--ink-10); }
.stat__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  font-feature-settings: "tnum";
  letter-spacing: -.02em;
}
.stat__unit { color: var(--cta); }
.stat__label {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .04em;
  color: var(--ink-55);
}

/* ============================ 9. CTA FINALE ============================ */
.cta { overflow: hidden; }
.cta__card {
  position: relative;
  overflow: hidden;
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
  padding: clamp(40px, 6vw, 76px);
  border-radius: var(--r-xl);
  background: linear-gradient(125deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: var(--e-accent);
}
.cta__title { font-size: clamp(28px, 4vw, 44px); }
.cta__lead { margin: 16px auto 32px; font-size: clamp(16px, 1.6vw, 19px); color: rgba(255, 255, 255, .9); }

/* ============================ 10. FOOTER ============================ */
.footer {
  background: var(--footer-bg);
  color: var(--ink-55);
  border-top: 1px solid var(--ink-10);
  padding-block: clamp(48px, 6vw, 80px) 32px;
}
.footer__grid {
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--ink-10);
}
.footer__brand .brand { margin-bottom: 14px; }
.footer__tag { max-width: 34ch; font-size: 14px; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__title {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 600;
  margin: 0 0 4px;
}
.footer__col a { text-decoration: none; font-size: 15px; color: var(--ink-55); transition: color .2s; }
.footer__col a:hover { color: var(--accent); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding-top: 28px;
  font-size: 13px;
}
.footer__heritage { font-family: var(--font-mono); letter-spacing: .03em; }

/* ============================ 11. RESPONSIVE ============================ */

/* Hero a due colonne + banco strumenti flottante (desktop) */
@media (min-width: 1200px) {
  .hero__grid { grid-template-columns: 1.05fr .95fr; }
  .hero__bench { min-height: 400px; }
  .tool { position: absolute; }
  .tool--orazero { top: 0; right: 16px; width: 270px; z-index: 3; }
  .tool--reputo { top: 176px; left: 0; width: 240px; z-index: 2; }
  .tool--soon { bottom: 0; right: 80px; width: 210px; z-index: 1; }
}

/* Tablet e sotto: banco strumenti in flusso normale */
@media (max-width: 1199px) {
  .hero__bench { display: flex; flex-wrap: wrap; gap: 16px; }
  .tool { position: static; flex: 1 1 220px; }
}

@media (min-width: 768px) {
  .products__grid { grid-template-columns: 1fr 1fr; }
  .product--soon { grid-column: 1 / -1; }
  .values__grid { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .stat { border-top: none; padding-top: 0; }
  .footer__grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

@media (min-width: 1024px) {
  .origin__grid { grid-template-columns: 1.1fr 1fr; align-items: center; }
}

/* Mobile: nav a menu, layout a colonna singola */
@media (max-width: 767px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 18px var(--gutter) 24px;
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--ink-10);
    box-shadow: var(--e2);
  }
  .nav.is-open .nav__menu { display: flex; }
  .nav__links { flex-direction: column; align-items: flex-start; gap: 14px; }
  .nav__menu .btn { justify-content: center; }

  .product--soon { flex-direction: column; align-items: flex-start; }
  .hero__cta .btn { width: 100%; justify-content: center; }
}

@media (max-width: 480px) {
  /* Nel banco strumenti resta in evidenza il countdown (elemento signature) */
  .tool--orazero { flex-basis: 100%; }
  .footer__bottom { flex-direction: column; }
}

/* ============================ 12. REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .hero__kw { background-size: 100% .1em !important; }
  .blob { animation: none !important; }
}
