/* ============================================
   TESTÀRE — Global Stylesheet
   Premium, Bold, Evidence-Based
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --black: #0A0A0A;
  --white: #FAFAFA;
  --coral: #E05A3A;
  --coral-dark: #C44A2E;
  --gray-100: #F5F5F5;
  --gray-200: #E8E8E8;
  --gray-300: #D0D0D0;
  --gray-500: #888888;
  --gray-700: #444444;
  --gray-900: #1A1A1A;
  --font-primary: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --transition: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  color: var(--black);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* --- Typography --- */
.h-display {
  font-size: clamp(2.4rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.h-large {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.h-medium {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.015em;
}

.h-small {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 600;
  line-height: 1.3;
}

.text-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--gray-700);
}

.text-large {
  font-size: clamp(1.08rem, 1.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--gray-700);
}

.text-small {
  font-size: 0.75rem;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.text-coral { color: var(--coral); }
.text-white { color: var(--white); }
.text-gray { color: var(--gray-500); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.container-narrow {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.section {
  padding: clamp(3.5rem, 6vw, 5.5rem) 0;
}

.section-dark {
  background: var(--black);
  color: var(--white);
}

.section-dark .text-body,
.section-dark .text-large {
  color: var(--gray-300);
}

.section-gray {
  background: var(--gray-100);
}

/* --- Grid --- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(2rem, 4vw, 4rem);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1.5rem 0;
  transition: all 0.4s var(--transition);
}

.nav.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.nav-logo img, .nav-logo svg {
  height: 48px;
  width: auto;
}

/* Logos di servizio (varianti -white: wordmark gia bianco, barra colorata
   originale preservata — niente filter, colori fedeli). */
.nav-logo img[src*="-logo-white.png"] {
  height: 48px;
  width: auto;
  transition: opacity 0.25s var(--transition);
}
/* Versioni vecchie (no -white suffix): mantiene il filter come fallback
   per il logo blu finché non viene rigenerato in versione white. */
.nav-logo img[src$="verde-logo.png"],
.nav-logo img[src$="giallo-logo.png"],
.nav-logo img[src$="blu-logo.png"] {
  height: 48px;
  width: auto;
  filter: invert(1) hue-rotate(180deg);
  transition: filter 0.25s var(--transition);
}
/* Make room for taller service logos in the nav */
body.service-page .nav {
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

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

.nav-links a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  position: relative;
  padding: 0.25rem 0;
  transition: color 0.3s var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--coral);
  transition: width 0.3s var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* Mobile Menu Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}

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

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: var(--black);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transition: right 0.5s var(--transition-smooth);
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1.2rem; }
}

/* --- Nav Dropdown (Servizi) --- */
.nav-item-dropdown {
  position: relative;
}
.nav-item-dropdown > a .dd-caret {
  display: inline-block;
  font-size: 0.6rem;
  margin-left: 0.35rem;
  transform: translateY(-1px);
  transition: transform 0.3s var(--transition);
}
.nav-item-dropdown.open > a .dd-caret,
.nav-item-dropdown:hover > a .dd-caret {
  transform: translateY(-1px) rotate(180deg);
}
.nav-dropdown {
  list-style: none;
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 240px;
  background: rgba(10, 10, 10, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 0.6rem 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s var(--transition), transform 0.25s var(--transition), visibility 0.25s;
  z-index: 1001;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}
.nav-dropdown::before {
  /* hover bridge so the gap between parent and dropdown is still hoverable */
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
  background: transparent;
}
.nav-item-dropdown:hover .nav-dropdown,
.nav-item-dropdown:focus-within .nav-dropdown,
.nav-item-dropdown.open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown li {
  list-style: none;
}
.nav-dropdown a {
  display: block;
  padding: 0.75rem 1.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  white-space: nowrap;
  transition: background 0.2s var(--transition), color 0.2s var(--transition), padding-left 0.2s var(--transition);
}
.nav-dropdown a::after { display: none; } /* disable the underline effect for dropdown items */
.nav-dropdown a:hover,
.nav-dropdown a.active {
  color: var(--coral);
  background: rgba(224, 90, 58, 0.08);
  padding-left: 1.7rem;
}

/* Mobile: dropdown inline-expanded inside the fullscreen menu */
@media (max-width: 768px) {
  .nav-item-dropdown { width: 100%; text-align: center; }
  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0.5rem 0 0.5rem 0;
    min-width: 0;
    margin-top: 0.75rem;
  }
  .nav-dropdown::before { display: none; }
  .nav-dropdown a {
    font-size: 0.95rem;
    padding: 0.5rem 0;
    text-align: center;
    color: var(--gray-300);
  }
  .nav-dropdown a:hover, .nav-dropdown a.active { padding-left: 0; }
  .nav-item-dropdown > a .dd-caret { display: none; }
}

/* Visually hidden (a11y/SEO) — visibile a screen reader/Google ma non a vista */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--black);
  color: var(--white);
  overflow: hidden;
}

/* === AURORA: mesh gradient morphico con 2 strati blur che si muovono ===
   Segue il colore servizio via --hero-rgb (RGB triple, no parentesi).
   Default = coral. Override per body.theme-* in fondo a questo blocco. */
.hero {
  --hero-rgb: 224, 90, 58;            /* coral di default */
  --hero-rgb-soft: 255, 120, 80;      /* tono più chiaro per profondità */
  --hero-rgb-deep: 180, 60, 40;       /* tono più scuro */
}
body.theme-coral .hero,
body.service-page.theme-coral .hero {
  --hero-rgb: 224, 90, 58;
  --hero-rgb-soft: 255, 120, 80;
  --hero-rgb-deep: 180, 60, 40;
}
body.theme-yellow .hero,
body.service-page.theme-yellow .hero {
  --hero-rgb: 240, 192, 64;
  --hero-rgb-soft: 255, 215, 110;
  --hero-rgb-deep: 195, 145, 30;
}
body.theme-green .hero,
body.service-page.theme-green .hero {
  --hero-rgb: 34, 197, 94;
  --hero-rgb-soft: 90, 230, 140;
  --hero-rgb-deep: 22, 145, 70;
}
body.theme-blue .hero,
body.service-page.theme-blue .hero {
  --hero-rgb: 59, 130, 246;
  --hero-rgb-soft: 110, 175, 255;
  --hero-rgb-deep: 35, 90, 200;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  /* azzera eventuali style="background:..." inline rimasti su .hero-bg */
  background: transparent !important;
}
.hero-bg::before,
.hero-bg::after {
  content: '';
  position: absolute;
  inset: -25%;
  filter: blur(70px);
  will-change: transform;
}
.hero-bg::before {
  background:
    radial-gradient(ellipse 38% 50% at 18% 28%, rgba(var(--hero-rgb), 0.55) 0%, transparent 60%),
    radial-gradient(ellipse 30% 42% at 78% 72%, rgba(var(--hero-rgb), 0.45) 0%, transparent 58%),
    radial-gradient(ellipse 25% 30% at 62% 18%, rgba(var(--hero-rgb-soft), 0.30) 0%, transparent 65%);
  opacity: 0.55;
  animation: auroraDriftA 26s ease-in-out infinite alternate;
}
.hero-bg::after {
  background:
    radial-gradient(ellipse 45% 36% at 70% 30%, rgba(var(--hero-rgb-deep), 0.42) 0%, transparent 55%),
    radial-gradient(ellipse 32% 50% at 22% 80%, rgba(var(--hero-rgb-soft), 0.32) 0%, transparent 60%),
    radial-gradient(ellipse 28% 28% at 50% 50%, rgba(var(--hero-rgb-deep), 0.35) 0%, transparent 70%);
  opacity: 0.5;
  animation: auroraDriftB 32s ease-in-out infinite alternate;
}
@keyframes auroraDriftA {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(7%, 4%) scale(1.08) rotate(2deg); }
  100% { transform: translate(-5%, -3%) scale(0.94) rotate(-1deg); }
}
@keyframes auroraDriftB {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  50%  { transform: translate(-6%, 5%) scale(1.1) rotate(-2deg); }
  100% { transform: translate(4%, -4%) scale(0.92) rotate(1deg); }
}
/* Subtle vignette per dare profondità ai bordi */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.45) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 6rem;
}

.hero-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 2rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(224, 90, 58, 0.3);
  border-radius: 2px;
}

.hero-title {
  margin-bottom: 2rem;
}
/* Typography hierarchy on the 3 slogan lines */
.hero-title-1 { font-weight: 900; }
.hero-title-2 { font-weight: 900; text-shadow: 0 0 60px rgba(224, 90, 58, 0.35); }
.hero-title-3 { font-weight: 700; opacity: 0.92; letter-spacing: -0.025em; }

.hero-text {
  font-size: clamp(1.05rem, 1.45vw, 1.25rem);
  line-height: 1.65;
  color: var(--gray-300);
  max-width: 620px;
  margin-bottom: 2.5rem;
}

.hero-page {
  min-height: auto;
  padding-top: 3rem;
  padding-bottom: 4rem;
  justify-content: flex-start;
}
/* Centered layout for service pages hero — robust full-child centering */
.hero-page .hero-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  padding: 2rem 1.5rem 0;
}
.hero-page .hero-label {
  align-self: center;
  margin-left: auto;
  margin-right: auto;
}
.hero-page .hero-title {
  width: 100%;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.hero-page .hero-text {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
/* Centre any inline flex rows inside the centered hero (tag chips, button groups) */
.hero-page .hero-content > div[style*="display:flex"],
.hero-page .hero-content > div[style*="display: flex"],
.hero-page .hero-content .flex {
  justify-content: center;
  align-items: center;
  margin-left: auto;
  margin-right: auto;
}
/* Any <p> directly in the hero-content gets centered too */
.hero-page .hero-content > p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 0;
  transition: all 0.4s var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--coral);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--coral-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(224, 90, 58, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 1.5px solid var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--black);
}

.btn-dark {
  background: var(--black);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--gray-900);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.btn-arrow::after {
  content: '→';
  transition: transform 0.3s var(--transition);
}

.btn-arrow:hover::after {
  transform: translateX(4px);
}

/* --- Video Block --- */
.video-block {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--gray-900);
  overflow: hidden;
  border-radius: 2px;
}

.video-block::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(224, 90, 58, 0.1), transparent);
  z-index: 1;
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--transition);
  cursor: pointer;
}

.video-play:hover {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 40px rgba(224, 90, 58, 0.4);
}

.video-play svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
  margin-left: 3px;
}

/* --- Service Color Variables --- */
:root {
  --svc-coral: #E05A3A;
  --svc-blue: #3B82F6;
  --svc-green: #22C55E;
  --svc-amber: #9CA3AF;
  --svc-yellow: #F0C040;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.2rem, 2vw, 2rem);
}

@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .services-grid { grid-template-columns: 1fr; }
}

/* --- Service Card V2 (dark, premium, accent per data-color) --- */
.service-card-v2 {
  position: relative;
  padding: 2.4rem 1.7rem 1.8rem;
  background: linear-gradient(160deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.55s var(--transition-smooth),
              border-color 0.4s ease,
              box-shadow 0.6s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  min-height: 380px;
  color: #fff;
}

/* Per-color accent variables */
.service-card-v2[data-color="coral"]  {
  --accent: var(--svc-coral);
  --accent-rgb: 224, 90, 58;
}
.service-card-v2[data-color="yellow"] {
  --accent: var(--svc-yellow);
  --accent-rgb: 240, 192, 64;
}
.service-card-v2[data-color="green"]  {
  --accent: var(--svc-green);
  --accent-rgb: 34, 197, 94;
}
.service-card-v2[data-color="blue"]   {
  --accent: var(--svc-blue);
  --accent-rgb: 59, 130, 246;
}

/* Subtle accent radial glow */
.service-card-v2::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 0%,
              rgba(var(--accent-rgb), 0.18) 0%,
              transparent 55%);
  opacity: 0.35;
  transition: opacity 0.55s ease;
  pointer-events: none;
  z-index: 0;
}
.service-card-v2:hover::before { opacity: 1; }

/* Hover: lift + accent glow + subtle accent border */
.service-card-v2:hover {
  transform: translateY(-8px);
  border-color: rgba(var(--accent-rgb), 0.5);
  box-shadow:
    0 24px 60px -20px rgba(0, 0, 0, 0.55),
    0 0 80px -20px rgba(var(--accent-rgb), 0.35);
}

/* Color bar at top — animated grow */
.service-color-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent) !important;
  transform-origin: left;
  transform: scaleX(0.35);
  transition: transform 0.7s var(--transition-smooth),
              filter 0.4s ease;
  z-index: 2;
}
.service-card-v2:hover .service-color-bar {
  transform: scaleX(1);
  filter: drop-shadow(0 0 12px var(--accent));
}

/* Big number watermark — design element, not just decoration */
.service-number-v2 {
  position: absolute;
  top: -1.2rem;
  right: -0.6rem;
  font-size: clamp(7rem, 11vw, 11rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--accent) !important;
  opacity: 0.13;
  margin: 0;
  pointer-events: none;
  font-family: Inter, sans-serif;
  transition: opacity 0.55s var(--transition-smooth),
              transform 0.55s var(--transition-smooth);
  z-index: 0;
}
.service-card-v2:hover .service-number-v2 {
  opacity: 0.22;
  transform: translateY(-4px);
}

/* Icon "chip" — top-left, accent halo */
.service-icon-wrap {
  width: 64px;
  height: 64px;
  margin: 0 0 1.6rem;
  border-radius: 14px;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: transform 0.5s var(--transition-smooth),
              background 0.4s ease,
              border-color 0.4s ease;
}
.service-card-v2:hover .service-icon-wrap {
  transform: scale(1.06) rotate(-2deg);
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.5);
}

.service-figure {
  width: 44px;
  height: 44px;
  transition: transform 0.5s var(--transition-smooth);
}

/* Tag pill — outlined accent */
.service-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent) !important;
  padding: 0.3rem 0.75rem;
  background: rgba(var(--accent-rgb), 0.12) !important;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: 999px;
  margin-bottom: 0.9rem;
  position: relative;
  z-index: 1;
}

/* Title */
.service-card-v2 h3 {
  font-size: 1.32rem;
  font-weight: 800;
  margin-bottom: 0.7rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* Description */
.service-card-v2 p {
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
  margin-bottom: 1.6rem;
  font-size: 0.88rem;
  max-width: none;
  position: relative;
  z-index: 1;
}

/* Link aligned bottom */
.service-card-v2 .service-link {
  margin-top: auto;
  color: var(--accent) !important;
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
}

/* --- Service Link (shared) --- */
.service-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--coral);
  transition: gap 0.3s var(--transition);
}

.service-link:hover { gap: 0.8rem; }

/* --- Services Page Cards (servizi.html) --- */
.services-page-grid {
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.service-page-card {
  display: block;
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.5s var(--transition-smooth);
  text-decoration: none;
  color: inherit;
}

.service-page-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border-color: transparent;
}

.spc-color-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  border-radius: 6px 0 0 6px;
}

.spc-inner {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 3vw, 3rem);
  padding-left: clamp(2.5rem, 4vw, 3.5rem);
  align-items: center;
}

.spc-left {
  display: flex;
  align-items: center;
  justify-content: center;
}

.spc-figure {
  width: 130px;
  height: 130px;
  transition: transform 0.5s var(--transition-smooth);
}

.service-page-card:hover .spc-figure {
  transform: scale(1.06) translateY(-4px);
}

.spc-right {
  min-width: 0;
}

.spc-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.25rem 0.8rem;
  border-radius: 2px;
  margin-bottom: 0.6rem;
}

.spc-number {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
}

.service-page-card h2 {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  margin-bottom: 0.8rem;
  line-height: 1.15;
}

.service-page-card p {
  color: var(--gray-700);
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 600px;
}

.spc-highlights {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.2rem;
}

.spc-highlights li {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-500);
  padding-left: 1.2rem;
  position: relative;
}

.spc-highlights li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-300);
}

.service-page-card[data-color="coral"] .spc-highlights li::before { background: var(--svc-coral); }
.service-page-card[data-color="blue"] .spc-highlights li::before { background: var(--svc-blue); }
.service-page-card[data-color="green"] .spc-highlights li::before { background: var(--svc-green); }
.service-page-card[data-color="amber"] .spc-highlights li::before { background: var(--svc-amber); }

.spc-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: gap 0.3s var(--transition);
}

.service-page-card:hover .spc-cta {
  gap: 0.8rem;
}

@media (max-width: 768px) {
  .spc-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .spc-figure { width: 100px; height: 100px; }
  .spc-highlights { justify-content: center; }
  .spc-color-accent { width: 100%; height: 4px; border-radius: 6px 6px 0 0; }
}

/* --- Legacy service-card (kept for other pages) --- */
.service-card {
  padding: clamp(1.5rem, 2.5vw, 2.2rem);
  border: 1px solid var(--gray-200);
  transition: all 0.5s var(--transition-smooth);
  position: relative;
  overflow: hidden;
  background: var(--white);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--coral);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--transition-smooth);
}

.service-card:hover {
  border-color: var(--coral);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-number {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--coral);
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.service-card p {
  color: var(--gray-700);
  line-height: 1.6;
  margin-bottom: 1.2rem;
  font-size: 0.88rem;
}

/* --- Stats --- */
.stats {
  display: flex;
  gap: clamp(3rem, 6vw, 6rem);
  flex-wrap: wrap;
}

.stat-item {
  text-align: left;
}

.stat-number {
  font-size: clamp(2.2rem, 4.5vw, 3.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-number .coral { color: var(--coral); }

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-top: 0.5rem;
}

/* --- Phase Cards (Test Page) --- */
.phase-card {
  padding: clamp(2.5rem, 4vw, 4rem);
  position: relative;
}

.phase-card + .phase-card {
  border-top: 1px solid var(--gray-200);
}

.section-dark .phase-card + .phase-card {
  border-top-color: rgba(255,255,255,0.1);
}

.phase-number {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  color: rgba(224, 90, 58, 0.12);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.phase-card h3 {
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 800;
  margin-bottom: 1.2rem;
  line-height: 1.15;
}

.phase-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.phase-list li {
  padding-left: 1.5rem;
  position: relative;
  color: var(--gray-700);
  line-height: 1.6;
}

.section-dark .phase-list li {
  color: var(--gray-300);
}

.phase-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 6px;
  height: 6px;
  background: var(--coral);
}

/* --- Project Cards --- */
.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--gray-900);
  cursor: pointer;
}

.project-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10, 10, 10, 0.9) 100%);
  z-index: 1;
  transition: all 0.5s var(--transition-smooth);
}

.project-card:hover .project-card-overlay {
  background: linear-gradient(180deg, transparent 20%, rgba(10, 10, 10, 0.95) 100%);
}

.project-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem;
  z-index: 2;
  transform: translateY(1rem);
  transition: transform 0.5s var(--transition-smooth);
}

.project-card:hover .project-card-content {
  transform: translateY(0);
}

.project-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.project-card h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
}

.project-card p {
  font-size: 0.9rem;
  color: var(--gray-300);
  opacity: 0;
  transition: opacity 0.4s var(--transition);
}

.project-card:hover p { opacity: 1; }

/* --- Divider --- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--coral);
  margin: 2rem 0;
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: clamp(4rem, 8vw, 7rem) 0;
}

.cta-section .h-large {
  margin-bottom: 1.5rem;
}

.cta-section .text-large {
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Footer --- */
.footer {
  background: var(--black);
  color: var(--white);
  padding: 4rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: var(--gray-500);
  margin-top: 1.5rem;
  max-width: 300px;
  line-height: 1.7;
}

.footer h4 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--gray-300);
  transition: color 0.3s var(--transition);
}

.footer-links a:hover { color: var(--coral); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--gray-500);
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}

/* === GRAIN OVERLAY === */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 180px;
}

/* === LINE REVEAL ANIMATION (Hero text) === */
.split-line {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%) rotateX(-80deg);
  transform-origin: top center;
  transition: opacity 1s var(--transition-smooth), transform 1.2s var(--transition-smooth);
}

.split-line.visible,
.reveal.visible .split-line {
  opacity: 1;
  transform: translateY(0) rotateX(0deg);
}

/* === WORD SCALE REVEAL === */
.split-word {
  display: inline-block;
  opacity: 0;
  transform: scale(0.85) translateY(20px);
  filter: blur(6px);
  transition: all 0.9s var(--transition-smooth);
}

.split-word.visible,
.reveal.visible .split-word {
  opacity: 1;
  transform: scale(1) translateY(0);
  filter: blur(0);
}

.split-word:nth-child(2) { transition-delay: 0.12s; }
.split-word:nth-child(3) { transition-delay: 0.24s; }

/* === BASE REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  filter: blur(3px);
  transition: opacity 0.9s var(--transition-smooth),
              transform 1s var(--transition-smooth),
              filter 0.7s var(--transition-smooth);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* === REVEAL FROM LEFT/RIGHT === */
.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.9s var(--transition-smooth), transform 0.9s var(--transition-smooth);
}
.reveal-left.visible { opacity: 1; transform: translateX(0); }

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.9s var(--transition-smooth), transform 0.9s var(--transition-smooth);
}
.reveal-right.visible { opacity: 1; transform: translateX(0); }

/* === SCALE REVEAL === */
.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.8s var(--transition-smooth), transform 1s var(--transition-smooth);
}
.reveal-scale.visible { opacity: 1; transform: scale(1); }

/* === STAGGER CARDS — Premium overlapping entrance === */
.stagger > * {
  opacity: 0;
  transform: translateY(60px) scale(0.92) rotate(1deg);
  filter: blur(4px);
  transition: opacity 0.7s var(--transition-smooth),
              transform 0.9s var(--transition-smooth),
              filter 0.6s var(--transition-smooth);
}

.stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger.visible > *:nth-child(3) { transition-delay: 0.16s; }
.stagger.visible > *:nth-child(4) { transition-delay: 0.24s; }
.stagger.visible > *:nth-child(5) { transition-delay: 0.32s; }
.stagger.visible > *:nth-child(6) { transition-delay: 0.4s; }

.stagger.visible > * {
  opacity: 1;
  transform: translateY(0) scale(1) rotate(0deg);
  filter: blur(0);
}

/* === CLIP REVEAL (wipe from left) === */
.reveal-clip {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s var(--transition-smooth);
}
.reveal-clip.visible {
  clip-path: inset(0 0 0 0);
}

/* === TEXT MASK REVEAL (bottom to top) === */
.reveal-mask {
  overflow: hidden;
  display: inline-block;
}
.reveal-mask > * {
  display: block;
  transform: translateY(110%);
  transition: transform 0.8s var(--transition-smooth);
}
.reveal-mask.visible > * {
  transform: translateY(0);
}

/* === MAGNETIC HOVER EFFECT (JS-powered) === */
.magnetic {
  transition: transform 0.3s var(--transition-smooth);
}

/* === SMOOTH SECTION CLIP TRANSITION === */
.section-clip {
  clip-path: inset(0 0 0 0);
  transition: clip-path 1.2s var(--transition-smooth);
}

/* === HORIZONTAL RULE ANIMATED === */
.divider-anim {
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-dark) 100%);
  transition: width 1.2s var(--transition-smooth);
  border-radius: 2px;
  position: relative;
}
.divider-anim.visible { width: 80px; }
.divider-anim::after {
  content: '';
  position: absolute;
  left: 0; top: 0; height: 100%; width: 30%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: dividerShimmer 2.5s ease-in-out infinite;
}
@keyframes dividerShimmer {
  0% { transform: translateX(0); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(280%); opacity: 0; }
}

/* === COUNTER ROLL ANIMATION === */
@keyframes countRoll {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === GLOW PULSE ON CTA === */
.btn-primary { position: relative; }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--coral);
  border-radius: inherit;
  opacity: 0;
  z-index: -1;
  filter: blur(15px);
  transition: opacity 0.4s ease;
}
.btn-primary:hover::before { opacity: 0.4; }

/* --- Marquee --- */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  padding: 2rem 0;
}

.marquee-inner {
  display: inline-flex;
  animation: marquee 30s linear infinite;
}

.marquee-item {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  padding: 0 2rem;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--gray-300);
}

.section-dark .marquee-item {
  -webkit-text-stroke-color: rgba(255,255,255,0.15);
}

.marquee-item.filled {
  color: var(--black);
  -webkit-text-stroke: 0;
}

.section-dark .marquee-item.filled {
  color: var(--white);
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Horizontal Scroll (About Page Values) --- */
.values-track {
  display: flex;
  gap: 2rem;
  padding: 2rem 0;
}

.value-card {
  flex: 0 0 260px;
  padding: 2rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.4s var(--transition);
}

.value-card:hover {
  border-color: var(--coral);
  background: rgba(224, 90, 58, 0.05);
}

.value-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.value-card p {
  color: var(--gray-300);
  line-height: 1.6;
  font-size: 0.85rem;
}

/* --- Team Section (Placeholder) --- */
.team-member {
  text-align: center;
}

.team-photo {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--gray-200);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.team-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10,10,10,0.1));
}

.team-member h3 {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.team-member p {
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.5;
}

.scroll-indicator span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--white), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* --- Page Transition --- */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9999;
  transform: scaleY(0);
  transform-origin: bottom;
}

/* --- Utility --- */
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }

/* === HORIZONTAL SCROLL SECTION === */
.h-scroll-section {
  height: 200vh; /* scroll length — compact */
  position: relative;
}

.h-scroll-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.h-scroll-track {
  display: flex;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  will-change: transform;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
}

.h-scroll-track > * {
  flex: 0 0 auto;
}

/* === IMAGE CLIP REVEAL === */
.img-reveal {
  overflow: hidden;
  position: relative;
}

.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--black);
  transform: scaleX(1);
  transform-origin: right;
  transition: transform 1.2s var(--transition-smooth);
}

.img-reveal.visible::after {
  transform: scaleX(0);
}

.img-reveal img {
  transform: scale(1.2);
  transition: transform 1.4s var(--transition-smooth);
}

.img-reveal.visible img {
  transform: scale(1);
}

/* === SECTION COLOR TRANSITIONS === */
.section-transition {
  transition: background-color 0.8s ease;
}

/* === OUTLINED TEXT (Stroke effect) === */
.text-outline {
  color: transparent;
  -webkit-text-stroke: 2px var(--white);
  transition: all 0.5s ease;
}

.text-outline:hover,
.text-outline.filled {
  color: var(--white);
  -webkit-text-stroke: 0;
}

/* === FLOAT ANIMATION (subtle hover) === */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float { animation: float 4s ease-in-out infinite; }
.float-delay { animation: float 4s ease-in-out infinite 1s; }
.float-slow { animation: float 6s ease-in-out infinite; }

/* === GRADIENT TEXT === */
.text-gradient {
  background: linear-gradient(135deg, var(--coral), #F0C040);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === CARD SHINE ON HOVER === */
.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 40%,
    rgba(255,255,255,0.03) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.card-shine:hover::after {
  transform: translateX(100%);
}

/* === STACKED SECTION (cards that unstack) === */
.stack-cards {
  position: relative;
}

.stack-cards > * {
  transition: all 0.6s var(--transition-smooth);
}

/* --- Responsive Fine-tuning --- */
@media (max-width: 768px) {
  .hero { min-height: 90vh; }
  .hero-page { min-height: auto; padding-top: 4.5rem; padding-bottom: 3rem; }
  .stats { gap: 2rem; }
  .stat-number { font-size: 2.2rem; }
  .section { padding: 4rem 0; }
  .h-scroll-section { height: auto !important; }
  .h-scroll-sticky { position: relative !important; height: auto !important; }
  .h-scroll-track { flex-direction: column; }
}

/* ============================================
   SERVICE PAGE THEMING
   Used by: test.html (coral), formazione.html (blue),
            data-analysis.html (green), ricerca.html (gray)
   Apply via <body class="service-page theme-*">
   ============================================ */

.theme-coral  { --service-accent: #E05A3A; --service-accent-soft: rgba(224, 90, 58, 0.15); }
.theme-blue   { --service-accent: #3B82F6; --service-accent-soft: rgba(59, 130, 246, 0.15); }
.theme-green  { --service-accent: #22C55E; --service-accent-soft: rgba(34, 197, 94, 0.15); }
.theme-gray   { --service-accent: #9CA3AF; --service-accent-soft: rgba(156, 163, 175, 0.15); }
.theme-yellow { --service-accent: #F0C040; --service-accent-soft: rgba(240, 192, 64, 0.18); }

/* Accent applications for service pages */
.service-page strong { color: var(--service-accent, var(--coral)); }
.service-page .phase-list li::before { background: var(--service-accent, var(--coral)); }
.theme-blue .h-large { border-bottom-color: var(--service-accent); }

/* Layout tweaks used on service pages */
.service-page .section .grid-2 { gap: 2rem; }
.service-page .phase-number { margin-bottom: -1rem; line-height: 0.8; }

/* Mini project card (shared across service pages, accent-themed) */
/* Mini-project card — same split layout as projects page */
.mini-project-card {
  position: relative;
  background: #0A0A0A;
  border-radius: 12px;
  overflow: hidden;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #fff;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  --card-accent: #E05A3A;
  --card-tag-bg: rgba(224,90,58,0.18);
  --card-tag-fg: #FF8366;
}
.mini-project-card[data-service="test"]       { --card-accent: #E05A3A; --card-tag-bg: rgba(224,90,58,0.18); --card-tag-fg: #FF8366; }
.mini-project-card[data-service="formazione"] { --card-accent: #F0C040; --card-tag-bg: rgba(240,192,64,0.18); --card-tag-fg: #F5D170; }
.mini-project-card[data-service="analytics"]  { --card-accent: #22C55E; --card-tag-bg: rgba(34,197,94,0.18);  --card-tag-fg: #4ADE80; }
.mini-project-card[data-service="research"]   { --card-accent: #3B82F6; --card-tag-bg: rgba(59,130,246,0.18); --card-tag-fg: #7BA9FA; }

.mini-project-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 24px 50px rgba(0,0,0,0.45),
    0 0 0 1.5px var(--card-accent);
}
.mini-project-bg {
  position: relative;
  flex: 1 1 auto;
  min-height: 200px;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}
.mini-project-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.mini-project-card:hover .mini-project-bg { transform: scale(1.04); }
.mini-project-overlay { display: none; } /* legacy element no longer needed */
.mini-project-content {
  position: relative;
  z-index: 2;
  padding: 1.4rem 1.5rem 1.5rem;
  background: #0A0A0A;
  border-top: 3px solid var(--card-accent);
  flex: 0 0 auto;
}
.mini-project-card:hover .mini-project-content { border-top-width: 4px; }

.mini-project-tag {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.32rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.7rem;
  background: var(--card-tag-bg);
  color: var(--card-tag-fg);
  border: 1px solid var(--card-tag-bg);
}
.mini-project-client {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.mini-project-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.55rem;
  color: #fff;
  line-height: 1.28;
}
.mini-project-card p {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  margin: 0 0 0.85rem;
}
.mini-project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--card-accent);
  transition: gap 0.25s ease;
}
.mini-project-card:hover .mini-project-link { gap: 0.6rem; }

/* ============================================
   KPI COUNTER SECTION
   ============================================ */
.kpi-section {
  background: var(--black);
  color: var(--white);
  padding: clamp(4rem, 8vw, 6rem) 0;
  position: relative;
  overflow: hidden;
}
.kpi-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 500px 300px at 20% 50%, rgba(224, 90, 58, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse 400px 250px at 80% 50%, rgba(224, 90, 58, 0.15) 0%, transparent 60%);
  pointer-events: none;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  position: relative;
  z-index: 1;
}
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-item {
  text-align: center;
  position: relative;
  padding: 1.5rem 1rem;
}
.kpi-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 20%;
  bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}
@media (max-width: 900px) {
  .kpi-item:not(:last-child)::after { display: none; }
}
.kpi-number {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--coral);
  display: block;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}
.kpi-suffix { font-size: 0.7em; margin-left: 0.05em; }

/* ============================================
   TRUST STRIP — loghi partner
   ============================================ */
.trust-strip {
  padding: clamp(2.5rem, 4vw, 3.5rem) 0;
  background: var(--gray-100);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.trust-strip-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 1.8rem;
}
.trust-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(2rem, 4vw, 4rem);
  opacity: 0.55;
  transition: opacity 0.3s;
}
.trust-strip:hover .trust-logos { opacity: 0.85; }
.trust-logo {
  font-size: clamp(1rem, 1.6vw, 1.3rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gray-700);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  filter: grayscale(1);
  transition: all 0.3s var(--transition-smooth);
}
.trust-logo:hover {
  filter: grayscale(0);
  color: var(--black);
  transform: translateY(-2px);
}
.trust-logo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--coral);
  display: inline-block;
}

/* ============================================
   PROCESS TIMELINE — "Come lavoriamo"
   ============================================ */
.timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--gray-200) 5%,
    var(--gray-200) 95%,
    transparent 100%);
  transform: translateX(-50%);
}
.timeline-item {
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 3rem;
  position: relative;
}
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item .timeline-content {
  padding: 1.8rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  transition: all 0.4s var(--transition-smooth);
}
.timeline-item:hover .timeline-content {
  transform: translateY(-4px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
  border-color: var(--coral);
}
.timeline-item:nth-child(odd) .timeline-content { grid-column: 1; text-align: right; }
.timeline-item:nth-child(odd) .timeline-spacer { grid-column: 3; }
.timeline-item:nth-child(even) .timeline-content { grid-column: 3; }
.timeline-item:nth-child(even) .timeline-spacer { grid-column: 1; }
.timeline-dot {
  grid-column: 2;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--coral);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--coral);
  margin: 0 auto;
  position: relative;
  z-index: 1;
  transition: all 0.4s var(--transition-smooth);
}
.timeline-item:hover .timeline-dot {
  background: var(--coral);
  color: var(--white);
  transform: scale(1.1);
}
.timeline-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}
.timeline-text {
  font-size: 0.88rem;
  color: var(--gray-700);
  line-height: 1.6;
}
@media (max-width: 700px) {
  .timeline::before { left: 28px; }
  .timeline-item { grid-template-columns: 56px 1fr; }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    grid-column: 2;
    text-align: left;
  }
  .timeline-item .timeline-spacer { display: none; }
  .timeline-dot { grid-column: 1; }
}

/* ============================================
   DIM-CARD HOVER CTA (test.html)
   ============================================ */
.dim-card {
  display: flex;
  flex-direction: column;
}
.dim-card .dim-card-cta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--coral);
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.35s var(--transition-smooth);
}
.dim-card:hover .dim-card-cta {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   DARK MODE (opt-in via [data-theme="dark"])
   Targeted overrides — dark-native sections stay dark
   ============================================ */
[data-theme="dark"] {
  color-scheme: dark;
}
/* Body + neutral page surfaces */
[data-theme="dark"] body {
  background: #0F0F11;
  color: #F0F0F2;
}
[data-theme="dark"] .section:not(.section-dark):not(.section-gray) {
  background: #0F0F11;
  color: #F0F0F2;
}
[data-theme="dark"] .section-gray { background: #17171B; color: #F0F0F2; }
[data-theme="dark"] .text-body,
[data-theme="dark"] .text-large { color: #C5C5CC; }

/* Cards inversion (service-card-v2 ha già stile dark di default, non viene toccato) */
[data-theme="dark"] .dim-card,
[data-theme="dark"] .timeline-content,
[data-theme="dark"] .mini-project-card {
  background: #1C1C21;
  border-color: #2E2E34;
  color: #F0F0F2;
}
[data-theme="dark"] .dim-card h4,
[data-theme="dark"] .timeline-title,
[data-theme="dark"] .mini-project-card h4 {
  color: #FFFFFF;
}
[data-theme="dark"] .dim-card p,
[data-theme="dark"] .timeline-text {
  color: #B8B8BE;
}

/* Timeline rail & dot */
[data-theme="dark"] .timeline::before {
  background: linear-gradient(180deg, transparent, #2E2E34 5%, #2E2E34 95%, transparent);
}
[data-theme="dark"] .timeline-dot {
  background: #1C1C21;
}

/* Trust strip */
[data-theme="dark"] .trust-strip {
  background: #17171B;
  border-color: #2E2E34;
}
[data-theme="dark"] .trust-logo { color: #B8B8BE; }
[data-theme="dark"] .trust-logo:hover { color: #FFFFFF; }

/* Headings in light sections now inverted */
[data-theme="dark"] .section:not(.section-dark) h1,
[data-theme="dark"] .section:not(.section-dark) h2,
[data-theme="dark"] .section:not(.section-dark) h3,
[data-theme="dark"] .section:not(.section-dark) h4,
[data-theme="dark"] .section:not(.section-dark) .h-large,
[data-theme="dark"] .section:not(.section-dark) .h-medium,
[data-theme="dark"] .section:not(.section-dark) .h-small {
  color: #FFFFFF;
}

/* Body text & links in light sections */
[data-theme="dark"] .section:not(.section-dark) p,
[data-theme="dark"] .section:not(.section-dark) li,
[data-theme="dark"] .section:not(.section-dark) span,
[data-theme="dark"] .section:not(.section-dark) li a {
  color: #C5C5CC;
}

/* Logo swap: dark SVG becomes white in dark mode via filter */
[data-theme="dark"] img[src*="logo-testare-dark"],
[data-theme="dark"] img[src*="logo-testare-gray"],
[data-theme="dark"] img[src*="logo.svg"] {
  filter: invert(1) brightness(1.1);
}
/* Nav bar in dark mode */
[data-theme="dark"] .navbar {
  background: rgba(15, 15, 17, 0.85);
  border-bottom-color: #2E2E34;
}
[data-theme="dark"] .navbar a { color: #F0F0F2; }
[data-theme="dark"] .navbar a:hover { color: var(--coral); }

/* Buttons */
[data-theme="dark"] .btn-dark {
  background: #FFFFFF;
  color: #0F0F11;
}
[data-theme="dark"] .btn-dark:hover {
  background: var(--coral);
  color: #FFFFFF;
}

/* Form inputs */
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1C1C21;
  border-color: #2E2E34;
  color: #F0F0F2;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #8A8A94; }

/* Table / list item borders */
[data-theme="dark"] [style*="border-top: 1px solid"],
[data-theme="dark"] [style*="border-bottom: 1px solid"],
[data-theme="dark"] [style*="border: 1px solid"] {
  border-color: #2E2E34 !important;
}

/* Dashboard demo stays dark — no override needed */
[data-theme="dark"] .text-coral,
[data-theme="dark"] .coral { color: var(--coral); }

/* Hero divider shimmer stays coral */
[data-theme="dark"] .divider-anim::after {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  bottom: 1.4rem;
  right: 1.4rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s var(--transition-smooth), background 0.3s;
}
.theme-toggle:hover { transform: scale(1.08) rotate(15deg); }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Respect user reduced-motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-bg, .divider-anim::after {
    animation: none;
  }
}

/* ============================================
   FAQ Accordion (homepage)
   ============================================ */
.faq-section {
  background: linear-gradient(180deg, #FAFAFA 0%, #F4F4F6 100%);
  padding: 6rem 0;
}
.faq-item {
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.25s var(--transition);
}
.faq-item:last-child {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.faq-item > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.4rem 0.5rem;
  font-family: Inter, sans-serif;
  user-select: none;
  outline: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-q {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 700;
  color: #0A0A0A;
  line-height: 1.4;
  letter-spacing: -0.01em;
  flex: 1;
}
.faq-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(224, 90, 58, 0.1);
  color: var(--coral);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.35s var(--transition), background 0.25s;
}
.faq-item[open] > summary .faq-icon {
  transform: rotate(45deg);
  background: var(--coral);
  color: #fff;
}
.faq-item:hover > summary .faq-icon {
  background: rgba(224, 90, 58, 0.2);
}
.faq-item:hover > summary .faq-q {
  color: var(--coral);
}
.faq-a {
  padding: 0 3.5rem 1.5rem 0.5rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #4A4A52;
  animation: faqFade 0.4s ease;
}
@keyframes faqFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .faq-section {
  background: linear-gradient(180deg, #0F0F11 0%, #17171B 100%);
}
[data-theme="dark"] .faq-item { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .faq-q { color: #F0F0F2; }
[data-theme="dark"] .faq-a { color: #C5C5CC; }

/* ============================================
   Breadcrumb (service pages)
   ============================================ */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0 2.5rem 0;
  font-family: Inter, sans-serif;
  font-size: clamp(0.88rem, 1.1vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  list-style: none;
  margin: 0;
  justify-content: center;
  opacity: 1;
}
.breadcrumb .bc-sep {
  font-size: 1.2em;
  line-height: 1;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.5rem; }
.breadcrumb a {
  color: var(--gray-300, #BBB);
  transition: color 0.25s var(--transition);
}
.breadcrumb a:hover { color: var(--coral); }
.breadcrumb .bc-sep {
  color: var(--gray-400, #888);
  font-weight: 400;
  opacity: 0.6;
}
.breadcrumb .bc-current {
  color: var(--coral);
}
[data-theme="dark"] .breadcrumb a { color: #C5C5CC; }

/* ============================================
   Contact Form (#contatti)
   ============================================ */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.8rem;
  backdrop-filter: blur(8px);
}
.contact-form .cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .contact-form .cf-row { grid-template-columns: 1fr; }
  .contact-form { padding: 1.2rem; }
}
.contact-form .cf-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: Inter, sans-serif;
}
.contact-form .cf-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-300);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: #fff;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.25s, background 0.25s;
  resize: vertical;
}
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--coral);
  background: rgba(255,255,255,0.08);
}
.contact-form .cf-invalid input,
.contact-form .cf-invalid select,
.contact-form .cf-invalid textarea,
.contact-form input.cf-invalid,
.contact-form select.cf-invalid,
.contact-form textarea.cf-invalid {
  border-color: #EF4444;
}
.contact-form .cf-error {
  min-height: 1.1em;
  font-size: 0.78rem;
  color: #EF4444;
  font-weight: 500;
}
.contact-form .cf-check {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.85rem;
  color: var(--gray-300);
  line-height: 1.4;
  cursor: pointer;
}
.contact-form .cf-check input[type="checkbox"] {
  width: 18px; height: 18px;
  flex-shrink: 0;
  accent-color: var(--coral);
  margin-top: 2px;
}
.contact-form .cf-check.cf-invalid span {
  color: #EF4444;
}
.contact-form .cf-success {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 8px;
  font-size: 0.88rem;
  color: #D1FAE5;
  line-height: 1.45;
}
/* Dropdown option readability */
.contact-form select option {
  background: #0a0a0a;
  color: #fff;
}

/* ============================================
   Proportions & rhythm overrides
   Beefing up small text that sits in big boxes
   so service pages feel more homogeneous.
   ============================================ */
.service-page .process-phase-desc {
  font-size: 1rem !important;
  line-height: 1.6 !important;
  max-width: 52ch;
}
.service-page .process-phase h3 {
  font-size: clamp(1.25rem, 1.8vw, 1.55rem) !important;
  margin-bottom: 0.8rem !important;
}
.service-page .process-phase {
  padding: 2rem 0 !important;
  gap: clamp(2rem, 4vw, 4rem) !important;
}
.service-page .process-phase-right ul li {
  font-size: 1rem !important;
  line-height: 1.55 !important;
  padding: 0.55rem 0 !important;
}
.service-page .process-phase-number {
  line-height: 0.8 !important;
  margin-bottom: 0.9rem !important;
}
/* Intro paragraph: give it breathing room with character */
.service-page section .container-narrow .text-large {
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  line-height: 1.6;
}
/* Hero label chip — bigger so it's readable at a glance */
.hero-page .hero-label {
  font-size: 0.8rem;
  padding: 0.5rem 1.2rem;
}
/* Hero big italic question */
.hero-page .hero-content > p.reveal[style*="italic"] {
  font-size: clamp(1.3rem, 2.6vw, 1.75rem) !important;
  margin-bottom: 0.75rem !important;
}
/* Stat numbers — bigger where they sit alone in panels */
.service-page .stat-number {
  font-size: clamp(2.8rem, 5vw, 4rem);
  line-height: 1;
}
/* Footer slightly denser */
.footer .footer-grid { gap: clamp(2rem, 4vw, 3rem); }
.footer h4 { font-size: 0.78rem; letter-spacing: 0.1em; }
.footer .footer-links a { font-size: 0.95rem; }

/* ============================================================
   TYPEWRITER — Hero titles, character-by-character with caret
   ============================================================ */
.tw-line {
  /* Reserve a baseline so the row doesn't collapse before chars arrive */
  min-height: 1em;
}
.tw-caret {
  display: inline-block;
  width: 0.06em;
  height: 0.78em;
  background: currentColor;
  margin-left: 0.06em;
  vertical-align: -0.04em;
  border-radius: 1px;
  animation: tw-blink 0.85s steps(2, jump-none) infinite;
}
@keyframes tw-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .tw-caret { animation: none; opacity: 0.6; }
}

/* ============================================================
   TOOLS — Hub + tool detail pages (shared)
   ============================================================ */

/* --- Hub: intro strip + cards grid --- */
.tools-intro {
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  background: var(--gray-100);
}
.tools-intro-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.tools-intro-item {
  display: flex; flex-direction: column; gap: 0.4rem;
  font-size: 0.92rem; color: var(--gray-700);
}
.tools-intro-item strong { color: var(--black); font-size: 0.95rem; }
.tools-intro-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: rgba(224,90,58,0.1); color: var(--coral);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.4rem;
}
@media (max-width: 720px) {
  .tools-intro-row { grid-template-columns: 1fr; gap: 1rem; }
}

.tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
@media (max-width: 980px) {
  .tool-cards-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tool-cards-grid { grid-template-columns: 1fr; }
}
.tool-card-link {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.6rem;
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s var(--transition);
  position: relative;
  overflow: hidden;
  min-height: 260px;
}
.tool-card-link::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(224,90,58,0) 0%, rgba(224,90,58,0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s var(--transition);
  pointer-events: none;
}
.tool-card-link:hover {
  border-color: var(--coral);
  transform: translateY(-3px);
  box-shadow: 0 18px 40px -16px rgba(224,90,58,0.25);
}
.tool-card-link:hover::before { opacity: 1; }
.tool-card-num {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  font-size: 0.7rem; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 700;
  color: var(--gray-500);
}
.tool-card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: rgba(224,90,58,0.1);
  color: var(--coral);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
  transition: all 0.25s var(--transition);
}
.tool-card-link:hover .tool-card-icon {
  background: var(--coral); color: var(--white);
  transform: scale(1.05);
}
.tool-card-title {
  font-size: 1.25rem; font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}
.tool-card-desc {
  font-size: 0.92rem;
  color: var(--gray-700);
  line-height: 1.55;
  margin-bottom: 1.1rem;
  flex-grow: 1;
}
.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--coral);
  margin-top: auto;
}
.tool-card-cta .arrow {
  transition: transform 0.25s var(--transition);
  display: inline-block;
}
.tool-card-link:hover .tool-card-cta .arrow { transform: translateX(4px); }

/* --- Tool detail pages: tool widget shared styles --- */
.tool-header { max-width: 760px; margin-bottom: 2rem; }
.tool-tag {
  display: inline-block;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); font-weight: 700; margin-bottom: 0.6rem;
}
.tool-sub {
  font-size: 1.05rem; color: var(--gray-700);
  margin-top: 0.7rem; line-height: 1.55;
}

.tool-card {
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  padding: 1.75rem;
  background: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,0.04);
}
.tool-card-dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
}
.tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 2rem;
}
@media (max-width: 880px) {
  .tool-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

.tool-label {
  display: block;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; color: var(--gray-700);
  margin-bottom: 0.4rem;
}
.tool-card-dark .tool-label { color: var(--gray-300); }
.tool-help {
  font-size: 0.85rem; color: var(--gray-500);
  margin-bottom: 0.75rem; line-height: 1.5;
}
.tool-card-dark .tool-help { color: var(--gray-300); }

.tool-textarea {
  width: 100%;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.95rem; padding: 0.85rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px; background: var(--white); color: var(--black);
  resize: vertical; min-height: 220px; outline: none;
  transition: border-color 0.2s var(--transition);
}
.tool-textarea:focus { border-color: var(--coral); }

.tool-number {
  width: 100%;
  font-family: var(--font-primary);
  font-size: 1.05rem; padding: 0.75rem 0.9rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--white); outline: none;
  transition: border-color 0.2s var(--transition);
}
.tool-number:focus { border-color: var(--coral); }
.tool-number::-webkit-outer-spin-button,
.tool-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tool-number[type=number] { -moz-appearance: textfield; }

.tool-z-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
.tool-z-grid > .tool-field:last-child { grid-column: 1 / -1; }
@media (max-width: 540px) {
  .tool-z-grid { grid-template-columns: 1fr; }
}

.tool-radio-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tool-radio {
  display: inline-flex; align-items: center;
  gap: 0.4rem; padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px; cursor: pointer;
  font-size: 0.85rem; color: var(--gray-300);
  transition: all 0.2s var(--transition);
}
.tool-radio input { accent-color: var(--coral); }
.tool-radio:has(input:checked) {
  border-color: var(--coral); color: var(--white);
  background: rgba(224,90,58,0.12);
}

.tool-actions {
  display: flex; flex-wrap: wrap; gap: 0.6rem;
  margin-top: 1.1rem;
}
.btn-ghost, .btn-ghost-light {
  padding: 0.65rem 1.2rem; border-radius: 999px;
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; background: transparent;
  transition: all 0.2s var(--transition);
}
.btn-ghost {
  border: 1px solid var(--gray-300); color: var(--gray-700);
}
.btn-ghost:hover { border-color: var(--black); color: var(--black); }
.btn-ghost-light {
  border: 1px solid rgba(255,255,255,0.25); color: var(--gray-300);
}
.btn-ghost-light:hover { border-color: var(--white); color: var(--white); }

.tool-error {
  margin-top: 0.8rem; padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: rgba(224,90,58,0.1);
  color: var(--coral-dark);
  font-size: 0.9rem;
  border-left: 3px solid var(--coral);
}
.tool-card-dark .tool-error {
  background: rgba(224,90,58,0.18); color: #ffb8a3;
}

.tool-output-pane {
  border-left: 1px solid var(--gray-200);
  padding-left: 2rem;
}
@media (max-width: 880px) {
  .tool-output-pane {
    border-left: none; border-top: 1px solid var(--gray-200);
    padding-left: 0; padding-top: 1.5rem;
  }
}
.tool-output-pane-dark { border-color: rgba(255,255,255,0.1); }
@media (max-width: 880px) {
  .tool-output-pane-dark { border-top-color: rgba(255,255,255,0.1); }
}

.tool-output-head {
  display: flex; align-items: baseline;
  justify-content: space-between; gap: 1rem;
  margin-bottom: 1rem;
}
.tool-output-tag {
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--coral); font-weight: 700;
}
.tool-output-meta { font-size: 0.85rem; color: var(--gray-500); }
.tool-card-dark .tool-output-meta { color: var(--gray-300); }

.tool-stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem; margin-bottom: 1.5rem;
}
@media (max-width: 540px) {
  .tool-stat-grid { grid-template-columns: repeat(2, 1fr); }
}
.tool-stat {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-100);
}
.tool-stat-key {
  display: block;
  font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-weight: 700; color: var(--gray-700);
  margin-bottom: 0.25rem;
}
.tool-stat-val {
  font-size: 1.4rem; font-weight: 800;
  color: var(--black); letter-spacing: -0.01em; line-height: 1;
}
.tool-stat-unit {
  font-size: 0.75rem; color: var(--gray-500);
  margin-left: 0.2rem; font-weight: 500;
}

.tool-hist-wrap, .tool-z-curve-wrap, .tool-scatter-wrap { margin-top: 0.5rem; }
.tool-hist {
  width: 100%; height: auto; max-height: 240px;
  display: block;
  background: var(--gray-100);
  border-radius: 8px;
}
.tool-card-dark .tool-hist { background: rgba(255,255,255,0.04); }

.tool-z-headline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.75rem; align-items: center;
  padding: 1.5rem 0 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 1.25rem;
}
@media (max-width: 720px) {
  .tool-z-headline { grid-template-columns: 1fr; gap: 1.1rem; }
}
.tool-z-big {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 0.35rem;
  color: var(--white);
  min-width: 0;
}
.tool-z-big-unit {
  order: -1;
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gray-300); font-weight: 700;
  line-height: 1;
}
.tool-z-big-num {
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 900; line-height: 0.95;
  color: var(--coral); letter-spacing: -0.03em;
}
.tool-z-secondary {
  display: flex; flex-direction: column; gap: 0.6rem;
}
.tool-z-secondary > div {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 0.5rem; padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tool-z-key {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gray-300); font-weight: 600;
}
.tool-z-val {
  font-size: 1.15rem; font-weight: 800;
  color: var(--white); letter-spacing: -0.01em;
}

/* Light variant of headline (for correlazione page) */
.tool-z-headline-light {
  border-bottom-color: var(--gray-200);
}
.tool-z-headline-light .tool-z-big { color: var(--black); }
.tool-z-headline-light .tool-z-big-unit { color: var(--gray-500); }
.tool-z-headline-light .tool-z-secondary > div { border-bottom-color: var(--gray-200); }
.tool-z-headline-light .tool-z-key { color: var(--gray-700); }
.tool-z-headline-light .tool-z-val { color: var(--black); }

/* Make secondary list breathe — values can wrap below long keys cleanly */
.tool-z-secondary > div {
  flex-wrap: wrap;
}
.tool-z-secondary .tool-z-val {
  white-space: nowrap;
  overflow-wrap: break-word;
}
.tool-z-secondary .tool-z-val.tool-z-val-equation {
  white-space: normal;
  text-align: right;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.95rem;
}

/* "Cosa significa?" — divulgative interpretation block */
.tool-takeaway {
  margin-top: 1.4rem;
  padding: 1.1rem 1.3rem;
  border-radius: 10px;
  background: rgba(224,90,58,0.06);
  border-left: 3px solid var(--coral);
}
.tool-takeaway-head {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--coral); font-weight: 700;
  margin-bottom: 0.55rem;
}
.tool-takeaway-head svg { flex-shrink: 0; }
.tool-takeaway-body {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--gray-700);
}
.tool-takeaway-body p { margin: 0; }
.tool-takeaway-body p + p { margin-top: 0.55rem; }
.tool-takeaway-body strong { color: var(--black); font-weight: 700; }
.tool-card-dark .tool-takeaway {
  background: rgba(224,90,58,0.14);
  border-left-color: var(--coral);
}
.tool-card-dark .tool-takeaway-body { color: var(--gray-300); }
.tool-card-dark .tool-takeaway-body strong { color: var(--white); }

.tool-formula {
  margin-top: 1.25rem; font-size: 0.88rem; color: var(--gray-700);
}
.tool-formula-dark { color: var(--gray-300); }
.tool-formula summary {
  cursor: pointer; font-weight: 700;
  color: var(--gray-700); padding: 0.4rem 0;
}
.tool-formula-dark summary { color: var(--gray-300); }
.tool-formula summary:hover { color: var(--coral); }
.tool-formula ul { padding-left: 1.2rem; margin-top: 0.5rem; line-height: 1.7; }
.tool-formula li { margin-bottom: 0.4rem; }

/* Two-column data input for correlation tool */
.tool-corr-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 540px) {
  .tool-corr-cols { grid-template-columns: 1fr; }
}
.tool-corr-cols .tool-textarea { min-height: 200px; }

/* "Altri tools" section at bottom of detail pages */
.tools-also-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.5rem;
}
@media (max-width: 720px) {
  .tools-also-grid { grid-template-columns: 1fr; }
}
.tools-also-grid .tool-card-link { min-height: 180px; padding: 1.25rem 1.4rem; }
.tools-also-grid .tool-card-icon { width: 44px; height: 44px; margin-bottom: 0.8rem; }
.tools-also-grid .tool-card-title { font-size: 1.05rem; margin-bottom: 0.3rem; }
.tools-also-grid .tool-card-desc { font-size: 0.85rem; margin-bottom: 0.7rem; }

/* =================================================================
   COOKIE BANNER GDPR — TESTÀRE
   ================================================================= */
.ck-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 99990;
  max-width: 1080px;
  margin: 0 auto;
  background: #0F0F0F;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  padding: 1.1rem 1.3rem;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  font-family: Inter, sans-serif;
}
.ck-banner.ck-show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.ck-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.2rem;
}
.ck-banner-text {
  flex: 1 1 360px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.78);
}
.ck-banner-text strong { color: #fff; margin-right: 0.3rem; }
.ck-banner-text a { color: var(--coral, #E05A3A); text-decoration: underline; }
.ck-banner-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.ck-btn {
  font-family: Inter, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.ck-btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.ck-btn-ghost:hover {
  border-color: var(--coral, #E05A3A);
  color: var(--coral, #E05A3A);
}
.ck-btn-primary {
  background: var(--coral, #E05A3A);
  color: #fff;
  border-color: var(--coral, #E05A3A);
}
.ck-btn-primary:hover {
  background: #FF6B35;
  border-color: #FF6B35;
}

@media (max-width: 720px) {
  .ck-banner { padding: 1rem; }
  .ck-banner-text { font-size: 0.85rem; flex-basis: 100%; }
  .ck-banner-actions { width: 100%; justify-content: stretch; }
  .ck-banner-actions .ck-btn { flex: 1 1 auto; padding: 0.7rem 0.8rem; }
}

/* === MODAL === */
.ck-modal {
  position: fixed; inset: 0;
  z-index: 99995;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.ck-modal.ck-show { opacity: 1; pointer-events: auto; }
.ck-modal-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.ck-modal-content {
  position: relative;
  background: #fff;
  color: #18181b;
  width: 100%;
  max-width: 580px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  font-family: Inter, sans-serif;
}
.ck-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid #E4E4E8;
}
.ck-modal-head h2 {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.01em;
}
.ck-modal-close {
  background: transparent;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: #6B7280;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.ck-modal-close:hover { background: #F4F4F6; color: #0F0F0F; }
.ck-modal-body {
  padding: 1.5rem;
  flex: 1;
}
.ck-intro {
  font-size: 0.88rem;
  color: #4B4D55;
  line-height: 1.6;
  margin: 0 0 1.3rem;
}
.ck-intro a { color: var(--coral, #E05A3A); }
.ck-cat {
  background: #FAFAFA;
  border: 1px solid #E4E4E8;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
}
.ck-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ck-cat h3 {
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  color: #0F0F0F;
}
.ck-cat p {
  font-size: 0.8rem;
  color: #6B7280;
  margin: 0;
  line-height: 1.5;
}
.ck-modal-foot {
  display: flex;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #E4E4E8;
  flex-wrap: wrap;
}
.ck-modal-foot .ck-btn { flex: 1 1 auto; }
.ck-modal-foot .ck-btn-ghost { color: #18181b; border-color: #CFCFD4; }
.ck-modal-foot .ck-btn-ghost:hover { color: var(--coral, #E05A3A); border-color: var(--coral, #E05A3A); }

/* Toggle switch */
.ck-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.ck-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.ck-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CFCFD4;
  border-radius: 24px;
  transition: background 0.25s ease;
}
.ck-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.ck-toggle input:checked + .ck-toggle-slider {
  background: var(--coral, #E05A3A);
}
.ck-toggle input:checked + .ck-toggle-slider::before {
  transform: translateX(20px);
}
.ck-toggle-locked .ck-toggle-slider {
  background: #CFCFD4 !important;
  cursor: not-allowed;
  opacity: 0.7;
}
.ck-toggle input:disabled + .ck-toggle-slider::before {
  background: #fff;
}
