/* ============ intelligenzAI.it — light Matrix theme ============ */
/* font self-hostati (niente CDN Google: GDPR/Garante) */
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/space-grotesk-400.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/space-grotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/space-grotesk-700.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-600.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/jetbrains-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/jetbrains-mono-600.woff2') format('woff2'); }
:root {
  --bg: #e7efe9;
  --bg-2: #f4f9f5;
  --card: rgba(246, 251, 248, 0.9);
  --border: rgba(6, 120, 60, 0.22);
  --text: #0a2114;
  --muted: #52705f;
  --c1: #00a44f;   /* verde matrix */
  --c2: #00c46b;   /* verde chiaro */
  --c3: #045d32;   /* verde profondo */
  --lime: #59e39c;
  --grad: linear-gradient(100deg, var(--c3), var(--c1) 55%, var(--c2));
  --radius: 16px;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  line-height: 1.6;
}
::selection { background: var(--c1); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--c1), var(--c2)); border-radius: 8px; }

/* ---------- sfondo: pioggia digitale + scanline ---------- */
#neural-bg {
  position: fixed; inset: 0; z-index: -3;
  width: 100%; height: 100%;
}
body::after { /* scanline sottili, vibe terminale */
  content: ''; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 140, 70, 0.04) 0 1px, transparent 1px 4px);
}
.aurora {
  position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 35% at 20% 25%, rgba(0, 196, 107, 0.10), transparent 70%),
    radial-gradient(35% 30% at 80% 20%, rgba(89, 227, 156, 0.10), transparent 70%),
    radial-gradient(45% 40% at 60% 85%, rgba(4, 93, 50, 0.07), transparent 70%);
  animation: auroraMove 24s ease-in-out infinite alternate;
  filter: blur(20px);
}
@keyframes auroraMove {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(3%, -4%) scale(1.08); }
  100% { transform: translate(-3%, 3%) scale(1.02); }
}
.cursor-glow {
  position: fixed; z-index: -1; width: 480px; height: 480px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(0, 196, 107, 0.10), transparent 60%);
  transform: translate(-50%, -50%);
  transition: opacity .3s;
}

/* ---------- navbar ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 5vw; transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled {
  background: rgba(238, 246, 240, 0.86); backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border), 0 8px 30px rgba(4, 93, 50, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-mark {
  font-family: var(--font-mono); font-weight: 700; font-size: .85rem; color: #eafff2;
  background: linear-gradient(135deg, #06331d, #0a5c33); border-radius: 9px; padding: 6px 9px;
  border: 1px solid rgba(89, 227, 156, 0.5); letter-spacing: 0;
  box-shadow: 0 0 14px rgba(0, 196, 107, 0.35), inset 0 0 8px rgba(0, 196, 107, 0.18);
  display: inline-flex; align-items: baseline;
}
.brand-mark i { font-style: normal; color: var(--lime); margin-right: 1px; }
.brand-mark u { text-decoration: none; color: var(--lime); animation: cursorBlink 1.1s steps(1) infinite; }
@keyframes cursorBlink { 50% { opacity: 0; } }
.brand-text { font-family: var(--font-head); font-weight: 700; letter-spacing: .2px; }
.brand-text b { color: var(--c1); }
.brand-text em { font-style: normal; color: var(--muted); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  color: var(--muted); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: var(--c3); }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- selettore lingua ---------- */
.lang-select {
  background: rgba(246,251,248,0.85); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--font-mono); font-size: .78rem;
  padding: 7px 10px; margin-left: 14px; outline: none; cursor: pointer;
}
.lang-select option { background: var(--bg-2); }

/* ---------- hero ---------- */
.hero { min-height: 92vh; display: flex; flex-direction: column; justify-content: center; padding: 130px 5vw 40px; position: relative; }
.hero-inner { max-width: 900px; margin: 0 auto; text-align: center; }
.hero-kicker { font-family: var(--font-mono); font-size: .82rem; color: var(--c3); letter-spacing: 1px; margin-bottom: 18px; }
.hero-title { font-family: var(--font-head); font-weight: 700; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1.04; letter-spacing: -1px; }
.hero-title .line { display: block; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  clip-path: inset(0 0 55% 0); opacity: 0;
}
.glitch:hover::before { opacity: .8; transform: translate(-2px, -1px); animation: glitchTop 0.5s steps(2) infinite; }
.glitch:hover::after { opacity: .8; clip-path: inset(55% 0 0 0); transform: translate(2px, 1px); animation: glitchBot 0.45s steps(2) infinite; }
@keyframes glitchTop { 50% { transform: translate(2px, 1px); } }
@keyframes glitchBot { 50% { transform: translate(-2px, -1px); } }
.hero-sub { color: var(--muted); font-size: 1.06rem; max-width: 640px; margin: 24px auto 30px; }
.hero-sub b { color: var(--c3); }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 12px; font-weight: 600;
  font-size: .95rem; text-decoration: none; transition: transform .2s, box-shadow .2s, background .2s;
  border: 0; cursor: pointer; font-family: var(--font-body);
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(0, 164, 79, 0.28); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(0, 164, 79, 0.36); }
.btn-ghost { background: transparent; color: var(--c3); border: 1.5px solid rgba(0, 164, 79, 0.4); }
.btn-ghost:hover { background: rgba(0, 196, 107, 0.08); }
.hero-stats { display: flex; gap: 48px; margin-top: 46px; flex-wrap: wrap; justify-content: center; }
.stat-num { font-family: var(--font-mono); font-weight: 600; font-size: 2rem; color: var(--c1); display: block; }
.stat-label { color: var(--muted); font-size: .82rem; }

/* ---------- marquee ---------- */
.hero-marquee { position: absolute; bottom: 0; left: 0; right: 0; overflow: hidden; border-top: 1px solid var(--border); background: rgba(238,246,240,0.75); backdrop-filter: blur(8px); }
.marquee-track { display: inline-flex; white-space: nowrap; animation: marquee 60s linear infinite; padding: 12px 0; }
.marquee-track span { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); margin-right: 34px; display: inline-flex; align-items: center; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-logo { width: 17px; height: 17px; vertical-align: -3px; margin-right: 8px; }

/* ---------- sezioni ---------- */
.section { padding: 90px 5vw; max-width: 1280px; margin: 0 auto; }
.section-head { margin-bottom: 40px; max-width: 720px; }
.section-kicker { font-family: var(--font-mono); font-size: .78rem; color: var(--c1); letter-spacing: 1px; margin-bottom: 10px; }
.section-head h2 { font-family: var(--font-head); font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.5px; margin-bottom: 10px; }
.section-sub { color: var(--muted); font-size: .98rem; }
.section-sub b { color: var(--c3); }

/* ---------- chips filtri ---------- */
.news-filters, .ai-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
.chip {
  background: rgba(246,251,248,0.85); border: 1px solid var(--border); color: var(--muted);
  font-family: var(--font-mono); font-size: .78rem; padding: 8px 16px; border-radius: 999px;
  cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.chip:hover { border-color: var(--c1); color: var(--c3); }
.chip.active { background: var(--grad); color: #fff; border-color: transparent; font-weight: 600; }

/* ---------- news ---------- */
/* layout a moduli compatto stile portale (prova 2026-07-21):
   hero grande + 3 compatte a fianco, il resto in griglia densa */
.news-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: stretch; }
.news-hero { padding: 34px 30px; display: flex; flex-direction: column; }
.news-hero h3 { font-size: 1.65rem; line-height: 1.25; }
.news-hero p { flex: 1; }
.news-side { display: flex; flex-direction: column; gap: 14px; }
.news-side .news-card { flex: 1; }
.news-compact { padding: 14px 16px; }
.news-compact .news-tag { margin-bottom: 8px; padding: 2px 10px; font-size: .62rem; }
.news-compact h3 { font-size: .95rem; line-height: 1.3; margin-bottom: 8px; }
.news-compact .news-meta { font-size: .68rem; }
.news-more { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)); gap: 14px; }
@media (max-width: 820px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-hero { padding: 24px 20px; }
  .news-hero h3 { font-size: 1.3rem; }
}
.news-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; backdrop-filter: blur(10px); position: relative; overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.news-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad); opacity: 0; transition: opacity .3s;
}
.news-card:hover { transform: translateY(-6px); box-shadow: 0 20px 46px rgba(4, 93, 50, 0.12); border-color: rgba(0, 164, 79, 0.35); }
.news-card:hover::before { opacity: 1; }
.news-card.clickable { cursor: pointer; }
.news-tag {
  display: inline-block; font-family: var(--font-mono); font-size: .68rem; letter-spacing: 1px;
  color: var(--c3); background: rgba(0, 196, 107, 0.12); border: 1px solid rgba(0, 164, 79, 0.25);
  padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; text-transform: uppercase;
}
.news-card h3 { font-family: var(--font-head); font-size: 1.15rem; line-height: 1.35; margin-bottom: 10px; }
.news-card p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.news-meta { display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono); font-size: .74rem; color: var(--muted); }

/* top 10 GitHub AI */
.gh-list { max-width: 780px; margin: 0 auto; list-style: none; display: grid; gap: 10px; }
.gh-item {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px;
}
.gh-rank { font: 700 1.05rem var(--font-mono); color: var(--c1); min-width: 26px; text-align: right; }
.gh-body { min-width: 0; }
.gh-top-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.gh-top-row a { font: 600 .95rem var(--font-mono); color: var(--c3); text-decoration: none; word-break: break-all; }
.gh-top-row a:hover { text-decoration: underline; }
.gh-lang { font: 500 .68rem var(--font-mono); color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; }
.gh-stars { font: 600 .74rem var(--font-mono); color: var(--c1); }
.gh-item p { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* frecce per sfogliare il catalogo AI */
.ai-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 20px; }
.pager-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(0, 164, 79, .4);
  background: var(--card); color: var(--c1); font-size: 1.3rem; line-height: 1; cursor: pointer;
  transition: background .2s, border-color .2s;
}
.pager-btn:hover:not(:disabled) { background: rgba(0, 164, 79, .1); border-color: var(--c1); }
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-info { font: 600 .8rem var(--font-mono); color: var(--c3); min-width: 46px; text-align: center; }

/* ---------- griglia AI ---------- */
/* card compatte, 5 per riga su desktop (scelta Enrico 2026-07-21) */
.ai-grid { display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: 14px; perspective: 1100px; }
@media (max-width: 1100px) { .ai-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .ai-grid { grid-template-columns: repeat(2, 1fr); } }
.ai-card {
  min-height: var(--card-min-h, auto); /* uniforme su tutte le pagine del catalogo */
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 12px; backdrop-filter: blur(10px); position: relative; overflow: hidden;
  transform-style: preserve-3d;
  transform: translateY(var(--lift, 0)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .18s ease-out, box-shadow .3s, border-color .3s;
}
.ai-card:hover { --lift: -5px; box-shadow: 0 16px 40px rgba(4, 93, 50, 0.12); border-color: rgba(0, 164, 79, 0.35); }
.ai-card > * { transform: translateZ(0.01px); } /* i figli entrano nel piano 3D */
.ai-card .ai-icon { transition: transform .18s ease-out; }
.ai-card:hover .ai-icon { transform: translateZ(30px); }
.ai-card::after {
  content: ''; position: absolute; top: -60%; right: -60%; width: 120%; height: 120%;
  background: radial-gradient(circle, var(--glow, rgba(0, 196, 107, 0.14)), transparent 60%);
  opacity: 0; transition: opacity .4s; pointer-events: none;
}
.ai-card:hover::after { opacity: 1; }
.ai-icon {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px;
}
.ai-logo { background: #f0f7f2; border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(4, 93, 50, 0.06); }
.ai-logo img { width: 28px; height: 28px; }
.ai-card h3 { font-family: var(--font-head); font-size: .92rem; margin-bottom: 2px; }
.ai-card .ai-by { font-family: var(--font-mono); font-size: .64rem; color: var(--c1); margin-bottom: 6px; }
.ai-card p { color: var(--muted); font-size: .76rem; }
.ai-badge {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--font-mono); font-size: .6rem; letter-spacing: 1px;
  color: var(--c3); border: 1px solid rgba(0, 164, 79, 0.3); padding: 3px 8px; border-radius: 999px;
}

/* ---------- badge redattrici ---------- */
.editor-badge { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: .78rem; color: var(--text); }
.editor-badge i {
  font-style: normal; font-weight: 700; font-size: .7rem; color: #fff;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
}
.editor-badge.sm { font-size: .72rem; }
.editor-badge.sm i { width: 18px; height: 18px; font-size: .6rem; }
.ed-pixie i { background: linear-gradient(135deg, var(--c2), #00a3c4); }
.ed-olya i { background: linear-gradient(135deg, var(--c3), var(--c1)); }
.ed-quality i { background: linear-gradient(135deg, var(--lime), var(--c1)); }

/* ---------- sezione redazione ---------- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.team-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; backdrop-filter: blur(10px); transition: transform .3s, box-shadow .3s;
}
.team-card:hover { transform: translateY(-5px); box-shadow: 0 16px 40px rgba(4, 93, 50, 0.12); }
.team-avatar i {
  font-style: normal; font-weight: 700; font-family: var(--font-head); font-size: 1.4rem;
  color: #fff; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 16px;
}
.ed-pixie .team-avatar i { background: linear-gradient(135deg, var(--c2), #00a3c4); }
.ed-olya .team-avatar i { background: linear-gradient(135deg, var(--c3), var(--c1)); }
.ed-quality .team-avatar i { background: linear-gradient(135deg, var(--lime), var(--c1)); }
.team-card h3 { font-family: var(--font-head); font-size: 1.15rem; margin-bottom: 2px; }
.team-role { font-family: var(--font-mono); font-size: .74rem; color: var(--c1); margin-bottom: 12px; letter-spacing: 1px; text-transform: uppercase; }
.team-card p { color: var(--muted); font-size: .9rem; }
.pipeline {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center;
  margin-top: 36px; font-family: var(--font-mono); font-size: .78rem;
}
.pipeline span {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px;
  background: rgba(246,251,248,0.85); color: var(--text);
}
.pipeline i { font-style: normal; color: var(--c1); }

/* ---------- feed vuoto ---------- */
.feed-empty {
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px;
  text-align: center; color: var(--muted);
}

/* ---------- riepilogo dall'ultima visita ---------- */
.since-visit {
  max-width: 780px; margin: 0 auto 26px; padding: 14px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--c3); background: rgba(246, 251, 248, .94);
  border: 1px solid rgba(0, 164, 79, .34); border-radius: 12px;
  font-family: var(--font-mono); font-size: .8rem;
  box-shadow: 0 8px 24px rgba(4, 93, 50, .08);
}
.since-visit[hidden] { display: none; }
.since-visit svg, .verification-receipt summary svg {
  width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- trasparenza editoriale ---------- */
.editorial-lab { background: rgba(232, 244, 235, .52); border-block: 1px solid var(--border); }
/* registro sopra (rettangolo a tutta larghezza), confronto sotto */
.editorial-grid {
  max-width: 1120px; margin: 0 auto; display: grid;
  grid-template-columns: 1fr; gap: 24px;
  align-items: start;
}
.editorial-card {
  min-width: 0; background: rgba(246, 251, 248, .94); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; box-shadow: 0 12px 34px rgba(4, 93, 50, .07);
}
.editorial-card h3 { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.35; margin-bottom: 12px; }
.editorial-card h3 a { color: inherit; text-decoration-color: rgba(0, 164, 79, .38); text-underline-offset: 4px; transition: color .2s; }
.editorial-card h3 a:hover { color: var(--c1); }
.editorial-kicker {
  color: var(--c1); font: 600 .68rem/1.4 var(--font-mono); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 9px;
}
.ledger-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 24px; }
.ledger-stats div {
  min-width: 0; padding: 14px 7px; text-align: center; background: rgba(0, 164, 79, .055);
  border: 1px solid rgba(0, 164, 79, .14); border-radius: 12px;
}
.ledger-stats strong { display: block; color: var(--c3); font: 700 1.7rem/1 var(--font-head); }
.ledger-stats span { display: block; margin-top: 7px; color: var(--muted); font-size: .68rem; line-height: 1.25; }
.reason-list { list-style: none; display: grid; gap: 8px; }
.reason-list li { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.reason-list li:last-child { border-bottom: 0; }
.reason-list b { color: var(--c3); font-family: var(--font-mono); }
.editorial-empty { color: var(--muted); font-size: .88rem; text-align: center; }
.debate-intro { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
/* confronto in orizzontale: le due voci affiancate su desktop */
.debate-duel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: stretch; margin-top: 10px; }
.debate-duel .debate-turn { margin-top: 0; }
@media (max-width: 720px) { .debate-duel { grid-template-columns: 1fr; } }
/* voci in solo testo, senza riquadri (scelta Enrico 2026-07-21) */
.debate-turn { margin-top: 10px; text-align: left; }
.debate-turn.ed-pixie b { color: #008ca8; }
.debate-turn b, .debate-close b { font: 600 .72rem var(--font-mono); color: var(--c3); }
.debate-turn p, .debate-close p { margin-top: 5px; font-size: .88rem; }
.debate-close { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); text-align: left; }

/* ---------- ricevuta di verifica ---------- */
.verification-receipt {
  margin-top: 24px; border: 1px solid rgba(0, 164, 79, .32); border-radius: 13px;
  background: rgba(0, 164, 79, .045); overflow: hidden; text-align: left;
}
.verification-receipt summary {
  display: flex; align-items: center; gap: 9px; padding: 14px 16px; cursor: pointer;
  color: var(--c3); font: 600 .78rem var(--font-mono); list-style: none;
  transition: background .2s;
}
.verification-receipt summary::-webkit-details-marker { display: none; }
.verification-receipt summary::after { content: '+'; margin-left: auto; font-size: 1rem; }
.verification-receipt[open] summary::after { content: '−'; }
.verification-receipt summary:hover { background: rgba(0, 164, 79, .06); }
.verification-receipt summary:focus-visible { outline: 3px solid rgba(0, 164, 79, .28); outline-offset: -3px; }
.verification-receipt dl { padding: 0 16px 15px; }
.verification-receipt dl div { padding: 11px 0; border-top: 1px solid var(--border); }
.verification-receipt dt { color: var(--c1); font: 600 .68rem var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.verification-receipt dd { margin-top: 4px; color: var(--text); font-size: .86rem; }

a.ai-card { display: block; color: inherit; text-decoration: none; }

/* sezioni a tendina su mobile: trasparenza + ecosistema chiuse di default.
   Da chiuse il section-head diventa un "bottone" bordato con freccia nel cerchio. */
@media (max-width: 768px) {
  .collapse-mobile:not(.open) > :not(.section-head) { display: none; }
  .collapse-mobile .section-head {
    cursor: pointer; position: relative; padding: 18px 56px 18px 18px;
    border: 1px solid rgba(0, 164, 79, .35); border-radius: 16px;
    background: rgba(0, 164, 79, .05); transition: background .2s;
  }
  .collapse-mobile .section-head:active { background: rgba(0, 164, 79, .12); }
  .collapse-mobile .section-head::after {
    content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(0, 164, 79, .45); background: #fff; color: var(--c1);
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; line-height: 1;
  }
  .collapse-mobile.open .section-head::after { content: '▴'; }
  .collapse-mobile:not(.open) .section-head .section-sub { display: none; }
  .collapse-mobile:not(.open) .section-head h2 { margin-bottom: 0; }
}

/* scheda AI di Olya nel modal ecosistema (riusa lo stile della ricevuta) */
.ai-profile { margin-top: 18px; }
.ai-profile dd a { color: var(--c3); text-decoration: underline; }
.ai-profile-pending { margin-top: 18px; color: var(--c3); font: 600 .78rem var(--font-mono); opacity: .75; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 60px 5vw 30px; background: #0a2a1a; }
.footer-inner {
  max-width: 1280px; margin: 0 auto 34px; display: flex; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
}
.footer-brand { max-width: 340px; display: flex; flex-direction: column; gap: 14px; }
.footer-brand p { color: #9fc4ae; font-size: .9rem; }
.footer-brand b { color: var(--lime); }
.footer-cols { display: flex; gap: 60px; flex-wrap: wrap; }
.footer-cols h4 { font-family: var(--font-head); margin-bottom: 12px; font-size: .95rem; color: #e8f5ec; }
.footer-cols a { display: block; color: #9fc4ae; text-decoration: none; font-size: .88rem; margin-bottom: 8px; transition: color .2s; }
.footer-cols a:hover { color: var(--lime); }
.footer-copy { text-align: center; color: #7ea890; font-size: .78rem; font-family: var(--font-mono); }
.footer-copy a { color: var(--lime); text-decoration: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 140%);
  background: var(--c3); color: #fff; padding: 13px 22px; border-radius: 12px;
  font-size: .9rem; z-index: 200; transition: transform .35s cubic-bezier(.2,.9,.3,1.2);
  box-shadow: 0 12px 34px rgba(4, 93, 50, 0.3);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- modal articolo ---------- */
.article-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.article-modal[hidden] { display: none; }
.article-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 33, 20, 0.45); backdrop-filter: blur(6px); }
.article-modal-panel {
  position: relative; width: min(760px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px; box-shadow: 0 30px 80px rgba(4, 93, 50, 0.25);
}
.article-modal-close {
  position: sticky; top: 0; float: right; z-index: 2;
  background: rgba(0, 196, 107, 0.08); border: 1px solid var(--border); border-radius: 50%;
  width: 36px; height: 36px; color: var(--text); cursor: pointer; font-size: .9rem;
}
.article-modal-close:hover { border-color: var(--c1); color: var(--c1); }
.article-title { font-family: var(--font-head); font-size: 1.6rem; line-height: 1.3; margin: 14px 0 12px; }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  color: var(--muted); font-size: .85rem; margin-bottom: 22px;
  border-bottom: 1px solid var(--border); padding-bottom: 18px;
}
.article-body p { margin-bottom: 16px; color: var(--text); font-size: .96rem; }

/* ---------- fonti in fondo all'articolo ---------- */
.article-sources { margin-top: 26px; border-top: 1px solid var(--border); padding-top: 16px; }
.article-sources h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.article-sources ol { padding-left: 20px; }
.article-sources li { font-size: .86rem; margin-bottom: 6px; }
.article-sources a { color: var(--c1); text-decoration: none; }
.article-sources a:hover { text-decoration: underline; }

/* ---------- commenti ---------- */
.article-comments { margin-top: 30px; border-top: 1px solid var(--border); padding-top: 22px; }
.article-comments h3 { font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 16px; }
.comment {
  background: rgba(0, 196, 107, 0.04); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 12px;
}
.comment-ai { border-left: 3px solid var(--c1); background: rgba(0, 196, 107, 0.09); }
.comment .comment { margin: 12px 0 0; }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; font-size: .82rem; color: var(--muted); }
.comment-head b { color: var(--text); }
.comment p { font-size: .9rem; color: var(--text); }
.comment-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.comment-form input, .comment-form textarea {
  background: #f4f9f5; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: .92rem;
  resize: vertical; outline: none; transition: border-color .25s, box-shadow .25s;
}
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--c1); box-shadow: 0 0 0 3px rgba(0, 196, 107, 0.14); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .nav-links {
    position: fixed; inset: 62px 0 auto 0; flex-direction: column; gap: 4px;
    background: rgba(255, 255, 255, 0.97); backdrop-filter: blur(20px);
    padding: 20px 5vw 28px; border-bottom: 1px solid var(--border);
    transform: translateY(-130%); transition: transform .35s;
  }
  .nav-links.open { transform: none; }
  .nav-links a { padding: 10px 0; font-size: 1.05rem; }
  .burger { display: block; }
  .hero { padding-top: 110px; }
  .hero-stats { gap: 28px; }
  .section { padding: 64px 5vw; }
  .article-modal-panel { padding: 24px 18px; }
  .lang-select { margin-left: 8px; font-size: .72rem; }
  .editorial-grid { grid-template-columns: 1fr; }
  .editorial-card { padding: 20px 16px; }
  .ledger-stats span { font-size: .62rem; }
  .since-visit { align-items: flex-start; text-align: left; }
}

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

/* ---------- intro animata (Matrix decode) ---------- */
.intro {
  position: fixed; inset: 0; z-index: 300; background: #04130a;
  display: grid; place-items: center; cursor: pointer;
  transition: opacity .7s ease;
}
.intro.leaving { opacity: 0; pointer-events: none; }
.intro[hidden] { display: none; }
#intro-rain { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-center { position: relative; text-align: center; pointer-events: none; }
.intro-brand {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.6rem, 6vw, 3.4rem); color: #d8ffe9;
  text-shadow: 0 0 18px rgba(0, 228, 124, 0.8), 0 0 60px rgba(0, 228, 124, 0.4);
}
.intro-brand .cur { color: var(--lime); animation: cursorBlink 0.9s steps(1) infinite; }
.intro-tag {
  margin-top: 14px; font-family: var(--font-mono); font-size: .8rem;
  letter-spacing: .35em; text-transform: uppercase; color: rgba(160, 240, 195, 0.75);
}
.intro-powered {
  pointer-events: auto; display: inline-block; margin-top: 26px;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .25em;
  text-transform: uppercase; color: rgba(160, 240, 195, 0.45); text-decoration: none;
}
.intro-powered:hover { color: var(--lime); }

/* ---------- badge trasparenza AI Act ---------- */
.ai-disclosure {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .5px;
  color: var(--c3); background: rgba(0, 196, 107, 0.1);
  border: 1px solid rgba(0, 164, 79, 0.3); border-radius: 999px; padding: 4px 12px;
}

.comment-flag {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
  padding: 2px 6px; border-radius: 8px; transition: color .2s, background .2s;
}
.comment-flag:hover { color: #b0483a; background: rgba(176, 72, 58, 0.08); }
.comment-flag:disabled { opacity: .5; cursor: default; }
a.news-card { display: block; color: inherit; text-decoration: none; }

/* ---------- tutto centrato (desktop + mobile) ---------- */
.section-head { margin: 0 auto 40px; text-align: center; }
.news-filters, .ai-filters { justify-content: center; }
.news-card, .ai-card, .team-card { text-align: center; }
.news-card .news-tag, .ai-badge { }
.ai-icon { margin: 0 0 10px; } /* logo a sinistra nelle card (scelta Enrico) */
.team-avatar i { margin: 0 auto 16px; }
.news-meta { justify-content: center; gap: 14px; }
.editor-badge { justify-content: center; }
/* footer: orizzontale su desktop (brand a sinistra, colonne a destra), centrato su mobile */
@media (max-width: 760px) {
  .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 26px; }
  .footer-brand { align-items: center; margin: 0 auto; }
  .footer-cols { justify-content: center; }
  .footer-cols > div { text-align: center; }
}

/* ---------- modal AI (ecosistema commentabile) ---------- */
.ai-talk-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 8px 0 6px; }
.ai-talk-head h2 { font-family: var(--font-head); font-size: 1.5rem; }
.ai-talk-head .ai-icon { margin: 0; }
.ai-talk-desc { color: var(--muted); text-align: center; max-width: 520px; margin: 0 auto 8px; }
.article-modal-panel { text-align: center; }
.article-modal-panel .article-body, .article-modal-panel .comment, .article-modal-panel .article-sources { text-align: left; }

/* ---------- news: meta/data sempre in fondo alla card ---------- */
.news-card { display: flex; flex-direction: column; }
a.news-card { display: flex; }
.news-card .news-tag { align-self: center; }
.news-card p { flex: 1; }
.news-card .news-meta { margin-top: auto; }

/* ---------- risposte nei thread ---------- */
.comment-reply {
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-mono); font-size: .68rem; color: var(--muted);
  padding: 2px 6px; border-radius: 8px; transition: color .2s, background .2s;
}
.comment-reply:hover { color: var(--c3); background: rgba(0, 196, 107, 0.1); }
.comment .comment-head .comment-reply { margin-left: auto; }
.comment .comment-head .comment-reply + .comment-flag { margin-left: 0; }
.reply-form { margin-top: 10px; }
.reply-form .btn { align-self: flex-end; padding: 9px 18px; font-size: .85rem; }

/* ---------- contatore commenti sulle card ---------- */
.card-comments { font-family: var(--font-mono); font-size: .72rem; color: var(--muted); }
.ai-card .card-comments { margin-top: 10px; }
