/* =================================================================
   MANUMBO — Homepage  ·  assets/css/style.css
   -----------------------------------------------------------------
   1.  Design tokens (colours, type, spacing) + Dark-mode tokens
   2.  Base / reset
   3.  Reusable utilities (layout, headings, buttons)
   4.  Components
        4.1  Navbar            4.6  Software gallery
        4.2  Theme toggle      4.7  Ambiti cards + CTA
        4.3  Hero (3D map)     4.8  Contatti + form
        4.4  Summary cards     4.9  Closing band
        4.5  Studio + flow     4.10 Footer (pure CSS)
        4.11 Contact modal
   5.  Responsive
   ================================================================= */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* ---- Brand palette (single source of truth) ---- */
  --brand-teal:    #66bea3;
  --brand-teal-dk: #1f7882;
  --brand-teal-d2: #185f68;
  --brand-orange:  #da6b3c;
  --brand-orange-2:#dd5e22;
  --brand-green:   #2e9e54;
  --brand-gold:    #efc04a;
  --brand-gold-dk: #d9a41e;
  --brand-purple:  #8a5db8;
  --brand-brown:   #6b4a3a;
  --brand-red:     #d6492e;

  /* ---- Semantic surfaces (re-mapped in dark mode) ---- */
  --bg:            #ffffff;   /* studio / ambiti */
  --bg-mint:       #f4fff0;   /* software */
  --bg-cream:      #fdffe3;   /* contatti */
  --bg-nav:        #ffffff;
  --card:          #ffffff;
  --field:         #f3f0cf;

  /* Card tints */
  --tint-pink:     #fcede7;
  --tint-cream:    #fbf5e2;
  --tint-lav:      #f1ecf8;
  --tint-mint:     #eaf5ee;
  --tint-teal:     #e6f2f0;
  --tint-warm:     #edeae6;

  /* Text */
  --text:          #45463f;
  --text-soft:     #6a7269;
  --heading:       #2f3330;
  --on-teal:       #16555c;   /* text over light teal */

  /* Lines & shadows */
  --border:        #e7e3da;
  --hairline:      rgba(0,0,0,.08);
  --shadow-sm:     0 4px 14px rgba(31,120,130,.08);
  --shadow-md:     0 12px 30px rgba(31,120,130,.12);
  --shadow-lg:     0 20px 50px rgba(31,120,130,.16);

  /* ---- Typography ---- */
  --font-head: 'Outfit', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;

  /* ---- Spacing scale (4px base, tightened) ---- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-section: 50px;     /* major vertical rhythm */

  /* ---- Layout ---- */
  --wrap: 1200px;
  --radius:    14px;
  --radius-sm: 4px;       /* buttons / fields (slightly rounded) */
  --radius-lg: 20px;
  --ring: 0 0 0 3px rgba(102,190,163,.45);

  /* ---- Motion ---- */
  --ease: cubic-bezier(.4,.2,.2,1);
  --t-fast: .18s;
  --t: .28s;
}

/* ============================================================
   1b. DARK MODE  —  re-mapped surfaces, brand accents preserved
   ============================================================ */
[data-theme="dark"] {
  --bg:        #363e3e;
  --bg-mint:   #313d38;
  --bg-cream:  #3a3d34;
  --bg-nav:    #333b3a;
  --card:      #465050;
  --field:     #3d4744;

  --tint-pink:  #52403a;
  --tint-cream: #524d3c;
  --tint-lav:   #423c4e;
  --tint-mint:  #3a4d44;
  --tint-teal:  #3a4f52;
  --tint-warm:  #4a453f;

  --text:      #d9e5e0;
  --text-soft: #a7bab2;
  --heading:   #f1f6f4;
  --on-teal:   #eafaf4;

  --border:    rgba(255,255,255,.14);
  --hairline:  rgba(255,255,255,.14);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.30);
  --shadow-md: 0 12px 30px rgba(0,0,0,.38);
  --shadow-lg: 0 20px 50px rgba(0,0,0,.46);

  /* slightly brighten brand greens/browns for contrast on dark */
  --brand-green: #46b86c;
  --brand-brown: #d9a487;
}

/* ============================================================
   2. BASE / RESET
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background var(--t) var(--ease), color var(--t) var(--ease);
}

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

a { color: var(--brand-green); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--brand-orange); }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; }

/* ============================================================
   3. UTILITIES
   ============================================================ */
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 15px; }
.wrap--wide { max-width: 1360px; }

.section { padding: var(--sp-section) 0; }

/* --- section heading with rule + doodle --- */
.section-head { position: relative; margin-bottom: var(--sp-7); }
.section-head h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 30px);
  color: var(--brand-orange);
  margin: 0 0 var(--sp-1);
  letter-spacing: -.01em;
}
.section-head::after {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(to right, var(--brand-orange) 0 80px, var(--border) 80px);
}
.section-doodle { position: absolute; right: 0; bottom: var(--sp-3); height: clamp(42px, 5vw, 50px); }

.sub-green {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(19px, 2.2vw, 24px);
  color: var(--brand-green);
  margin: 0 0 var(--sp-5);
  line-height: 1.25;
}

/* --- BUTTON SYSTEM (shared language; slightly rounded) --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 16px;
  line-height: 1;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              transform var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--brand-orange-2); color: #fff; }
.btn--primary:hover { background: #c64f17; color: #fff; box-shadow: var(--shadow-md); }

.btn--orange { background: var(--brand-orange); color: #fff; }
.btn--orange:hover { background: #c2562b; color: #fff; box-shadow: var(--shadow-md); }

.btn--gold { background: var(--brand-gold); color: #2a2a2a; }
.btn--gold:hover { background: #c4920f; color: #2a2a2a; box-shadow: var(--shadow-md); }

.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--brand-teal-dk); color: var(--brand-teal-dk); }

/* ============================================================
   4.1 NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 1000;
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.nav-inner { display: flex; align-items: center; gap: var(--sp-5); height: 72px; }
.nav-logo img { height: 65px; width: auto; }
[data-theme="dark"] .nav-logo img { filter: brightness(0) invert(1); opacity: .92; }

.nav-links {
  display: flex; align-items: stretch; align-self: stretch; gap: 6px;
  list-style: none; margin: 0; padding: 0; flex: 1;
}
.nav-links li {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 100px;
  padding-top: 6px;           /* subtle downward shift of text within the bar */
}
.nav-links li::after {
  content: "";
  position: absolute;
  left: 6px; right: 6px; bottom: 0;  /* inset so the rounded ends are visible */
  height: 3px;
  border-radius: 4px;
  transition: height var(--t-fast) var(--ease);
}

/* Section colours for every item */
.nav-links li:nth-child(1)::after { background: var(--brand-orange); }
.nav-links li:nth-child(2)::after { background: var(--brand-green); }
.nav-links li:nth-child(3)::after { background: var(--brand-gold); }
.nav-links li:nth-child(4)::after { background: var(--brand-purple); }
.nav-links li:nth-child(5)::after { background: var(--brand-teal); }

/* Active state: thicker bar + bolder text */
.nav-links li:has(> a.active)::after { height: 6px; }
.nav-links li:has(> a.active) > a    { font-weight: 700; }

.nav-links a {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  color: var(--heading);
  padding: 12px 6px;
  white-space: nowrap;
}

/* Section-specific hover + active text colours */
.nav-links li:nth-child(1) a:hover, .nav-links li:nth-child(1) a.active { color: var(--brand-orange); }
.nav-links li:nth-child(2) a:hover, .nav-links li:nth-child(2) a.active { color: var(--brand-green); }
.nav-links li:nth-child(3) a:hover, .nav-links li:nth-child(3) a.active { color: var(--brand-gold-dk); }
.nav-links li:nth-child(4) a:hover, .nav-links li:nth-child(4) a.active { color: var(--brand-purple); }
.nav-links li:nth-child(5) a:hover, .nav-links li:nth-child(5) a.active { color: var(--brand-teal); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-3); }

/* --- Language switcher: compact dropdown, same footprint on every breakpoint
   so it never fights the logo/CTA/hamburger for space on narrow phones.
   Colours reuse the existing .btn--ghost look (transparent + border) instead
   of introducing a new tint. The globe icon uses the "Software" gold accent
   (brand-gold-dk / brand-gold) rather than green, since green is already the
   colour of the sibling hamburger/grid icons right next to it — same pairing
   the theme-toggle already uses (dk shade on light, brighter shade on dark)
   so it stays legible against the dark navbar too. --- */
.lang-switch { position: relative; }
.lang-current {
  display: flex; align-items: center; gap: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .02em;
  padding: 9px 12px;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
[data-theme="dark"] .lang-current { border-color: rgba(255,255,255,.32); }
.lang-current:hover, .lang-switch.open .lang-current { border-color: var(--brand-gold-dk); color: var(--brand-gold-dk); }
.lang-current i.fa-globe { font-size: 13px; color: var(--brand-gold-dk); }
[data-theme="dark"] .lang-current i.fa-globe { color: var(--brand-gold); }
[data-theme="dark"] .lang-current:hover, [data-theme="dark"] .lang-switch.open .lang-current { border-color: var(--brand-gold); color: var(--brand-gold); }
.lang-current .lang-caret { font-size: 9px; opacity: .7; transition: transform var(--t-fast) var(--ease); }
.lang-switch.open .lang-current .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 150px;
  list-style: none; margin: 0; padding: var(--sp-2);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), visibility var(--t-fast);
  z-index: 1001;
}
.lang-switch.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.lang-menu li + li { margin-top: 2px; }
.lang-menu a {
  display: flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-body); font-weight: 600; font-size: 14.5px;
  color: var(--text); padding: 9px 10px; border-radius: var(--radius-sm);
  transition: color var(--t-fast) var(--ease);
}
.lang-menu a:hover { color: var(--brand-teal-dk); }
.lang-menu a.active { color: var(--brand-teal-dk); font-weight: 700; }
.lang-menu a .lang-code { font-family: var(--font-head); font-size: 11px; font-weight: 700; color: var(--text-soft); }
.lang-menu a.active .lang-code { color: var(--brand-teal-dk); }
.nav-grid {
  background: none; border: none; color: var(--brand-green);
  font-size: 24px; line-height: 1; cursor: pointer; padding: 4px; display: inline-flex;
  transition: color var(--t-fast) var(--ease);
}
.nav-grid:hover { color: var(--brand-teal-dk); }
.nav-toggle { display: none; background: none; border: none; color: var(--brand-green); font-size: 26px; cursor: pointer; padding: 4px; }

/* ============================================================
   4.2 THEME TOGGLE (fixed, discreet)
   ============================================================ */
.theme-toggle {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 1100;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--brand-teal-dk);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease), color var(--t) var(--ease);
}
.theme-toggle:hover { transform: scale(1.08); }
[data-theme="dark"] .theme-toggle { color: var(--brand-gold); }
.theme-toggle .fa-moon { display: inline; }
.theme-toggle .fa-sun  { display: none; }
[data-theme="dark"] .theme-toggle .fa-moon { display: none; }
[data-theme="dark"] .theme-toggle .fa-sun  { display: inline; }

/* ============================================================
   4.3 HERO — carousel a schermo intero (2 slide)
   ============================================================ */
.hero-carousel { position: relative; height: clamp(480px, 82vh, 680px); overflow: hidden; }
.hero-track { display: flex; width: 100%; height: 100%; transition: transform .7s var(--ease); }
.hero-slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; }
.hero-slide-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-slide-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,26,25,.8) 0%, rgba(8,26,25,.2) 48%, rgba(8,26,25,.05) 68%);
}
.hero-slide-content {
  position: absolute; left: 0; right: 0; bottom: clamp(64px, 9vw, 96px);
  z-index: 2; color: #fff;
}
.hero-slide .hero-badge {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
  color: var(--brand-teal-d2);
  font-family: var(--font-head); font-weight: 600; font-size: 13px;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 7px 14px; border-radius: 100px;
  margin-bottom: var(--sp-4);
}
.hero-slide .hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-orange); box-shadow: 0 0 0 4px rgba(218,107,60,.25); }
.hero-slide-title {
  font-family: var(--font-head); font-weight: 700;
  font-size: clamp(28px, 4.2vw, 48px);
  margin: 0 0 var(--sp-3); max-width: 18ch;
  line-height: 1.08; letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0,0,0,.35);
}
.hero-slide-text {
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(15px, 1.6vw, 18px);
  color: rgba(255,255,255,.94); margin: 0 0 var(--sp-5); max-width: 48ch;
  text-shadow: 0 1px 16px rgba(0,0,0,.3);
}
.hero-slide-cta {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-family: var(--font-head); font-weight: 600; font-size: 15px;
  color: #fff; background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  padding: 11px 20px; border-radius: 100px; border: 1px solid rgba(255,255,255,.4);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.hero-slide-cta:hover { background: rgba(255,255,255,.26); transform: translateY(-2px); color: #fff; }
.hero-slide-cta i { transition: transform var(--t-fast) var(--ease); }
.hero-slide-cta:hover i { transform: translateX(4px); }

.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.5); background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px); color: #fff; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.hero-arrow:hover { background: rgba(255,255,255,.3); transform: translateY(-50%) scale(1.06); }
.hero-arrow:active { transform: translateY(-50%) scale(.94); }
.hero-arrow.prev { left: clamp(12px, 3vw, 32px); }
.hero-arrow.next { right: clamp(12px, 3vw, 32px); }

.hero-dots {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: clamp(20px, 3vw, 32px);
  z-index: 3; display: flex; gap: var(--sp-2);
}
.hero-dots button {
  width: 9px; height: 9px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1.5px solid rgba(255,255,255,.7); background: rgba(255,255,255,.3);
  transition: all var(--t-fast) var(--ease);
}
.hero-dots button.active { width: 22px; border-radius: 100px; background: var(--brand-orange); border-color: var(--brand-orange); }

/* ============================================================
   4.4 SUMMARY CARDS (former banner) — now navigation links
   ============================================================ */
.summary { background: var(--brand-teal); }
[data-theme="dark"] .summary { background: var(--brand-teal-d2); }
.summary-grid {
  display: grid; grid-template-columns: 1.3fr 1fr 1.2fr;
  align-items: stretch;
}
.summary .wrap { padding-top: 0; padding-bottom: 0; }

.panel {
  display: flex; flex-direction: column;
  padding: var(--sp-7) var(--sp-6);
  color: inherit;
  position: relative;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t) var(--ease);
}
.panel:focus-visible { outline: none; box-shadow: var(--ring); }

.panel-software { background: var(--brand-teal-dk);border-left: 1px solid rgba(255, 255, 255, .8);border-right: 1px solid rgba(255, 255, 255, .8); }
.panel-software:hover { background: #1a6b75; transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.panel-software h3 { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: #fff; margin: 0 0 0; display: flex; align-items: center; gap: var(--sp-3); }
.panel-software h3 .go { font-size: 15px; opacity: 0; transform: translateX(-6px); transition: all var(--t) var(--ease); }
.panel-software:hover h3 .go { opacity: .9; transform: translateX(0); }
.panel-software p { color: #e8f5f0; font-size: 15.5px; margin: 0 0 var(--sp-4); }
.panel-software .desk { margin: auto; width: 70%; max-width: 280px; }

.panel-light:hover { background: rgba(255,255,255,.08); transform: translateY(-4px); }
.panel-light h3 { font-family: var(--font-head); font-weight: 700; font-size: 23px; color: #fff; margin: 0 0 var(--sp-2); display:flex; align-items:center; gap:var(--sp-3); }
.panel-light h3 .go { font-size: 15px; opacity: 0; transform: translateX(-6px); transition: all var(--t) var(--ease); }
.panel-light:hover h3 .go { opacity: .9; transform: translateX(0); }
.panel-light .rule { height: 2px; background: rgba(255,255,255,.5); margin-bottom: var(--sp-5); }
.panel-light p { color: rgba(255,255,255,.82); font-size: 15.5px; transition: color var(--t) var(--ease); }
.panel-light:hover p { color: var(--on-teal); }
[data-theme="dark"] .panel-light p { color: rgba(255,255,255,.7); }
[data-theme="dark"] .panel-light:hover p { color: #d6efe7; }

.ambiti-icons { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(10px, 1.5vw, 18px); }
.ambiti-icons .ic {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 50%;
  background: #fff; color: var(--brand-teal-dk);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast) var(--ease);
  container-type: inline-size;
}
/* sized in cqw (relative to the circle's own width) so the icon scales with its
   circle at every breakpoint, instead of a vw-based size that shrinks less than
   the circle does on narrow/mobile layouts and ends up looking too small */
.ambiti-icons .ic i { font-size: 40cqw; }
.panel-light:hover .ic { transform: scale(1.05); }
.ambiti-icons .ic.more { background: var(--brand-teal-dk); color: #fff; }

/* ============================================================
   4.5 STUDIO + flow cards
   ============================================================ */
.studio { background: var(--bg); }
.studio-grid { display: grid; grid-template-columns: 1.32fr 1fr; gap: var(--sp-8); align-items: start; }
.studio-text h4 { font-family: var(--font-head); font-weight: 600; font-size: 20px; color: var(--brand-green); margin: 0 0 var(--sp-3); }
.studio-text .block + .block { margin-top: var(--sp-7); }

.flow { display: flex; flex-direction: column; gap: var(--sp-2); }
.flow-card { border-radius: var(--radius); padding: var(--sp-5); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.flow-card:hover { transform: translateX(4px); box-shadow: var(--shadow-sm); }
.flow-card .fc-head {
  display: flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-head); font-weight: 600; font-size: 18px;
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-3);
  border-bottom: 1px solid var(--hairline);
}
.flow-card .fc-head i { font-size: 20px; }
.flow-card p { font-size: 15px; color: var(--text-soft); margin: 0; }
.flow-arrow { text-align: center; color: var(--text-soft); opacity: .5; font-size: 16px; }

.fc-gold   { background: var(--tint-cream); } .fc-gold   .fc-head { color: var(--brand-gold-dk); }
.fc-purple { background: var(--tint-lav); }   .fc-purple .fc-head { color: var(--brand-purple); }
.fc-green  { background: var(--tint-mint); }  .fc-green  .fc-head { color: var(--brand-green); }
.fc-red    { background: var(--tint-pink); }  .fc-red    .fc-head { color: var(--brand-red); }

/* ============================================================
   4.6 SOFTWARE — immersive horizontal gallery
   ============================================================ */
.software { background: var(--bg-mint); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-7); margin-top: var(--sp-2); }
.cols-3 p { font-size: 15.5px; }

.gallery-wrap { position: relative; margin: var(--sp-7) 0 var(--sp-8); }
.gallery {
  display: flex; align-items: center; gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: var(--sp-5) max(24px, calc((100vw - var(--wrap)) / 2)) var(--sp-6);
  -ms-overflow-style: none; scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery-slide {
  position: relative;
  cursor: zoom-in;
  margin-inline-start: 20px;
  margin-inline-end: 20px;
  scroll-snap-align: center;
  flex: 0 0 clamp(260px, 52vw, 640px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  will-change: transform, opacity;
  transition: transform .4s var(--ease), opacity .4s var(--ease), box-shadow var(--t) var(--ease);
}
.gallery-slide:hover { box-shadow: var(--shadow-md); }
.gallery-slide img { width: 100%; height: clamp(220px, 34vw, 380px); object-fit: cover; object-position: top center; display: block; }
.gallery-slide .gs-label {
  position: absolute;
  left: 16px;
  top: 80%;
  transform: translateY(-50%);
  z-index: 2;
  max-width: calc(100% - 32px);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--brand-teal-dk);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 100px;
  box-shadow: var(--shadow-md);
}

.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 48px; height: 48px; border-radius: 50%;
  border: none; background: var(--brand-teal-dk); color: #fff;
  font-size: 16px; cursor: pointer; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
.gallery-nav:hover:not(:disabled) { background: var(--brand-teal-d2); transform: translateY(-50%) scale(1.06); box-shadow: var(--shadow-md); }
.gallery-nav:active:not(:disabled) { transform: translateY(-50%) scale(.94); }
.gallery-nav:disabled { opacity: .32; cursor: not-allowed; box-shadow: none; }
.gallery-nav.prev { left: max(12px, calc((100vw - var(--wrap)) / 2 - 24px)); }
.gallery-nav.next { right: max(12px, calc((100vw - var(--wrap)) / 2 - 24px)); }

.gallery-dots { display: flex; justify-content: center; gap: var(--sp-2); margin-top: var(--sp-2); }
.gallery-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: var(--border); cursor: pointer; padding: 0; transition: all var(--t-fast) var(--ease); }
.gallery-dots button.active { background: var(--brand-teal-dk); width: 22px; border-radius: 100px; }

.bobo-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--sp-8); align-items: center; }
.bobo-text p { font-size: 15.5px; }
.bobo-devices img { width: 100%; height: auto; }

/* ============================================================
   4.7 AMBITI cards + CTA
   ============================================================ */
.ambiti { background: var(--bg); }
.ambiti-intro { font-size: 16.5px; max-width: 1000px; margin-bottom: var(--sp-8); }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.amb-card {
  border-radius: var(--radius);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  border: 1px solid transparent;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.amb-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.amb-card .ac-head {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-3);
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--hairline);
}
.amb-card .ac-icon {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  display: flex; align-items: center; justify-content: center; font-size: 21px;
}
[data-theme="dark"] .amb-card .ac-icon { background: rgba(255,255,255,.10); }
.amb-card h4 { font-family: var(--font-head); font-weight: 600; font-size: 20px; margin: 0; }
.amb-card p { font-size: 15px; color: var(--text-soft); margin: 0; }

.amb-pink  { background: var(--tint-pink); }  .amb-pink  h4, .amb-pink  .ac-icon { color: var(--brand-red); }
.amb-cream { background: var(--tint-cream); }  .amb-cream h4, .amb-cream .ac-icon { color: var(--brand-gold-dk); }
.amb-brown { background: var(--tint-cream); }  .amb-brown h4, .amb-brown .ac-icon { color: var(--brand-brown); }
.amb-lav   { background: var(--tint-lav); }    .amb-lav   h4, .amb-lav   .ac-icon { color: var(--brand-purple); }
.amb-teal  { background: var(--tint-teal); }   .amb-teal  h4, .amb-teal  .ac-icon { color: var(--brand-teal-dk); }
.amb-dark  { background: var(--tint-warm); }   .amb-dark  h4, .amb-dark  .ac-icon { color: var(--brand-brown); }
.amb-green { background: var(--tint-mint); }   .amb-green h4, .amb-green .ac-icon { color: var(--brand-green); }
[data-theme="dark"] .amb-teal h4, [data-theme="dark"] .amb-teal .ac-icon { color: var(--brand-teal); }

.cta-band { display: flex; justify-content: center; margin-top: var(--sp-8); }
.cta-band .btn { font-size: 18px; padding: 12px 30px; gap: var(--sp-3); font-weight: normal; }
.cta-band i{font-size: 28px;}

/* ============================================================
   4.8 CONTATTI + form
   ============================================================ */
.contatti { background: var(--bg-cream); }
.contatti-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--sp-8); align-items: start; }
.contact-list { margin-top: var(--sp-7); display: flex; flex-direction: column; gap: var(--sp-5); }
.contact-item { display: flex; align-items: center; gap: var(--sp-4); }
.contact-item .ci-icon { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; }
.ci-gold { background: var(--brand-gold); } .ci-green { background: var(--brand-green); }
.contact-item .ci-body { font-size: 15.5px; line-height: 1.5; }

.contact-form { position: relative; }
.field {
  width: 100%; border: 1px solid transparent; background: var(--field);
  border-radius: var(--radius-sm); padding: 15px 18px;
  font-family: var(--font-body); font-size: 16px; color: var(--text);
  margin-bottom: var(--sp-3); resize: vertical; transition: box-shadow var(--t-fast) var(--ease);
}
.field::placeholder { color: var(--text-soft); }
.field:focus { outline: none; box-shadow: var(--ring); }
.field.area { min-height: 180px; padding-right: clamp(90px,16vw,150px) }
.form-monkey { position: absolute; right: 14px; bottom: 84px; width: clamp(90px,16vw,150px); opacity: .85; pointer-events: none; mix-blend-mode: multiply; }
[data-theme="dark"] .form-monkey { mix-blend-mode: screen; opacity: .25; }
.form-actions { display: flex; gap: var(--sp-3); margin-top: var(--sp-1); }

/* ============================================================
   4.9 CLOSING band
   ============================================================ */
.closing { background: var(--bg); text-align: center; padding: var(--sp-7) 0 0; }
.closing h3 { font-family: var(--font-head); font-weight: 700; font-size: clamp(23px, 3vw, 30px); color: var(--brand-orange); margin: 0 0 var(--sp-3); }
.closing p { font-family: var(--font-head); font-size: clamp(15px, 2vw, 19px); color: var(--brand-green); margin: 0; }
.closing .grass { width: 64px; margin: var(--sp-5) auto 0; }
[data-theme="dark"] .closing .grass { content: url("../images/doodle/grass-dark.svg"); }

/* ============================================================
   4.10 FOOTER — pure CSS (gradient + shapes + pattern)
   ============================================================ */
.site-footer {
  position: relative;
  color: #fff;
  background: linear-gradient(120deg, var(--brand-teal) 0 56%, var(--brand-teal-dk) 56% 100%);
  overflow: hidden;
}
[data-theme="dark"] .site-footer {
  background: linear-gradient(120deg, #18555c 0 56%, #103e45 56% 100%);
}
.site-footer a{color: #fff;}
/* subtle dot pattern overlay — darker-teal dots on the pale side (56% split matches the bg gradient), white dots on the dark side */
.site-footer::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--brand-teal-dk) 1.5px, transparent 1.5px);
  background-size: 22px 22px; pointer-events: none; opacity: .14;
  -webkit-mask-image: linear-gradient(120deg, #000 0 56%, transparent 56% 100%);
          mask-image: linear-gradient(120deg, #000 0 56%, transparent 56% 100%);
}
.site-footer::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.06) 1.5px, transparent 1.5px);
  background-size: 22px 22px; pointer-events: none;
  -webkit-mask-image: linear-gradient(120deg, transparent 0 56%, #000 56% 100%);
          mask-image: linear-gradient(120deg, transparent 0 56%, #000 56% 100%);
}
[data-theme="dark"] .site-footer::before {
  -webkit-mask-image: linear-gradient(120deg, #000 0 56%, transparent 56% 100%);
          mask-image: linear-gradient(120deg, #000 0 56%, transparent 56% 100%);
}
[data-theme="dark"] .site-footer::after {
  -webkit-mask-image: linear-gradient(120deg, transparent 0 56%, #000 56% 100%);
          mask-image: linear-gradient(120deg, transparent 0 56%, #000 56% 100%);
}
/* soft glow accent shapes */
.footer-blob { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .35; pointer-events: none; }
.footer-blob.a { width: 320px; height: 320px; background: #8fd6c0; top: -120px; left: 8%; }
.footer-blob.b { width: 260px; height: 260px; background: #0f4a52; bottom: -100px; right: 12%; opacity: .5; }
[data-theme="dark"] .footer-blob.a { opacity: .16; }

.footer-inner {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-7);
  padding-top: var(--sp-7); padding-bottom: var(--sp-5); align-items: start;
  text-shadow: 0 1px 2px rgba(8,36,40,.35);
}
.footer-logo { width: 220px; margin-bottom: var(--sp-3); }
.footer-legal { font-family: var(--font-head); font-weight: 600; color: #fff; margin-bottom: var(--sp-2); opacity: .95; }
.footer-block { font-size: 15px; line-height: 1.5; }
.footer-block .label { font-family: var(--font-head); font-weight: 600; color: #fff; }
.footer-block .val { color: #e3f1ec; margin-bottom: var(--sp-3); }

.footer-contacts { display: flex; flex-direction: column; gap: var(--sp-5); padding-left: 28%; padding-top: 62px; }
.footer-contacts .fc { display: flex; align-items: center; gap: var(--sp-4); }
.footer-contacts .fc i { font-size: 38px; width: 45px; text-align: center; color: #fff; }
.footer-contacts .fc.iso { max-width: 140px; }
.footer-contacts .fc .lbl { font-family: var(--font-head); font-weight: 600; }
.footer-contacts .fc .v { color: #e3f1ec; font-size: 15px; }
.footer-bottom {
  position: relative; z-index: 2; border-top: 1px solid rgba(255,255,255,.15);
  padding: var(--sp-4) var(--sp-3); font-size: 13.5px; color: rgba(255,255,255,.8);
  display: flex; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap;
  text-shadow: 0 1px 2px rgba(8,36,40,.35);
}

/* ============================================================
   4.11 CONTACT MODAL
   ============================================================ */
.modal-backdrop-cc {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(15,31,29,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}
.modal-backdrop-cc.open { opacity: 1; visibility: visible; }
.modal-cc {
  width: 100%; max-width: 520px;
  background: var(--card); color: var(--text);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(.98); transition: transform var(--t) var(--ease);
}
.modal-backdrop-cc.open .modal-cc { transform: translateY(0) scale(1); }
.modal-cc-head {
  position: relative;
  background: linear-gradient(120deg, var(--brand-teal) 0%, var(--brand-teal-dk) 100%);
  color: #fff; padding: var(--sp-6) var(--sp-6) var(--sp-5);
}
.modal-cc-head h3 { font-family: var(--font-head); font-weight: 700; font-size: 22px; margin: 0 0 4px; }
.modal-cc-head p { font-size: 14px; color: rgba(255,255,255,.9); margin: 0; }
.modal-cc-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.18); color: #fff; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: background var(--t-fast) var(--ease);
}
.modal-cc-close:hover { background: rgba(255,255,255,.32); }
.modal-cc-body { padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.modal-row { display: flex; align-items: center; gap: var(--sp-4); }
.modal-row .mr-icon {
  flex: 0 0 50px; width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 25px;
  background: var(--brand-teal-dk);
}
.modal-row.gold .mr-icon { background: var(--brand-gold); }
.modal-row.green .mr-icon { background: var(--brand-green); }
.modal-row.orange .mr-icon { background: var(--brand-orange); }
.modal-row .mr-body .mr-label { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.modal-row .mr-body .mr-val { font-size: 16px; color: var(--heading); }
.modal-row .mr-body a { color: var(--brand-green); }
.modal-cc-foot {
  border-top: 1px solid var(--border); padding: var(--sp-4) var(--sp-6);
  font-size: 13px; color: var(--text-soft); text-align: center;
}
body.modal-open { overflow: hidden; }

/* ============================================================
   4.12 GALLERY LIGHTBOX
   ============================================================ */
.lightbox-backdrop {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(10,20,19,.82); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; opacity: 0; visibility: hidden;
  transition: opacity var(--t) var(--ease), visibility var(--t) var(--ease);
}
.lightbox-backdrop.open { opacity: 1; visibility: visible; }
.lightbox-figure {
  margin: 0; max-width: min(1100px, 88vw); max-height: 84vh;
  background: var(--card); border-radius: var(--radius-lg);
  padding: var(--sp-3); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: var(--sp-3);
  transform: translateY(16px) scale(.97); transition: transform var(--t) var(--ease);
}
.lightbox-backdrop.open .lightbox-figure { transform: translateY(0) scale(1); }
.lightbox-img {
  display: block; width: 100%; max-height: 70vh;
  border-radius: var(--radius); object-fit: contain; background: var(--card);
}
.lightbox-caption {
  font-family: var(--font-head); font-weight: 600; font-size: 14px;
  color: var(--heading); text-align: center; padding: 0 var(--sp-2);
}
.lightbox-close, .lightbox-nav {
  position: fixed; z-index: 1301; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-teal-dk); color: #fff; box-shadow: var(--shadow-sm);
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.lightbox-close:hover, .lightbox-nav:hover { background: var(--brand-teal-d2); }
.lightbox-close {
  top: 20px; right: 20px; width: 42px; height: 42px; border-radius: 50%; font-size: 17px;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; font-size: 17px;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.06); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

@media (max-width: 760px) {
  .lightbox-figure { max-width: 94vw; padding: var(--sp-2); }
  .lightbox-img { max-height: 58vh; }
  .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 15px; }
  .lightbox-nav { width: 38px; height: 38px; font-size: 14px; }
  .lightbox-nav.prev { left: 10px; }
  .lightbox-nav.next { right: 10px; }
}

/* ============================================================
   5. RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  :root { --sp-section: 56px; }
  .studio-grid, .bobo-grid, .contatti-grid { grid-template-columns: 1fr; gap: var(--sp-7); }
}

@media (max-width: 900px) {
  .nav-links, .nav-grid { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav-inner { gap: var(--sp-4); justify-content: space-between; }
  .nav-logo { margin-right: auto; }
  .nav-links.open {
    display: flex; position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-nav); box-shadow: var(--shadow-md);
    padding: var(--sp-2) 0px;
    border-bottom: 1px solid var(--border);
  }

  /* Reset desktop-specific layout on each drawer item */
  .nav-links.open li {
    flex: none;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
  }

  /* Vertical left bar — inset top/bottom so the rounded caps are visible,
     exactly mirroring the desktop bottom bar's left/right inset. */
  .nav-links.open li::after {
    left: 0; right: auto;
    top: 2px; bottom: 2px;    /* inset = visible rounded caps at both ends */
    width: 3px; height: auto;
    border-radius: 4px;
    transition: width var(--t-fast) var(--ease);
  }

  /* Active: beat the desktop height rule, widen to match desktop active thickness */
  .nav-links.open li:has(> a.active)::after {
    width: 7px;
    height: auto;
  }

  .nav-links.open a { padding: 13px 20px 13px 20px; }

  /* tablet: Software spans both rows on the left, Studio+Ambiti stack on the right */
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .panel-software p{margin-top: var(--sp-2);}
  .panel-software .desk{margin: var(--sp-2) auto 0px auto; width: 100%; max-width: 100%;}
  .panel-software { grid-row: span 2; }
  .panel-light{ padding: var(--sp-5) var(--sp-6);}
  .cols-3 { grid-template-columns: 1fr; gap: var(--sp-5); }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { background: linear-gradient(130deg, var(--brand-teal) 0 36%, var(--brand-teal-dk) 36% 100%); }
  [data-theme="dark"] .site-footer { background: #18555c; }
  /* solid light bg on mobile: no more light/dark split, so keep only the pale-side dots, full coverage */
  .site-footer::before,
  [data-theme="dark"] .site-footer::before {
    -webkit-mask-image: none; mask-image: none;
  }
  .site-footer::after { display: none; }
}

/* footer-contacts needs a narrower column than the rest of the tablet layout before it wraps, otherwise it drops too early and leaves a gap on the right */
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; gap: var(--sp-7); }
  .footer-contacts { padding-left: 0; padding-top: 10px; }
}

@media (max-width: 760px) {
  .hero-carousel { height: clamp(420px, 78vh, 560px); }
  .hero-arrow { display: none; }
  /* phone: no room for arrows next to the peeking slides — swipe + dots only,
     with a bigger (but visually unchanged) tap target on the dots for touch */
  .gallery-nav { display: none; }
  .gallery-slide .gs-label { font-size: 12px; padding: 6px 13px; left: 12px; max-width: calc(100% - 24px); }
  .gallery-dots { gap: var(--sp-3); }
  .gallery-dots button {
    box-sizing: content-box;
    width: 8px; height: 8px; padding: 9px;
    background-clip: content-box;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  :root { --sp-section: 44px; }
  .wrap { padding: 0 18px; }
  /* header: logo + lang-switch + CTA + hamburger no longer fit at full size on
     narrow phones (worse once translated: "Contactez-nous" wraps to 2 lines) —
     collapse both the lang-switch and the CTA label to icon-only (logo stays
     full size) so the header keeps the same compact footprint in every language */
  .nav-actions { gap: var(--sp-2); }
  .nav-actions .btn--primary { padding: 10px; }
  .nav-actions .btn--primary .btn-label { display: none; }
  .lang-current { padding: 8px; }
  .lang-current span, .lang-current .lang-caret { display: none; }
  .lang-menu { right: -10px; }
  /* phone: single column, software no longer spans rows */
  .summary-grid { grid-template-columns: 1fr; }
  .panel-software {
    grid-row: auto;
    margin-left: -18px; margin-right: -18px;
    border-left: none; border-right: none;
  }
  .panel { padding: var(--sp-6) var(--sp-5); }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-carousel { height: clamp(380px, 74vh, 480px); }
  .hero-slide-content { bottom: 40px; }
  .hero-slide-title { max-width: 20ch; }
  .cta-band .btn { font-size: 16px; padding: 13px 22px; }
  .footer-bottom { flex-direction: column; gap: var(--sp-2); }
  .theme-toggle { width: 42px; height: 42px; right: 14px; bottom: 14px; }
}
