/* ============================================================
   Progetto X – stile A "Editoriale notturno"
   Un solo foglio per le 4 pagine. Font self-hosted (latin).
   Palette: sfondo #14110F · superficie #1D1916 · bordo #2E2823
            testo #ECE6DA · secondario #B4AB9C · accento #D9A15B
   ============================================================ */
@font-face {
  font-family: 'Instrument Serif';
  src: url('fonts/instrument-serif-latin.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Hanken Grotesk';
  src: url('fonts/hanken-grotesk-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --bg: #14110F;
  --surface: #1D1916;
  --line: #2E2823;
  --text: #ECE6DA;
  --text-muted: #B4AB9C;
  --accent: #D9A15B;
  --accent-hover: #E5B374;
  --on-accent: #14110F;
  --radius: 6px;
  --font-head: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  /* alias: i link inline del markup usano ancora questi nomi */
  --neon-pink: var(--accent);
  --neon-red: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; color: var(--text); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
strong { font-weight: 600; }

/* emoji decorative avvolte in <span class="emo"> */
.emo, .why-num, .why-icon, .type-icon { display: none; }

/* ---------- breadcrumb ---------- */
.breadcrumb {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { margin: 0 8px; opacity: 0.7; }

/* ---------- hero ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px 64px;
}
.hero-content { width: 100%; max-width: 960px; text-align: left; }
.hero-badge, .category-chip {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 16px;
}
.parent-link { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; }
.parent-link a { color: var(--text-muted); }
.parent-link a:hover { color: var(--accent); }
.hero h1 {
  font-size: clamp(2.75rem, 9vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .h1-sub { display: block; font-size: 0.5em; line-height: 1.15; margin-top: 8px; color: var(--text-muted); }
.hero h1 .h1-sub .accent { color: var(--accent); }
.hero-sub {
  font-size: clamp(1rem, 3.5vw, 1.1875rem);
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 32px;
}
.hero-sub strong { color: var(--text); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.hero-tags span {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ---------- CTA ---------- */
.tg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.02em;
  padding: 12px 24px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease-out;
}
.tg-btn:hover { background: var(--accent-hover); color: var(--on-accent); }
.tg-btn:active { transform: scale(0.98); }
.tg-btn:focus-visible { outline-offset: 4px; }
.tg-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.tg-btn svg circle { fill: var(--on-accent); }
.tg-btn svg path { fill: var(--accent); }

.sticky-cta {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  padding: 12px 16px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.sticky-cta .tg-btn { width: 100%; }
@media (max-width: 768px) {
  .sticky-cta { display: block; }
  footer { padding-bottom: 96px; }
}

/* ---------- barra numeri (landing) ---------- */
.stats-bar {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 64px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 200px));
  gap: 24px;
}
@media (max-width: 600px) { .stats-bar { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
.stat-item { border-top: 1px solid var(--line); padding-top: 16px; }
.stat-num { display: block; font-family: var(--font-head); font-size: 2.25rem; line-height: 1.1; color: var(--text); }
.stat-label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- sezioni a card ---------- */
.why, .content-types {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 64px;
}
.why h2, .content-types h2 {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  line-height: 1.15;
  margin-bottom: 32px;
}
.why-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .why-grid { grid-template-columns: repeat(3, 1fr); } }
.why-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.why-card h3 { font-size: 1.5rem; line-height: 1.2; margin-bottom: 12px; }
.why-card p { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.65; }
.why-card p strong { color: var(--text); }

.type-list { display: grid; grid-template-columns: 1fr; gap: 0 32px; }
@media (min-width: 600px) { .type-list { grid-template-columns: 1fr 1fr; } }
.type-item { border-top: 1px solid var(--line); padding: 16px 0 24px; }
.type-text h3, .type-text h4 { font-size: 1.375rem; line-height: 1.25; margin-bottom: 8px; }
.type-text p { font-size: 0.9375rem; color: var(--text-muted); line-height: 1.6; }

/* ---------- testo lungo ---------- */
.seo-block { max-width: 720px; margin: 0 auto; padding: 24px 24px 64px; }
.seo-block h2 { font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.15; margin-bottom: 24px; }
.seo-block h3 { font-size: 1.5rem; line-height: 1.25; margin: 40px 0 12px; }
.seo-block p { font-size: 1rem; line-height: 1.75; color: var(--text-muted); margin-bottom: 16px; text-align: left; }
.seo-block strong { color: var(--text); }
.seo-block a { text-decoration: underline !important; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.seo-block a:hover { text-decoration-thickness: 2px; }
.seo-list { list-style: none; margin: 8px 0 24px; }
.seo-list li {
  border-top: 1px solid var(--line);
  padding: 12px 0;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.seo-list li:last-child { border-bottom: 1px solid var(--line); }
.seo-list li span.arrow { display: none; }
.seo-list li strong { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { max-width: 960px; margin: 0 auto; padding: 24px 24px 64px; }
.faq h2 { font-size: clamp(1.75rem, 5vw, 2.25rem); line-height: 1.15; margin-bottom: 32px; }
.faq-grid { display: grid; grid-template-columns: 1fr; gap: 0 48px; align-items: start; }
@media (min-width: 700px) { .faq-grid { grid-template-columns: 1fr 1fr; } }
body:has(.guide-hero) .faq { max-width: 720px; }
body:has(.guide-hero) .faq-grid { grid-template-columns: 1fr; }
.faq-col { display: flex; flex-direction: column; }
.faq-col > .acc-btn:first-child { border-top: 1px solid var(--line); }
.acc-btn {
  position: relative;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 0;
  border-radius: 0;
  padding: 16px 40px 16px 0;
  text-align: left;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  transition: color 0.15s ease-out;
}
.acc-btn::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
}
.acc-btn.open::after { content: '\2212'; }
.acc-btn:hover { color: var(--accent); }
.acc-panel {
  border-bottom: 1px solid var(--line);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-out;
}
.acc-panel.open { max-height: 640px; }
.acc-panel p {
  margin: 0;
  padding: 0 0 20px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 60ch;
}
.acc-panel p strong { color: var(--text); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 32px 24px;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-muted);
  text-align: center;
}
footer a { color: var(--text); }
footer a:hover { color: var(--accent); }

/* ---------- guida Telegram ---------- */
.guide-hero { border-bottom: 1px solid var(--line); padding: 24px 24px 48px; margin-bottom: 48px; }
.guide-hero-inner { max-width: 720px; margin: 0 auto; }
.guide-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 24px; }
.guide-kicker { color: var(--accent); font-weight: 600; }
.guide-dot { color: var(--text-muted); }
.guide-hero h1 {
  font-size: clamp(2.25rem, 7vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
  max-width: 20ch;
}
.guide-hero h1 .quoted { color: var(--accent); }
.guide-standfirst { font-size: clamp(1rem, 2.4vw, 1.1875rem); line-height: 1.65; color: var(--text-muted); max-width: 60ch; margin-bottom: 32px; }
.guide-standfirst strong { color: var(--text); }
.tldr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.tldr-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.tldr p { margin: 0 0 12px; font-size: 0.9375rem; line-height: 1.7; color: var(--text-muted); }
.tldr strong { color: var(--text); }
.tldr-jump { font-size: 0.9375rem; font-weight: 600; }

#fix-title, .steps { scroll-margin-top: 24px; }
.error-box { max-width: 640px; margin: 0 auto 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; text-align: center; }
.error-box .err-label { display: block; font-size: 0.875rem; color: var(--text-muted); margin-bottom: 12px; }
.error-box .err-msg { font-size: 1.125rem; color: var(--text); font-weight: 600; margin: 0 0 8px; }
.error-box .err-sub { font-size: 0.9375rem; color: var(--text-muted); margin: 0; }

.steps { max-width: 720px; margin: 0 auto 56px; padding: 0 24px; counter-reset: step; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 230px;
  gap: 32px;
  align-items: start;
  padding: 0 0 32px 48px;
  margin-left: 16px;
  border-left: 1px solid var(--line);
}
.step-nofig { grid-template-columns: 1fr; }
.step:last-child { border-left-color: transparent; padding-bottom: 0; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -16px;
  top: -4px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-family: var(--font-head);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
}
.step-body { min-width: 0; }
.step h3 { font-size: 1.375rem; line-height: 1.25; margin: 0 0 8px; }
.step p { font-size: 0.9375rem; line-height: 1.65; color: var(--text-muted); margin: 0 0 8px; }
.step p strong { color: var(--text); }
.step code { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; font-size: 0.875em; color: var(--text); }
.step-shot { margin: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); line-height: 0; }
.step-shot img { display: block; width: 100%; height: auto; }
.step-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.875rem !important;
  color: var(--text-muted) !important;
  margin-top: 16px !important;
}
.step-note strong { color: var(--text); }
.note {
  max-width: 720px;
  margin: 0 auto 48px;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-muted);
}
@media (max-width: 720px) {
  .step { grid-template-columns: 1fr; gap: 16px; }
  .step-shot { max-width: 250px; }
}

/* ---------- mobile ---------- */
@media (max-width: 480px) {
  .hero { padding: 40px 20px 48px; }
  .stats-bar { padding-left: 20px; padding-right: 20px; }
  .stat-num { font-size: 1.75rem; }
  .why, .content-types, .seo-block, .faq { padding-left: 20px; padding-right: 20px; }
  .steps { padding: 0 20px; }
  .step { padding-left: 40px; margin-left: 12px; }
  .guide-hero { padding: 16px 20px 32px; margin-bottom: 32px; }
  .guide-hero h1 { max-width: none; }
  .tldr { padding: 16px; }
  .error-box { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
