/* ==========================================================================
   TIFOSO INFINITO — Design System
   Implementa i token e i componenti base definiti in DESIGN_LANGUAGE.md.
   Fonte di verità unica per colori, tipografia, spaziature e componenti
   condivisi tra tutte le pagine del sito.

   Breakpoint di riferimento (DESIGN_LANGUAGE.md §8):
     mobile  < 640px
     tablet  640px - 1023px
     desktop 1024px - 1439px
     wide    >= 1440px
   ========================================================================== */

:root {
  /* Colori — DESIGN_LANGUAGE.md §5 */
  --color-dark-0: #0C0C0A;
  --color-dark-1: #111110;
  --color-dark-2: #181815;
  --color-foreground: #F5F0E8;
  --color-foreground-muted: #9A9A90;
  --color-brand-red: #CC1F1F;
  --color-brand-red-bright: #E82020;
  --color-brand-red-dim: #7A1010;
  --color-gold: #C9A84C;
  --color-gold-border: rgba(201, 168, 76, 0.35);
  --color-green: #3AAA6E;
  --color-divider: rgba(245, 240, 232, 0.08);
  --color-surface-soft: rgba(245, 240, 232, 0.06);

  /* Tipografia — DESIGN_LANGUAGE.md §6 */
  --font-display: 'Bebas Neue', sans-serif;
  --font-label: 'Barlow Condensed', sans-serif;
  --font-body: 'Barlow', sans-serif;

  /* Spaziature — DESIGN_LANGUAGE.md §7 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 32px;
  --space-6: 48px;
  --space-7: 64px;
  --space-8: 96px;
  --space-9: 128px;

  /* Raggi — coerenti con §3.6 (un solo set, mai variabile per sezione) */
  --radius-sm: 2px;   /* bottoni, tag, badge: taglio netto, editoriale */
  --radius-md: 8px;   /* card, immagini */
  --radius-full: 999px; /* elementi circolari (icon button, avatar) */

  /* Movimento — DESIGN_LANGUAGE.md §31-32 */
  --motion-fast: 150ms;
  --motion-base: 200ms;
  --motion-entrance: 500ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Container — DESIGN_LANGUAGE.md §8 */
  --container-max: 1280px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-dark-0);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

/* --------------------------------------------------------------------------
   Accessibilità trasversale — DESIGN_LANGUAGE.md §33
   -------------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-brand-red-bright);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -60px;
  z-index: 10000;
  background: var(--color-brand-red);
  color: var(--color-foreground);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-label);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  transition: top var(--motion-base) var(--ease-out);
}

.skip-link:focus {
  top: var(--space-3);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--space-6);
  }
}

/* --------------------------------------------------------------------------
   Componente: Bottoni — DESIGN_LANGUAGE.md §10
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  min-height: 44px;
  transition: background-color var(--motion-fast) var(--ease-out),
              border-color var(--motion-fast) var(--ease-out),
              transform var(--motion-fast) var(--ease-out);
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--color-brand-red);
  color: var(--color-foreground);
  border: 1px solid var(--color-brand-red);
}

.btn--primary:hover {
  background: var(--color-brand-red-bright);
  border-color: var(--color-brand-red-bright);
}

.btn--secondary {
  background: transparent;
  color: var(--color-foreground);
  border: 1px solid var(--color-divider);
}

.btn--secondary:hover {
  border-color: var(--color-brand-red);
  color: var(--color-brand-red);
}

.btn--text {
  padding: var(--space-1) 0;
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid transparent;
}

.btn--text:hover {
  border-bottom-color: currentColor;
}

.btn--disabled,
.btn[disabled] {
  background: var(--color-brand-red-dim);
  border-color: var(--color-brand-red-dim);
  color: rgba(245, 240, 232, 0.5);
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Componente: Badge — DESIGN_LANGUAGE.md §11
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.badge--positive {
  background: rgba(58, 170, 110, 0.15);
  color: var(--color-green);
  border: 1px solid rgba(58, 170, 110, 0.35);
}

.badge--neutral {
  background: transparent;
  color: var(--color-foreground-muted);
  border: 1px solid var(--color-divider);
}

.badge--upcoming {
  background: transparent;
  color: var(--color-foreground-muted);
  border: 1px dashed var(--color-divider);
}

.badge--premium {
  background: rgba(201, 168, 76, 0.12);
  color: var(--color-gold);
  border: 1px solid rgba(201, 168, 76, 0.4);
}

/* --------------------------------------------------------------------------
   Utility: reveal on scroll — DESIGN_LANGUAGE.md §31, pattern "sezione che appare"
   Applicata solo se JS e' attivo (classe .js su <html>): senza JS il
   contenuto resta visibile di default, per non penalizzare chi naviga
   senza JavaScript.
   -------------------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--motion-entrance) var(--ease-out),
              transform var(--motion-entrance) var(--ease-out);
}

.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
