:root {
  --bg: #f8f7f4;
  --bg2: #ffffff;
  --surface: #ffffff;
  --surface2: #f3f2ef;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.12);
  --accent: #f5a623;
  --accent-dark: #d4890a;
  --accent-light: #fff4e0;
  --accent2: #1a1a2e;
  --text: #1a1a1a;
  --text2: #444444;
  --muted: #888888;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.10);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* CANVAS */
#neural-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.08;
  pointer-events: none;
}

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

/* NAV */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0;
  backdrop-filter: blur(20px);
  background: rgba(248, 247, 244, 0.92);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

nav .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
}

.logo-img {
  height: 32px;
  display: block;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  align-items: center;
}

nav ul a {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

nav ul a:hover {
  color: var(--accent-dark);
}

.nav-cta {
  background: var(--accent) !important;
  color: #fff !important;
  padding: 9px 22px !important;
  border-radius: 8px;
  font-weight: 600 !important;
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.3);
  transition: background 0.2s, box-shadow 0.2s !important;
}

.nav-cta:hover {
  background: var(--accent-dark) !important;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.4) !important;
  color: #fff !important;
}

/* HERO */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 68px;
  background: linear-gradient(160deg, #fefefe 0%, #fff8ee 50%, #f8f7f4 100%);
  position: relative;
  overflow: hidden;
}

#hero::before {
  content: "";
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.12), transparent 70%);
  pointer-events: none;
}

#hero::after {
  content: "";
  position: absolute;
  bottom: -100px;
  left: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(26, 26, 46, 0.05), transparent 70%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  padding: 60px 0;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  color: var(--accent-dark);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
  background: var(--accent-light);
  border: 1px solid rgba(245, 166, 35, 0.3);
  padding: 5px 14px;
  border-radius: 100px;
}

.hero-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.5s ease-in-out infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: 0.3
  }
}

h1 {
  font-family: "DM Sans", sans-serif;
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 28px;
}

h1 strong {
  font-weight: 700;
  color: var(--accent);
  display: block;
}

.hero-sub {
  font-size: 1.08rem;
  color: var(--text2);
  max-width: 500px;
  line-height: 1.75;
  margin-bottom: 40px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  padding: 14px 28px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.35);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245, 166, 35, 0.4);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  padding: 14px 28px;
  border-radius: 10px;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-ghost:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(245, 166, 35, 0.15);
}

.stats-row {
  display: flex;
  gap: 36px;
  padding: 24px 0 0;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.stat-n {
  font-family: "Space Mono", monospace;
  font-size: 1.5rem;
  color: var(--text);
  font-weight: 700;
}

.stat-n span {
  color: var(--accent);
}

.stat-l {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* AGENT DEMO CARD */
.agent-demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(245, 166, 35, 0.06);
  animation: float 5s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0)
  }

  50% {
    transform: translateY(-10px)
  }
}

.agent-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
}

.agent-dots {
  display: flex;
  gap: 6px;
}

.agent-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.agent-dots span:nth-child(1) {
  background: #ff5f57
}

.agent-dots span:nth-child(2) {
  background: #febc2e
}

.agent-dots span:nth-child(3) {
  background: #28c840
}

.agent-title {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-left: 6px;
}

.agent-body {
  padding: 20px;
  background: var(--bg2);
}

.agent-msg {
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  opacity: 0;
  transform: translateY(6px);
  animation: msgIn 0.5s forwards;
}

.agent-msg:nth-child(1) {
  animation-delay: 0.5s
}

.agent-msg:nth-child(2) {
  animation-delay: 1.4s
}

.agent-msg:nth-child(3) {
  animation-delay: 2.3s
}

.agent-msg:nth-child(4) {
  animation-delay: 3.2s
}

@keyframes msgIn {
  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
  font-family: "Space Mono", monospace;
  font-weight: 700;
}

.avatar.user {
  background: #e8f0fe;
  color: #1a73e8;
  border: 1px solid #c5d8fb;
}

.avatar.ai {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

.bubble {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text);
  flex: 1;
}

.bubble.ai-bubble {
  background: var(--accent-light);
  border-color: rgba(245, 166, 35, 0.25);
}

.bubble code {
  font-family: "Space Mono", monospace;
  font-size: 0.78rem;
  color: var(--accent-dark);
  background: rgba(245, 166, 35, 0.15);
  padding: 1px 5px;
  border-radius: 3px;
}

.typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.typing span {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing span:nth-child(1) {
  animation-delay: 3.8s
}

.typing span:nth-child(2) {
  animation-delay: 3.95s
}

.typing span:nth-child(3) {
  animation-delay: 4.1s
}

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4
  }

  30% {
    transform: translateY(-4px);
    opacity: 1
  }
}

/* SECTION TITLES */
.section-eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 14px;
}

h2 {
  font-size: clamp(1.9rem, 3vw, 2.9rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.15;
}

h2 em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent-dark);
}

/* DIVIDER */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* SERVICES */
#servizi {
  padding: 120px 0;
  background: var(--bg2);
}

.services-intro {
  max-width: 560px;
  margin-bottom: 64px;
}

.services-intro p {
  color: var(--text2);
  font-size: 1.05rem;
  line-height: 1.75;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 36px 28px;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}

.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
  background: var(--accent-light);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
}

.service-card p {
  font-size: 0.875rem;
  color: var(--text2);
  line-height: 1.7;
}

.service-tag {
  display: inline-block;
  margin-top: 18px;
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(245, 166, 35, 0.3);
}

/* AGENTS */
#agenti {
  padding: 120px 0;
  background: var(--bg);
}

.agents-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}

.agent-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 40px;
}

.agent-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.agent-item:hover,
.agent-item.active {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.12);
}

.agent-item-icon {
  font-size: 1.3rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  border-radius: 10px;
  flex-shrink: 0;
}

.agent-item-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.agent-item-content p {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.5;
}

.agents-visual {
  position: sticky;
  top: 100px;
}

.pipeline-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.pipeline-card h4 {
  font-family: "Space Mono", monospace;
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.pipeline {
  display: flex;
  flex-direction: column;
}

.pipe-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.pipe-line {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pipe-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.2);
  flex-shrink: 0;
  margin-top: 4px;
}

.pipe-dot.dim {
  background: #ddd;
  box-shadow: none;
}

.pipe-connector {
  width: 2px;
  height: 36px;
  background: linear-gradient(to bottom, var(--accent), rgba(245, 166, 35, 0.15));
  margin: 2px 0;
}

.pipe-connector.dim {
  background: var(--border);
}

.pipe-content {
  padding-bottom: 24px;
}

.pipe-content .pipe-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.pipe-content .pipe-desc {
  font-size: 0.8rem;
  color: var(--muted);
}

.pipe-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: "Space Mono", monospace;
  font-size: 0.62rem;
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(245, 166, 35, 0.3);
  margin-left: 8px;
}

/* PROCESS */
#processo {
  padding: 120px 0;
  background: var(--accent2);
}

#processo .section-eyebrow {
  color: rgba(245, 166, 35, 0.9);
}

#processo h2 {
  color: #fff;
}

#processo h2 em {
  color: var(--accent);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 64px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
}

.process-step {
  padding: 40px 28px;
  background: rgba(255, 255, 255, 0.03);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.3s;
}

.process-step:last-child {
  border-right: none;
}

.process-step:hover {
  background: rgba(255, 255, 255, 0.06);
}

.step-num {
  font-family: "Space Mono", monospace;
  font-size: 2.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.1);
  line-height: 1;
  margin-bottom: 20px;
  transition: color 0.3s;
}

.process-step:hover .step-num {
  color: rgba(245, 166, 35, 0.5);
}

.process-step h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}

.process-step p {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.65;
}

/* TECH */
#tecnologie {
  padding: 80px 0;
  background: var(--bg2);
}

.tech-intro {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 56px;
}

.tech-marquee-wrap {
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}

.tech-marquee {
  display: flex;
  gap: 12px;
  animation: marquee 35s linear infinite;
  width: max-content;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.tech-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--text2);
  white-space: nowrap;
  transition: border-color 0.2s;
}

.tech-tag:hover {
  border-color: var(--accent);
}

.tech-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* CTA */
#contatti {
  padding: 140px 0;
  background: var(--bg);
}

.cta-box {
  background: linear-gradient(135deg, #fff8ee 0%, #ffffff 100%);
  border: 1.5px solid rgba(245, 166, 35, 0.25);
  border-radius: 24px;
  padding: 80px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.cta-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.cta-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 200px;
  background: radial-gradient(ellipse, rgba(245, 166, 35, 0.15), transparent 70%);
  pointer-events: none;
}

.cta-box h2 {
  margin-bottom: 16px;
}

.cta-box p {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 480px;
  margin: 0 auto 40px;
  line-height: 1.75;
}

.cta-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-info {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.contact-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: "Space Mono", monospace;
}

.contact-value {
  font-size: 0.95rem;
  color: var(--text);
}

.contact-value a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
}

.contact-value a:hover {
  text-decoration: underline;
}

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  background: var(--bg2);
  position: relative;
  z-index: 2;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text);
}

/* REVEAL */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {

  .hero-grid,
  .agents-layout {
    grid-template-columns: 1fr;
  }

  .services-grid {
    grid-template-columns: 1fr 1fr;
  }

  .process-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-grid .agent-demo {
    display: none;
  }

  nav ul {
    display: none;
  }
}

@media (max-width: 600px) {

  .services-grid,
  .process-grid {
    grid-template-columns: 1fr;
  }

  .contact-info {
    flex-direction: column;
    align-items: center;
  }

  .cta-box {
    padding: 48px 24px;
  }
}

/* CONTACT FORM */
.contact-form {
  max-width: 600px;
  margin: 40px auto 0;
  text-align: left;
  background: var(--surface);
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border2);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-submit {
  width: 100%;
  border: none;
  cursor: pointer;
}

.antispam-group {
  background: var(--accent-light);
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(245, 166, 35, 0.2);
  margin-bottom: 20px;
}

.antispam-label {
  font-size: 0.85rem;
  color: var(--accent-dark);
  margin-bottom: 8px;
  display: block;
  font-weight: 600;
}

.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 0.9rem;
}

.alert-success {
  background: #e6fffa;
  color: #2c7a7b;
  border: 1px solid #b2f5ea;
}

.alert-error {
  background: #fff5f5;
  color: #c53030;
  border: 1px solid #feb2b2;
}

.hidden-field {
  display: none !important;
}