/*
 * Il sito di Motivetto. Gli stessi colori dell'app: fondo scuro, ambra per
 * l'accento, un colore per ruolo. Sulla carta (il PDF del manuale) si passa a
 * fondo bianco: l'inchiostro su nero non si legge e non si stampa.
 */
:root {
  --bg: #0f0f11;
  --surface: #1a1a1e;
  --surface-high: #26262c;
  --text: #ededf0;
  --text-dim: #a0a0aa;
  --accent: #e8a33d;
  --drums: #ec6a45;
  --bass: #4d9de0;
  --chords: #6bbf8a;
  --guide: #b47dd8;
  --width: 46rem;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 Inter, -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;
}

a {
  color: var(--accent);
}

.top {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem max(1rem, calc((100vw - var(--width)) / 2));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-high);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.95rem;
}

.top nav a {
  color: var(--text-dim);
  text-decoration: none;
}

.top nav a[aria-current='page'] {
  color: var(--text);
  font-weight: 600;
}

.top nav .lang {
  padding: 0 0.6rem;
  border-radius: 999px;
  background: var(--surface-high);
}

main {
  max-width: var(--width);
  margin: 0 auto;
  padding: 1rem 1rem 4rem;
}

h1,
h2,
h3,
h4 {
  line-height: 1.25;
}

h1 {
  font-size: 2.2rem;
  margin: 1.5rem 0 0.5rem;
}

h2 {
  font-size: 1.5rem;
  margin: 3rem 0 1rem;
}

h3 {
  font-size: 1.15rem;
  margin: 2rem 0 0.25rem;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-dim);
}

.hero {
  padding: 1.5rem 0 1rem;
}

.button {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.button.quiet {
  background: var(--surface-high);
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

/*
 * Le icone dell'app (`icons.tsx`, disegnate da React alla build): tratto 2,
 * estremità tonde, `currentColor`. Prendono il colore del testo accanto.
 */
.icon {
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
}

/* Il giro: registri → trascrive → arrangi → esporti. Pillole come i
   pulsanti dell'app, con la sua icona. */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.flow li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.95rem;
}

.flow .icon {
  color: var(--accent);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.card {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.card > .icon {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* La storia: una linea del tempo. */
.timeline {
  margin: 1rem 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--surface-high);
}

.timeline > li {
  position: relative;
  margin: 0 0 2rem;
  padding-left: 1.5rem;
}

.timeline > li::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 0.45rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline .when {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.timeline h3 {
  margin: 0.15rem 0 0.4rem;
}

.timeline p,
.timeline ul {
  margin: 0.4rem 0;
}

.numbers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.numbers div {
  padding: 1rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.numbers strong {
  display: block;
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}

.numbers span {
  color: var(--text-dim);
  font-size: 0.9rem;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--accent);
  color: var(--text-dim);
}

/* Il manuale. */
.toc {
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.toc > ol {
  margin: 0;
  padding-left: 1.2rem;
  columns: 2 16rem;
  column-gap: 2rem;
}

.toc > ol > li {
  break-inside: avoid;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.toc ol ol {
  padding-left: 1rem;
  font-weight: 400;
  font-size: 0.92rem;
}

.toc a {
  color: var(--text);
  text-decoration: none;
}

.chapter > h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent);
}

.chapter > h2 .icon {
  color: var(--accent);
}

.cover-meta {
  color: var(--text-dim);
  font-size: 0.9em;
}

.topic .intro {
  margin: 0.25rem 0 0.5rem;
  color: var(--text-dim);
}

/* I passi come nella guida dell'app: un riquadro ciascuno, il numero nel
   cerchietto, il titolo in grassetto e sotto la spiegazione. */
.steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}

.steps li {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: var(--surface);
}

.steps .n {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--surface-high);
  font-size: 0.8em;
  font-variant-numeric: tabular-nums;
}

.steps strong {
  display: block;
}

.steps li > span:last-child {
  color: var(--text-dim);
}

.steps li strong {
  color: var(--text);
}

.tips {
  margin: 0.75rem 0 0;
  padding: 0.6rem 0.9rem;
  border-radius: 0.5rem;
  background: var(--surface);
  font-size: 0.95em;
}

.tips h4 {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.8em;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tips p {
  margin: 0.25rem 0;
}

.bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  padding: 2rem 1rem;
  border-top: 1px solid var(--surface-high);
  color: var(--text-dim);
  font-size: 0.9rem;
}

@media (max-width: 520px) {
  body {
    font-size: 16px;
  }
  h1 {
    font-size: 1.8rem;
  }
}

/* ── La carta ─────────────────────────────────────────────────────────── */
@page {
  size: A4;
  margin: 18mm 16mm 20mm;
}

@media print {
  :root {
    --bg: #fff;
    --surface: #f4f3f0;
    --surface-high: #e2e0db;
    --text: #1a1a1e;
    --text-dim: #55555e;
    --accent: #a8650a;
    color-scheme: light;
  }

  body {
    font-size: 10.5pt;
    line-height: 1.5;
  }

  .top,
  .bottom,
  .no-print {
    display: none;
  }

  main {
    max-width: none;
    padding: 0;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  /* La copertina da sola, l'indice sulla pagina dopo. */
  .manual-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 230mm;
    padding: 0;
    break-after: page;
  }

  .manual-hero .lead {
    font-size: 13pt;
  }

  .cover-meta {
    margin-top: 2rem;
  }

  .manual-hero h1 {
    font-size: 28pt;
  }

  .toc {
    break-after: page;
    background: none;
    padding: 0;
  }

  /* Tutto l'indice su una pagina: tre colonne strette invece di due. */
  .toc > ol {
    columns: 3;
    column-gap: 8mm;
    font-size: 9pt;
  }

  .chapter {
    break-before: page;
  }

  .chapter > h2 {
    margin-top: 0;
  }

  /* Un argomento lungo può continuare nella pagina dopo, ma il titolo resta
     attaccato all'inizio, e un passo non si spezza mai. */
  .topic .intro {
    break-after: avoid;
  }

  h3 {
    break-after: avoid;
  }

  .tips {
    border: 1px solid var(--surface-high);
  }

  /* Sulla carta i passi stanno più stretti: un riquadro pieno per ognuno
     raddoppierebbe le pagine. */
  .steps {
    gap: 0.25rem;
  }

  .steps li {
    padding: 0.35rem 0.5rem;
    break-inside: avoid;
  }

  .steps strong {
    display: inline;
  }

  .steps strong::after {
    content: '. ';
  }
}

/*
 * Le schermate dell'app (`scripts/site-shots.mjs`): quelle in orizzontale
 * larghe, due per riga quando c'è posto; quelle in verticale in fila, come
 * telefoni appoggiati uno accanto all'altro.
 */
.shots {
  display: grid;
  gap: 1rem;
  margin: 1rem 0;
}

.shots.wide {
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

.shots.tall {
  /* Una fila sola: sul computer ci stanno tutte, sul telefono scorre di lato. */
  grid-auto-flow: column;
  grid-auto-columns: minmax(7.5rem, 1fr);
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.shot {
  margin: 0;
}

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--surface-high);
  border-radius: 0.75rem;
}

.shot figcaption {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
