/*
Theme Name: DM Energy
Theme URI: https://dmenergy.it
Author: DM Energy Web
Description: Tema professionale per D.M.ENERGY - Impianti Elettrici & Tecnologici
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: dm-energy
Tags: electricity, energy, professional, dark, orange
*/

/* ===================================
   CSS VARIABLES & BASE
   =================================== */
:root {
  --orange: #FF6500;
  --orange-light: #FF8C42;
  --orange-dark: #CC4E00;
  --orange-glow: rgba(255, 101, 0, 0.25);
  --bg-dark: #0a0a0a;
  --bg-card: #111111;
  --bg-card2: #161616;
  --text-white: #F5F5F5;
  --text-gray: #A0A0A0;
  --text-light: #CCCCCC;
  --border: rgba(255,101,0,0.2);
  --shadow: 0 8px 40px rgba(255,101,0,0.15);
  --font-display: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;
  --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-white);
  overflow-x: hidden;
  line-height: 1.6;
}

body.no-scroll { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-padding { padding: 100px 0; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  transform: translateX(-100%);
  transition: transform 0.4s ease;
}
.btn:hover::before { transform: translateX(0); }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,101,0,0.4);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 35px rgba(255,101,0,0.6);
}

.btn-outline {
  background: transparent;
  color: var(--orange);
  border: 2px solid var(--orange);
}
.btn-outline:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-3px);
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 16px;
}
.section-label::before {
  content: '';
  width: 30px;
  height: 2px;
  background: var(--orange);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.5px;
  text-transform: uppercase;
  color: var(--text-white);
}

.section-title span { color: var(--orange); }

/* ===================================
   PRELOADER
   =================================== */
#preloader {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-logo-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.preloader-logo {
  width: 340px;
  max-width: 85vw;
  height: auto;
  /* GIF has its own glow animation — no extra CSS pulse needed */
  filter: drop-shadow(0 0 24px rgba(255,101,0,0.4));
}

.preloader-bar-wrap {
  width: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.preloader-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.preloader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--orange-dark), var(--orange), var(--orange-light));
  border-radius: 3px;
  transition: width 0.1s ease;
  box-shadow: 0 0 12px var(--orange);
}

.preloader-percent {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--orange);
}

.preloader-sparks {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--orange);
  border-radius: 50%;
  animation: sparkFloat linear infinite;
  opacity: 0;
}

@keyframes sparkFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 0.5; }
  100% { transform: translateY(-10vh) scale(1.5); opacity: 0; }
}

/* ===================================
   COOKIE BANNER
   =================================== */
#cookie-banner {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(200px);
  width: min(680px, calc(100vw - 40px));
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,101,0,0.1);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  opacity: 0;
}

#cookie-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.cookie-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.cookie-text { flex: 1; }

.cookie-text h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 6px;
}

.cookie-text p {
  font-size: 0.82rem;
  color: var(--text-gray);
  line-height: 1.5;
}

.cookie-text p a { color: var(--orange); }
.cookie-text p a:hover { text-decoration: underline; }

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-actions .btn {
  padding: 12px 20px;
  font-size: 0.78rem;
}

/* ===================================
   HEADER
   =================================== */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  padding: 16px 0;
  transition: var(--transition);
}

/* Account for WP admin bar */
.admin-bar #site-header { top: 32px; }
@media screen and (max-width: 782px) {
  .admin-bar #site-header { top: 46px; }
}

#site-header.scrolled {
  background: rgba(10,10,10,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.6);
}

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

/* ---- LOGO ---- */
.site-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}

.site-logo img,
.site-logo a img {
  height: 52px !important;
  width: auto !important;
  max-width: 210px !important;
  object-fit: contain !important;
  display: block;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.site-logo:hover img {
  transform: scale(1.04);
  filter: brightness(1.15);
}

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

.site-nav a {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-light);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s;
  white-space: nowrap;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.3s ease;
}

.site-nav a:hover { color: var(--orange); }
.site-nav a:hover::after { width: 100%; }

.header-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.header-phone {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

/* ---- HAMBURGER ---- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: rgba(255,101,0,0.1);
  border: 1px solid rgba(255,101,0,0.3);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--orange);
  border-radius: 2px;
  transition: var(--transition);
  margin: 0 auto;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: translateX(-8px); }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- MOBILE NAV ---- */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.99);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 8999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.mobile-nav.open { display: flex; opacity: 1; }

.mobile-nav a {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-white);
  transition: color 0.3s, transform 0.3s;
}
.mobile-nav a:hover { color: var(--orange); transform: translateX(8px); }

/* ===================================
   HERO SLIDER
   =================================== */
#hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  overflow: hidden;
}

/* Offset for WP admin bar */
.admin-bar #hero { margin-top: 0; }

.hero-slides { position: relative; width: 100%; height: 100%; }

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  /* Push content down from fixed header */
  padding-top: 90px;
  padding-bottom: 80px;
}

.hero-slide.active { opacity: 1; }

.hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.1);
  transition: transform 8s ease;
}
.hero-slide.active .hero-slide-bg { transform: scale(1); }

.hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(10,10,10,0.92) 0%,
    rgba(10,10,10,0.7) 50%,
    rgba(200,78,0,0.25) 100%
  );
}

.hero-slide-content {
  position: relative;
  z-index: 2;
  max-width: 740px;
}

.hero-slide-content .section-label {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s ease 0.3s;
}
.hero-slide.active .hero-slide-content .section-label {
  opacity: 1; transform: translateX(0);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  letter-spacing: -1px;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease 0.5s;
}
.hero-slide.active .hero-title { opacity: 1; transform: translateY(0); }

.hero-title span { color: var(--orange); display: block; }

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 540px;
  margin-bottom: 40px;
  line-height: 1.7;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease 0.7s;
}
.hero-slide.active .hero-desc { opacity: 1; transform: translateY(0); }

.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s ease 0.9s;
}
.hero-slide.active .hero-buttons { opacity: 1; transform: translateY(0); }

.hero-controls {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  padding: 0;
}
.hero-dot.active {
  width: 32px;
  background: var(--orange);
  box-shadow: 0 0 10px var(--orange);
}

.hero-arrows {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 24px;
  pointer-events: none;
  z-index: 10;
}

.hero-arrow {
  width: 52px; height: 52px;
  border: 2px solid rgba(255,101,0,0.5);
  border-radius: 50%;
  background: rgba(10,10,10,0.5);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: all;
  transition: var(--transition);
  color: var(--orange);
  font-size: 1.2rem;
}
.hero-arrow:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
  transform: scale(1.1);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 48px;
  right: 48px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.hero-scroll-hint span {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-gray);
  writing-mode: vertical-rl;
}
.scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, var(--orange), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%,100%{opacity:0.3;transform:scaleY(0.8)}
  50%{opacity:1;transform:scaleY(1)}
}

/* ===================================
   STRIP TICKER
   =================================== */
.ticker-strip {
  background: linear-gradient(90deg, var(--orange-dark), var(--orange), var(--orange-dark));
  padding: 14px 0;
  overflow: hidden;
}

.ticker-inner {
  display: flex;
  gap: 0;
  animation: ticker 20s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0 32px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.9);
}

.ticker-item::after {
  content: '⚡';
  font-size: 1rem;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ===================================
   ABOUT SECTION
   =================================== */
#about {
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

#about::before {
  content: '';
  position: absolute;
  right: -200px;
  top: 50%;
  transform: translateY(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,101,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-image-wrap {
  position: relative;
}

.about-image-main {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  border-radius: 8px;
  filter: grayscale(20%) contrast(1.1);
}

.about-image-card {
  position: absolute;
  bottom: -30px;
  right: -30px;
  background: var(--orange);
  border-radius: 8px;
  padding: 24px 28px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(255,101,0,0.4);
}

.about-image-card .num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  line-height: 1;
}

.about-image-card .label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-top: 4px;
}

.about-content { padding-right: 20px; }

.about-text {
  color: var(--text-gray);
  margin: 24px 0 32px;
  font-size: 1rem;
  line-height: 1.8;
}

.about-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.about-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}
.about-feature:hover {
  border-color: var(--orange);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.about-feature-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,101,0,0.1);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid rgba(255,101,0,0.2);
}

.about-feature-text h4 {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-white);
}
.about-feature-text p {
  font-size: 0.78rem;
  color: var(--text-gray);
  margin-top: 2px;
  line-height: 1.4;
}

/* ===================================
   SERVICES
   =================================== */
#servizi {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

#servizi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
}

.servizi-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 64px;
}

.servizi-desc {
  color: var(--text-gray);
  margin-top: 16px;
  font-size: 1rem;
  line-height: 1.7;
}

.servizi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.servizio-card {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 28px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
}

.servizio-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--orange-dark), var(--orange));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.servizio-card:hover {
  border-color: rgba(255,101,0,0.4);
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(255,101,0,0.15);
}
.servizio-card:hover::before { transform: scaleX(1); }

.servizio-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--orange);
  margin-bottom: 20px;
  opacity: 0.6;
}

.servizio-icon {
  width: 64px; height: 64px;
  background: rgba(255,101,0,0.08);
  border: 1px solid rgba(255,101,0,0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
  transition: var(--transition);
}
.servizio-card:hover .servizio-icon {
  background: rgba(255,101,0,0.15);
  border-color: var(--orange);
  box-shadow: 0 0 20px rgba(255,101,0,0.2);
}

.servizio-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 12px;
}

.servizio-card p {
  font-size: 0.9rem;
  color: var(--text-gray);
  line-height: 1.7;
}

.servizio-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange);
  transition: gap 0.3s;
}
.servizio-card:hover .servizio-link { gap: 12px; }

/* ===================================
   STATS / NUMERI
   =================================== */
#numeri {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a0a00 50%, #0f0f0f 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

#numeri::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23FF6500' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.numeri-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
}

.numero-item {
  position: relative;
  padding: 48px 32px;
  text-align: center;
  border-right: 1px solid rgba(255,101,0,0.15);
}
.numero-item:last-child { border-right: none; }

.numero-val {
  font-family: var(--font-display);
  font-size: clamp(3rem, 5vw, 5rem);
  font-weight: 900;
  color: var(--orange);
  line-height: 1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.numero-val .suffix {
  font-size: 0.45em;
  color: var(--orange-light);
}

.numero-label {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-gray);
  margin-top: 8px;
}

/* ===================================
   PROGETTI / GALLERY
   =================================== */
#progetti { background: var(--bg-dark); }

.progetti-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
}

.progetti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.progetto-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--bg-card);
}

.progetto-card:nth-child(1) { grid-column: span 2; aspect-ratio: 16/9; }

.progetto-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-card2) 0%, #1c1c1c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  transition: transform 0.6s ease;
}
.progetto-card:hover .progetto-bg { transform: scale(1.08); }

.progetto-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 28px;
}

.progetto-cat {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

.progetto-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text-white);
  transform: translateY(16px);
  opacity: 0;
  transition: all 0.4s ease;
}
.progetto-card:hover .progetto-title { transform: translateY(0); opacity: 1; }

.progetto-zoom {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px; height: 40px;
  background: rgba(255,101,0,0.8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.3s ease;
}
.progetto-card:hover .progetto-zoom { opacity: 1; transform: scale(1); }

/* ===================================
   PERCHE NOI
   =================================== */
#perche-noi {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.perche-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.perche-list { margin-top: 36px; display: flex; flex-direction: column; gap: 20px; }

.perche-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}
.perche-item:hover {
  border-color: var(--orange);
  transform: translateX(8px);
  box-shadow: -4px 0 0 var(--orange), var(--shadow);
}

.perche-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 900;
  color: var(--orange);
  opacity: 0.3;
  line-height: 1;
  min-width: 48px;
  transition: opacity 0.3s;
}
.perche-item:hover .perche-num { opacity: 1; }

.perche-item h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 4px;
}
.perche-item p { font-size: 0.86rem; color: var(--text-gray); line-height: 1.6; }

.perche-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

.perche-circuit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circuit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid;
  animation: rotateSlow linear infinite;
}

.circuit-ring:nth-child(1) {
  width: 300px; height: 300px;
  border-color: rgba(255,101,0,0.15);
  animation-duration: 20s;
}
.circuit-ring:nth-child(2) {
  width: 220px; height: 220px;
  border-color: rgba(255,101,0,0.2);
  animation-duration: 15s;
  animation-direction: reverse;
  border-style: dashed;
}
.circuit-ring:nth-child(3) {
  width: 140px; height: 140px;
  border-color: rgba(255,101,0,0.3);
  animation-duration: 10s;
}

@keyframes rotateSlow { to { transform: rotate(360deg); } }

.circuit-center {
  position: relative;
  z-index: 2;
  width: 100px; height: 100px;
  background: rgba(255,101,0,0.1);
  border: 2px solid var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 0 40px rgba(255,101,0,0.3);
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%,100%{box-shadow: 0 0 20px rgba(255,101,0,0.3);}
  50%{box-shadow: 0 0 60px rgba(255,101,0,0.6), 0 0 100px rgba(255,101,0,0.2);}
}

/* ===================================
   TESTIMONIALS
   =================================== */
#testimonianze { background: var(--bg-dark); }

.testi-header { text-align: center; margin-bottom: 56px; }

.testi-slider-wrap { position: relative; overflow: hidden; }

.testi-slides {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.testi-slide { min-width: 100%; }

.testi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.testi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  position: relative;
  transition: var(--transition);
}
.testi-card:hover {
  border-color: rgba(255,101,0,0.4);
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.testi-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  color: var(--orange);
  font-size: 1rem;
}

.testi-text {
  font-size: 0.92rem;
  color: var(--text-gray);
  line-height: 1.8;
  font-style: italic;
  margin-bottom: 24px;
}

.testi-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testi-avatar {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--orange-dark), var(--orange-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.testi-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-white);
}
.testi-role { font-size: 0.78rem; color: var(--text-gray); }

.testi-quote {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 3rem;
  color: rgba(255,101,0,0.08);
  font-family: Georgia, serif;
  line-height: 1;
}

/* ===================================
   CTA BAND
   =================================== */
#cta-band {
  background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 50%, var(--orange-light) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

#cta-band::before {
  content: '⚡';
  position: absolute;
  font-size: 25rem;
  opacity: 0.04;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.cta-band-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.cta-band-sub {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  margin-bottom: 40px;
  max-width: 540px;
  margin-left: auto;
  margin-right: auto;
}

.cta-band .btn-primary {
  background: #fff;
  color: var(--orange-dark);
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.cta-band .btn-primary:hover { background: #fff; box-shadow: 0 16px 50px rgba(0,0,0,0.4); }

/* ===================================
   CONTATTI
   =================================== */
#contatti { background: var(--bg-card); }

.contatti-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 80px;
}

.contatti-info { padding-right: 20px; }

.contact-items { margin-top: 40px; display: flex; flex-direction: column; gap: 20px; }

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: var(--transition);
}
.contact-item:hover { border-color: var(--orange); }

.contact-item-icon {
  width: 48px; height: 48px;
  background: rgba(255,101,0,0.1);
  border: 1px solid rgba(255,101,0,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.contact-item-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-gray);
  margin-bottom: 4px;
}

.contact-item-val {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-white);
}

.contact-form-wrap {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-white);
  margin-bottom: 28px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-group label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-gray);
}

.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  color: var(--text-white);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.form-control:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255,101,0,0.1);
}
.form-control::placeholder { color: rgba(160,160,160,0.5); }

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

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.form-check input[type="checkbox"] { accent-color: var(--orange); margin-top: 2px; }
.form-check label { font-size: 0.8rem; color: var(--text-gray); line-height: 1.4; }
.form-check label a { color: var(--orange); }

.form-msg { display: none; padding: 12px 16px; border-radius: 6px; margin-top: 16px; font-size: 0.88rem; }
.form-msg.success { display: block; background: rgba(0,200,100,0.1); border: 1px solid rgba(0,200,100,0.3); color: #00c864; }
.form-msg.error { display: block; background: rgba(255,60,60,0.1); border: 1px solid rgba(255,60,60,0.3); color: #ff3c3c; }

/* ===================================
   FOOTER
   =================================== */
#site-footer {
  background: #080808;
  border-top: 1px solid var(--border);
}

.footer-top {
  padding: 80px 0 60px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
}

.footer-brand img {
  height: 56px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 8px rgba(255,101,0,0.3));
}

.footer-brand p {
  font-size: 0.88rem;
  color: var(--text-gray);
  line-height: 1.7;
  max-width: 280px;
  margin-bottom: 24px;
}

.footer-social {
  display: flex;
  gap: 12px;
}
.social-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-gray);
  transition: var(--transition);
}
.social-btn:hover { border-color: var(--orange); color: var(--orange); transform: translateY(-3px); }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-white);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col ul li a {
  font-size: 0.88rem;
  color: var(--text-gray);
  transition: color 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.footer-col ul li a:hover { color: var(--orange); }
.footer-col ul li a::before { content: '▸'; font-size: 0.7rem; color: var(--orange); }

.footer-bottom {
  border-top: 1px solid rgba(255,101,0,0.1);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-bottom p { font-size: 0.8rem; color: var(--text-gray); }
.footer-bottom a { color: var(--orange); }

/* ===================================
   SCROLL ANIMATIONS
   =================================== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.revealed { opacity: 1; transform: translateY(0); }

.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-left.revealed { opacity: 1; transform: translateX(0); }

.reveal-right { opacity: 0; transform: translateX(40px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal-right.revealed { opacity: 1; transform: translateX(0); }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1100px) {
  .servizi-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .numeri-grid { grid-template-columns: repeat(2, 1fr); }
  .numero-item:nth-child(2) { border-right: none; }
  .numero-item:nth-child(3) { border-top: 1px solid rgba(255,101,0,0.15); }
  .testi-grid { grid-template-columns: 1fr 1fr; }
  /* Hide desktop nav on tablets too */
  .site-nav { display: none !important; }
  .header-cta { display: none !important; }
  .hamburger { display: flex !important; }
}

@media (max-width: 900px) {
  .about-grid, .perche-grid, .contatti-grid { grid-template-columns: 1fr; }
  .about-image-wrap { order: -1; }
}

@media (max-width: 768px) {
  .section-padding { padding: 64px 0; }

  /* ---- HEADER MOBILE ---- */
  #site-header { padding: 14px 0; }
  #site-header .header-inner { gap: 0; justify-content: space-between; }
  .site-logo img { height: 44px; }
  .site-nav,
  .header-cta { display: none !important; }
  .hamburger { display: flex !important; }

  /* ---- HERO MOBILE ---- */
  #hero { min-height: 100svh; }
  .hero-slide { align-items: flex-end; padding-bottom: 100px; }
  .hero-title { font-size: 2rem; line-height: 1; margin-bottom: 16px; }
  .hero-desc { font-size: 0.88rem; margin-bottom: 28px; }
  .hero-buttons { flex-direction: column; gap: 12px; }
  .hero-buttons .btn { width: 100%; justify-content: center; }
  .hero-arrows { padding: 0 12px; top: auto; bottom: 140px; transform: none; }
  .hero-arrow { width: 42px; height: 42px; font-size: 1rem; }
  .hero-controls { bottom: 110px; }
  .hero-scroll-hint { display: none; }

  /* ---- LAYOUT ---- */
  .about-features { grid-template-columns: 1fr; }
  .servizi-grid { grid-template-columns: 1fr; }
  .progetti-grid { grid-template-columns: 1fr; }
  .progetto-card:nth-child(1) { grid-column: span 1; aspect-ratio: 4/3; }
  .testi-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .numeri-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* ---- COOKIE ---- */
  #cookie-banner { flex-direction: column; gap: 16px; padding: 20px; }
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1; justify-content: center; text-align: center; }

  /* ---- FORM ---- */
  .form-grid { grid-template-columns: 1fr; }
  .progetti-header { flex-direction: column; gap: 20px; align-items: flex-start; }

  /* ---- NUMERI MOBILE ---- */
  .numero-item { padding: 32px 20px; }
  .numero-val { font-size: 2.8rem; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.75rem; }
  .hero-desc { font-size: 0.85rem; }
  .perche-visual { display: none; }
  .numeri-grid { grid-template-columns: 1fr 1fr; }
  .contatti-grid { gap: 40px; }
  .hero-slide { padding-bottom: 90px; }
  .section-title { font-size: 1.8rem; }
  .btn { font-size: 0.82rem; padding: 14px 24px; }
  .contact-form-wrap { padding: 24px 18px; }
  .servizio-card { padding: 28px 20px; }
  .testi-card { padding: 24px 20px; }
}

/* Fix for very tall/small phones */
@media (max-height: 700px) and (max-width: 768px) {
  .hero-slide { padding-bottom: 80px; }
  .hero-controls { bottom: 55px; }
}

/* ===================================
   MOBILE HERO FIX — OVERRIDE
   =================================== */
@media (max-width: 768px) {
  /* Fix hero — content centered, no bottom-push */
  .hero-slide {
    align-items: center !important;
    padding-top: 80px !important;
    padding-bottom: 60px !important;
  }
  .hero-title {
    font-size: clamp(1.7rem, 7.5vw, 2.2rem) !important;
    line-height: 1.05 !important;
    margin-bottom: 14px !important;
  }
  .hero-desc { font-size: 0.86rem !important; margin-bottom: 22px !important; }
  .hero-buttons { flex-direction: column !important; gap: 10px !important; }
  .hero-buttons .btn { width: 100% !important; justify-content: center !important; }
  .hero-arrow { width: 38px !important; height: 38px !important; font-size: 0.85rem !important; }
  .hero-arrows { padding: 0 6px !important; }
  .hero-controls { bottom: 20px !important; }

  /* Fix numero items border */
  .numero-item { border-right: none !important; padding: 28px 16px !important; }
  .numero-val { font-size: 2.6rem !important; }
  .numero-label { font-size: 0.7rem !important; }
}

/* WP admin bar corrections */
.admin-bar #site-header { top: 32px !important; }
@media screen and (max-width: 782px) {
  .admin-bar #site-header { top: 46px !important; }
  .admin-bar .hero-slide { padding-top: 130px !important; }
  .admin-bar #hero { }
}
