:root {
  --bg-dark: #0b1220;
  --bg-panel: #0e1622;
  --bg-light: #f4f7fa;
  --text-light: #f2f6fa;
  --text-muted: #9fb3c8;
  --text-dark: #1c2733;
  --accent: #4fd6ff;
  --accent-strong: #1c8fd6;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
}

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

/* ---------- HERO ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at 50% 30%, #14233a 0%, #0b1220 70%);
  color: var(--text-light);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(79,214,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79,214,255,0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.navbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  z-index: 5;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  opacity: 0;
  animation: navFadeIn 0.8s ease-out 1.4s forwards;
}

.nav-logo {
  height: 34px;
  width: auto;
}

.nav-wordmark {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-light);
}

.nav-wordmark .accent { color: var(--accent); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
  opacity: 0;
  animation: navFadeIn 0.8s ease-out 1.6s forwards;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 15px;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.nav-links a:hover { color: var(--accent); }

@keyframes navFadeIn {
  to { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.hero-logo {
  position: relative;
  width: min(520px, 82vw);
  aspect-ratio: 1169 / 709;
  margin: 0 auto;
  opacity: 0;
  transform: scale(0) rotate(-15deg);
  filter: drop-shadow(0 0 0 rgba(79,214,255,0));
  animation: logoAppear 1.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  cursor: pointer;
}

.wave-strip {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--i) * (100% / 12));
  width: calc(100% / 12);
  background-image: url('../assets/logo-full.png');
  background-repeat: no-repeat;
  background-size: 1200% 100%;
  background-position: calc(var(--i) / 11 * 100%) center;
  will-change: transform;
}

.hero-logo:hover .wave-strip {
  animation: waveStrip 1s ease-in-out;
  animation-delay: calc(var(--i) * 0.05s);
}

@keyframes waveStrip {
  0%   { transform: translateY(0); }
  35%  { transform: translateY(-9px); }
  65%  { transform: translateY(7px); }
  100% { transform: translateY(0); }
}

@keyframes logoAppear {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-15deg);
    filter: drop-shadow(0 0 0 rgba(79,214,255,0));
  }
  60% {
    opacity: 1;
    transform: scale(1.08) rotate(2deg);
    filter: drop-shadow(0 0 40px rgba(79,214,255,0.45));
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 18px rgba(79,214,255,0.25));
  }
}

.hero-tagline {
  margin-top: 24px;
  font-size: clamp(16px, 2.2vw, 22px);
  color: var(--text-muted);
  letter-spacing: 1px;
  opacity: 0;
  animation: navFadeIn 1s ease-out 1.1s forwards;
}

.scroll-cta {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 60px;
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  animation: navFadeIn 1s ease-out 1.8s forwards;
}

.scroll-arrow {
  font-size: 20px;
  animation: bounce 1.8s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- SECTIONS ---------- */

.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 40px);
  color: var(--text-dark);
  margin-bottom: 20px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 4px;
  background: var(--accent-strong);
  margin: 14px auto 0;
  border-radius: 2px;
}

.intro {
  max-width: 780px;
  margin: 0 auto;
  padding: 100px 24px 60px;
  text-align: center;
}

.section-text {
  font-size: 18px;
  line-height: 1.7;
  color: #45566a;
  text-align: left;
}

.section-text p { margin: 0 0 18px; }
.section-text p:last-child { margin-bottom: 0; }

/* ---------- COMPONENTI (PORTFOLIO) ---------- */

.products {
  padding: 20px 0 40px;
}

.products-intro {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 0;
}

.component-row {
  width: 100%;
  padding: 100px 0;
}

.component-row[data-align="left"] {
  background: var(--bg-light);
}

.component-row[data-align="right"] {
  background: #eceff4;
}

.component {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  gap: 90px;
}

.component-row[data-align="right"] .component {
  flex-direction: row-reverse;
}

.component-media {
  flex: 1 1 50%;
  overflow: hidden;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 1s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease;
}

.component.in-view .component-media {
  transform: scale(1);
  opacity: 1;
}

.component-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.component-media:hover img {
  transform: scale(1.045);
}

.component-info {
  flex: 1 1 50%;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease 0.15s, transform 0.9s ease 0.15s;
}

.component.in-view .component-info {
  opacity: 1;
  transform: translateY(0);
}

.component-eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 18px;
}

.component-title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-dark);
  margin: 0 0 20px;
  transition: color 0.8s ease 0.3s;
}

.component.in-view .component-title {
  color: var(--accent-strong);
}

.component-summary {
  font-size: 18px;
  line-height: 1.65;
  color: #56677a;
  margin: 0 0 36px;
  max-width: 46ch;
}

.component-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px 32px;
  margin: 0 0 36px;
  padding-top: 28px;
  border-top: 1px solid rgba(28, 39, 51, 0.12);
}

.component-specs dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8a97a6;
  margin: 0 0 6px;
}

.component-specs dd {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-dark);
  margin: 0;
}

.component-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-strong);
  cursor: pointer;
}

.toggle-arrow {
  display: inline-block;
  transition: transform 0.35s ease;
}

.component-toggle[aria-expanded="true"] .toggle-arrow {
  transform: rotate(90deg);
}

.component-detail-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.component-detail-wrap.open {
  grid-template-rows: 1fr;
}

.component-detail {
  overflow: hidden;
  min-height: 0;
}

.component-detail p {
  font-size: 16px;
  line-height: 1.7;
  color: #5a6b7d;
  margin: 22px 0 0;
}

/* ---------- CONTACT / FOOTER ---------- */

.contact {
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 90px 24px 40px;
  text-align: center;
}

.contact .section-title { color: var(--text-light); }
.contact .section-title::after { background: var(--accent); }

.contact-lead {
  margin: 24px 0 0;
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 700;
  color: var(--text-light);
}

.contact-subtext {
  margin: 12px auto 0;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-muted);
}

.contact-grid {
  max-width: 760px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.contact-item {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(79,214,255,0.15);
  border-radius: 12px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.contact-item a {
  color: var(--text-light);
  text-decoration: none;
}

.contact-item a:hover { color: var(--accent); }

.contact-icon { font-size: 24px; }

.contact-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.85;
}

.contact-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 44px;
  padding: 16px 32px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  color: var(--text-light);
  background: rgba(79, 214, 255, 0.08);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.contact-cta:hover {
  background: var(--accent);
  color: var(--bg-dark);
  transform: translateY(-2px);
}

.copyright {
  margin-top: 60px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 820px) {
  .navbar { padding: 16px 20px; }
  .nav-links { gap: 12px; font-size: 12px; }
  .nav-links a { white-space: nowrap; }
  .nav-logo { height: 26px; }
  .nav-wordmark { font-size: 16px; }

  .component,
  .component-row[data-align="right"] .component {
    flex-direction: column;
    align-items: stretch;
    gap: 36px;
    padding: 0 24px;
  }

  .component-row { padding: 64px 0; }

  .component-summary { max-width: none; }

  .component-specs { grid-template-columns: 1fr 1fr; gap: 18px 20px; }

  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .component-specs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-logo, .nav-brand, .nav-links, .hero-tagline, .scroll-cta,
  .component-media, .component-media img, .component-info, .scroll-arrow, .wave-strip {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}
