:root {
  /* Core Colors */
  --bg-dark: #07090F;
  --bg-card: #111522;
  --bg-card-hover: #1A1F30;
  
  --primary: #00E5FF;
  --primary-hover: #00B8CC;
  --primary-glow: rgba(0, 229, 255, 0.4);
  
  --secondary: #6366F1;
  --secondary-glow: rgba(99, 102, 241, 0.4);

  --text-main: #F3F4F6;
  --text-muted: #9CA3AF;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --error: #EF4444;
  --success: #10B981;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Layout & Spacing */
  --container-width: 1200px;
  --section-pad: 100px;
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background-color: var(--bg-dark);
  color: var(--text-main);
  overflow-x: hidden;
}

body {
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography Utility */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: #FFFFFF;
}

h2 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 3rem;
}

/* Gradient Texts */
.text-gradient {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent; /* Fallback for browsers that do not support background-clip: text */
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 229, 255, 0.6);
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(5px);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 229, 255, 0.05);
}

/* --- LOGO --- */
.logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.logo span {
  color: var(--primary);
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* --- HEADER --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 20px 0;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.header.scrolled {
  background: rgba(7, 9, 15, 0.85);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.header-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.header-nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.header-phone i {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
}

/* --- HERO --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 100px;
  overflow: hidden;
}

/* Abstract Background Glow in Hero */
.hero-glow {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
  top: 50%;
  right: -100px;
  transform: translateY(-50%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

.hero-glow-2 {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2) 0%, rgba(0, 229, 255, 0) 70%);
  top: -100px;
  left: -100px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 24px;
}

.hero-chip i {
  font-size: 0.75rem;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

.hero p {
  font-size: clamp(1.125rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 60px;
}

.hero-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 32px;
  border-top: 1px solid var(--border-light);
  padding-top: 40px;
  margin-top: 40px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.trust-item i {
  color: var(--primary);
}

/* --- SECTIONS COMMON --- */
section {
  padding: var(--section-pad) 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- PROBLEM / SOLUTION --- */
.ps-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: stretch;
}

.ps-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.ps-card.solution {
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 10px 40px rgba(0, 229, 255, 0.05);
}

.ps-card-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
}

.ps-card.problem .ps-card-title i { color: var(--error); }
.ps-card.solution .ps-card-title i { color: var(--success); }

.ps-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ps-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: var(--text-muted);
}

.ps-card.problem li i { color: var(--error); margin-top: 4px; }
.ps-card.solution li { color: var(--text-main); }
.ps-card.solution li i { color: var(--success); margin-top: 4px; }

/* --- SERVICES --- */
.services-section {
  background: #090B14;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 32px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 30px rgba(0, 229, 255, 0.1);
  background: var(--bg-card-hover);
}

.service-icon {
  width: 50px;
  height: 50px;
  background: rgba(0, 229, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.service-card h4 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}

/* --- PROCESS (DALL'IDEA ALLA DELIVERY) --- */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.process-step {
  position: relative;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
}

.process-step::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -24px;
  width: 24px;
  height: 1px;
  background: var(--border-strong);
  z-index: -1;
}

.process-step:last-child::after {
  display: none;
}

.process-num {
  font-size: 3rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.05);
  position: absolute;
  top: 10px;
  right: 20px;
  line-height: 1;
}

.process-step h4 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.process-step p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- AGILE SCRUM --- */
.agile-section {
  position: relative;
  overflow: hidden;
}

.agile-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.3;
}

.agile-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.agile-text p {
  margin-bottom: 24px;
  color: var(--text-muted);
}

.agile-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 32px;
}

.agile-feat {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.agile-feat i {
  color: var(--primary);
  background: rgba(0, 229, 255, 0.1);
  padding: 8px;
  border-radius: 50%;
}

.agile-visual {
  position: relative;
  aspect-ratio: 1;
  max-width: 500px;
  margin: 0 auto;
}

/* CSS-drawn Scrum loop representation */
.scrum-loop {
  position: absolute;
  inset: 0;
  border: 2px dashed rgba(0, 229, 255, 0.2);
  border-radius: 50%;
  animation: rotate 20s linear infinite;
}

.scrum-item {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 10;
}

.scrum-item.center {
  width: 160px;
  height: 160px;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  font-size: 1.25rem;
  box-shadow: inset 0 0 40px rgba(0, 229, 255, 0.1), 0 0 30px rgba(0, 229, 255, 0.1);
}

/* Nodes on circle */
.scrum-node {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary);
}

.node-1 { top: -6px; left: 50%; transform: translateX(-50%); }
.node-2 { bottom: -6px; left: 50%; transform: translateX(-50%); }
.node-3 { top: 50%; left: -6px; transform: translateY(-50%); }
.node-4 { top: 50%; right: -6px; transform: translateY(-50%); }

@keyframes rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- TECNOLOGIE --- */
.tech-section {
  background: #090B14;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

.tech-category {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
}

.tech-category h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  color: #fff;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.tech-tag:hover {
  background: rgba(0, 229, 255, 0.1);
  border-color: rgba(0, 229, 255, 0.2);
  color: var(--primary);
}

/* --- PERCHÉ 20DEV --- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.why-card {
  text-align: center;
  padding: 32px;
}

.why-card i {
  font-size: 2.5rem;
  color: var(--primary);
  margin-bottom: 20px;
}

.why-card h4 {
  margin-bottom: 12px;
}

.why-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- CONTATTI (FORM) --- */
.contact-section {
  position: relative;
  padding: 100px 0;
}

.contact-wrapper {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 60px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  position: relative;
  z-index: 2;
}

.contact-wrapper::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, var(--primary) 0%, transparent 50%, var(--secondary) 100%);
  border-radius: 21px;
  z-index: -1;
  opacity: 0.2;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group.full {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 14px 16px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(0, 229, 255, 0.05);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

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

.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.checkbox-wrap input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  accent-color: var(--primary);
}

.checkbox-wrap a {
  color: var(--primary);
  text-decoration: underline;
}

.form-submit {
  margin-top: 32px;
  width: 100%;
}

.form-message {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  display: none;
  font-size: 0.9rem;
  text-align: center;
}

.form-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.form-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
}

/* --- FOOTER --- */
.footer {
  background: #000;
  padding: 60px 0 30px;
  border-top: 1px solid var(--border-strong);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 16px;
  font-size: 0.95rem;
  max-width: 300px;
}

.footer-col h5 {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #fff;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a, .footer-links button {
  color: var(--text-muted);
  font-size: 0.95rem;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: var(--transition);
}

.footer-links a:hover, .footer-links button:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* --- MODALS --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
  padding: 24px;
}

.modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.modal-body h3 {
  color: #fff;
  margin-top: 24px;
  margin-bottom: 12px;
  font-size: 1.25rem;
}

.modal-body table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  overflow: hidden;
}

.modal-body th, .modal-body td {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  text-align: left;
}

.modal-body table td a {
  word-break: break-all;
}

.modal-body ul {
  list-style: disc;
  padding-left: 20px;
  margin: 15px 0;
}

.modal-body li {
  margin-bottom: 8px;
  display: list-item; /* Override potential flex/box from parent */
  list-style-position: outside;
}

/* --- REVEAL ANIMATIONS (Intersection Observer) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 992px) {
  .process-timeline {
    grid-template-columns: repeat(2, 1fr);
  }
  .agile-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .wh-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .ps-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .header-actions .btn {
    display: none;
  }
  .header-phone { display: none; }
  .header-nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    flex-direction: column;
    padding: 24px;
    border-bottom: 1px solid var(--border-strong);
    display: none;
  }
  .header-nav.active {
    display: flex;
  }
  .mobile-menu-toggle {
    display: block;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-group.full {
    grid-column: 1;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .contact-wrapper {
    padding: 32px 24px;
  }
  
  .process-timeline {
    grid-template-columns: 1fr;
  }
  .process-step::after {
    display: none;
  }
}
