/* ===== CURSORE CUSTOM ===== */
* { cursor: none !important; }

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--purple);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: background 0.2s, transform 0.1s;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 2px solid var(--purple);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s, border-color 0.3s, opacity 0.3s;
  opacity: 0.6;
}

.cursor-ring.hovered {
  width: 56px;
  height: 56px;
  border-color: var(--pink);
  opacity: 0.4;
}

.cursor-trail {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  transform: translate(-50%, -50%);
  animation: trailFade 0.6s ease forwards;
}

@keyframes trailFade {
  0%   { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(0.2); }
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple: #6b6bdb;
  --purple-dark: #4a4ab8;
  --pink: #e8348a;
  --bg: #ffffff;
  --bg-light: #f7f7fc;
  --text: #1a1a2e;
  --text-muted: #888;
  --border: #e0e0f0;
  --font-sans: 'Montserrat', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 3rem;
  background: transparent;
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s, box-shadow 0.3s, transform 0.35s ease;
}

#navbar.hidden {
  transform: translateY(-100%);
}

#navbar.scrolled {}

#navbar.over-white .nav-links a { color: var(--purple); }
#navbar.over-white .nav-links a:hover { color: var(--purple-dark); }
#navbar.over-white .hamburger span { background: var(--purple); }

.nav-logo img {
  height: 60px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.3s;
}

.nav-links a:hover { color: rgba(255,255,255,0.7); }


.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--purple);
  transition: all 0.3s;
}

/* ===== HOME ===== */
#home { padding-top: 0; }

/* HERO */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 90vh;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.hero-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(55%, 520px);
  pointer-events: none;
}

.hero-logo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 30px rgba(107,107,219,0.5));
}

/* TAGLINE */
.tagline {
  background: #fff;
  padding: 5rem 3rem;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.tagline-main {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 600;
  color: var(--purple);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.tagline-sub {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--text-muted);
}

/* ===== CATEGORIE BENTO GRID ===== */
.categorie {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 1.2rem;
  padding: 0 3rem 4rem;
  max-width: 1300px;
  margin: 0 auto;
}

.card-large { grid-column: span 2; }

.categoria-card {
  background: var(--c-light);
  padding: 3rem 2.8rem;
  cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  min-height: 280px;
}

.categoria-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c);
  border-radius: 20px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
}

.categoria-card:hover::after { transform: scaleY(1); }

.categoria-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
}

.categoria-num {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--c);
  margin-bottom: 1.2rem;
  position: relative;
  z-index: 1;
  transition: color 0.3s, opacity 0.3s;
  letter-spacing: -0.03em;
}

.categoria-card:hover .categoria-num {
  color: #fff;
  opacity: 0.25;
}

.categoria-body {
  flex: 1;
  position: relative;
  z-index: 1;
}

.categoria-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.8rem;
  transition: color 0.3s;
  letter-spacing: -0.01em;
}

.categoria-card:hover h3 { color: #fff; }

.categoria-card p {
  font-size: 0.85rem;
  color: #555;
  line-height: 1.75;
  transition: color 0.3s;
}

.categoria-card:hover p { color: rgba(255,255,255,0.88); }

.categoria-arrow {
  font-size: 1.4rem;
  color: var(--text);
  transition: transform 0.3s, color 0.3s;
  display: inline-block;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
  font-weight: 300;
}

.categoria-card:hover .categoria-arrow {
  transform: translateX(10px);
  color: #fff;
}

/* ===== LOGO SLIDER ===== */
.logo-slider-section {
  padding: 2rem 0 4rem;
  overflow: hidden;
}

.slider-label {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.logo-slider {
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.slider-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: slide 25s linear infinite;
}

.logo-slider:hover .slider-track {
  animation-play-state: paused;
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.slider-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.5rem;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border);
  min-width: 160px;
  height: 70px;
  transition: border-color 0.3s, background 0.3s;
  flex-shrink: 0;
}

.slider-logo:hover {
  border-color: var(--purple);
  background: #fff;
}

.slider-logo img {
  max-height: 38px;
  max-width: 130px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1) opacity(0.45);
  mix-blend-mode: multiply;
  transition: filter 0.3s;
}

.slider-logo:hover img {
  filter: grayscale(0) opacity(1);
}

.slider-logo span {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ===== SECTIONS ===== */
.section { padding: 5rem 0; }
.section-light { background: var(--bg-light); }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--purple);
  margin-bottom: 1rem;
}

.section h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1.2rem;
  color: var(--text);
}

.section-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 500px;
  margin-bottom: 4rem;
}

/* ===== CHI SIAMO ===== */
.chi-siamo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: center;
}

.chi-siamo-text p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

.stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; }

.stat-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--purple);
  line-height: 1;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.chi-siamo-img { aspect-ratio: 3/4; }

/* ===== PROGETTI ===== */
.progetti-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 420px 320px 420px 320px;
  grid-template-areas:
    "p1 p1 p2"
    "p3 p4 p4"
    "p5 p5 p6"
    "p7 p8 p8";
  gap: 1rem;
  padding: 0 3rem;
  max-width: 1300px;
  margin: 0 auto;
}

.progetto-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
  will-change: transform;
}

.progetto-card.progetto-visible {
  opacity: 1;
  transform: translateY(0);
}

.progetto-card:hover {
  box-shadow: 0 24px 60px rgba(107,107,219,0.2);
  z-index: 1;
}

.progetto-img {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.progetto-img img,
.progetto-img .img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: unset;
  border: none;
  border-radius: 0;
}

.progetto-card:hover .progetto-img img,
.progetto-card:hover .progetto-img .img-placeholder {
  transform: scale(1.07);
}

.progetto-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(107,107,219,0.92) 0%, rgba(107,107,219,0.4) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.progetto-card:hover .progetto-overlay {
  opacity: 1;
  transform: translateY(0);
}

.progetto-cat {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  margin-bottom: 0.4rem;
}

.progetto-overlay h3 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}

.progetto-open {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  letter-spacing: 0.1em;
  transition: letter-spacing 0.3s;
}

.progetto-card:hover .progetto-open {
  letter-spacing: 0.2em;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10,10,20,0.97);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 201;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 900px;
  width: 90%;
  transform: scale(0.95);
  transition: transform 0.4s ease;
}

.lightbox.open .lightbox-content { transform: scale(1); }

.lightbox-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a2e;
}

.lightbox-img-wrap img,
.lightbox-img-wrap .img-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: unset;
  border: none;
  border-radius: 0;
  background: #1a1a2e;
  color: #555;
}

.lightbox-info { text-align: center; }

.lightbox-cat {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--purple);
  display: block;
  margin-bottom: 0.5rem;
}

.lightbox-info h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #fff;
}

/* ===== IMG PLACEHOLDER ===== */
.img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--bg-light);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 200px;
}

/* ===== CONTATTI ===== */
.contatti-simple {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contatti-simple h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.contatti-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.7;
}

.contatti-email {
  display: inline-block;
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 500;
  color: var(--purple);
  border-bottom: 2px solid var(--purple);
  padding-bottom: 0.2rem;
  transition: color 0.3s, border-color 0.3s, letter-spacing 0.3s;
  letter-spacing: 0.01em;
}

.contatti-email:hover {
  color: var(--purple-dark);
  border-color: var(--purple-dark);
  letter-spacing: 0.04em;
}

.contatti-citta {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.btn {
  display: inline-block;
  padding: 0.9rem 2.5rem;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.3s;
  align-self: flex-start;
}

.btn:hover { background: var(--purple-dark); }

/* ===== FOOTER ===== */
footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border);
  padding: 3rem 0;
  text-align: center;
}

.footer-logo-img {
  height: 70px;
  width: auto;
  margin: 0 auto 1rem;
  object-fit: contain;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* ===== FADE IN ===== */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== RESPONSIVE ===== */
/* ===== TABLET (max 900px) ===== */
@media (max-width: 900px) {
  .container { padding: 0 2rem; }
  #navbar { padding: 0.8rem 1.5rem; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    z-index: 99;
  }
  .nav-links.open a { font-size: 1.1rem; color: var(--purple); }
  .hamburger { display: flex; z-index: 101; }
  .hamburger span { background: #fff; }
  #navbar.over-white .hamburger span { background: var(--purple); }

  .hero-img { height: 65vh; }
  .hero-logo { width: min(65%, 300px); }

  .tagline { padding: 3.5rem 2rem; }

  .categorie { grid-template-columns: 1fr 1fr; padding: 0 2rem 4rem; }
  .card-large { grid-column: span 2; }

  .logo-slider-section { padding: 2rem 0 4rem; }

  .chi-siamo-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .chi-siamo-img { aspect-ratio: 4/3; max-height: 400px; }
  .chi-siamo-img img { width: 100%; height: 100%; object-fit: cover; }

  .progetti-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-template-areas: none;
    padding: 0 2rem;
  }

  .progetto-card {
    grid-area: unset !important;
    aspect-ratio: 4/3;
    height: auto;
  }

  .lightbox-content { width: 95%; }
}

/* ===== MOBILE (max 600px) ===== */
@media (max-width: 600px) {
  .section { padding: 4rem 0; }
  .container { padding: 0 1.5rem; }

  .hero-img { height: 55vh; object-position: center center; }
  .hero-logo { width: 75%; }

  .tagline { padding: 2.5rem 1.5rem; }
  .tagline-main { font-size: 1rem; }

  .categorie {
    grid-template-columns: 1fr;
    padding: 0 1.5rem 3rem;
  }
  .card-large { grid-column: span 1; }
  .categoria-num { font-size: 4rem; }

  .chi-siamo-img { aspect-ratio: 1/1; }

  .progetti-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-template-areas: none;
    padding: 0 1.5rem;
    gap: 0.8rem;
  }

  .progetto-card {
    grid-area: unset !important;
    aspect-ratio: 4/3;
    height: auto;
  }

  .contatti-email { font-size: 0.95rem; }

  .lightbox-img-wrap { aspect-ratio: 4/3; }
  .lightbox-info h2 { font-size: 1.3rem; }
}
