/* ══════════════════════════════════════════════════════════════════
   fabric.css — strato "Global Fabric" sopra lo stile originale (27/09/2026)
   Struttura dal design system della dashboard lp365.site:
   Inter, etichette maiuscole spaziate, raggi 10px, vetro + cornice a
   gradiente, griglia di fondo, comparsa morbida.
   I COLORI restano quelli di Mare Conero (blu + semaforo), chiaro e scuro.
   Per tornare allo stile precedente basta togliere il <link> in index.html.
   ══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('inter-latin.woff2') format('woff2');
}

:root {
  --r: 10px;
  --r-sm: 9px;
  --fx-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fx-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --fx-glass: color-mix(in srgb, var(--bg2) 80%, transparent);
  --fx-shell: linear-gradient(140deg,
      color-mix(in srgb, var(--accent) 55%, transparent),
      color-mix(in srgb, var(--fg) 6%, transparent) 46%,
      color-mix(in srgb, var(--g1) 40%, transparent));
  --fx-shell-hi: linear-gradient(140deg,
      color-mix(in srgb, var(--accent) 90%, transparent),
      color-mix(in srgb, var(--fg) 12%, transparent) 46%,
      color-mix(in srgb, var(--g1) 70%, transparent));
  --fx-grid: color-mix(in srgb, var(--accent) 9%, transparent);
  --fx-hover:
      0 1px 0 0 color-mix(in srgb, #fff 35%, transparent) inset,
      0 2px 6px 0 rgba(0, 0, 0, .18),
      0 18px 42px -16px color-mix(in srgb, var(--accent) 70%, transparent);
}

/* ---------- fondo: griglia statica che sfuma verso l'alto ---------- */

body {
  font-family: var(--fx-font);
  font-size: 15px;
  line-height: 1.55;
  position: relative;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--fx-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--fx-grid) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
          mask-image: linear-gradient(180deg, transparent 0%, #000 45%, #000 100%);
}

/* ---------- testata ---------- */

header { padding-top: max(32px, env(safe-area-inset-top)); padding-bottom: 12px; }

h1 {
  font-size: 34px;
  line-height: 38px;
  font-weight: 600;
  letter-spacing: -0.025em;
  gap: 12px;
}

.sub { font-size: 14px; margin-top: 6px; }

.dot { box-shadow: 0 0 10px var(--g1); }
.dot.off { box-shadow: 0 0 10px var(--g5); }

/* ---------- barra comandi ---------- */

.bar { background: color-mix(in srgb, var(--bg) 78%, transparent); }

.seg {
  border-radius: var(--r);
  background: var(--fx-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.seg button {
  border-radius: 7px;
  transition: background 300ms var(--fx-ease), color 300ms var(--fx-ease), box-shadow 300ms var(--fx-ease);
}

.seg button[aria-pressed="true"] {
  background:
    linear-gradient(var(--bg2), var(--bg2)) padding-box,
    var(--fx-shell) border-box;
  border: 1px solid transparent;
  color: var(--fg);
}

.ghost {
  border-radius: var(--r);
  font-weight: 600;
  transition: color 300ms var(--fx-ease), border-color 300ms var(--fx-ease);
}

/* ---------- etichette: maiuscole, 12/600, +1.68px ---------- */

h2.sec,
.hero .lbl {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 1.68px;
  text-transform: uppercase;
  color: var(--accent);
}

h2.sec {
  margin: 32px 0 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

h2.sec .secsub { color: var(--fg3); letter-spacing: 0; }

/* ---------- superfici: vetro dentro cornice a gradiente ---------- */

.hero,
.card,
.legend,
.err {
  background:
    linear-gradient(var(--fx-glass), var(--fx-glass)) padding-box,
    var(--fx-shell) border-box;
  border: 1px solid transparent;
  border-radius: var(--r);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.card {
  transition: transform 300ms var(--fx-ease), box-shadow 300ms var(--fx-ease), background 300ms ease;
  animation: fx-rise 500ms var(--fx-ease) both;
}

.card:hover {
  background:
    linear-gradient(var(--fx-glass), var(--fx-glass)) padding-box,
    var(--fx-shell-hi) border-box;
  box-shadow: var(--fx-hover);
  transform: translateY(-2px);
}

/* lo spot migliore: cornice verde piena, come prima */
.card.best {
  background:
    linear-gradient(var(--fx-glass), var(--fx-glass)) padding-box,
    linear-gradient(140deg, var(--g1), color-mix(in srgb, var(--g1) 25%, transparent) 55%, var(--g1)) border-box;
  box-shadow: 0 18px 42px -18px color-mix(in srgb, var(--g1) 70%, transparent), var(--shadow);
}

.grid .card:nth-child(2) { animation-delay: 60ms; }
.grid .card:nth-child(3) { animation-delay: 120ms; }
.grid .card:nth-child(4) { animation-delay: 180ms; }
.grid .card:nth-child(n+5) { animation-delay: 240ms; }

#hero .hero { animation: fx-rise 500ms var(--fx-ease) both; }

.slots, .slot { background-color: transparent; }
.slots { background: var(--line); }
.slot { background: var(--fx-glass); }
.slot .sb { border-radius: 9999px; }

.chead .nm { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.score .v { font-weight: 700; letter-spacing: -0.025em; }
.score .t, .m .k, .slot .sn { letter-spacing: .08em; }

.legend { margin-top: 32px; }
.legend h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.68px;
  text-transform: uppercase;
  color: var(--accent);
}
.legend .sw { border-radius: 9999px; }

code { border-radius: 6px; }

/* ---------- focus ---------- */

button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent);
}

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

/* ---------- accessibilità e mobile ---------- */

@supports not (backdrop-filter: blur(1px)) {
  .hero, .card, .legend, .err, .seg { --fx-glass: var(--bg2); }
}

@media (prefers-reduced-motion: reduce) {
  .card, #hero .hero { animation: none; }
  .card:hover { transform: none; }
  * { transition-duration: 0.01ms !important; }
}

@media (max-width: 520px) {
  h1 { font-size: 26px; line-height: 30px; flex-wrap: nowrap; align-items: flex-start; }
  h1 .dot { margin-top: 11px; }   /* il pallino resta accanto al titolo, non su una riga da solo */
  header { padding-top: max(22px, env(safe-area-inset-top)); }
}
