/* ============================================
   VibeCoding Pro — Stile del corso
   Tema: zinc scuro, glassmorphism, serif display
   ============================================ */

:root {
  /* Palette zinc (dal design di riferimento) */
  --bg-0: #09090b;
  --bg-100: #18181b;
  --bg-200: #27272a;
  --bg-300: #3f3f46;
  --text-100: #fafafa;
  --text-200: #e4e4e7;
  --text-300: #a1a1aa;
  --text-400: #71717a;

  --bg: var(--bg-0);
  --bg-soft: #101012;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.12);
  --border-soft: rgba(255, 255, 255, 0.08);
  --text: var(--text-100);
  --text-dim: var(--text-300);

  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 0.5rem;
  --radius-lg: 16px;
  --maxw: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

h3, h4 {
  font-family: var(--font-sans);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

a { color: var(--text-200); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.4); }

img { max-width: 100%; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Animazioni (fade + slide) ---------- */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.anim-1, .anim-2, .anim-3, .anim-4 {
  opacity: 0;
  animation: fadeSlideIn 0.7s ease-out forwards;
}
.anim-1 { animation-delay: 0.05s; }
.anim-2 { animation-delay: 0.2s; }
.anim-3 { animation-delay: 0.35s; }
.anim-4 { animation-delay: 0.5s; }

@media (prefers-reduced-motion: reduce) {
  .anim-1, .anim-2, .anim-3, .anim-4 { animation: none; opacity: 1; }
}

/* ---------- Navbar (pillola in vetro) ---------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
  background: linear-gradient(to bottom, rgba(9, 9, 11, 0.75), rgba(9, 9, 11, 0));
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-100);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .spark { color: var(--text-300); }

.nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s ease;
}
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }

.nav-cta {
  background: #fff;
  color: #171717 !important;
  font-weight: 600 !important;
  margin-left: 4px;
}
.nav-cta::after { content: " ↗"; font-weight: 400; }
.nav-cta:hover { background: rgba(255, 255, 255, 0.9); text-decoration: none; }

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Hero (immagine di sfondo + vetro) ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: 110px 0 90px;
  margin-top: -68px; /* la navbar sticky "galleggia" sopra l'immagine */
  padding-top: 180px;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(9, 9, 11, 0.55) 0%, rgba(9, 9, 11, 0.65) 55%, var(--bg-0) 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 28px;
}

.hero .badge .badge-label {
  background: rgba(255, 255, 255, 0.92);
  color: #171717;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  max-width: 900px;
  margin: 0 auto 24px;
  color: #fff;
}

.hero .sub {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.1rem;
  max-width: 620px;
  margin: 0 auto 40px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.btn-primary:hover { background: rgba(255, 255, 255, 0.16); }
.btn-primary::after { content: "→"; }

.btn-solid {
  background: #fff;
  color: #171717;
  font-weight: 600;
}
.btn-solid:hover { background: rgba(255, 255, 255, 0.9); }

.btn-ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
}
.btn-ghost:hover { color: #fff; }
.btn-ghost::before { content: "▶"; font-size: 0.7em; }

/* Riga "partner" nella hero */
.hero-partners { margin-top: 84px; }
.hero-partners .partners-title {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}
.partners-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}
.partners-row span {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 7px 18px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: color 0.15s ease, background 0.15s ease;
}
.partners-row span:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  margin-top: 64px;
  flex-wrap: wrap;
}

.stat .num {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  color: #fff;
  line-height: 1.1;
}
.stat .label { color: rgba(255, 255, 255, 0.65); font-size: 0.88rem; }

/* ---------- Sezioni ---------- */
section { padding: 80px 0; }

.section-head { text-align: center; margin-bottom: 52px; }
.section-head .kicker {
  color: var(--text-400);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}
.section-head h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 10px; color: var(--text-100); }
.section-head p { color: var(--text-300); max-width: 620px; margin: 14px auto 0; }

/* ---------- Card ---------- */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.card:hover { border-color: var(--border); background: var(--bg-card-hover); }

.card .icon { font-size: 1.6rem; margin-bottom: 14px; display: block; }
.card h3 { font-size: 1.05rem; margin-bottom: 10px; color: var(--text-100); }
.card p { color: var(--text-300); font-size: 0.93rem; }

/* ---------- Elenco moduli ---------- */
.module-list { display: flex; flex-direction: column; gap: 14px; }

.module-card {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.module-card:hover {
  border-color: var(--border);
  background: var(--bg-card-hover);
  text-decoration: none;
}

.module-num {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-100);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-info h3 { font-size: 1.12rem; margin-bottom: 6px; color: var(--text-100); }
.module-info p { color: var(--text-300); font-size: 0.93rem; }

.module-meta {
  margin-left: auto;
  flex-shrink: 0;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}

.duration {
  font-size: 0.82rem;
  color: var(--text-300);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.03);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.done-badge {
  font-size: 0.8rem;
  color: var(--text-100);
  font-weight: 600;
  display: none;
}
.module-card.completed .done-badge { display: inline; }
.module-card.completed .module-num {
  background: #fff;
  color: #171717;
  border-color: #fff;
}

/* ---------- Card strumenti ---------- */
.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 26px;
}

.tool-card .tool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.tool-card h3 { font-size: 1.08rem; color: var(--text-100); }
.tool-card h3 a { color: var(--text-100); }

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-200);
}
.tag-free { color: #a7f3d0; }
.tag-freemium { color: #c7d2fe; }
.tag-paid { color: #fbcfe8; }

.tool-card p { color: var(--text-300); font-size: 0.92rem; margin-bottom: 12px; }
.tool-card .best-for {
  font-size: 0.85rem;
  color: var(--text-200);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 8px 12px;
}
.tool-card .best-for strong { color: var(--text-100); }

/* ---------- Pagine lezione ---------- */
.lesson-header {
  padding: 60px 0 44px;
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(ellipse 70% 120% at 50% -20%, rgba(255, 255, 255, 0.06), transparent),
    var(--bg-soft);
}

.breadcrumb { font-size: 0.85rem; color: var(--text-400); margin-bottom: 18px; }
.breadcrumb a { color: var(--text-400); }
.breadcrumb a:hover { color: var(--text-200); }

.lesson-header .module-label {
  color: var(--text-400);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
}

.lesson-header h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin: 12px 0 16px; color: var(--text-100); }
.lesson-header .lesson-desc { color: var(--text-300); max-width: 720px; font-size: 1.05rem; }

.lesson-meta-row { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.lesson-body { padding: 50px 0 30px; }

.lesson-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}

.lesson-toc {
  position: sticky;
  top: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  font-size: 0.88rem;
}
.lesson-toc h4 {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--text-400);
  margin-bottom: 12px;
}
.lesson-toc ol { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.lesson-toc a { color: var(--text-300); display: block; }
.lesson-toc a:hover { color: var(--text-100); text-decoration: none; }

.lesson-content h2 {
  font-size: 1.9rem;
  margin: 52px 0 18px;
  padding-top: 12px;
  color: var(--text-100);
}
.lesson-content h2:first-child { margin-top: 0; }
.lesson-content h3 { font-size: 1.1rem; margin: 28px 0 12px; color: var(--text-100); }
.lesson-content p { margin-bottom: 16px; color: var(--text-200); }
.lesson-content ul, .lesson-content ol { margin: 0 0 16px 24px; color: var(--text-200); }
.lesson-content li { margin-bottom: 8px; }
.lesson-content strong { color: var(--text-100); }
.lesson-content a { color: var(--text-100); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.3); }

.time-chip {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-300);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin-left: 12px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* Box informativi */
.box {
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 22px 0;
  border: 1px solid var(--border-soft);
  background: var(--bg-card);
}
.box .box-title {
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-100);
}
.box p:last-child, .box ul:last-child, .box ol:last-child { margin-bottom: 0; }

.box-tip { border-left: 3px solid #6ee7b7; }
.box-warn { border-left: 3px solid #fda4af; }
.box-exercise { border-left: 3px solid #a5b4fc; }

/* Blocchi prompt */
.prompt-block {
  background: #0c0c0e;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
}
.prompt-block .prompt-label {
  background: rgba(255, 255, 255, 0.04);
  padding: 9px 18px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-300);
  border-bottom: 1px solid var(--border-soft);
}
.prompt-block pre {
  padding: 18px;
  overflow-x: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.87rem;
  line-height: 1.6;
  color: var(--text-200);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Tabelle */
.table-wrap { overflow-x: auto; margin: 22px 0; border-radius: var(--radius-lg); border: 1px solid var(--border-soft); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
th { background: rgba(255, 255, 255, 0.04); font-family: var(--font-sans); font-weight: 600; font-size: 0.84rem; color: var(--text-100); }
td { color: var(--text-300); }
tr:last-child td { border-bottom: none; }
td strong { color: var(--text-100); }

/* Checklist */
.checklist { list-style: none; margin-left: 0 !important; }
.checklist li { padding-left: 32px; position: relative; margin-bottom: 10px; }
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-100);
  font-weight: 600;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Navigazione tra lezioni */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 40px 0 70px;
  flex-wrap: wrap;
}
.lesson-nav a {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 16px 22px;
  color: var(--text-100);
  background: var(--bg-card);
  max-width: 47%;
  flex: 1;
}
.lesson-nav a:hover { border-color: var(--border); background: var(--bg-card-hover); text-decoration: none; }
.lesson-nav .dir { font-size: 0.74rem; color: var(--text-400); text-transform: uppercase; letter-spacing: 0.1em; }
.lesson-nav .title { font-weight: 600; margin-top: 4px; display: block; }
.lesson-nav .next { text-align: right; margin-left: auto; }

.complete-bar { text-align: center; padding: 10px 0 30px; }
.btn-complete {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-100);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(8px);
  transition: background 0.15s ease;
}
.btn-complete:hover { background: rgba(255, 255, 255, 0.12); }
.btn-complete.done { background: #fff; color: #171717; border-color: #fff; }

/* Barra progressi (home) */
.progress-wrap { max-width: 560px; margin: 0 auto 44px; text-align: center; }
.progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e4e4e7, #fff);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-label { font-size: 0.86rem; color: var(--text-300); margin-top: 10px; }

/* FAQ */
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  padding: 18px 24px;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-100);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--text-400); }
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 24px 18px; color: var(--text-300); }

/* Glossario */
.glossary-item { border-bottom: 1px solid var(--border-soft); padding: 18px 0; }
.glossary-item dt {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-100);
  margin-bottom: 6px;
}
.glossary-item dd { color: var(--text-300); margin-left: 0; }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
  margin-top: 40px;
}
footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-400);
  font-size: 0.88rem;
}
footer .foot-links { display: flex; gap: 20px; }
footer a { color: var(--text-400); }
footer a:hover { color: var(--text-100); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-toc { position: static; }
}

@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 16px;
    right: 16px;
    background: rgba(24, 24, 27, 0.92);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: 12px;
    align-items: stretch;
    text-align: center;
  }
  .nav-links.open { display: flex; }
  .nav-cta { margin-left: 0; margin-top: 6px; }

  .module-card { flex-direction: column; gap: 14px; }
  .module-meta { margin-left: 0; align-items: flex-start; text-align: left; flex-direction: row; }

  .lesson-nav a { max-width: 100%; }
  .hero { padding-top: 150px; padding-bottom: 70px; }
  .hero-stats { gap: 32px; }
  .hero-partners { margin-top: 60px; }
}
