:root {
  --verde-scuro: #010D00;
  --verde: #1A402A;
  --olio: #697346;
  --chiaro: #F2F2F2;
}

@property --a {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--chiaro);
  color: var(--verde-scuro);
  line-height: 1.7;
  overflow-x: hidden;
}

/* ---------- Forme che scorrono lungo i bordi ---------- */
.bordi { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.f { position: absolute; color: var(--olio); opacity: .35; }
.f1 { width: 70px;  left: 1.5vw;  top: 0; animation: su 38s linear infinite, gira 24s linear infinite; }
.f2 { width: 40px;  left: 4vw;    top: 0; animation: su 52s linear -20s infinite, gira 30s linear infinite reverse; color: var(--verde); }
.f3 { width: 95px;  left: .5vw;   top: 0; animation: su 66s linear -40s infinite, gira 40s linear infinite; }
.f4 { width: 60px;  right: 1.5vw; top: 0; animation: giu 44s linear infinite, gira 28s linear infinite reverse; }
.f5 { width: 90px;  right: .5vw;  top: 0; animation: giu 60s linear -25s infinite, gira 36s linear infinite; color: var(--verde); }
.f6 { width: 36px;  right: 4vw;   top: 0; animation: giu 34s linear -12s infinite, gira 20s linear infinite; }

@keyframes su  { from { transform: translateY(110vh); } to { transform: translateY(-20vh); } }
@keyframes giu { from { transform: translateY(-20vh); } to { transform: translateY(110vh); } }
@keyframes gira { to { rotate: 360deg; } }

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: rgba(1, 13, 0, .92);
  backdrop-filter: blur(8px);
  padding: 12px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--chiaro); font-weight: bold; letter-spacing: .3px; }
.brand img { height: 44px; background: var(--chiaro); border-radius: 6px; padding: 3px; }

nav { margin-left: auto; display: flex; gap: 28px; }
nav a { color: var(--chiaro); text-decoration: none; font-size: .95rem; transition: color .2s; }
nav a:hover { color: var(--olio); }

.azioni { display: flex; gap: 10px; }
.btn-mini {
  display: inline-block; text-decoration: none; font-size: .85rem; font-weight: bold;
  padding: 8px 16px; border-radius: 5px; border: 1px solid var(--olio);
  transition: background .2s, color .2s;
}
.btn-ghost { color: var(--chiaro); background: transparent; }
.btn-ghost:hover { background: var(--olio); }
.btn-fill { color: var(--chiaro); background: var(--verde); border-color: var(--verde); }
.btn-fill:hover { background: var(--olio); border-color: var(--olio); }

/* Piccola luce che corre lungo il bordo inferiore dell'header */
.corsa { position: absolute; left: 0; bottom: 0; height: 2px; width: 140px;
  background: linear-gradient(90deg, transparent, var(--olio), transparent);
  animation: corsa 7s linear infinite; }
@keyframes corsa { from { left: -140px; } to { left: 100%; } }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; z-index: 1; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(1,13,0,.92) 25%, rgba(26,64,42,.55) 100%); }

.hero-grid {
  position: relative; z-index: 2; width: 100%; max-width: 1200px; margin: 0 auto; padding: 120px 40px 60px;
  display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 60px;
}
.hero-testo { color: var(--chiaro); }
.hero h1 { font-size: 3.1rem; line-height: 1.15; margin-bottom: 20px; }
.hero p { font-size: 1.2rem; max-width: 520px; margin-bottom: 32px; opacity: .9; }

.cta { display: inline-block; background: var(--olio); color: var(--chiaro); padding: 15px 38px;
  text-decoration: none; border-radius: 6px; font-weight: bold; transition: background .2s; }
.cta:hover { background: var(--verde); }
.link-sec { color: var(--chiaro); margin-left: 24px; text-decoration: underline; text-underline-offset: 4px; }
.link-sec:hover { color: var(--olio); }

/* ---------- Logo che si costruisce da solo ---------- */
.logo-build { position: relative; width: 330px; height: 380px; justify-self: center; }
.piastra {
  position: absolute; inset: 0; background: var(--chiaro);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  opacity: 0; animation: appare .8s ease 2.4s forwards;
}
.traccia { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.traccia polygon {
  fill: none; stroke: var(--olio); stroke-width: 2; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: disegna 1.8s ease-in-out .2s forwards, svanisce .6s ease 3.2s forwards;
}
.logo-build img {
  position: absolute; inset: 9% 9%; width: 82%; height: 82%; object-fit: contain;
  --a: 0deg;
  -webkit-mask-image: conic-gradient(from 0deg, #000 var(--a), transparent calc(var(--a) + 2deg));
          mask-image: conic-gradient(from 0deg, #000 var(--a), transparent calc(var(--a) + 2deg));
  animation: costruisci 2.6s cubic-bezier(.5, 0, .3, 1) 1s forwards;
}
@keyframes disegna { to { stroke-dashoffset: 0; } }
@keyframes svanisce { to { opacity: 0; } }
@keyframes appare { to { opacity: 1; } }
@keyframes costruisci { to { --a: 362deg; } }

/* ---------- Sezioni ---------- */
section { position: relative; z-index: 1; padding: 100px 20px; text-align: center; }
section h2 { color: var(--verde); font-size: 2.2rem; margin-bottom: 24px; }
.colonna { max-width: 680px; margin: 0 auto; }
.colonna p { margin-bottom: 18px; font-size: 1.05rem; }
.colonna p.grande { font-size: 1.6rem; line-height: 1.4; color: var(--verde); font-weight: bold; }
.intro { max-width: 520px; margin: -8px auto 40px; }

.split { display: flex; align-items: center; justify-content: center; gap: 70px; max-width: 1100px; margin: 0 auto; text-align: left; }
.split .testo { flex: 1; }
.split .testo p { margin-bottom: 16px; }
.split .foto { flex: 1; max-width: 480px; height: 380px; width: 100%; object-fit: cover; border-radius: 8px; filter: saturate(.7); }

/* Licenze */
.carte { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; max-width: 1000px; margin: 0 auto; }
.carta { background: #fff; border: 1px solid #dcdcdc; border-radius: 10px; padding: 40px 28px 32px; text-align: center; }
.carta.in-evidenza { border: 2px solid var(--verde); }
.carta .icona { width: 56px; height: 56px; color: var(--olio); margin-bottom: 12px; }
.carta h3 { color: var(--verde); margin-bottom: 10px; font-size: 1.3rem; }
.carta p { margin-bottom: 24px; font-size: .95rem; }

/* Footer */
footer { position: relative; z-index: 1; background: var(--verde); color: var(--chiaro); text-align: center; padding: 36px 20px; }
footer p { margin: 4px 0; }
footer .footer-logo { display: block; margin: 0 auto 18px; height: 48px; background: var(--chiaro); border-radius: 6px; padding: 3px; }

@media (prefers-reduced-motion: reduce) {
  .f, .corsa { animation: none; }
  .traccia polygon { animation: none; stroke-dashoffset: 0; opacity: 0; }
  .piastra { animation: none; opacity: 1; }
  .logo-build img { animation: none; --a: 362deg; }
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  header { padding: 12px 20px; flex-wrap: wrap; gap: 8px 16px; }
  nav { order: 3; width: 100%; justify-content: center; gap: 16px; margin-left: 0; }
  .brand img { height: 36px; }
  .hero { min-height: 100vh; }
  .hero-grid { grid-template-columns: 1fr; padding: 140px 20px 60px; text-align: center; }
  .hero-testo { display: flex; flex-direction: column; align-items: center; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { font-size: 1rem; margin: 0 auto 24px; max-width: 100%; }
  .logo-build { width: 250px; height: 285px; }
  section { padding: 60px 20px; }
  .split { flex-direction: column; gap: 40px; text-align: center; }
  .split .testo { flex: 1; }
  .split .testo p { margin: 0 auto 12px; }
  .split .foto { max-width: 100%; width: 100%; height: 300px; }
  footer { padding: 32px 16px; }
}
