:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --text: #111111;
  --muted: #666666;
  --accent: #2563ff;
  --accent-soft: #dce8ff;
  --wave: #4d9fff;
  --border: #e2e2e2;
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ---- NAV ---- */
nav {
  position: sticky;
  animation: headown ease-out 0.5s forwards;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 5vw;
  background: rgba(245,244,240,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
nav.scrolled { box-shadow: 0 4px 24px rgba(0,0,0,0.07); }

.nav-logo {
  align-items: center;
  background-color: black;
  border-radius: 20px;
  padding: 10px;
  margin: 0px;
  width: 120px;
  height: 70px;
  font-family: 'Syne', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  text-decoration: none;
}

.nav-links { display: flex; gap: 36px; list-style: none; }
.nav-links a {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.02em;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width .25s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  background: var(--text);
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 50px;
  transition: background .2s, transform .15s !important;
}
.nav-cta:hover { background: var(--accent) !important; transform: translateY(-1px); }
.nav-cta::after { display: none !important; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 26px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg);
  z-index: 1001;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-family: 'Syne', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}
.mobile-menu a:hover { color: var(--accent); }
.mobile-close {
  position: absolute;
  top: 23px; right: 5.5vw;
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text);
}

/* ---- HERO ---- */
#home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 5vw 80px;
  position: relative;
  overflow: hidden;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
}
.blob-1 { width: 500px; height: 500px; background: #2563ff; top: -100px; left: -150px; }
.blob-2 { width: 400px; height: 400px; background: #4d9fff; bottom: -50px; right: -100px; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1.0rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 50px;
  margin-bottom: 28px;
  animation: fadeUp .6s ease both;
}
.hero-badge .dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(1.4); }
}

h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 820px;
  animation: fadeUp .7s .1s ease both;
}
h1 span { color: var(--accent); }

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 520px;
  margin: 24px auto 40px;
  line-height: 1.7;
  font-weight: 300;
  animation: fadeUp .7s .2s ease both;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeUp .7s .3s ease both;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 16px 36px;
  border-radius: 50px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(37,99,255,0.4); }

.btn-secondary {
  background: transparent;
  color: white;
  padding: 16px 36px;
  border-radius: 50px;
  border: 2px solid var(--border);
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.6s;
  background-color: transparent;
}
.btn-secondary:hover {
  border-color: var(--accent);
  background-color: white;
  color: black;
}

/* ---- HERO VISUAL (3 phones) ---- */
.hero-visual {
  margin-top: 70px;
  position: relative;
  width: 100%;
  max-width: 1100px;
  animation: fadeUp .8s .4s ease both;
}

.phone-mockup-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(12px, 2vw, 28px);
  perspective: 1200px;
}

/* Base phone shell — fluid width using clamp */
.phone {
  width: clamp(160px, 22vw, 230px);
  background: var(--surface);
  border-radius: 36px;
  border: 2px solid var(--border);
  padding: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  transition: transform .3s, opacity .3s;
  flex-shrink: 0;
}

/* Center phone: larger, lifted */
.phone.center-phone {
  width: clamp(180px, 24vw, 250px);
  transform: scale(1.06) translateY(-18px);
  z-index: 2;
  box-shadow: 0 32px 80px rgba(37,99,255,0.18), 0 4px 12px rgba(0,0,0,0.08);
}
.phone.center-phone:hover {
  transform: scale(1.06) translateY(-24px);
}

/* Side phones: angled, faded */
.phone.side-phone {
  opacity: 0.72;
}


.phone.side-phone:hover {
  opacity: 1;
  transform: translateY(-20px);
}

/* Phone inner screen */
.phone-inner {
  background: #f0f6ff;
  border-radius: 28px;
  padding: 16px 13px;
  min-height: clamp(300px, 38vw, 400px);
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow: hidden;
}

/* Notch */
.ph-notch {
  width: 52px; height: 7px;
  background: #d4e4f7;
  border-radius: 8px;
  margin: 0 auto 2px;
}

/* Screen title */
.ph-screen-title {
  font-family: 'Syne', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #111;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Shared card */
.phone-card {
  background: #fff;
  border-radius: 13px;
  padding: 11px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.phone-card-title {
  font-family: 'Syne', sans-serif;
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 8px;
}

/* Device rows */
.device-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 0;
  border-bottom: 1px solid #f0f0f0;
}
.device-row:last-child { border-bottom: none; }
.device-icon { color: var(--accent); display: flex; align-items: center; flex-shrink: 0; }
.device-info { flex: 1; }
.device-name { font-size: 10px; font-weight: 500; color: var(--text); }
.device-status { font-size: 9px; color: var(--muted); }

/* Toggle */
.toggle {
  width: 26px; height: 15px;
  background: var(--accent);
  border-radius: 8px;
  position: relative;
  flex-shrink: 0;
}
.toggle.off { background: #ddd; }
.toggle-knob {
  position: absolute;
  top: 2px; right: 2px;
  width: 11px; height: 11px;
  background: #fff;
  border-radius: 50%;
}
.toggle.off .toggle-knob { right: auto; left: 2px; }

/* Temperature row */
.temp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 13px;
  padding: 11px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.temp-circle {
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.temp-num { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 800; color: var(--accent); }
.temp-label { font-size: 7px; color: var(--muted); }
.temp-info { flex: 1; }
.temp-room { font-size: 11px; font-weight: 600; color: var(--text); }
.temp-status { font-size: 9px; color: var(--muted); margin-top: 2px; }

/* Green badge */
.badge-green {
  background: #e6f5ee;
  color: #1a8c50;
  font-size: 8px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* Scene card */
.scene-card {
  background: var(--accent);
  border-radius: 13px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.scene-icon {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.scene-info { flex: 1; }
.scene-name { font-size: 10px; font-weight: 700; color: #fff; font-family: 'Syne', sans-serif; }
.scene-sub { font-size: 8px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.scene-dot {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Energy bar */
.energy-bar-wrap {}
.energy-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}
.energy-label { font-size: 9px; color: var(--muted); }
.energy-val-num { font-size: 11px; font-weight: 700; color: var(--text); }
.energy-track {
  height: 5px;
  background: #dce8ff;
  border-radius: 4px;
  overflow: hidden;
}
.energy-fill { height: 100%; background: var(--accent); border-radius: 4px; width: 68%; }
.energy-saving { font-size: 9px; color: var(--accent); margin-top: 5px; font-weight: 600; }

/* Security banner */
.security-banner {
  background: #ffffff;
  border-radius: 13px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sec-icon {
  width: 28px; height: 28px;
  background: #2563ff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sec-text { flex: 1; }
.sec-title { font-size: 10px; font-weight: 700; color: #000000; }
.sec-sub { font-size: 9px; color: rgba(0, 0, 0, 0.5); }
.sec-badge {
  background: #4ade80;
  color: #052e16;
  font-size: 8px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 20px;
  flex-shrink: 0;
}
/* social */
.footer-socials {
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.footer-socials a:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.06);
}
/* Camera grid */
.cam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.cam-cell {
  background: #2563ff;
  border-radius: 7px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.cam-label {
  position: absolute;
  bottom: 4px; left: 5px;
  font-size: 7px;
  color: rgb(255, 255, 255);
}
.cam-dot {
  position: absolute;
  top: 4px; right: 4px;
  width: 5px; height: 5px;
  background: #ef4444;
  border-radius: 50%;
}

/* Stats pills row */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.stat-pill {
  background: #fff;
  border-radius: 11px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.stat-val {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
}
.stat-lbl { font-size: 8px; color: var(--muted); margin-top: 2px; }

/* Savings card */
.savings-card {}
.savings-val {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 2px;
}
.savings-sub { font-size: 9px; color: var(--muted); }

/* ---- SECTIONS COMMON ---- */
section { padding: 100px 5vw; }
.section-label {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
h2 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.75;
  max-width: 520px;
  font-weight: 300;
}

/* ---- UPCYCLE ---- */
#upcycle-devices {
  background: var(--accent);
  color: #fff;
  padding: 60px 5vw;
  text-align: center;
  border-radius: var(--radius);
  margin: 40px 5vw;
  box-shadow: 0 10px 30px rgba(37,99,255,0.2);
}
#upcycle-devices h2 {
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  margin-bottom: 15px;
}
#upcycle-devices p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 650px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* ---- COME FUNZIONA ---- */
#come-funziona { background: var(--surface); padding: 10px; }

.funziona-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-top: 60px;
}
.steps { display: flex; flex-direction: column; gap: 36px; }
.step { display: flex; gap: 20px; align-items: flex-start; transition: opacity .5s, transform .5s; }
.step-num {
  flex-shrink: 0;
  width: 48px; height: 48px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
}
.step-body h3 { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 6px; }
.step-body p { color: var(--muted); font-size: 0.95rem; line-height: 1.65; }

.funziona-visual {
  background: #edf3ff;
  border-radius: var(--radius);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid var(--border);
}
.fv-row {
  background: #fff;
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform .2s;
}
.fv-row:hover { transform: translateX(4px); }
.fv-icon { font-size: 1.6rem; display: flex; align-items: center; color: var(--accent); }
.fv-text { flex: 1; }
.fv-title { font-weight: 600; font-size: .95rem; }
.fv-sub { color: var(--muted); font-size: .82rem; }
.fv-badge {
  background: #e6f5ee;
  color: #1a8c50;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}
.fv-badge.warn { background: #fff4e0; color: #c97a00; }

/* ---- APP ---- */
#app { background: var(--bg); }
.app-header { text-align: center; max-width: 600px; margin: 0 auto 60px; }
.app-header .section-desc { margin: 0 auto; }
.app-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 60px;
}
.feat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s;
  max-height: 400px;
}
.feat-card:hover { box-shadow: 0 12px 36px rgba(0,0,0,0.08); transform: translateY(-4px) !important; }
.feat-icon { margin-bottom: 20px; display: block; color: var(--accent); }
.feat-card h3 { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.feat-card p { color: var(--muted); font-size: .92rem; line-height: 1.65; }

/* ---- CHI SIAMO ---- */
#chi-siamo { background: var(--surface); }
.chisiamo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-top: 0;
}
.values { display: flex; flex-direction: column; gap: 20px; margin-top: 32px; }
.val {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px;
  background: var(--bg);
  border-radius: 14px;
  border: 1px solid var(--border);
}
.val-icon { font-size: 1.4rem; margin-top: 2px; color: var(--accent); }
.val h4 { font-family: 'Syne', sans-serif; font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.val p { color: var(--muted); font-size: .87rem; line-height: 1.6; }
.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.team-card {
  background: var(--bg);
  border-radius: 18px;
  padding: 28px 24px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s;
}
.team-card:hover { transform: translateY(-4px) !important; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.team-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.team-card h4 { font-family: 'Syne', sans-serif; font-weight: 700; margin-bottom: 4px; }
.team-card span { font-size: .82rem; color: var(--muted); }

/* ---- CTA BANNER ---- */
.cta-section {
  background: var(--text);
  color: #fff;
  text-align: center;
  padding: 80px 5vw;
}
.cta-section h2 { color: #fff; margin-bottom: 16px; }
.cta-section p {
  color: rgba(255,255,255,.6);
  font-size: 1.05rem;
  margin-bottom: 36px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- FOOTER ---- */
footer {
  background: var(--text);
  color: rgba(255,255,255,.5);
  padding: 40px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: .85rem;
}
footer a { color: rgba(255,255,255,.5); text-decoration: none; margin-left: 20px; transition: color .2s; }
footer a:hover { color: #fff; }

/* ---- ANIMATIONS ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes headown {
  from { transform: translateY(-30px); opacity: 0.3; }
  to { transform: translateY(0px); opacity: 1; }
}

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

/* Tablet landscape: shrink gap, reduce side phone angle */
@media (max-width: 1024px) {
  .hero-visual { max-width: 100%; padding: 0 2vw; }
  .phone-mockup-wrap { gap: clamp(8px, 1.5vw, 16px); }
  
}

/* Tablet portrait: hide one side phone, keep left + center */
@media (max-width: 820px) {
  .phone.side-phone:last-child { display: none; }
  .phone.side-phone:first-child {
    opacity: 0.6;
    transform: rotateY(5deg) translateY(10px) scale(0.91);
  }
  .phone.center-phone {
    transform: scale(1.05) translateY(-14px);
  }
  .phone.center-phone:hover {
    transform: scale(1.05) translateY(-20px);
  }
}

/* Mobile: only center phone, full width, no rotation */
@media (max-width: 640px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-visual { margin-top: 50px; }
  .phone-mockup-wrap { justify-content: center; }
  .phone.side-phone { display: none; }
  .phone.center-phone {
    width: min(280px, 78vw);
    transform: none;
    box-shadow: 0 24px 60px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
  }
  .phone.center-phone:hover { transform: translateY(-6px); }
  .phone-inner { min-height: 340px; }

  .funziona-grid,
  .chisiamo-grid { grid-template-columns: 1fr; gap: 40px; }
  .app-features { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }

  footer { flex-direction: column; text-align: center; }
  footer div { display: flex; gap: 16px; }
  footer a { margin: 0; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .funziona-grid,
  .chisiamo-grid { grid-template-columns: 1fr; gap: 40px; }
  .app-features { grid-template-columns: 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  footer { flex-direction: column; text-align: center; }
  footer div { display: flex; gap: 16px; }
  footer a { margin: 0; }
}

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