:root {
  --background: #060c1a;
  --foreground: #e8edf8;
  --card: #0d1526;
  --secondary: #111c35;
  --muted-foreground: #6b82a8;
  --border: rgba(47, 128, 237, 0.15);
  --primary: #2f80ed;
  --primary-foreground: #ffffff;
  --accent: #1a4fc4;
  --kita: #ff5c5c;
  --green: #4ade80;
  --font-display: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --font-body: "DM Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius-sm: 4px;   /* bottoni, input, tag */
  --radius-md: 8px;   /* card */
  --radius-lg: 12px;  /* prodotti, form, banner CTA */
  --max-width: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 1024px) {
  .container { padding: 0 40px; }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
}
h1 {
  font-size: clamp(3rem, 6vw, 4.5rem);
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 1.15;
  margin: 16px 0;
}
h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: 8px; }
p { margin: 0 0 16px; }

.text-accent { color: var(--primary); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--primary);
  border: 1px solid rgba(47, 128, 237, 0.3);
  background: rgba(47, 128, 237, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 32px;
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, gap 0.2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: rgba(47, 128, 237, 0.9); gap: 12px; }
.btn-outline { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn-outline:hover { border-color: rgba(47, 128, 237, 0.5); background: rgba(47, 128, 237, 0.05); }
.btn-light {
  background: #fff;
  color: var(--primary);
  font-weight: 600;
  padding: 14px 32px;
}
.btn-light:hover { background: rgba(255,255,255,0.9); }
.btn-block { width: 100%; justify-content: center; padding: 12px; }

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(6, 12, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark {
  position: relative;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: -0.02em;
}
/* AI sparkle accent (top-right, inside the mark) */
.brand-mark::after {
  content: "";
  position: absolute;
  top: 2px; right: 2px;
  width: 9px; height: 9px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 0 Q6 6 12 6 Q6 6 6 12 Q6 6 0 6 Q6 6 6 0 Z' fill='%2322d3ee'/%3E%3C/svg%3E") no-repeat center / contain;
}
.brand-mark-sm::after { width: 7px; height: 7px; top: 2px; right: 2px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--foreground);
  font-size: 1.125rem;
  letter-spacing: -0.02em;
}
.brand-name em { font-style: normal; color: var(--muted-foreground); font-weight: 300; }

.nav-links { display: flex; gap: 32px; }
.nav-links a {
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.95rem;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}
.nav-links a:hover { opacity: 1; color: var(--primary); }
.nav-cta { padding: 8px 20px; font-size: 0.95rem; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.icon-menu, .icon-menu::before, .icon-menu::after {
  content: "";
  display: block;
  width: 22px;
  height: 2px;
  background: var(--foreground);
  position: relative;
}
.icon-menu::before { position: absolute; top: -7px; }
.icon-menu::after { position: absolute; top: 7px; }

/* Hero */
.hero { position: relative; padding-top: 64px; overflow: hidden; }
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at top, black 30%, transparent 75%);
  opacity: 0.6;
}
.hero-inner {
  position: relative;
  display: grid;
  gap: 64px;
  align-items: center;
  padding-top: 96px;
  padding-bottom: 96px;
}
@media (min-width: 1024px) {
  .hero-inner { grid-template-columns: 1fr 1fr; }
}
.hero .lead {
  color: var(--muted-foreground);
  font-size: 1.125rem;
  line-height: 1.65;
  margin-bottom: 40px;
  max-width: 32rem;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.3s ease;
}
.stat-card:hover { border-color: rgba(47, 128, 237, 0.3); }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.1;
}
.stat-label { display: block; font-weight: 500; font-size: 0.875rem; margin-bottom: 2px; }
.stat-sub { display: block; color: var(--muted-foreground); font-size: 0.75rem; }

/* Sections */
.section { padding: 96px 0; border-top: 1px solid var(--border); }
.section-muted { background: rgba(17, 28, 53, 0.3); }
.section-head { margin-bottom: 56px; }
.section-head p { color: var(--muted-foreground); max-width: 36rem; margin: 0; }

.split {
  display: grid;
  gap: 64px;
}
.split-center { align-items: center; }
@media (min-width: 1024px) {
  .split { grid-template-columns: 1fr 1fr; }
}
.split-copy > p { color: var(--muted-foreground); line-height: 1.7; margin-bottom: 24px; }

.office-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 32px;
}
.meta-icon { color: var(--primary); margin-top: 2px; }
.office-meta strong { display: block; font-size: 0.9rem; font-weight: 500; }
.office-meta span { color: var(--muted-foreground); font-size: 0.85rem; }

.split-media { position: relative; }
.split-media img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--card);
}
.media-badge {
  position: absolute;
  bottom: -20px;
  left: -20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.media-badge-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.media-badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.media-badge-label { font-family: var(--font-mono); font-size: 0.75rem; color: var(--muted-foreground); }
.media-badge-year { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
.media-badge-sub { font-size: 0.75rem; color: var(--muted-foreground); }

/* Cards grid (servizi) */
.cards-grid {
  display: grid;
  gap: 20px;
}
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.service-card:hover { border-color: rgba(47, 128, 237, 0.4); background: rgba(47, 128, 237, 0.05); }
.service-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(47, 128, 237, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease;
}
.service-card:hover .service-icon { background: var(--primary); color: #fff; }
.tag {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  height: fit-content;
}
.service-card p { color: var(--muted-foreground); font-size: 0.9rem; margin: 0; }

/* Prodotti */
.products-grid {
  display: grid;
  gap: 24px;
}
@media (min-width: 1024px) { .products-grid { grid-template-columns: 1fr 1fr; } }

.product-card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s ease;
}
.product-card:hover { border-color: rgba(47, 128, 237, 0.4); }
.product-kita:hover { border-color: rgba(255, 92, 92, 0.4); }
.product-deco {
  position: absolute;
  top: 0; right: 0;
  width: 192px; height: 192px;
  border-radius: 50%;
  background: rgba(47, 128, 237, 0.05);
  transform: translate(50%, -50%);
  transition: background 0.3s ease;
}
.product-kita .product-deco { background: rgba(255, 92, 92, 0.05); }
.product-card:hover .product-deco { background: rgba(47, 128, 237, 0.1); }
.product-kita:hover .product-deco { background: rgba(255, 92, 92, 0.1); }
.product-inner { position: relative; }
.product-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.product-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(47, 128, 237, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-kita .product-icon { background: rgba(255, 92, 92, 0.1); color: var(--kita); }
.product-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
}
.product-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--primary);
}
.product-kita .product-tag { color: var(--kita); }
.product-card p { color: var(--muted-foreground); line-height: 1.7; margin-bottom: 24px; }
.feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.feature-list li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}
.product-kita .feature-list li::before { background: var(--kita); }
.product-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.product-link:hover { color: var(--foreground); }
.product-kita .product-link { color: var(--kita); }
.product-kita .product-link:hover { color: var(--foreground); }

/* CTA banner */
.section-cta {
  padding: 80px 0;
  border-top: 1px solid var(--border);
  background: rgba(17, 28, 53, 0.3);
}
.cta-banner {
  position: relative;
  overflow: hidden;
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
}
.cta-banner-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.12) 1px, transparent 1px);
  background-size: 48px 48px;
}
.cta-banner-inner { position: relative; }
.cta-banner h2 {
  color: #fff;
  font-size: 2.25rem;
  margin: 0 0 16px;
}
.cta-banner p {
  color: rgba(255,255,255,0.8);
  font-size: 1.125rem;
  max-width: 36rem;
  margin: 0 auto 32px;
}

/* Contatti */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-list li { display: flex; align-items: center; gap: 16px; }
.contact-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.contact-list strong { display: block; font-size: 0.875rem; font-weight: 500; }
.contact-list span:not(.contact-icon), .contact-list a {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  text-decoration: none;
}
.contact-list a:hover { color: var(--primary); }

.contact-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 6px;
}
.form-row input, .form-row textarea {
  width: 100%;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--foreground);
  font-family: var(--font-body);
  font-size: 0.875rem;
  transition: border-color 0.2s ease;
}
.form-row input::placeholder, .form-row textarea::placeholder { color: var(--muted-foreground); }
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
}
.form-row textarea { resize: vertical; }
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 400 !important;
  color: var(--muted-foreground) !important;
}
.checkbox-label a { color: var(--primary); }
.checkbox-label input { width: auto; margin-top: 3px; }
.form-note { font-size: 0.875rem; min-height: 1.2em; margin: 12px 0 0; }
.form-note.success { color: var(--green); }
.form-note.error { color: var(--kita); }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .footer-inner { flex-direction: row; }
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.brand-mark-sm { width: 28px; height: 28px; font-size: 0.75rem; }
.footer-brand-lines { display: flex; flex-direction: column; gap: 1px; }
.footer-brand-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.875rem;
  line-height: 1.2;
}
.footer-payoff {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.footer-links a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}
.footer-links a:hover { color: var(--foreground); }
.footer-legal {
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  font-size: 0.75rem;
  margin: 0;
}
.footer-legal a { color: var(--muted-foreground); }
.footer-legal a:hover { color: var(--foreground); }

/* Simple static pages (privacy/cookie) */
.legal-page { padding: 140px 24px 80px; max-width: 780px; margin: 0 auto; }
.legal-page h1 { font-size: 2.25rem; margin: 8px 0 24px; }
.legal-page h2 { font-size: 1.4rem; margin: 40px 0 12px; }
.legal-page p, .legal-page li { color: var(--muted-foreground); }
.legal-page a { color: var(--primary); }

/* Responsive */
@media (max-width: 1023px) {
  .split-media { order: -1; }
  #contatti .split-copy { order: -1; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-150%);
    transition: transform 0.25s ease;
    z-index: 40;
  }
  .nav-links.open { transform: translateY(0); }
  .nav-cta { display: none; }
  .media-badge { left: 12px; bottom: -16px; }
}
