/* ═══════════════════════════════════════════════════
   LINE 3.0 — Manuale  |  style.css
═══════════════════════════════════════════════════ */

:root {
  --ink: #1a1814;
  --paper: #f7f3ec;
  --acc: #d4401a;
  --dim: #7a7268;
  --border: rgba(0,0,0,.09);
  --code-bg: #1a1814;
  --code-fg: #e8dcc8;
}

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Syne', sans-serif;
  line-height: 1.7;
}

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 2rem;
  border-bottom: 2px solid var(--acc);
}
.topbar-brand {
  font-weight: 800; font-size: 1.1rem; color: #fff;
  text-decoration: none; letter-spacing: -.01em;
}
.topbar-brand span { color: var(--acc); }
.topbar-nav {
  display: flex; align-items: center; gap: 1.5rem;
  font-size: .75rem; letter-spacing: .15em; text-transform: uppercase;
}
.topbar-nav a { color: rgba(255,255,255,.45); text-decoration: none; transition: color .2s; }
.topbar-nav a:hover { color: #fff; }
.topbar-nav .current { color: var(--acc); }

/* ── Pagina contenuto ── */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* ── Intestazione sezione ── */
.section-tag {
  font-family: 'Syne Mono', monospace;
  font-size: .65rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--acc);
  margin-bottom: .8rem;
}
.section-title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin-bottom: .8rem;
}
.section-desc {
  font-size: 1.05rem;
  color: var(--dim);
  max-width: 560px;
  margin-bottom: 3.5rem;
}

/* ── Capitoli ── */
.chapter { margin-bottom: 3.5rem; }
.chapter-title {
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 1rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.chapter-num {
  font-family: 'Syne Mono', monospace;
  font-size: .7rem; background: var(--acc);
  color: #fff; padding: .2rem .5rem;
  letter-spacing: .05em; flex-shrink: 0;
}

p { margin-bottom: .9rem; font-size: 1rem; color: var(--ink); }
p:last-child { margin-bottom: 0; }

code {
  font-family: 'Syne Mono', monospace;
  font-size: .85em;
  background: rgba(0,0,0,.07);
  padding: .15em .4em;
  border-radius: 2px;
  color: var(--ink);
}

/* ── code inline dentro il quiz (sfondo scuro) ── */
.quiz-section code {
  background: rgba(255,255,255,.1);
  color: #e8dcc8;
}

/* ── Blocchi di codice ── */
.codeblock {
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: 'Syne Mono', monospace;
  font-size: .88rem;
  line-height: 1.7;
  padding: 1.3rem 1.5rem;
  margin: 1.2rem 0;
  overflow-x: auto;
  white-space: pre;
}
.codeblock-label {
  font-size: .6rem; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(255,255,255,.25); margin-bottom: .6rem; display: block;
  white-space: normal;
}
.cmt { color: #7a7060; }
.kw  { color: #e8854a; font-weight: 700; }
.str { color: #85c17e; }
.num { color: #79aee6; }

/* ── Callout ── */
.callout {
  border-left: 3px solid var(--acc);
  background: rgba(212,64,26,.05);
  padding: .9rem 1.2rem;
  margin: 1.2rem 0;
  font-size: .95rem;
}
.callout strong { color: var(--acc); }

/* ── Tabelle ── */
.table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .9rem; }
.table th {
  text-align: left; font-size: .65rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--dim);
  padding: .5rem .8rem; border-bottom: 2px solid var(--border);
}
.table td {
  padding: .6rem .8rem; border-bottom: 1px solid var(--border);
  font-family: 'Syne Mono', monospace;
}
.table td:first-child { color: var(--acc); }
.table td:last-child  { font-family: 'Syne', sans-serif; color: var(--dim); }

/* ── Divisore ── */
.sep { height: 1px; background: var(--border); margin: 3rem 0; }

/* ═══════════════════════════════════════════════════
   QUIZ
═══════════════════════════════════════════════════ */
.quiz-section {
  background: var(--ink);
  color: #fff;
  padding: 3rem 2rem;
  margin-top: 4rem;
}
.quiz-header { text-align: center; margin-bottom: 2.5rem; }
.quiz-header h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.quiz-header p  { color: rgba(255,255,255,.4); font-size: .85rem; letter-spacing: .05em; }

.quiz-inner {
  max-width: 680px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 2rem;
}

.q-block {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  padding: 1.5rem;
}
.q-num {
  font-family: 'Syne Mono', monospace; font-size: .6rem;
  letter-spacing: .35em; color: var(--acc);
  text-transform: uppercase; margin-bottom: .6rem;
}
.q-text { font-size: 1rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.4; color: #fff; }
.q-code {
  background: rgba(0,0,0,.4); font-family: 'Syne Mono', monospace;
  font-size: .82rem; padding: .8rem 1rem; margin-bottom: 1rem;
  color: #c8b89a; overflow-x: auto; white-space: pre;
}

.options { display: flex; flex-direction: column; gap: .5rem; }
.opt {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border: 1px solid rgba(255,255,255,.1);
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: .95rem; color: rgba(255,255,255,.75); user-select: none;
}
.opt:hover:not(.disabled) { border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.opt-letter {
  font-family: 'Syne Mono', monospace; font-size: .7rem;
  color: rgba(255,255,255,.3); width: 1.2em; flex-shrink: 0;
}
.opt.correct { border-color: #2d7a3a; background: rgba(45,122,58,.15); color: #69c97a; }
.opt.wrong   { border-color: #c0392b; background: rgba(192,57,43,.12); color: #e87070; }
.opt.disabled { cursor: default; }

.q-feedback {
  margin-top: .8rem; font-size: .85rem; min-height: 1.2em;
  padding: .5rem .8rem; display: none;
}
.q-feedback.show { display: block; }
.q-feedback.ok  { color: #69c97a; background: rgba(45,122,58,.1); border-left: 2px solid #2d7a3a; }
.q-feedback.err { color: #e87070; background: rgba(192,57,43,.08); border-left: 2px solid #c0392b; }

.quiz-result {
  text-align: center; padding: 2rem;
  border: 1px solid rgba(255,255,255,.1); display: none;
}
.quiz-result.show { display: block; }
.result-score { font-size: 3rem; font-weight: 800; color: var(--acc); line-height: 1; margin-bottom: .4rem; }
.result-msg   { color: rgba(255,255,255,.5); font-size: .9rem; margin-bottom: 1.5rem; }

.btn-next {
  display: inline-block; background: var(--acc); color: #fff;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .85rem;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  padding: .8rem 2rem; border: none; cursor: pointer; transition: background .2s;
}
.btn-next:hover { background: #b83515; }
.btn-retry {
  background: none; border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6); font-family: 'Syne', sans-serif;
  font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  padding: .7rem 1.5rem; cursor: pointer; margin-left: .8rem;
  transition: border-color .2s, color .2s;
}
.btn-retry:hover { border-color: rgba(255,255,255,.5); color: #fff; }

/* ═══════════════════════════════════════════════════
   HOME — solo index.html
═══════════════════════════════════════════════════ */

/* Hero senza immagine */
.hero {
  min-height: 100dvh;
  background: var(--ink);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 3rem 2rem;
  position: relative; overflow: hidden;
}
/* Griglia decorativa in background */
.hero::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
/* Alone centrale */
.hero::after {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 60% at 50% 50%,
    rgba(212,64,26,.18) 0%, transparent 70%);
}
.hero > * { position: relative; z-index: 1; }

.hero-label {
  font-family: 'Syne Mono', monospace;
  font-size: .7rem; letter-spacing: .5em;
  text-transform: uppercase; color: rgba(255,255,255,.35);
  margin-bottom: 1.5rem;
}
.hero h1 {
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 800; color: #fff;
  letter-spacing: -.04em; line-height: .95;
  margin-bottom: .6rem;
}
.hero h1 span { color: var(--acc); }
.hero-sub {
  font-size: clamp(.95rem, 2.5vw, 1.25rem);
  color: rgba(255,255,255,.5);
  margin-bottom: .8rem;
}
.hero-acronimo {
  font-family: 'Syne Mono', monospace;
  font-size: .72rem; color: rgba(255,255,255,.22);
  letter-spacing: .1em; margin-bottom: 3.5rem;
}
.btn-primary {
  display: inline-block; background: var(--acc); color: #fff;
  font-family: 'Syne', sans-serif; font-weight: 700; font-size: .9rem;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  padding: 1rem 2.5rem; border: none; cursor: pointer;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: #b83515; transform: translateY(-1px); }

/* Info sezione */
.content { background: var(--paper); }
.info {
  max-width: 860px; margin: 0 auto;
  padding: 6rem 2rem 4rem;
  display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4rem;
}
@media(max-width:640px) { .info { grid-template-columns: 1fr; } }

.info-block h2 {
  font-size: .65rem; letter-spacing: .4em; text-transform: uppercase;
  color: var(--acc); margin-bottom: 1rem;
}
.info-block p { font-size: 1rem; line-height: 1.7; color: var(--dim); }
.features { display: flex; flex-direction: column; gap: .6rem; }
.feature  { display: flex; align-items: flex-start; gap: .75rem; }
.feature-dot {
  width: 6px; height: 6px; background: var(--acc); border-radius: 50%;
  flex-shrink: 0; margin-top: .55em;
}
.feature p { font-size: .95rem; line-height: 1.5; color: var(--dim); }

.divider { max-width: 860px; margin: 0 auto; height: 1px; background: var(--border); }

.cta-section {
  max-width: 860px; margin: 0 auto; padding: 4rem 2rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 2rem; flex-wrap: wrap;
}
.cta-section h2 { font-size: clamp(1.5rem,4vw,2.2rem); font-weight: 700; line-height: 1.2; }
.cta-section h2 em { font-style: normal; color: var(--acc); }
.cta-section p  { font-size: .95rem; color: var(--dim); margin-top: .5rem; }

.footer-sections {
  background: var(--ink); color: rgba(255,255,255,.8);
  display: grid; grid-template-columns: 1fr 1fr;
}
@media(max-width:640px) { .footer-sections { grid-template-columns: 1fr; } }

.footer-block { padding: 3.5rem 3rem; border-right: 1px solid rgba(255,255,255,.08); }
.footer-block:last-child { border-right: none; }
.footer-block h3 {
  font-size: .6rem; letter-spacing: .45em; text-transform: uppercase;
  color: rgba(255,255,255,.3); margin-bottom: 1.5rem;
}
.gh-link {
  display: inline-flex; align-items: center; gap: .75rem;
  text-decoration: none; color: #fff; font-size: 1.05rem;
  font-weight: 600; transition: color .2s;
}
.gh-link:hover { color: var(--acc); }
.gh-icon { width: 28px; height: 28px; fill: currentColor; flex-shrink: 0; }
.gh-sub  { font-size: .8rem; color: rgba(255,255,255,.4); margin-top: .5rem; line-height: 1.5; }
.collab-text { font-size: .95rem; line-height: 1.7; color: rgba(255,255,255,.5); margin-bottom: 1.5rem; }
.btn-ghost {
  display: inline-block; border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.7); font-family: 'Syne', sans-serif;
  font-size: .75rem; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; text-decoration: none;
  padding: .6rem 1.4rem; transition: border-color .2s, color .2s;
}
.btn-ghost:hover { border-color: var(--acc); color: var(--acc); }

.copyright {
  background: var(--ink); border-top: 1px solid rgba(255,255,255,.06);
  padding: 1.2rem 3rem; font-family: 'Syne Mono', monospace;
  font-size: .65rem; letter-spacing: .1em; color: rgba(255,255,255,.2);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .5rem;
}
.copyright a { color: rgba(255,255,255,.3); text-decoration: none; }
.copyright a:hover { color: var(--acc); }

/* ── Logo hero ── */
.hero-logo-wrap {
  background: #fff;
  border-radius: 12px;
  padding: .6rem 1.6rem;
  margin-bottom: 2rem;
  display: inline-block;
}
.hero-logo {
  height: clamp(48px, 8vw, 80px);
  width: auto;
  display: block;
  object-fit: contain;
}

/* ── Favicon topbar (sinistra, cliccabile) ── */
.topbar-brand .topbar-favicon {
  height: 32px;
  width: 32px;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}

/* ── Quiz: domanda completamento (IDE simulato) ── */
.q-ide {
  background: #0d0d0d;
  border: 1px solid rgba(255,255,255,.12);
  font-family: 'Syne Mono', monospace;
  font-size: .88rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  line-height: 1.9;
  color: #c8b89a;
  position: relative;
}
.q-ide .ide-line {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.q-ide .ide-lnum {
  color: rgba(255,255,255,.15);
  font-size: .72rem;
  width: 1.4em;
  text-align: right;
  flex-shrink: 0;
  user-select: none;
}
.q-ide .ide-kw  { color: #e8854a; font-weight: 700; }
.q-ide .ide-cmt { color: #7a7060; }
.q-ide .ide-str { color: #85c17e; }
.q-ide .ide-num { color: #79aee6; }

.ide-blank {
  display: inline-block;
  background: rgba(255,255,255,.07);
  border: 1px dashed rgba(255,255,255,.25);
  border-radius: 2px;
  min-width: 120px;
  padding: .1rem .5rem;
  color: #fff;
  font-family: 'Syne Mono', monospace;
  font-size: .88rem;
  outline: none;
  transition: border-color .2s, background .2s;
  vertical-align: middle;
}
.ide-blank:focus { border-color: #e8854a; background: rgba(232,133,74,.08); }
.ide-blank.correct { border-color: #2d7a3a; background: rgba(45,122,58,.15); color: #69c97a; }
.ide-blank.wrong   { border-color: #c0392b; background: rgba(192,57,43,.12); color: #e87070; }
.ide-blank:disabled { cursor: default; }

.q-ide-submit {
  margin-top: .8rem;
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.6);
  font-family: 'Syne', sans-serif;
  font-size: .72rem; letter-spacing: .15em; text-transform: uppercase;
  padding: .45rem 1rem; cursor: pointer;
  transition: border-color .2s, color .2s;
}
.q-ide-submit:hover:not(:disabled) { border-color: #e8854a; color: #e8854a; }
.q-ide-submit:disabled { opacity: .4; cursor: default; }
