/* ==========================================================================
   FC CAB — stile custom (integra Tailwind CDN)
   Strategia colore: DRENCHED DARK. Superficie near-black, oro champagne come
   identità, tricolore (verde/rosso) come firma sottile dello stemma. OKLCH.
   ========================================================================== */

:root {
  --bg:        oklch(0.16 0.010 85);   /* near-black caldo */
  --bg-deep:   oklch(0.12 0.008 85);
  --surface:   oklch(0.20 0.012 85);
  --gold:      oklch(0.78 0.085 85);   /* oro champagne */
  --gold-soft: oklch(0.86 0.070 88);
  --green:     oklch(0.58 0.130 150);  /* tricolore */
  --red:       oklch(0.55 0.160 25);   /* tricolore */
  --ink:       oklch(0.96 0.008 90);
  --muted:     oklch(0.74 0.012 90);

  /* z-index semantico */
  --z-marquee: 10;
  --z-header:  40;

  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', system-ui, -apple-system, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.font-mono-label {
  font-family: 'Space Mono', ui-monospace, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* ==========================================================================
   LAYOUT — classi semantiche (sostituiscono Tailwind CDN: niente più
   script bloccante in <head>, niente FOUC)
   ========================================================================== */
.site-header { position: relative; z-index: var(--z-header); }
.header-bar {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.header-bar .ig-btn { padding: 0.4rem 0.8rem; font-size: 0.72rem; }
.header-bar .ig-btn svg { width: 15px; height: 15px; }

/* su telefoni stretti il pill header diventa icona-only (evita overflow);
   la CTA completa "Seguici su Instagram" resta nella hero. */
@media (max-width: 479px) {
  .header-bar .ig-btn span { display: none; }
  .header-bar .ig-btn { padding: 0.45rem; }
}
.wip-group { display: flex; align-items: center; gap: 0.625rem; }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.hero-copy { margin-top: clamp(2rem, 5vw, 3rem); max-width: 42rem; }
.hero-kicker { color: var(--gold); font-size: 0.72rem; }
.hero-lead {
  margin: 1.25rem auto 0;
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(0.9rem, 2.4vw, 1rem);
  line-height: 1.65;
  text-wrap: pretty;
}

.site-footer { position: relative; z-index: var(--z-marquee); padding: 1.5rem 0 2rem; }
.partners-label { text-align: center; color: var(--muted); font-size: 0.625rem; margin-bottom: 1.25rem; }
.partners-empty { text-align: center; color: var(--muted); font-size: 0.8rem; }
.partners-empty a { color: var(--gold-soft); text-decoration: underline; }
.copyright { text-align: center; color: var(--muted); opacity: 0.7; font-size: 0.65rem; margin-top: 2rem; }

@media (min-width: 640px) {
  .header-bar { padding: 0.85rem 2rem; }
  .header-bar .ig-btn { padding: 0.5rem 1rem; font-size: 0.8rem; }
  .wip-text { font-size: 0.78rem; }
  .hero-kicker { font-size: 0.78rem; }
  .hero-lead { font-size: 1rem; }
}

/* --- Sfondo scena: bagliore oro dietro logo + hairline tricolore ---------- */
.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  /* minmax(0,1fr): la colonna NON si dimensiona sul max-content del marquee
     (largo migliaia di px) — altrimenti spingerebbe header/hero fuori schermo. */
  grid-template-columns: minmax(0, 1fr);
  isolation: isolate;
}

.scene::before {
  /* alone radiale caldo dietro al centro */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 45% at 50% 42%, oklch(0.30 0.05 85 / 0.55), transparent 70%),
    radial-gradient(120% 90% at 50% 120%, var(--bg-deep), var(--bg) 60%);
}

.scene::after {
  /* grana finissima per togliere il "flat digitale" */
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.04;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* barra tricolore sottile: firma dello stemma */
.tricolore-rule {
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg,
    var(--green) 0 33.33%,
    var(--ink)  33.33% 66.66%,
    var(--red)  66.66% 100%);
  opacity: 0.85;
}

/* ==========================================================================
   HEADER — banner Work in Progress + Instagram
   ========================================================================== */
.wip-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 0 oklch(0.78 0.085 85 / 0.7);
  animation: wip-pulse 2s var(--ease-out-quint) infinite;
}

@keyframes wip-pulse {
  0%   { box-shadow: 0 0 0 0 oklch(0.78 0.085 85 / 0.65); }
  70%  { box-shadow: 0 0 0 10px oklch(0.78 0.085 85 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(0.78 0.085 85 / 0); }
}

/* testo WIP con luccichio che scorre */
.wip-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-soft);            /* fallback visibile se il clip non è supportato */
  background: linear-gradient(100deg, var(--muted) 0 40%, var(--gold-soft) 50%, var(--muted) 60% 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: wip-shine 4.5s linear infinite;
}
@keyframes wip-shine {
  to { background-position: -220% 0; }
}

/* Instagram — bottone ORO PIENO ben visibile (header + hero) */
.ig-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;                /* padding proprio (niente più Tailwind) */
  font-size: 0.8rem;
  line-height: 1;
  background: var(--gold);
  color: oklch(0.18 0.02 85);          /* testo scuro su oro → alto contrasto */
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px oklch(0.78 0.085 85 / 0.28);
  transition: transform 0.4s var(--ease-out-quint), background 0.4s, box-shadow 0.4s;
}
.ig-btn svg { flex: 0 0 auto; }
.ig-btn:hover {
  transform: translateY(-2px);
  background: var(--gold-soft);
  box-shadow: 0 10px 28px oklch(0.78 0.085 85 / 0.42);
}
.ig-btn svg { color: currentColor; }

/* pulsazione lieve del bottone hero per attirare l'occhio */
.ig-btn--hero {
  margin-top: 2rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
  animation: ig-attract 2.6s var(--ease-out-quint) infinite;
}
@keyframes ig-attract {
  0%, 100% { box-shadow: 0 6px 20px oklch(0.78 0.085 85 / 0.30); }
  50%      { box-shadow: 0 10px 30px oklch(0.78 0.085 85 / 0.55); }
}

/* variante bordata (link secondari, es. 404) */
.ig-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: 999px;
  transition: transform 0.4s var(--ease-out-quint), border-color 0.4s var(--ease-out-quint), background 0.4s;
}
.ig-pill:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: oklch(0.78 0.085 85 / 0.08);
}

/* pagina errore 404 */
.error-page { text-align: center; padding: 1.5rem; }
.error-logo { width: min(30vw, 180px); }
.error-kicker { color: var(--gold); font-size: 0.75rem; margin-top: 2rem; }
.error-back { margin-top: 2rem; }

/* ==========================================================================
   HERO — logo con float + bagliore pulsante + ingresso
   ========================================================================== */
.hero-logo {
  width: min(52vw, 340px);
  height: auto;
  opacity: 1;                 /* SEMPRE visibile: nessuna animazione lo nasconde */
  /* Bagliore STATICO sempre dipinto. Colori in rgba() (NON oklch): oklch dentro
     drop-shadow() non è supportato da vari browser mobile e farebbe sparire il logo. */
  filter: drop-shadow(0 14px 34px rgba(5, 5, 4, 0.6))
          drop-shadow(0 0 22px rgba(201, 165, 95, 0.28));
}

/* Animazioni (ingresso + float + bagliore) SOLO su schermi larghi con motion
   abilitato. Su mobile il logo resta statico e sempre renderizzato: la combo
   will-change + animazione creava un layer che su vari browser mobile non
   dipingeva, facendo sparire il logo. */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .hero-logo {
    animation:
      logo-enter 1.1s var(--ease-out-quint) forwards,
      logo-float 6s ease-in-out 1.1s infinite,
      logo-glow  4.5s ease-in-out 1.1s infinite;
  }
}

@keyframes logo-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}
@keyframes logo-glow {
  0%, 100% { filter: drop-shadow(0 18px 40px rgba(5, 5, 4, 0.6)) drop-shadow(0 0 20px rgba(201, 165, 95, 0.22)); }
  50%      { filter: drop-shadow(0 18px 40px rgba(5, 5, 4, 0.6)) drop-shadow(0 0 40px rgba(201, 165, 95, 0.45)); }
}

/* default visibile; l'ingresso trasla soltanto (nessun opacity-gating) */
.hero-copy { opacity: 1; animation: rise 0.9s var(--ease-out-quint) 0.15s forwards; }
@keyframes rise {
  from { transform: translateY(16px); }
  to   { transform: translateY(0); }
}

.hero-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-wrap: balance;
  font-size: clamp(2rem, 7vw, 4.5rem);
}

/* ==========================================================================
   MARQUEE SPONSOR — ticker infinito destra → sinistra
   ========================================================================== */
.marquee {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
  animation: marquee-scroll var(--marquee-duration, 40s) linear infinite;
}
.marquee:hover .marquee__track { animation-play-state: paused; }

@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }   /* -50% perché la lista è duplicata 2x */
}

.marquee__item {
  position: relative;
  flex: 0 0 auto;
}

/* chip bianca: ogni logo (a colori, con qualsiasi sfondo) resta leggibile
   sul fondo scuro. Niente filtri distruttivi. */
.marquee__chip {
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(66px, 13vw, 92px);
  min-width: clamp(120px, 26vw, 180px);
  padding: 0 clamp(16px, 3.5vw, 26px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 22px oklch(0.05 0 0 / 0.45);
  transition: transform 0.45s var(--ease-out-quint), box-shadow 0.45s;
}
.marquee__chip img {
  max-height: 66%;
  max-width: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}
.marquee__item:hover .marquee__chip {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 30px oklch(0.05 0 0 / 0.55);
}

/* anello oro sulla chip degli sponsor Gold */
.marquee__item[data-tier="gold"] .marquee__chip {
  box-shadow: 0 8px 22px oklch(0.05 0 0 / 0.45), 0 0 0 2px var(--gold);
}

/* ==========================================================================
   Reduced motion — alternative accessibili
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-logo,
  .hero-copy,
  .wip-text,
  .wip-dot,
  .marquee__track {
    animation: none !important;
  }
  .hero-logo { opacity: 1; transform: none; }
  .marquee { overflow-x: auto; }
  .marquee__track { scroll-snap-type: x proximity; }
}
