/* ci pensa lui — componenti del design system come classi CSS.
   Ricostruzione fedele delle primitive React del bundle
   (Logo, Button, Badge, Bubble, ModulePill, Card). Carica DOPO styles.css. */

/* ---------- Logo (bolla + wordmark) ---------- */
.logo {
  position: relative; display: inline-block;
  padding: 0.46em 0.74em 0.5em; border-radius: var(--radius-bubble);
  background: var(--oliva); color: var(--carta);
  font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1;
  letter-spacing: var(--tracking-title); text-transform: lowercase; white-space: nowrap;
}
.logo--fill { box-shadow: var(--shadow-bubble); }
.logo--dark { box-shadow: none; }
.logo .emph { color: var(--oliva-chiara); }
.logo::after {
  content: ""; position: absolute; left: 0.6em; bottom: -0.3em;
  width: 0.74em; height: 0.5em; background: var(--oliva);
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

/* ---------- Button ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-weight: 600;
  line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  border-radius: var(--radius-md); font-size: var(--text-base); padding: 10px 20px;
  border: 1.5px solid transparent;
  transition: background var(--dur-base) var(--ease-soft), transform var(--dur-fast) var(--ease-soft);
}
.btn:active { transform: translateY(1px); }
.btn--sm { font-size: var(--text-sm); padding: 7px 14px; border-radius: var(--radius-sm); }
.btn--md { font-size: var(--text-base); padding: 10px 20px; border-radius: var(--radius-md); }
.btn--lg { font-size: var(--text-md); padding: 13px 26px; border-radius: var(--radius-md); }
.btn--primary { background: var(--oliva); color: var(--carta); border-color: transparent; }
.btn--primary:hover { background: var(--oliva-700); }
.btn--secondary { background: var(--carta-pura); color: var(--inchiostro); border-color: var(--carta-bordo); }
.btn--secondary:hover { background: var(--carta-ombra); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-body); font-weight: 600; font-size: var(--text-xs); line-height: 1;
  padding: 5px 10px; border-radius: var(--radius-pill); text-transform: lowercase;
}
.badge--oliva { background: var(--oliva-100); color: var(--oliva-800); }
.badge--terracotta { background: var(--terracotta-100); color: var(--terracotta-700); }
.badge--neutral { background: var(--carta-ombra); color: var(--inchiostro-70); }

/* ---------- ModulePill ---------- */
.pill {
  display: inline-block; font-family: var(--font-display); font-weight: 600;
  text-transform: lowercase; letter-spacing: var(--tracking-title);
  border-radius: var(--radius-pill); border: 1.5px solid var(--terracotta);
  background: transparent; color: var(--terracotta);
  font-size: var(--text-md); padding: 8px 20px;
  transition: background var(--dur-base) var(--ease-soft), color var(--dur-base) var(--ease-soft);
}
.pill--sm { font-size: var(--text-sm); padding: 5px 14px; }
.pill--active { background: var(--terracotta); color: var(--carta); box-shadow: var(--shadow-sm); }

/* ---------- Card ---------- */
.card {
  border-radius: var(--radius-lg); font-family: var(--font-body); padding: var(--space-5);
}
.card--pad-sm { padding: var(--space-4); }
.card--pad-md { padding: var(--space-5); }
.card--pad-lg { padding: var(--space-6); }
.card--light { background: var(--carta-pura); color: var(--inchiostro); border: 1px solid var(--border-soft); box-shadow: var(--shadow-md); }
.card--sunken { background: var(--carta-ombra); color: var(--inchiostro); border: 1px solid var(--border-soft); box-shadow: none; }
.card--dark { background: var(--scuro-soft); color: var(--carta); border: 1px solid var(--border-on-dark); box-shadow: var(--shadow-lg); }

/* ---------- Bubble (chat) ---------- */
.bubble {
  position: relative; display: inline-block; max-width: min(90%, 460px);
  padding: 11px 15px; border-radius: var(--radius-bubble); border-bottom-left-radius: 6px;
  font-family: var(--font-body); font-size: var(--text-base); line-height: var(--leading-normal);
  box-shadow: var(--shadow-sm);
}
.bubble--carta { background: var(--carta-pura); color: var(--inchiostro); border: 1px solid var(--border-soft); }
.bubble--oliva { background: var(--oliva); color: var(--carta); border: none; }
.bubble__dots { display: inline-flex; gap: 6px; align-items: center; }
.bubble__dots span {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  background: rgba(244,239,228,0.55);
}
.bubble--carta .bubble__dots span { background: var(--inchiostro-30); }
@media (prefers-reduced-motion: no-preference) {
  .bubble__dots span { animation: cpl-typing 1.2s var(--ease-soft) infinite; }
  .bubble__dots span:nth-child(2) { animation-delay: .15s; }
  .bubble__dots span:nth-child(3) { animation-delay: .3s; }
  @keyframes cpl-typing { 0%,60%,100% { opacity:.35; transform: translateY(0); } 30% { opacity:1; transform: translateY(-3px); } }
}

/* ---------- header sticky (stato solido allo scroll) ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(244,239,228,0); border-bottom: 1px solid transparent;
  transition: background .25s var(--ease-soft), border-color .25s var(--ease-soft), backdrop-filter .25s var(--ease-soft);
}
.site-header.is-solid {
  background: rgba(244,239,228,0.88);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-link {
  font-family: var(--font-body); font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--inchiostro); text-decoration: none; padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: color .18s var(--ease-soft), border-color .18s var(--ease-soft);
}
.nav-link:hover { color: var(--oliva); border-bottom-color: var(--oliva-200); }
.nav-link.is-active { color: var(--oliva); border-bottom-color: var(--oliva); }

/* footer link hover */
.foot-link { font-family: var(--font-body); font-size: 14px; color: rgba(244,239,228,0.78); text-decoration: none; transition: color .18s var(--ease-soft); }
.foot-link:hover { color: var(--oliva-chiara); }

/* responsività di base */
@media (max-width: 860px) {
  .grid-2, .grid-2-aside, .grid-3, .grid-4, .hero-grid { grid-template-columns: 1fr !important; }
  .nav-desktop { display: none !important; }
}
