/* ============================================================
   style.css — Layout, tipografia, variabili CSS, navbar, footer
   TiramisuCode — 2025
   ============================================================ */

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

/* --- Variabili CSS — sistema design token --- */
:root {
  /* Palette colori */
  --bg:       #FAFAF8;
  --text:     #1A1A1A;
  --accent:   #8B5E3C;   /* marrone tiramisù */
  --accent2:  #C9A96E;   /* oro/crema */
  --muted:    #555555;   /* migliorato da #6B6B6B per contrasto WCAG */
  --border:   #E8E4DF;
  --surface:  #F2EDE8;

  /* Tipografia */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Spaziatura */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Layout */
  --max-width:  1200px;
  --nav-height: 72px;
  --radius:     8px;
  --radius-lg:  16px;

  /* Ombre */
  --shadow-sm: 0 1px 4px rgba(26, 26, 26, 0.06);
  --shadow-md: 0 4px 20px rgba(26, 26, 26, 0.09);
  --shadow-lg: 0 12px 40px rgba(26, 26, 26, 0.12);

  /* Transizioni */
  --transition:      0.25s ease;
  --transition-slow: 0.4s ease;
}

/* --- Base HTML --- */
html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Texture grain overlay tramite SVG data URI */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.03;
  /* Promosso su layer GPU proprio: evita repaint ad ogni scroll */
  transform: translateZ(0);
  will-change: transform;
}

/* --- Tipografia --- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }

p {
  font-family: var(--font-body);
  color: var(--muted);
  line-height: 1.75;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent2);
}

/* Focus visibile per accessibilità keyboard */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
  box-shadow: 0 0 0 5px rgba(139, 94, 60, 0.15);
}

/* Focus per bottoni */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-nav-cta:focus-visible,
.lang-btn:focus-visible,
.tab-btn:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(139, 94, 60, 0.18);
}

/* --- Container principale --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* --- Spaziatura sezioni --- */
section {
  padding: var(--space-xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  margin-bottom: var(--space-xs);
}

.section-header > p {
  margin: 0 auto;
  font-size: 1.1rem;
  max-width: 55ch;
}

/* Label piccola sopra i titoli di sezione */
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: var(--space-sm);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  /* backdrop-filter escluso dalla transition: troppo costoso da interpolare */
  transition:
    background var(--transition-slow),
    border-bottom var(--transition-slow);
  will-change: transform;
}

/* Stile navbar su scroll */
.navbar.scrolled {
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  width: 100%;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.nav-logo .dot {
  color: var(--accent);
}

.nav-logo-img {
  height: 72px;
  width: auto;
  display: block;
  margin-right: -2rem;
}

/* Link centrali */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
  position: relative;
  padding-bottom: 2px;
}

/* Underline animato per link attivo/hover */
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--transition);
}

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}

/* Area destra: switch lingua + CTA */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Switch lingua */
.lang-switch {
  display: flex;
  align-items: center;
  gap: 2px;
}

.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.05em;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.lang-active {
  color: var(--accent);
  font-weight: 600;
}

.lang-divider {
  color: var(--border);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  pointer-events: none;
}

/* CTA button navbar */
.btn-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent);
  color: #fff !important;
  padding: 0.45rem 1.1rem;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), transform var(--transition);
}

.btn-nav-cta:hover {
  background: var(--text);
  color: #fff !important;
  transform: translateY(-1px);
}

/* --- Hamburger mobile --- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

/* --- Overlay scuro dietro al menu mobile --- */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 998;
  animation: overlayFadeIn 0.25s ease forwards;
}

.nav-overlay.show {
  display: block;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Menu mobile overlay --- */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-md);
  z-index: 999;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow-lg);
  transform: translateY(-8px);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-mobile.open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  animation: mobileNavSlide 0.25s ease forwards;
}

@keyframes mobileNavSlide {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.nav-mobile a {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--transition);
}

.nav-mobile a:last-of-type {
  border-bottom: none;
}

.nav-mobile a:hover {
  color: var(--accent);
}

.nav-mobile .btn-nav-cta {
  margin-top: var(--space-sm);
  justify-content: center;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

/* Pattern griglia geometrica di sfondo */
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 94, 60, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 94, 60, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding: var(--space-md);
}

/* Badge label sopra il titolo */
.hero-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
}

/* Headline hero */
.hero h1 {
  white-space: pre-line;
  margin-bottom: var(--space-sm);
  line-height: 1.1;
}

/* Span per animazione staggered parola per parola */
.hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  animation: wordReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes wordReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Payoff monospace */
.hero-payoff {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-bottom: var(--space-lg);
}

/* CTA buttons hero */
.hero-ctas {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  flex-wrap: wrap;
}

/* 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.45;
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-indicator span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.scroll-indicator svg {
  color: var(--muted);
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ============================================================
   BOTTONI PRIMARI / SECONDARI
   ============================================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--text);
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  font-family: var(--font-body);
  text-decoration: none;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ============================================================
   FOOTER DARK
   ============================================================ */
.site-footer {
  position: relative;
  background: #1C1208;
  color: #F5F0E8;
  overflow: hidden;
  padding: 80px 6vw 0;
}

.footer-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Playfair Display', serif;
  font-size: clamp(80px, 15vw, 180px);
  font-weight: 700;
  color: #F5F0E8;
  opacity: 0.04;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.05em;
}

.footer-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 60px;
  padding-bottom: 80px;
}

.footer-left {
  max-width: 420px;
}

.footer-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 400;
  line-height: 1.1;
  color: #F5F0E8;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}

.footer-email {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  color: #F5F0E8;
  text-decoration: underline;
  text-decoration-color: #C9A96E;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

.footer-email:hover {
  color: #C9A96E;
}

.footer-right {
  display: flex;
  gap: 60px;
  flex-shrink: 0;
}

.footer-col-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8A7A6A;
  display: block;
  margin-bottom: 20px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col ul li a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: #C4B89A;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col ul li a:hover {
  color: #F5F0E8;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5A4A3A;
}

/* ============================================================
   RESPONSIVE — Mobile first breakpoints
   ============================================================ */

/* Tablet e mobile */
@media (max-width: 768px) {
  /* Navbar: nascondi link e CTA, mostra hamburger */
  .nav-links {
    display: none;
  }

  .nav-right .btn-nav-cta {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Hero: stack verticale CTA */
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }

  .hero-ctas .btn-primary,
  .hero-ctas .btn-secondary {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Footer dark: stack verticale su mobile */
  .footer-main {
    flex-direction: column;
    gap: 40px;
  }

  .footer-right {
    gap: 40px;
  }

  /* Sezioni: padding ridotto */
  section {
    padding: var(--space-lg) 0;
  }
}

/* Mobile piccolo */
@media (max-width: 480px) {
  :root {
    --space-xl: 5rem;
    --space-lg: 3rem;
  }

  .container {
    padding: 0 var(--space-sm);
  }

  /* Nav logo: evita overflow su schermi molto piccoli */
  .nav-logo {
    font-size: 1.1rem;
  }

  .nav-logo-img {
    height: 56px;
    margin-right: -1.5rem;
  }

  /* Bottoni: full-width su mobile piccolo */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    justify-content: center;
  }

  /* Footer bottom: stack verticale su mobile piccolo */
  .footer-bottom {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* Footer right: stack colonne su mobile piccolo */
  .footer-right {
    flex-direction: column;
    gap: 28px;
  }

  /* Sito-footer: meno padding laterale */
  .site-footer {
    padding: 48px var(--space-sm) 0;
  }

  /* Footer headline: taglia su piccolo schermo */
  .footer-headline {
    font-size: clamp(28px, 8vw, 40px);
  }
}

/* ============================================================
   SCROLL PROGRESS BAR — barra sottile in cima alla pagina
   ============================================================ */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 1002; /* sopra la navbar */
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

/* ============================================================
   TOOLTIP CUSTOM — per icone servizi e altri elementi
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  white-space: nowrap;
  max-width: 260px;
  white-space: normal;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateX(-50%) translateY(4px);
  z-index: 200;
  box-shadow: var(--shadow-md);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Freccia tooltip */
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 200;
}

[data-tooltip]:hover::before {
  opacity: 1;
}

/* ============================================================
   FLOATING LABELS — form contatti
   ============================================================ */
.form-group.floating-label {
  position: relative;
  padding-top: 1.2rem;
}

/* Label agisce come placeholder interno */
.form-group.floating-label > label {
  position: absolute;
  top: 1.95rem; /* allineato con il testo dentro l'input */
  left: 1rem;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--muted);
  pointer-events: none;
  transition:
    top 0.2s ease,
    font-size 0.2s ease,
    color 0.2s ease,
    font-weight 0.2s ease;
  background: var(--bg);
  padding: 0 4px;
  z-index: 1;
  line-height: 1;
}

/* Stato: focus attivo O campo con valore */
.form-group.floating-label:focus-within > label,
.form-group.floating-label.has-value > label {
  top: 0.25rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
}

/* Errore: colore rosso sulla label floating */
.form-group.floating-label.has-error:not(:focus-within) > label {
  color: #C0392B;
}

/* Textarea con floating label: più spazio */
.form-group.floating-label textarea {
  padding-top: 1rem;
}

/* ============================================================
   SERVICE TABS — struttura generica tabs orizzontali
   ============================================================ */
.services-tabs-wrapper {
  margin-top: var(--space-md);
}

/* Barra tab navigation */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

/* Singolo tab button */
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition), border-bottom-color var(--transition);
}

.tab-btn:hover {
  color: var(--accent);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-btn-icon {
  display: flex;
  align-items: center;
  color: inherit;
  transition: color var(--transition);
}

/* Pannello tab */
.tab-panel {
  display: none;
  padding: var(--space-md) 0;
}

.tab-panel.active {
  display: block;
  animation: tabReveal 0.3s ease forwards;
}

@keyframes tabReveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Layout interno pannello: 2 colonne */
.tab-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

/* Colonna sinistra: icona + titolo + descrizione */
.tab-panel-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.tab-icon-large {
  width: 72px;
  height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background var(--transition), color var(--transition);
  cursor: default;
  flex-shrink: 0;
}

.tab-icon-large:hover {
  background: var(--accent);
  color: #fff;
}

.tab-tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  letter-spacing: 0.03em;
  max-width: none;
}

.tab-desc {
  font-size: 1rem;
  line-height: 1.75;
  max-width: 50ch;
}

/* Colonna destra: liste + tech + CTA */
.tab-panel-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tab-list-block h4 {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6rem;
}

.tab-list-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tab-list-block ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
}

.tab-list-block ul li::before {
  content: '→';
  color: var(--accent);
  font-size: 0.8rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.tab-tech-string {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  max-width: none;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
}

/* CTA dentro tab */
.tab-cta {
  align-self: flex-start;
}

/* --- Come lavoriamo --- */
.how-section {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.how-section > h3 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-md);
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  position: relative;
}

/* Linea connettiva tra step */
.how-steps::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(12.5% + 20px);
  right: calc(12.5% + 20px);
  height: 1px;
  background: linear-gradient(to right, var(--border), var(--accent2), var(--border));
  z-index: 0;
}

.how-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.6rem;
  position: relative;
  z-index: 1;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.1em;
  background: var(--bg);
  padding: 0 4px;
}

.step-icon-wrap {
  width: 56px;
  height: 56px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.how-step:hover .step-icon-wrap {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.how-step h4 {
  font-size: 1rem;
  font-weight: 700;
}

.how-step p {
  font-size: 0.85rem;
  line-height: 1.55;
  max-width: 22ch;
  margin: 0 auto;
}

/* Responsive tab + how */
@media (max-width: 900px) {
  .tab-panel-grid {
    grid-template-columns: 1fr;
  }

  .how-steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .how-steps::before {
    display: none;
  }
}

@media (max-width: 600px) {
  .tab-btn {
    padding: 0.7rem 1rem;
    font-size: 0.88rem;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   PORTFOLIO TEASER — su index.html
   ============================================================ */
.portfolio-teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.teaser-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  transition: border-left-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.teaser-card:hover {
  border-left-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.teaser-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.teaser-card-header h3 {
  font-size: 1.1rem;
}

.teaser-category-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.teaser-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}

.teaser-card p {
  font-size: 0.88rem;
  line-height: 1.6;
}

.teaser-cta-wrap {
  text-align: center;
  margin-top: var(--space-md);
}

@media (max-width: 768px) {
  .portfolio-teaser-grid {
    grid-template-columns: 1fr;
  }
}
