/* ============================================================
   PAGES.CSS — Inner pages styles
   (lavori, processo, chi-sono, contatti)
   ============================================================ */

/* ============================================================
   CHI SONO
   ============================================================ */
.about-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 70vh;
  overflow: hidden;
}

.about-visual {
  background: var(--ink);
  position: relative;
  overflow: hidden;
  min-height: 500px;
}

.about-visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.about-visual-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3.5rem;
}

.about-profile-img {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.1);
  aspect-ratio: 3 / 4;
}

.about-content {
  background: var(--warm);
  padding: 5rem 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.about-heading {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.2vw, 46px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1.8rem;
}

.about-heading em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

.about-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1rem;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
}

.about-feature {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
  padding-right: 2rem;
  background: transparent;
  border-bottom: 1px solid var(--border);
  transition: all 0.4s ease;
  cursor: default;
}

.about-feature:hover {
  transform: translateX(8px);
}

.feature-number {
  font-family: 'Syne', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.8rem;
  letter-spacing: 0.2em;
}

.about-feature-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.4rem;
}

.about-feature-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.6;
  transition: color 0.3s ease;
}

.about-feature:hover .about-feature-desc {
  color: var(--ink);
}

/* Stack tech */
.stack-section {
  padding: 7rem 5%;
  background: var(--paper);
}

.stack-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 3rem;
}

.stack-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.stack-groups {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.stack-group-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.stack-pill {
  background: var(--warm);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}

.stack-pill:hover {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* Timeline */
.timeline-section {
  padding: 7rem 5%;
  background: var(--warm);
}

.timeline-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 4rem;
}

.timeline-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.timeline {
  position: relative;
  max-width: 720px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  padding-left: 2.5rem;
  padding-bottom: 3rem;
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -4px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--warm);
}

.timeline-year {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.timeline-role {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}

.timeline-company {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.timeline-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 520px;
}

/* ============================================================
   LAVORI (portfolio)
   ============================================================ */
.lavori-section {
  padding: 5rem 5%;
  background: var(--paper);
}

.lavori-filters {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.45rem 1.2rem;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.lavori-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5px;
  background: var(--border);
}

.lavoro-card {
  background: var(--paper);
  overflow: hidden;
  position: relative;
  transition: opacity 0.3s;
}

.lavoro-card.hidden {
  display: none;
}

.lavoro-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  background: var(--warm);
}

.lavoro-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lavoro-card:hover .lavoro-thumb img {
  transform: scale(1.04);
}

.project-next-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
}

.project-next-label {
  font-family: 'Syne', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.04em;
}

.project-next-sub {
  font-family: 'Syne', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.14em;
}

.lavoro-body {
  padding: 2rem 2.5rem;
}

.lavoro-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lavoro-name {
  font-family: 'Syne', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.lavoro-desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}

.lavoro-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.1rem;
  transition: color 0.2s, border-color 0.2s;
}

.lavoro-link:hover {
  color: var(--green);
  border-color: var(--green);
}

/* ============================================================
   PROCESSO
   ============================================================ */
.processo-section {
  background: var(--ink);
  padding: 7rem 5%;
  position: relative;
  overflow: hidden;
}

.processo-section::before {
  content: '';
  position: absolute;
  bottom: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(28, 92, 68, 0.3) 0%, transparent 65%);
  pointer-events: none;
}

.processo-bg-img {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=1400&q=60&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
}

.processo-section > * {
  position: relative;
  z-index: 1;
}

.processo-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-bottom: 5rem;
  align-items: end;
}

.processo-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: white;
  line-height: 1.05;
}

.processo-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green-light);
}

.processo-intro {
  font-size: 1rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.5);
}

.processo-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.processo-step {
  padding: 3rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.processo-step:last-child {
  border-right: none;
}

.step-number {
  font-family: 'Syne', sans-serif;
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.06);
  line-height: 1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.04em;
}

.step-icon {
  width: 44px;
  height: 44px;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.step-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}

.step-desc {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.7;
}

/* FAQ */
.faq-section {
  padding: 7rem 5%;
  background: var(--paper);
}

.faq-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.5vw, 50px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 4rem;
}

.faq-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.faq-list {
  max-width: 760px;
}

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

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: 1.8rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  text-align: left;
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.faq-question:hover {
  color: var(--green);
}

.faq-icon {
  width: 28px;
  height: 28px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  transition: transform 0.3s, border-color 0.2s, color 0.2s;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  border-color: var(--green);
  color: var(--green);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.faq-item.open .faq-answer {
  max-height: 300px;
}

.faq-answer p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.8;
  padding-bottom: 1.8rem;
}

/* ============================================================
   CONTATTI
   ============================================================ */
.contatti-section {
  padding: 7rem 5%;
  background: var(--paper);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.contatti-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(30px, 3.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.contatti-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green);
}

.contatti-desc {
  font-size: 0.98rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.contatti-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.contatti-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.9rem 1.3rem;
  background: var(--warm);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Syne', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.contatti-link:hover {
  background: var(--green);
  color: white;
  border-color: var(--green);
  transform: translateX(4px);
}

.contatti-link-icon {
  width: 36px;
  height: 36px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.contatti-link:hover .contatti-link-icon {
  background: rgba(255, 255, 255, 0.15);
}

/* Form */
.contact-form-wrapper {
  background: var(--warm);
  border-radius: 20px;
  padding: 2.5rem;
  border: 1px solid var(--border);
}

.form-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.form-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(28, 92, 68, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 10px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  margin-top: 0.5rem;
}

.btn-submit:hover {
  background: var(--green);
  transform: translateY(-1px);
}

#form-success {
  color: var(--green);
  font-size: 0.88rem;
  margin-top: 0.8rem;
  font-weight: 500;
}

/* ---- RESPONSIVE PAGES ---- */
@media (max-width: 900px) {
  .about-section {
    grid-template-columns: 1fr;
  }

  .about-visual {
    min-height: 380px;
  }

  .about-content {
    padding: 3rem 2rem;
  }

  .stack-groups {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .processo-header {
    grid-template-columns: 1fr;
  }

  .processo-steps {
    grid-template-columns: 1fr;
  }

  .processo-step {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .processo-step:last-child {
    border-bottom: none;
  }

  .contatti-section {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .lavori-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .about-features {
    grid-template-columns: 1fr;
  }

  .lavori-filters {
    gap: 0.4rem;
  }
}

/* ============================================================
   AI AGENT PAGE
   ============================================================ */

/* Hero dark */
.ai-hero {
  background: var(--ink);
  padding: 10rem 5% 9rem;
  position: relative;
  overflow: hidden;
}

.ai-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.ai-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 120px;
  background: linear-gradient(to top, var(--paper), transparent);
}

.ai-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 1.8rem;
}

.ai-hero-eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-light);
  animation: pulse 2s infinite;
}

.ai-hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(44px, 6vw, 84px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #fff;
  line-height: 1.0;
  margin-bottom: 1.5rem;
}

.ai-hero-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
  color: var(--green-light);
}

.ai-hero-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.8;
  max-width: 480px;
  margin-bottom: 2.5rem;
}

.ai-hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Intro section */
.ai-intro {
  padding: 7rem 5%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
  background: var(--paper);
}

.ai-intro-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1rem;
}

.ai-intro-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 1.5rem;
}

.ai-intro-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

.ai-intro-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 1.2rem;
}

/* Chat mock */
.ai-chat-mock {
  background: var(--ink);
  border-radius: 20px;
  padding: 2rem;
  font-family: 'DM Sans', sans-serif;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ai-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.ai-chat-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.ai-chat-status {
  font-size: 0.72rem;
  color: var(--green-light);
}

.ai-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.chat-msg.user {
  align-items: flex-end;
}

.chat-msg.bot {
  align-items: flex-start;
}

.chat-bubble {
  padding: 0.75rem 1.1rem;
  border-radius: 16px;
  font-size: 0.84rem;
  line-height: 1.6;
  max-width: 85%;
}

.chat-msg.user .chat-bubble {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-bottom-right-radius: 4px;
}

.chat-msg.bot .chat-bubble {
  background: var(--green);
  color: #fff;
  border-bottom-left-radius: 4px;
}

.chat-time {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.3);
}

/* Use cases */
.ai-usecases {
  padding: 7rem 5%;
  background: var(--warm);
}

.ai-usecases-header {
  text-align: center;
  margin-bottom: 4rem;
}

.ai-usecases-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.5vw, 50px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.ai-usecases-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

.ai-usecases-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 860px;
  margin: 0 auto;
}

.ai-usecase-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.ai-usecase-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}

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

.ai-usecase-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

.ai-usecase-icon {
  width: 48px;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.3rem;
  transition: border-color 0.3s, background 0.3s;
}

.ai-usecase-card:hover .ai-usecase-icon {
  border-color: rgba(28, 92, 68, 0.3);
  background: rgba(28, 92, 68, 0.06);
}

.ai-usecase-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--ink);
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.3s;
}

.ai-usecase-card:hover .ai-usecase-icon svg {
  stroke: var(--green);
}

.ai-usecase-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 0.6rem;
}

.ai-usecase-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
}

/* Come funziona */
.ai-come-funziona {
  padding: 7rem 5%;
  background: var(--paper);
}

.ai-cf-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  max-width: 960px;
}

.ai-cf-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.ai-cf-title em {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-weight: 400;
}

.ai-cf-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ai-cf-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1.5rem;
  padding-bottom: 2.5rem;
  position: relative;
}

.ai-cf-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 25px;
  top: 52px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.ai-cf-num {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.1em;
  background: var(--paper);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.ai-cf-step-title {
  font-family: 'Syne', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0.4rem;
  padding-top: 0.9rem;
}

.ai-cf-step-desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
}

/* Stack */
.ai-stack {
  padding: 5rem 5%;
  background: var(--warm);
  text-align: center;
}

.ai-stack-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(22px, 2.5vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 2.5rem;
}

.ai-stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto;
}

.ai-stack-pill {
  padding: 0.55rem 1.2rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-family: 'Syne', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
  background: var(--paper);
  transition: border-color 0.3s, background 0.3s, color 0.3s;
  cursor: default;
}

.ai-stack-pill:hover {
  border-color: var(--green);
  background: rgba(28, 92, 68, 0.06);
  color: var(--green);
}

/* Demo chat */
.ai-demo {
  padding: 7rem 5%;
  background: var(--ink);
  position: relative;
  overflow: hidden;
}

.ai-demo::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.ai-demo-inner {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.ai-demo-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 1rem;
}

.ai-demo-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 3rem;
}

.ai-demo-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 2rem;
  text-align: left;
}

.ai-demo-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.ai-demo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-light);
  animation: pulse 2s infinite;
}

.ai-demo-bar-name {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
}

.ai-demo-messages {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  font-family: 'DM Sans', sans-serif;
}

.ai-demo-msg {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.ai-demo-msg.user {
  flex-direction: row-reverse;
}

.ai-demo-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-demo-msg.user .ai-demo-msg-avatar {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
}

.ai-demo-msg.bot .ai-demo-msg-avatar {
  background: var(--green);
  color: #fff;
}

.ai-demo-msg-text {
  padding: 0.8rem 1.1rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 75%;
}

.ai-demo-msg.user .ai-demo-msg-text {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.8);
  border-bottom-right-radius: 4px;
}

.ai-demo-msg.bot .ai-demo-msg-text {
  background: rgba(28, 92, 68, 0.35);
  color: rgba(255,255,255,0.9);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(28, 92, 68, 0.5);
}

.ai-demo-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.8rem 1.1rem;
}

.ai-demo-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-light);
  animation: typing-dot 1.4s infinite;
}

.ai-demo-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-demo-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-dot {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* AI page responsive */
@media (max-width: 860px) {
  .ai-intro,
  .ai-cf-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .ai-usecases-grid {
    grid-template-columns: 1fr;
  }
}
