@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo-latin-wdth-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('fonts/atkinson-hyperlegible-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Atkinson';
  src: url('fonts/atkinson-hyperlegible-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --piastrella: #f6f7f4;   /* bianco piastrella del bar */
  --caffe: #2a1b14;        /* testo */
  --verde: #0e4a3a;        /* bancone */
  --feltro: #143a30;       /* listino in feltro */
  --crema: #e0a93b;        /* crema dell'espresso */
  --zucchero: #b3261e;     /* errori */
  --grigio: #5b605a;
  --carta: #fffdf8;        /* scontrino */
  --bordo: #d9ddd6;
  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --testo: 'Atkinson', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Courier New', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--piastrella);
  color: var(--caffe);
  font: 400 1.125rem/1.55 var(--testo);
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--verde); text-underline-offset: 0.15em; }
:focus-visible { outline: 3px solid var(--crema); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.colonna { width: min(100% - 2rem, 40rem); margin-inline: auto; }

/* Titoli: larghi e pesanti, come le insegne dei bar */
h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.3rem, 8.5vw, 4.25rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

/* Barra in alto */
.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem;
}
.marchio {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font: 800 1.15rem/1 var(--display); font-stretch: 125%;
  color: var(--caffe); text-decoration: none;
}
.marchio svg { width: 2rem; }

/* Bottoni */
.bottone {
  display: inline-block;
  font: 700 1.1rem/1.2 var(--testo);
  background: var(--crema); color: var(--caffe);
  border: 2px solid var(--caffe); border-radius: 999px;
  padding: 0.85rem 1.5rem;
  text-decoration: none; text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--caffe);
  transition: transform 0.08s, box-shadow 0.08s;
}
.bottone:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--caffe); }
.bottone:disabled, .bottone[aria-disabled='true'] { opacity: 0.45; cursor: not-allowed; }
.bottone.secondario { background: var(--carta); }

/* Home */
.eroe { padding-block: 1.5rem 3rem; }
.eroe .nota { color: var(--grigio); font-size: 1rem; margin-top: 1rem; }
.eroe .moka-grande { width: 5.5rem; margin-bottom: 1.25rem; }

/* Il listino: la lavagna di feltro con le lettere bianche */
.listino {
  background-color: var(--feltro);
  background-image: repeating-linear-gradient(to bottom, transparent 0 9px, rgb(0 0 0 / 0.22) 9px 10px);
  color: #fff;
  border: 10px solid #6b4a2f;
  border-radius: 6px;
  padding: 1.5rem 1.1rem;
  font-family: var(--display);
  font-stretch: 100%;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.listino h2 { text-align: center; font-size: 1.6rem; letter-spacing: 0.12em; color: #fff; }
.listino ol { list-style: none; margin: 0; padding: 0; }
.listino a {
  display: flex; align-items: baseline; gap: 0.5rem;
  color: #fff; text-decoration: none;
  padding: 0.55rem 0; font-weight: 600; font-size: 0.98rem; line-height: 1.25;
}
.listino a:hover .voce { text-decoration: underline; }
.listino .puntini { flex: 1; border-bottom: 2px dotted rgb(255 255 255 / 0.5); min-width: 1rem; }
.listino .prezzo { white-space: nowrap; color: var(--crema); }
.listino .fatta .prezzo::before { content: '✓ '; }
.listino .totale span:last-child { white-space: nowrap; }
.listino .totale { margin-top: 1rem; padding-top: 0.9rem; border-top: 2px solid rgb(255 255 255 / 0.4); display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }

.sezione { padding-block: 3rem 0; }
.passi { padding-left: 1.4rem; }
.passi li { margin-bottom: 0.75rem; }
.passi li::marker { font: 800 1.1rem var(--display); color: var(--verde); }
details { border-top: 1px solid var(--bordo); padding-block: 0.9rem; }
details:last-of-type { border-bottom: 1px solid var(--bordo); }
summary { font-weight: 700; cursor: pointer; }
details p { margin: 0.6rem 0 0; }

.piede { padding-block: 3rem 2.5rem; color: var(--grigio); font-size: 0.95rem; }
.piede a { color: var(--grigio); margin-right: 1rem; }

/* Lettore delle lezioni */
.testa-lezione .numero { color: var(--grigio); margin-bottom: 0.4rem; font-size: 1rem; }
.testa-lezione h1 { font-size: clamp(1.8rem, 6.5vw, 2.6rem); }
.chicchi { display: flex; gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1.5rem; flex-wrap: wrap; }
.chicchi li {
  width: 0.9rem; height: 1.2rem; border-radius: 50%;
  border: 2px solid var(--caffe); background: transparent;
  transform: rotate(25deg);
}
.chicchi li.fatto { background: var(--caffe); }
.chicchi li.ora { background: var(--crema); }
.scheda { min-height: 50vh; outline: none; }
.scheda .moka { width: 3rem; margin-bottom: 0.75rem; }
.evidenza {
  background: var(--verde); color: #fff;
  border-radius: 14px; padding: 1rem 1.15rem;
  font-weight: 700;
}
.istruzioni { color: var(--grigio); }
.nav { padding-block: 1.5rem 3rem; display: flex; justify-content: flex-end; }

/* Opzioni toccabili: quiz ed esperimenti */
.opzione {
  display: block; width: 100%;
  text-align: left; font: 400 1.05rem/1.4 var(--testo); color: var(--caffe);
  background: #fff; border: 2px solid var(--bordo); border-radius: 12px;
  padding: 0.8rem 1rem; margin-bottom: 0.6rem; cursor: pointer;
}
.opzione:hover:not(:disabled) { border-color: var(--caffe); }
.opzione:disabled { cursor: default; }
.opzione.giusta { border-color: var(--verde); background: #e3efe9; }
.opzione.sbagliata { border-color: var(--zucchero); background: #f8e5e3; }
.opzione.vera { opacity: 0.55; text-decoration: line-through; }
.opzione[aria-pressed='true'] { border-color: var(--caffe); background: var(--crema); }
.gruppo { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.gruppo .opzione { width: auto; margin: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
legend { font-weight: 700; margin-bottom: 0.6rem; padding: 0; }
.esito { min-height: 1.5em; font-size: 1rem; }

.frase { font-size: 1.35rem; font-weight: 700; }
.buco { color: var(--verde); border-bottom: 3px solid var(--crema); padding-inline: 0.2rem; }
.barra-p { display: flex; justify-content: space-between; gap: 1rem; background-image: linear-gradient(to right, #f3dfb4 var(--p, 0%), transparent var(--p, 0%)); }
.barra-p.scelta { border-color: var(--caffe); }

.esempio legend { font-weight: 400; }
.previsioni { list-style: none; padding: 0; }
.previsioni li { background: #fff; border: 2px solid var(--bordo); border-radius: 12px; padding: 0.8rem 1rem; margin-bottom: 0.6rem; }
.previsioni strong { display: block; }
.previsioni .errata { border-color: var(--zucchero); }

.prompt, .risposta { white-space: pre-line; border-radius: 12px; padding: 0.9rem 1rem; font-size: 1rem; }
.prompt { background: #fff; border: 2px dashed var(--caffe); }
.risposta { background: #fff; border: 2px solid var(--bordo); }
.etichetta-campo { font-weight: 700; margin: 1rem 0 0.4rem; }

.registro { padding-left: 1.4rem; }
.registro li { margin-bottom: 0.4rem; }
.registro .bloccato { color: var(--zucchero); font-weight: 700; }

.chicco { font-family: var(--display); font-stretch: 112%; font-weight: 700; font-size: 1.4rem; line-height: 1.25; }
.azioni { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; margin-top: 1.5rem; }

/* La cassa: lo scontrino */
.scontrino {
  background: var(--carta); font-family: var(--mono); font-size: 1rem; line-height: 1.5;
  padding: 1.5rem 1.25rem 2rem; margin-block: 1rem 2rem;
  box-shadow: 0 2px 10px rgb(42 27 20 / 0.12);
  --dente: 10px;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--dente)) 100%;
}
.scontrino .centro { text-align: center; }
.scontrino .riga { display: flex; justify-content: space-between; gap: 1rem; }
.scontrino hr { border: 0; border-top: 2px dashed var(--caffe); margin: 0.8rem 0; }
.scontrino .grande { font-weight: 700; font-size: 1.2rem; }
.consenso { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.95rem; margin-bottom: 1rem; }
.consenso input { width: 1.3rem; height: 1.3rem; flex: none; margin-top: 0.15rem; accent-color: var(--verde); }
.form-chiave { margin-top: 2rem; }
.form-chiave input, .campo {
  display: block; width: 100%;
  font: 400 1.05rem var(--testo); padding: 0.75rem 0.9rem;
  border: 2px solid var(--caffe); border-radius: 10px; background: #fff; margin-bottom: 0.75rem;
}
.form-chiave label { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.errore { color: var(--zucchero); font-weight: 700; }

.tela { width: 100%; height: auto; border-radius: 12px; margin-block: 1rem; }

/* Pagine legali */
.legale h2 { font-size: 1.3rem; margin-top: 2rem; }
.legale .bozza { background: #f8e5e3; border: 2px solid var(--zucchero); border-radius: 12px; padding: 0.9rem 1rem; }

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