/* =========================================================
   25Glitch — foglio di stile principale
   Palette "neon notturno". Per cambiare i colori modifica
   solo le variabili qui sotto.
   ========================================================= */

:root {
  --bg: #0a0912;
  --bg-2: #100e1b;
  --surface: #161327;
  --surface-2: #1e1a34;
  --border: #2b2647;
  --text: #eeeaf8;
  --muted: #a9a3c6;
  --pink: #ff2d95;
  --cyan: #21e6ff;
  --violet: #9b6bff;
  --yellow: #ffd23f;
  --grad: linear-gradient(90deg, var(--pink), var(--violet) 55%, var(--cyan));
  --radius: 14px;
  --maxw: 1200px;
  --font-head: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(155, 107, 255, .18), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(255, 45, 149, .12), transparent 60%);
  background-repeat: no-repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  letter-spacing: .01em;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--pink); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 9, 18, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: var(--grad); opacity: .6;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }

.logo {
  font-family: var(--font-head); font-weight: 700; font-size: 1.5rem;
  text-decoration: none; color: var(--text); letter-spacing: .04em;
  position: relative; white-space: nowrap;
}
.logo .num { color: var(--cyan); }
.logo:hover { color: var(--text); }
.logo:hover .glitch-word { animation: glitch .35s steps(2) 2; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.menu-toggle {
  display: none; background: transparent; border: 1px solid var(--border);
  color: var(--text); width: 44px; height: 44px; border-radius: 10px; cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle svg { width: 22px; height: 22px; }

@media (max-width: 980px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg-2); border-bottom: 1px solid var(--border);
    display: none; padding: 8px 16px 16px;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { padding: 12px; font-size: 1.05rem; }
}

/* ---------- Effetto glitch ---------- */
.glitch {
  position: relative;
  text-shadow: 2px 0 rgba(255, 45, 149, .75), -2px 0 rgba(33, 230, 255, .75);
}
@keyframes glitch {
  0%   { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan); transform: translate(0); }
  25%  { text-shadow: -3px 1px var(--pink), 3px -1px var(--cyan); transform: translate(-1px, 1px); }
  50%  { text-shadow: 3px -1px var(--pink), -3px 1px var(--cyan); transform: translate(1px, -1px); }
  100% { text-shadow: 2px 0 var(--pink), -2px 0 var(--cyan); transform: translate(0); }
}
.hero h1.glitch { animation: glitch 2.6s steps(2) 1s 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.text-grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
  padding: 12px 22px; border-radius: 12px; font-weight: 700; text-decoration: none;
  font-family: var(--font-head); letter-spacing: .02em; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--pink); color: #fff; box-shadow: 0 0 24px rgba(255, 45, 149, .35); }
.btn-primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 0 34px rgba(255, 45, 149, .55); }
.btn-ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { color: var(--text); border-color: var(--cyan); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
@media (min-width: 768px) { .hero { padding: 96px 0 64px; } }
.eyebrow {
  display: inline-block; font-family: var(--font-head); font-size: .8rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cyan);
  border: 1px solid rgba(33, 230, 255, .35); padding: 4px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero p.lead { font-size: 1.2rem; color: var(--muted); max-width: 640px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- Sezioni ---------- */
.section { padding: 40px 0; }
@media (min-width: 768px) { .section { padding: 56px 0; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }

/* ---------- Griglie e card ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.cat-tile {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s, background .15s;
}
.cat-tile:hover { color: var(--text); border-color: var(--violet); transform: translateY(-2px); background: var(--surface-2); }
.cat-tile .icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(155, 107, 255, .14); color: var(--violet);
}
.cat-tile:nth-child(3n+2) .icon { background: rgba(255, 45, 149, .14); color: var(--pink); }
.cat-tile:nth-child(3n+3) .icon { background: rgba(33, 230, 255, .12); color: var(--cyan); }
.cat-tile .icon svg { width: 24px; height: 24px; }
.cat-tile h3 { margin: 0 0 4px; font-size: 1.1rem; }
.cat-tile p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }

.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--pink); transform: translateY(-3px); }
.card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { margin: 0; font-size: 1.15rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.tag {
  align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--cyan); background: rgba(33, 230, 255, .1); padding: 3px 10px; border-radius: 999px;
}
.card-meta { margin-top: auto; padding-top: 6px; font-size: .85rem; color: var(--muted); }

.empty-state {
  padding: 28px; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); text-align: center; background: rgba(22, 19, 39, .5);
}

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: .9rem; color: var(--muted); padding-top: 24px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--border); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--cyan); }

.page-head { padding: 20px 0 8px; }
.page-head p.lead { color: var(--muted); font-size: 1.15rem; max-width: 760px; }

/* ---------- Filtro categorie ---------- */
.filter { margin: 8px 0 24px; max-width: 420px; }
.filter input {
  width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 1rem;
}
.filter input:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(33, 230, 255, .2); }

/* ---------- Pagina guida ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 56px; }
@media (min-width: 1024px) { .guide-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; } }

.guide-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .92rem; margin-bottom: 20px; }
.guide-meta strong { color: var(--text); }

.cover { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.quick-answer {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px 6px 26px; margin: 0 0 32px; overflow: hidden;
}
.quick-answer::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.quick-answer h2 { margin-top: 0; padding-top: 0; font-size: 1.1rem; color: var(--pink); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }

.prose h2 { margin-top: 2em; padding-top: .2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose figure { margin: 1.6em 0; }
.prose figure img { border-radius: 12px; border: 1px solid var(--border); width: 100%; }
.prose figcaption { font-size: .9rem; color: var(--muted); margin-top: 8px; }

.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--surface-2); font-family: var(--font-head); color: var(--cyan); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(30, 26, 52, .45); }

.callout { border-radius: 12px; padding: 14px 18px; margin: 1.4em 0; border: 1px solid; }
.callout p:last-child { margin: 0; }
.callout-tip { border-color: rgba(33, 230, 255, .4); background: rgba(33, 230, 255, .07); }
.callout-warn { border-color: rgba(255, 210, 63, .45); background: rgba(255, 210, 63, .07); }
.callout strong { font-family: var(--font-head); }

.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 0 18px; margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 12px; color: var(--pink); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding-bottom: 14px; color: var(--muted); }

.author-box {
  display: flex; gap: 16px; align-items: center; padding: 20px; margin-top: 40px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.author-box .avatar {
  flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.4rem; color: #fff;
}
.author-box p { margin: 0; color: var(--muted); font-size: .95rem; }
.author-box strong { color: var(--text); }

/* Indice (TOC) */
.toc-wrap { order: -1; }
@media (min-width: 1024px) { .toc-wrap { order: 0; } .toc { position: sticky; top: 88px; } }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px; }
.toc summary { cursor: pointer; font-family: var(--font-head); font-weight: 700; padding: 12px 0; }
.toc ol { list-style: none; margin: 0; padding: 0 0 14px; }
.toc a {
  display: block; padding: 6px 10px; border-left: 2px solid var(--border);
  color: var(--muted); text-decoration: none; font-size: .95rem; line-height: 1.4;
}
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--text); border-left-color: var(--pink); background: rgba(255, 45, 149, .07); }

/* ---------- Strisce informative ---------- */
.strip {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 28px;
  background: linear-gradient(135deg, rgba(255, 45, 149, .1), rgba(33, 230, 255, .06));
}
.strip ul { margin: 0; padding-left: 1.2em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 40px 0 24px; margin-top: 40px; color: var(--muted); font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--cyan); }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 28px; padding-top: 18px; font-size: .85rem; line-height: 1.6; }

/* ---------- Torna su ---------- */
.to-top {
  position: fixed; right: 16px; bottom: 16px; width: 46px; height: 46px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 80px 0; }
.notfound .code { font-family: var(--font-head); font-size: clamp(5rem, 18vw, 9rem); font-weight: 700; line-height: 1; margin: 0 0 12px; }


/* Credito immagini */
.cover figcaption {
  padding: 5px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}
.credit {
  display: block;
  font-size: .68rem;
  line-height: 1.4;
  letter-spacing: .05em;
  
  color: var(--muted);
  opacity: .8;
}
figcaption .credit { margin-top: 2px; }
.cover figcaption .credit { margin-top: 0; }
.credit a { color: var(--muted); text-decoration: none; }
.credit a:hover { color: var(--cyan); }

