/* ============================================================
   DPM Software House — stile cinematografico dark
   ============================================================ */
:root {
  --bg: #07080a;
  --bg-2: #0c0e12;
  --surface: rgba(255, 255, 255, 0.03);
  --line: rgba(255, 255, 255, 0.08);
  --text: #e7e9ee;
  --muted: #9aa2b1;
  --dim: #6b7280;
  --accent: #38e1c9;      /* teal freddo */
  --accent-2: #5b9dff;    /* blu acciaio */
  --accent-soft: rgba(56, 225, 201, 0.14);
  --radius: 16px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  cursor: default;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: "Sora", sans-serif; line-height: 1.08; letter-spacing: -0.02em; font-weight: 700; }

/* --- Sfondo animato ---------------------------------------- */
#bg-canvas {
  position: fixed; inset: 0; z-index: -3;
  width: 100%; height: 100%;
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(91, 157, 255, 0.10), transparent 60%),
    radial-gradient(1000px 700px at 10% 20%, rgba(56, 225, 201, 0.08), transparent 55%),
    var(--bg);
}
.grain {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.cursor-glow {
  position: fixed; top: 0; left: 0; z-index: -1; width: 480px; height: 480px;
  margin: -240px 0 0 -240px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  transition: opacity 0.4s ease; opacity: 0;
}

/* --- Progress bar ------------------------------------------ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%; z-index: 100;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
}

/* --- Navigazione ------------------------------------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 8, 10, 0.72); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
/* Marchietto DPM: la "P" ruota su sé stessa a intervalli casuali */
.nav__brand .brand { position: relative; display: inline-block; height: 47px; perspective: 460px; }
.nav__brand .brand__base { height: 47px; width: auto; display: block; }
.brand__p {
  position: absolute; left: 50.56%; top: 11.64%; width: 18.45%; height: 50%;
  transition: transform 1.1s cubic-bezier(0.55, 0.05, 0.2, 1);
  will-change: transform;
}
.brand__p img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (prefers-reduced-motion: reduce) {
  .brand__p { transition: none; }
}
.nav__links { display: flex; align-items: center; gap: 30px; }
.nav__links a { font-size: 0.9rem; color: var(--muted); font-weight: 500; transition: color 0.25s; position: relative; }
.nav__links a:not(.nav__cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--accent); transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__cta {
  padding: 9px 18px; border: 1px solid var(--line); border-radius: 100px;
  color: var(--text) !important; transition: all 0.3s var(--ease);
}
.nav__cta:hover { border-color: var(--accent); box-shadow: 0 0 24px var(--accent-soft); }
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); transition: 0.3s var(--ease); }

/* --- Bottoni ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: 100px; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.25s var(--ease), box-shadow 0.3s, background 0.3s; cursor: pointer; border: 1px solid transparent;
}
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #05100e; box-shadow: 0 10px 40px -12px var(--accent);
}
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 18px 50px -10px var(--accent); }
.btn--ghost { border-color: var(--line); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-3px); }

/* --- Layout sezioni ---------------------------------------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(80px, 12vh, 160px) clamp(20px, 5vw, 40px); position: relative; }
.section--alt { max-width: none; background: linear-gradient(180deg, transparent, var(--bg-2) 12%, var(--bg-2) 88%, transparent); }
.section--alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section__head { max-width: 720px; margin-bottom: 60px; }
.kicker {
  display: inline-block; font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 18px; font-weight: 600;
}
.kicker::before { content: "// "; color: var(--dim); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.section h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 18px; }
.section__sub { color: var(--muted); font-size: 1.1rem; }

/* --- HERO -------------------------------------------------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  max-width: var(--maxw); margin: 0 auto; padding: 120px clamp(20px, 5vw, 40px) 60px; position: relative;
}
.hero__inner { max-width: 860px; position: relative; z-index: 2; }
.hero__stats { position: relative; z-index: 2; }

/* Cascata di codice: sfondo FISSO trasparente dietro tutta la pagina.
   z-index negativo → resta sotto ai contenuti (che scorrono e restano leggibili).
   Maschera radiale: più tenue al centro (zona di lettura), più viva ai bordi. */
.code-rain {
  position: fixed; inset: 0; z-index: -1;
  width: 100vw; height: 100vh; pointer-events: none; opacity: 0.55;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 52%, rgba(0,0,0,0.85) 74%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 52%, rgba(0,0,0,0.85) 74%, #000 100%);
}
.code-rain__tag {
  position: fixed; bottom: 14px; right: clamp(16px, 4vw, 30px); z-index: 40;
  pointer-events: auto; cursor: pointer; -webkit-user-select: none; user-select: none; touch-action: none;
  padding: 6px 10px; border-radius: 8px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--muted); opacity: 0.7;
  transition: color 0.6s ease, opacity 0.3s ease, text-shadow 0.3s ease;
}
.code-rain__tag:hover { opacity: 1; }
.code-rain__tag.held { opacity: 1; text-shadow: 0 0 14px currentColor; }
.code-rain__tag::before { content: "\25be "; color: var(--accent); }

/* Pulsanti audio: Musica (file) + Ambient (sintetizzato) */
.sound { position: fixed; left: clamp(16px, 4vw, 30px); bottom: 16px; z-index: 45; display: flex; gap: 8px; }
.sound-btn {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; color: var(--muted);
  border: 1px solid var(--line); background: rgba(7, 8, 10, 0.6);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.3s, box-shadow 0.3s, color 0.3s;
}
.sound-btn:hover { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-soft); color: var(--text); }
.sound-btn.on { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 18px var(--accent-soft); }
.sound-btn.missing { border-color: rgba(255, 107, 107, 0.5); }
.sound-btn__note { font-size: 1.15rem; line-height: 1; display: block; }
.sound-btn.on .sound-btn__note { animation: notebob 1s ease-in-out infinite; }
@keyframes notebob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.sound-btn__bars { display: flex; align-items: center; gap: 3px; height: 16px; }
.sound-btn__bars i { width: 3px; height: 4px; border-radius: 2px; background: currentColor; }
.sound-btn.on .sound-btn__bars i { animation: eq 0.9s ease-in-out infinite; }
.sound-btn.on .sound-btn__bars i:nth-child(2) { animation-delay: 0.15s; }
.sound-btn.on .sound-btn__bars i:nth-child(3) { animation-delay: 0.3s; }
.sound-btn.on .sound-btn__bars i:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.code-rain__tag { transform-origin: right center; }
.code-rain__tag.pulse { animation: tagPulse 1.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes tagPulse { 0% { transform: scale(1); } 35% { transform: scale(1.9); } 100% { transform: scale(1); } }
@media (max-width: 860px) {
  .code-rain { opacity: 0.28; }   /* versione leggera su mobile, più tenue per leggibilità */
  .code-rain__tag { display: none; }
}
.hero__eyebrow { font-size: 0.82rem; letter-spacing: 0.34em; color: var(--muted); margin-bottom: 26px; font-weight: 600; }
.hero__title { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 800; margin-bottom: 28px; text-shadow: 0 2px 40px rgba(7, 8, 10, 0.85), 0 1px 8px rgba(7, 8, 10, 0.6); }
.grad {
  background: linear-gradient(110deg, var(--accent) 10%, var(--accent-2) 55%, #c9d3ff 95%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.3rem); color: var(--muted); max-width: 640px; margin-bottom: 40px; }
.hero__actions { display: flex; gap: 16px; flex-wrap: wrap; }
/* Terminale che digita */
.terminal {
  margin-top: 30px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.95rem; color: var(--muted); display: inline-flex; align-items: baseline;
  gap: 8px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255, 255, 255, 0.02); max-width: 100%;
}
.terminal__prompt { color: var(--accent); }
.terminal__sep { color: var(--dim); }
.terminal__text { color: var(--text); white-space: pre; }
.terminal__caret { color: var(--accent); animation: caret 1.05s steps(1) infinite; margin-left: -6px; }
@keyframes caret { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }

.hero__stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  margin-top: clamp(50px, 9vh, 100px); padding-top: 40px; border-top: 1px solid var(--line);
}
.stat__num { font-family: "Sora", sans-serif; font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700; display: block; color: var(--text); }
.stat__label { color: var(--dim); font-size: 0.85rem; }
.hero__scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 26px; height: 42px; border: 2px solid var(--line); border-radius: 20px; }
.hero__scroll span { position: absolute; top: 8px; left: 50%; width: 4px; height: 8px; margin-left: -2px; background: var(--accent); border-radius: 4px; animation: scrolldot 1.8s infinite; }
@keyframes scrolldot { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* --- Timeline ---------------------------------------------- */
.timeline { list-style: none; position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), transparent); }
.timeline__item { position: relative; padding: 0 0 46px 20px; }
.timeline__dot { position: absolute; left: -34px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.timeline__year { font-family: "Sora", sans-serif; font-size: 0.85rem; letter-spacing: 0.1em; color: var(--accent); font-weight: 600; }
.timeline__item h3 { font-size: 1.35rem; margin: 6px 0 8px; }
.timeline__item p { color: var(--muted); max-width: 640px; margin-bottom: 12px; }
.timeline__item p:last-child { margin-bottom: 0; }
.timeline__q { font-family: "Sora", sans-serif; font-style: italic; font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--text); border-left: 2px solid var(--accent); padding-left: 18px; margin: 6px 0 14px !important; }
.timeline__q::after { content: "\2589"; color: var(--accent); margin-left: 5px; display: inline-block; animation: caret 1.05s steps(1) infinite; font-style: normal; }

/* --- Cards aziende ----------------------------------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.card {
  position: relative; overflow: hidden; padding: 30px 26px; border-radius: var(--radius);
  background: #ffffff; border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 12px 34px -20px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s var(--ease), box-shadow 0.4s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 28px 55px -24px rgba(0, 0, 0, 0.8); }
.card__glow { position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s; background: radial-gradient(360px at var(--mx, 50%) var(--my, 0%), rgba(56, 225, 201, 0.10), transparent 70%); pointer-events: none; }
.card:hover .card__glow { opacity: 1; }
.card__index { font-family: "Sora", sans-serif; font-size: 0.85rem; color: #0d9488; font-weight: 700; letter-spacing: 0.1em; }
.card h3 { font-size: 1.4rem; margin: 12px 0 12px; color: #0f1116; }
.card__form { font-size: 0.72em; font-weight: 400; color: #94a0ad; letter-spacing: 0.02em; }
.card__brand { display: inline-flex; align-items: center; margin: 8px 0 4px; }
.card__brand img { height: 42px; width: auto; display: block; }
.card p { color: #55606e; font-size: 0.98rem; margin-bottom: 18px; }
.card__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.card__tags li { font-size: 0.76rem; color: #5b6470; border: 1px solid rgba(0, 0, 0, 0.14); padding: 4px 11px; border-radius: 100px; }

/* --- Clienti ----------------------------------------------- */
.clients { display: grid; gap: 40px; }
.quote { font-family: "Sora", sans-serif; font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 300; line-height: 1.4; border-left: 3px solid var(--accent); padding-left: 28px; max-width: 900px; }
.quote footer { font-family: "Inter", sans-serif; font-size: 0.95rem; color: var(--dim); margin-top: 18px; font-weight: 500; }
.quote footer span { color: var(--muted); }
.clients__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.chip { display: flex; align-items: center; justify-content: center; padding: 22px 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-weight: 600; letter-spacing: 0.04em; background: var(--surface); transition: all 0.3s var(--ease); }
.chip:hover { color: var(--text); border-color: var(--accent); transform: translateY(-3px); }

/* --- Metodo ------------------------------------------------ */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.step { padding: 30px 26px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform 0.4s var(--ease), border-color 0.4s; }
.step:hover { transform: translateY(-6px); border-color: rgba(91, 157, 255, 0.4); }
.step__n { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; font-family: "Sora", sans-serif; font-weight: 700; font-size: 1.2rem; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #05100e; margin-bottom: 18px; }
.step h3 { font-size: 1.25rem; margin-bottom: 10px; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* --- Chi sono ---------------------------------------------- */
.about { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: clamp(30px, 5vw, 70px); align-items: center; }
.about__photo { display: flex; justify-content: center; }
/* Foto scontornata (trasparente), ridotta del ~30% e senza cornice */
.about__frame { position: relative; width: 70%; max-width: 300px; }
.about__frame img { width: 100%; filter: drop-shadow(0 26px 55px rgba(0,0,0,0.55)); }
.about__text h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: 20px; }
.about__text p { color: var(--muted); margin-bottom: 16px; }
.about__text .btn { margin-top: 12px; }

/* --- Form -------------------------------------------------- */
.form { max-width: 720px; display: grid; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field span { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.field input, .field textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font-family: inherit; font-size: 1rem; resize: vertical;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.hp { position: absolute; left: -9999px; opacity: 0; }
.form__submit { justify-self: start; margin-top: 6px; }
.form__status { font-size: 0.92rem; min-height: 1.2em; }
.form__status.ok { color: var(--accent); }
.form__status.err { color: #ff6b6b; }

/* --- Footer ------------------------------------------------ */
.footer { border-top: 1px solid var(--line); padding: 40px 20px; }
.footer__inner { max-width: var(--maxw); margin: 0 auto; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.footer__logo { height: 41px; opacity: 0.85; }
/* Barra di "compilazione" */
.compile { display: flex; align-items: center; gap: 10px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 0.78rem; color: var(--dim); }
.compile__label { min-width: 88px; transition: color 0.3s ease; }
.compile__label.is-done { color: var(--accent); }
.compile__track { width: 120px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.compile__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.footer p { color: var(--dim); font-size: 0.88rem; }

/* --- Reveal on scroll -------------------------------------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.timeline__item.reveal { transition-delay: 0.05s; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 860px) {
  .nav__links { position: fixed; inset: 0 0 auto; top: 0; flex-direction: column; justify-content: center; gap: 26px; height: 100vh; background: rgba(7,8,10,0.97); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transform: translateY(-100%); transition: transform 0.5s var(--ease); }
  .nav__links.open { transform: none; }
  .nav__links a { font-size: 1.3rem; }
  .nav__burger { display: flex; z-index: 60; }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .hero__stats { grid-template-columns: repeat(2, 1fr); gap: 30px 18px; }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 360px; }
  .form__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.15s !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
