/* ============================================================
   ENRICO MADDALONI — Sistema di Design v2
   style.css — Reset + Variabili + Componenti globali
   Ottimizzato per Core Web Vitals 2026
   ============================================================ */

/* ── FONT — caricamento ottimizzato, no @import ── */
/* Inter e Special Elite vengono precaricati nel <head> via <link> */
/* Schabo Condensed viene caricato localmente in woff2 */
@font-face {
  font-family: 'Schabo';
  src: url('../fonts/SCHABO-Condensed.woff2') format('woff2'),
       url('../fonts/SCHABO-Condensed.otf') format('opentype');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ── VARIABILI ── */
:root {
  --black:        #0d0d0d;
  --black-soft:   #1a1a1a;
  --white:        #f2f2f0;
  --red:          #f44040;
  --gray:         #555555;
  --gray-light:   #999999;
  --border:       #e0e0de;
  --border-dark:  #2a2a2a;
  --green:        #22c55e;

  --font-hero:    'Schabo', 'Arial Black', sans-serif;
  --font-body:    'Inter', 'Helvetica Neue', sans-serif;
  --font-cta:     'Special Elite', 'Courier New', cursive;

  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   40px;
  --space-2xl:  64px;
  --space-3xl:  96px;
  --space-4xl:  128px;

  --max-width:        1280px;
  --padding-x:        80px;
  --padding-x-mobile: 24px;
  --nav-height:       64px;
  --transition:       0.2s ease;
}

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

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

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

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

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ── ANIMAZIONI ENTRATA (Intersection Observer) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

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

/* ── CURSORE PERSONALIZZATO ── */
.cursor {
  width: 10px;
  height: 10px;
  background: var(--red);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, width 0.2s ease, height 0.2s ease, background 0.2s ease;
  mix-blend-mode: multiply;
}

.cursor.hovering {
  width: 36px;
  height: 36px;
  background: var(--red);
  opacity: 0.25;
}

.cursor.clicking {
  transform: translate(-50%, -50%) scale(0.7);
}

/* Nasconde il cursore su touch device */
@media (hover: none) {
  .cursor { display: none; }
}

/* ── TIPOGRAFIA ── */
h1 { font-family: var(--font-hero); }
h2 {
  font-family: var(--font-body);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
h3 {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
p { font-size: 1rem; line-height: 1.75; color: var(--gray); }

/* ── LABEL ── */
.label {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  display: block;
  margin-bottom: var(--space-sm);
}
.label--gray { color: var(--gray-light); }

/* ── BOTTONI ── */
.btn {
  font-family: var(--font-cta);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 14px 28px;
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--transition);
}

.btn:active::after { opacity: 1; }
.btn:active { transform: scale(0.98); }

.btn--primary { background: var(--black); color: var(--white); }
.btn--primary:hover { background: var(--red); }
.btn--ghost { background: transparent; color: var(--black); border: 1.5px solid var(--black); }
.btn--ghost:hover { background: var(--black); color: var(--white); }
.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: var(--black); }
.btn--white { background: var(--white); color: var(--red); }
.btn--white:hover { background: var(--black); color: var(--white); }

/* ── TAG ── */
.tag {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  color: var(--gray);
  display: inline-block;
  transition: all var(--transition);
}
.tag--red { border-color: var(--red); color: var(--red); }
.tag--black { border-color: var(--black); background: var(--black); color: var(--white); }

/* ── NAVBAR ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1.5px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--padding-x);
  transition: box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.06);
}

.nav__logo {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  text-decoration: none;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.nav__link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--gray-light);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color var(--transition);
  position: relative;
}

.nav__link:hover { color: var(--black); }

.nav__link.active { color: var(--black); }

.nav__link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
}

.nav__cta {
  font-family: var(--font-cta);
  font-size: 0.88rem;
  background: var(--black);
  color: var(--white);
  padding: 9px 18px;
  text-decoration: none;
  transition: background var(--transition);
}

.nav__cta:hover { background: var(--red); }

.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--space-sm);
  background: none;
  border: none;
}

.nav__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  transition: all var(--transition);
}

/* ── BREADCRUMB ── */
.breadcrumb {
  padding: 14px var(--padding-x);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-light);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--gray-light); text-decoration: none; transition: color var(--transition); }
.breadcrumb a:hover { color: var(--black); }
.breadcrumb__sep { color: var(--border); }
.breadcrumb__current { color: var(--black); }

/* ── TESTIMONIANZE ── */
.testimonianze {
  padding: 64px var(--padding-x);
  border-bottom: 1.5px solid var(--black);
}

.testimonianze__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1.5px solid var(--black);
  margin-top: 32px;
}

.testimonianza {
  background: var(--white);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.testimonianza__testo {
  font-size: 0.9rem;
  color: var(--black);
  line-height: 1.75;
  font-style: italic;
  flex: 1;
}

.testimonianza__testo::before { content: '"'; color: var(--red); font-size: 1.5rem; line-height: 0; vertical-align: -0.3em; margin-right: 4px; }
.testimonianza__testo::after  { content: '"'; color: var(--red); font-size: 1.5rem; line-height: 0; vertical-align: -0.3em; margin-left: 4px; }

.testimonianza__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.testimonianza__iniziali {
  width: 36px;
  height: 36px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.testimonianza__nome {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--black);
  display: block;
}

.testimonianza__ruolo {
  font-size: 0.72rem;
  color: var(--gray-light);
  letter-spacing: 0.06em;
}

.testimonianza__stelle {
  margin-left: auto;
  color: var(--red);
  font-size: 0.75rem;
  letter-spacing: 2px;
}

/* ── COOKIE BANNER ── */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--black);
  color: var(--white);
  padding: 20px var(--padding-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 9000;
  border-top: 2px solid var(--red);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  flex-wrap: wrap;
}

.cookie-banner.visible { transform: translateY(0); }

.cookie-banner__text {
  font-size: 0.82rem;
  color: rgba(242,242,240,0.75);
  line-height: 1.6;
  max-width: 600px;
}

.cookie-banner__text a {
  color: var(--red);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn-accept {
  font-family: var(--font-cta);
  font-size: 0.82rem;
  background: var(--red);
  color: var(--white);
  padding: 10px 20px;
  border: none;
  cursor: pointer;
  transition: background var(--transition);
}

.cookie-btn-accept:hover { background: var(--white); color: var(--red); }

.cookie-btn-decline {
  font-family: var(--font-cta);
  font-size: 0.82rem;
  background: transparent;
  color: rgba(242,242,240,0.5);
  padding: 10px 16px;
  border: 1px solid rgba(242,242,240,0.2);
  cursor: pointer;
  transition: all var(--transition);
}

.cookie-btn-decline:hover { color: var(--white); border-color: rgba(242,242,240,0.5); }

/* ── FOOTER — sfondo nero ── */
.footer {
  background: var(--black);
  border-top: none;
  padding: var(--space-xl) var(--padding-x);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
  flex-wrap: wrap;
}

.footer__logo {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
}

.footer__links { display: flex; gap: var(--space-xl); }

.footer__link {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(242,242,240,0.4);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}

.footer__link:hover { color: var(--white); }

.footer__copy {
  font-size: 0.72rem;
  color: rgba(242,242,240,0.2);
  letter-spacing: 0.05em;
}

/* ── BOTTOM CTA ── */
.bottom-cta {
  padding: var(--space-4xl) var(--padding-x);
  border-top: 1.5px solid var(--black);
  border-bottom: 1.5px solid var(--black);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2xl);
}

.bottom-cta__text {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--black);
}

.bottom-cta__text span { color: var(--red); }

/* ── UTILITY ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.img-placeholder {
  background: var(--black-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(242,242,240,0.15);
  font-family: var(--font-body);
}

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  :root { --padding-x: 40px; }
}

@media (max-width: 768px) {
  :root {
    --padding-x: var(--padding-x-mobile);
    --space-3xl: 64px;
    --space-4xl: 80px;
  }

  .nav__links { display: none; }
  .nav__hamburger { display: flex; }

  .nav__links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: var(--nav-height) 0 0 0;
    background: var(--white);
    padding: var(--space-2xl) var(--padding-x-mobile);
    gap: var(--space-xl);
    border-top: 1px solid var(--border);
    z-index: 99;
    overflow-y: auto;
  }

  .nav__link { font-size: 1.2rem; }
  .nav__cta { font-size: 1rem; padding: 12px 20px; }

  .bottom-cta { flex-direction: column; align-items: flex-start; }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-lg);
  }

  .testimonianze__grid { grid-template-columns: 1fr; }

  .cookie-banner {
    padding: 16px var(--padding-x-mobile);
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Tutti i titoli in Schabo — sempre maiuscolo */
.hero__title,
.page-header__title,
.proj-hero__title,
.about-hero__title,
.notfound__code,
.art-hero__title,
.analisi-cta__title,
h1[class*="title"],
h1[class*="hero"],
.page-header h1,
.about-hero h1 {
  text-transform: uppercase;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   FOOTER — sfondo nero definitivo
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.footer {
  background: #0d0d0d !important;
  border-top: none !important;
}
.footer__logo { color: #f2f2f0 !important; }
.footer__link { color: rgba(242,242,240,0.4) !important; }
.footer__link:hover { color: #f2f2f0 !important; }
.footer__copy { color: rgba(242,242,240,0.2) !important; }

/* ── LOGO NAVBAR — sostituisce il testo con l'SVG ──
   Aggiungi questo in fondo a style.css
   Carica logo.svg nella cartella img/ del sito       */

.nav__logo {
  font-size: 0;              /* nasconde il testo "Enrico Maddaloni" */
  display: inline-flex;
  align-items: center;
  width: 28px;
  height: 32px;
  background-image: url('../img/logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center left;
  flex-shrink: 0;
}