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

:root {
  --teal:   #3a8980;
  --teal-d: #2d7069;
  --ink:    #0d0d0d;
  --ink2:   #1a1a2e;
  --text:   #1a1a1a;
  --muted:  #6b7280;
  --subtle: #9ca3af;
  --light:  #f9f9f9;
  --white:  #ffffff;
  --border: #e5e7eb;
  --max-w:  1200px;
  --r:      6px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── NAV ── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 500;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4%, 2.5rem);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo img { height: 44px; width: auto; display: block; }
.nav-left { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; list-style: none; align-items: center; gap: 2rem; }
.nav-links > li { position: relative; }
.nav-links > li > a { color: var(--text); text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.nav-links > li > a:hover { color: var(--teal-d); }

/* megamenu */
.has-mega { position: static; }
.has-mega > a::after { content: ''; position: fixed; top: 44px; left: 0; right: 0; height: 20px; z-index: 498; }
.nav-mega-wrap { position: fixed; top: 60px; left: 0; right: 0; z-index: 499; padding: 0 clamp(1.5rem,5%,3rem); pointer-events: none; opacity: 0; transition: opacity .18s; }
.has-mega:hover > .nav-mega-wrap, .has-mega.mega-open > .nav-mega-wrap { opacity: 1; pointer-events: auto; }
.nav-mega { background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--r) var(--r); box-shadow: 0 20px 60px rgba(0,0,0,.1); max-width: var(--max-w); margin: 0 auto; display: flex; overflow: hidden; min-height: 320px; }

/* tab sidebar */
.mega-tabbar { width: 210px; flex-shrink: 0; border-right: 1px solid var(--border); padding: .75rem 0; display: flex; flex-direction: column; gap: 2px; background: var(--light); }
.mega-tab { background: none; border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); text-align: left; padding: .65rem .85rem; margin: 0 .4rem; border-radius: var(--r); transition: background .12s, color .12s; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.mega-tab:hover { background: rgba(0,0,0,.04); color: var(--text); }
.mega-tab.active { background: #fff; color: var(--teal-d); box-shadow: 0 1px 3px rgba(0,0,0,.07); }
.mega-tab svg { flex-shrink: 0; opacity: .55; }
.mega-tab.active svg { opacity: 1; color: var(--teal); }

/* tab panels */
.mega-panels { flex: 1; padding: 1.5rem 1.75rem; overflow: hidden; min-width: 0; }
.mega-panel { display: none; }
.mega-panel.active { display: grid; grid-template-columns: repeat(3, 1fr); }
.mega-col { padding: 0 1.4rem; border-right: 1px solid var(--border); }
.mega-col:first-child { padding-left: 0; }
.mega-col:last-child { border-right: none; padding-right: 0; }
.mega-col-title { font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-d); margin-bottom: .75rem; display: block; }
.mega-links { list-style: none; display: flex; flex-direction: column; gap: .05rem; }
.mega-links a { display: flex; align-items: center; gap: .5rem; padding: .33rem .45rem; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; border-radius: 5px; transition: background .12s, color .12s; }
.mega-links a:hover { background: var(--light); color: var(--text); }
.mega-links a .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); flex-shrink: 0; transition: background .15s; }
.mega-links a:hover .dot { background: var(--teal); }

/* nav right */
.nav-right { display: flex; align-items: center; gap: .75rem; }
.nav-link-plain { font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; transition: color .15s; }
.nav-link-plain:hover { color: var(--teal-d); }
.nav-cta-fill { font-size: 14px; font-weight: 600; color: #fff; text-decoration: none; padding: .45rem 1rem; background: var(--ink); border-radius: var(--r); transition: background .15s; }
.nav-cta-fill:hover { background: #333; }
.lang-toggle { display: flex; align-items: center; gap: .3rem; margin-right: .25rem; }
.lang-btn { background: none; border: none; font-size: 12px; font-weight: 700; letter-spacing: .05em; color: var(--muted); cursor: pointer; padding: .2rem .3rem; font-family: inherit; transition: color .15s; }
.lang-btn.active { color: var(--text); }
.lang-btn:hover { color: var(--text); }
.lang-sep { font-size: 11px; color: var(--border); user-select: none; }

/* mobile burger */
.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: .4rem; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: var(--r); transition: .3s; }

/* mobile nav accordion */
.nav-mobile { display: none; position: fixed; inset: 60px 0 0; background: #fff; z-index: 499; overflow-y: auto; border-top: 1px solid var(--border); }
.nav-mobile.open { display: block; }
.mobile-cat { border-bottom: 1px solid var(--border); padding: 0 clamp(1.5rem,5%,3rem); }
.mobile-cat-btn { width: 100%; background: none; border: none; font-family: inherit; font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: space-between; padding: .9rem 0; cursor: pointer; }
.mobile-cat-chevron { font-size: 11px; color: var(--muted); transition: transform .2s; display: inline-block; }
.mobile-cat.open .mobile-cat-chevron { transform: rotate(180deg); }
.mobile-cat-links { display: none; flex-direction: column; padding-bottom: .75rem; gap: 1px; }
.mobile-cat.open .mobile-cat-links { display: flex; }
.mobile-cat-links a { display: block; padding: .38rem .5rem .38rem 1rem; font-size: 13.5px; color: var(--muted); text-decoration: none; border-radius: 5px; }
.mobile-cat-links a:hover { color: var(--teal-d); background: var(--light); }
.mobile-nav-footer { padding: 1.25rem clamp(1.5rem,5%,3rem) 2rem; display: flex; flex-direction: column; gap: .35rem; }
.mobile-nav-footer a { display: block; padding: .6rem 0; font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.mobile-nav-footer a:last-of-type { border-bottom: none; }

/* ── UTILS ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 clamp(1.5rem, 5%, 3rem); }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-d); margin-bottom: .65rem; }
.h1 { font-size: clamp(2.2rem, 4vw, 3.75rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.08; }
.h2 { font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; color: var(--text); margin-bottom: 1rem; }
.h3 { font-size: clamp(1.5rem, 2.5vw, 2rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.2; color: var(--text); }
.lead { font-size: 1rem; color: var(--muted); line-height: 1.75; }
.section-header { margin-bottom: 3rem; }
.section-header .lead { max-width: 640px; }

.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.6rem; border-radius: var(--r); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: none; font-family: inherit; transition: all .2s; white-space: nowrap; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--text); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-d); }

.reveal { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.reveal.vis { opacity: 1; transform: none; }

/* ── PAGE HERO ── */
.page-hero {
  padding: 120px 0 80px;
  background: var(--ink);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 70% 50%, rgba(58,137,128,.18) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.page-hero-img {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
  aspect-ratio: 16/10;
}
.page-hero-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.page-hero .eyebrow { color: var(--teal); }
.page-hero h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; color: #fff; margin-bottom: 1.25rem; }
.page-hero .lead { color: rgba(255,255,255,.65); font-size: 1.05rem; margin-bottom: 2rem; max-width: 520px; }
.page-hero-btns { display: flex; gap: 1rem; flex-wrap: wrap; }

/* ── SERVICES SECTION ── */
.services-section { padding: 90px 0; }
.services-section.bg-light { background: var(--light); }
.services-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.svc-item {
  background: #fff;
  padding: 2rem;
  transition: background .15s;
}
.svc-item:hover { background: var(--light); }
.svc-item-icon {
  width: 42px; height: 42px;
  border-radius: var(--r);
  background: rgba(58,137,128,.08);
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  color: var(--teal);
}
.svc-item h4 { font-size: 15px; font-weight: 700; margin-bottom: .4rem; color: var(--text); }
.svc-item p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* ── CHIPS LIST ── */
.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chip { font-size: 12px; font-weight: 500; color: var(--teal-d); background: rgba(58,137,128,.07); border: 1px solid rgba(58,137,128,.15); border-radius: 100px; padding: .3rem .85rem; }

/* ── STATS ROW ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 3rem;
}
.stat-cell { background: #fff; padding: 2rem; text-align: center; }
.stat-cell .num { font-size: clamp(2rem,4vw,3rem); font-weight: 800; letter-spacing: -.04em; color: var(--ink); line-height: 1; margin-bottom: .4rem; }
.stat-cell .lbl { font-size: 13px; color: var(--muted); }

/* ── CTA BANNER ── */
.cta-banner {
  background: var(--ink);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}
.cta-banner h2 { font-size: clamp(1.8rem,3.5vw,2.75rem); font-weight: 800; letter-spacing: -.03em; color: #fff; margin-bottom: .75rem; }
.cta-banner p { color: rgba(255,255,255,.55); margin-bottom: 2rem; }
.cta-banner-btns { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #f0f0f0; }
.btn-ghost { background: transparent; color: rgba(255,255,255,.7); border: 1.5px solid rgba(255,255,255,.2); }
.btn-ghost:hover { border-color: rgba(255,255,255,.6); color: #fff; }

/* ── TWO-COL CONTENT ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.two-col.reverse .two-col-img { order: -1; }
.two-col-img { border-radius: 12px; overflow: hidden; }
.two-col-img img { width: 100%; display: block; border-radius: 12px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; margin-top: 1.5rem; }
.feature-list li { display: flex; align-items: flex-start; gap: .75rem; font-size: 14px; color: var(--muted); }
.feature-list li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--teal); flex-shrink: 0; margin-top: .55em; }

/* ── FOOTER ── */
footer { background: var(--ink); color: rgba(255,255,255,.55); }
footer .container { padding-top: 3.5rem; padding-bottom: 2rem; }
.foot-cols { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 3rem; margin-bottom: 3rem; }
.foot-brand img { height: 32px; width: auto; margin-bottom: 1.1rem; display: block; filter: brightness(10); }
.foot-brand p { font-size: 13px; color: rgba(255,255,255,.65); line-height: 1.7; max-width: 240px; margin-bottom: 1.25rem; }
.foot-col-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.6); margin-bottom: 1rem; display: block; }
.foot-col ul { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.foot-col ul li a { font-size: 13.5px; color: rgba(255,255,255,.72); text-decoration: none; transition: color .15s; }
.foot-col ul li a:hover { color: #fff; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.07); padding-top: 1.75rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.foot-copy { font-size: 13px; color: rgba(255,255,255,.55); }
.foot-bottom-links { display: flex; gap: 1.5rem; }
.foot-bottom-links a { font-size: 13px; color: rgba(255,255,255,.35); text-decoration: none; transition: color .15s; }
.foot-bottom-links a:hover { color: rgba(255,255,255,.7); }
.foot-social { display: flex; gap: .5rem; }
.foot-social a { width: 34px; height: 34px; border-radius: var(--r); background: rgba(255,255,255,.06); display: grid; place-items: center; color: rgba(255,255,255,.4); text-decoration: none; border: 1px solid rgba(255,255,255,.07); transition: background .2s, color .2s; }
.foot-social a:hover { background: rgba(255,255,255,.12); color: #fff; }
@media(max-width:900px){ .foot-cols { grid-template-columns: 1fr 1fr; gap: 2rem; } }
@media(max-width:540px){ .foot-cols { grid-template-columns: 1fr; } .foot-bottom { flex-direction: column; text-align: center; } }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .reviews-layout { grid-template-columns: 1fr !important; gap: 2.5rem !important; }
}

@media (max-width: 900px) {
  .page-hero-inner { grid-template-columns: 1fr; }
  .page-hero-img { display: none; }
  .two-col { grid-template-columns: 1fr; gap: 2.5rem; }
  .two-col.reverse .two-col-img { order: 0; }
  .services-grid-2col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1fr !important; gap: 2.5rem !important; padding: 80px 0 !important; }
}

@media (max-width: 768px) {
  /* NAV */
  .nav-links, .nav-right { display: none; }
  .nav-burger { display: flex; }

  /* CMS / LINGUAGGI SECTIONS — override inline styles */
  .cms-services { grid-template-columns: 1fr !important; }
  .cms-panel.active { grid-template-columns: 1fr !important; gap: 2rem !important; }
  .cms-text .lead { max-width: 100% !important; }
  .linguaggi-layout { grid-template-columns: 1fr !important; }
  .linguaggi-left, .linguaggi-right { min-width: 0; overflow: hidden; }
  .linguaggi-right { position: static !important; }
  .cms-tabs { overflow-x: auto !important; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .cms-tab { flex-shrink: 0 !important; }

  /* STATS */
  .stats-row { grid-template-columns: 1fr; }

  /* CMS TABS — scrollabili */
  .cms-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: .5rem; scrollbar-width: none; }
  .cms-tabs::-webkit-scrollbar { display: none; }
  .cms-tab { flex-shrink: 0; }

  /* REVIEWS */
  .reviews-layout { grid-template-columns: 1fr !important; }
  .rev-card-grid { grid-template-columns: 1fr !important; }
  .rev-card-grid .rev-card { grid-column: auto !important; }

  /* PORT GRID (pagine portfolio) */
  .port-grid { grid-template-columns: 1fr 1fr !important; }

  /* SERVICES GRID */
  .services-grid { grid-template-columns: 1fr 1fr; }

  /* CERT GRID chi-sono */
  .cert-row { flex-direction: column; }

  /* FOOTER */
  .foot-cols { grid-template-columns: 1fr 1fr; }
  .foot-brand p { max-width: none; }

  /* TYPOGRAPHY */
  .page-hero h1 { font-size: clamp(2rem, 6vw, 3rem); }
  .cta-banner h2 { font-size: clamp(1.5rem, 5vw, 2.2rem); }

  /* CHI SONO pagine */
  .bio-section { padding: 60px 0; }
  .tl-item { grid-template-columns: 70px 1fr; gap: 1rem; }
  .tl-item::before { left: 69px; }
  .tl-dot { left: 64px; }
}

@media (max-width: 540px) {
  /* PORT GRID 1 colonna */
  .port-grid { grid-template-columns: 1fr !important; }

  /* SERVICES GRID 1 colonna */
  .services-grid { grid-template-columns: 1fr !important; }

  /* FOOTER */
  .foot-cols { grid-template-columns: 1fr !important; }
  .foot-bottom { flex-direction: column; text-align: center; }

  /* BUTTONS */
  .btn { padding: .65rem 1.2rem; font-size: 14px; }
  .page-hero-btns { flex-direction: column; }
  .cta-banner-btns { flex-direction: column; align-items: center; }

  /* CONTACT */
  .contact-layout { padding: 60px 0 !important; }

  /* TIMELINE */
  .tl-year { font-size: 11px; }
}
