/* Le regole sono quelle dell'invito: contrasti di scala, due assi a sinistra, niente centrature né maiuscole, solo nero. */

@font-face { font-family: 'Baskervville'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/baskervville.woff2) format('woff2') }
@font-face { font-family: 'Baskervville'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/baskervville-italic.woff2) format('woff2') }
@font-face { font-family: 'Cabin'; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/cabin.woff2) format('woff2') }

:root {
  color-scheme: light;
  --carta: #F7F3EA;
  --nero: #000;
  --margine: clamp(24px, 5vw, 72px);
  --rientro: 16%;
  --pausa: clamp(112px, 18vw, 220px);
}

* { box-sizing: border-box; margin: 0 }
html { -webkit-text-size-adjust: 100% }
body {
  background: var(--carta);
  color: var(--nero);
  font: 400 19px/1.42 'Baskervville', Georgia, serif;
  font-variant-numeric: lining-nums;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
em { font-style: italic }

.pagina { max-width: 1240px; margin-inline: auto; padding-inline: var(--margine) }
.rientro { margin-left: var(--rientro) }
[hidden] { display: none !important }

/* Scala: due misure, molto distanti */
h1, h2 { font-weight: 400 }
h1 { font-size: clamp(60px, 16.4vw, 196px); line-height: 1; letter-spacing: -.012em }
h2 { font-size: clamp(48px, 12.6vw, 96px); line-height: 1.03; letter-spacing: -.01em }

.testo { max-width: 31em }
.testo p + p { margin-top: .75em }
.dato, .etichetta, .colophon { font: 400 14px/1.4 'Cabin', sans-serif; letter-spacing: .02em }
.etichetta { display: block }

/* Apertura: come l'interno del libretto */
.sottotitolo { margin-top: 20px; font-style: italic; font-size: clamp(26px, 6.6vw, 48px); line-height: 1.15 }
.apertura {
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  padding-block: clamp(28px, 5vw, 64px);
}
.apertura .testo { margin-top: auto; padding-top: 64px }
.firma { margin-top: 44px }
.firma .dato { display: block; margin-top: 2px }

/* Il viaggio */
.viaggio { padding-top: calc(var(--pausa) / 2) }
.panorama { margin-top: 64px }

/* Mappe: una costa sottile e pochi punti */
.mappa { display: block; width: 100%; height: auto; overflow: hidden }
.costa, .rotta, .filo { fill: none; stroke: var(--nero); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke }
.costa { stroke-width: .6 }
.rotta { stroke-width: 1.15 }
.filo { stroke-width: .5 }
.mappa circle { fill: var(--nero) }
.mappa text { paint-order: stroke; stroke: var(--carta); stroke-width: 4px; stroke-linejoin: round; fill: var(--nero) }
.luogo { font: 400 var(--corpo, 15px) 'Cabin', sans-serif }
.luogo .data { font-size: .84em }
.mappa a:hover .luogo, .mappa a:focus .luogo { text-decoration: underline }
.panorama-largo { display: none }

/* Le tappe */
.tappe { padding-top: var(--pausa) }
.tappa { scroll-margin-top: 40px }
.tappa + .tappa { margin-top: var(--pausa) }
.intestazione .dato { margin-bottom: 10px }
.momento { font-style: italic; font-size: clamp(23px, 5.8vw, 30px); line-height: 1.22; margin-top: 12px; max-width: 15em }
.corpo { margin-top: 32px }
.racconto { max-width: 31em }
.corpo .mappa { margin-top: 32px }

/* Il gesto: lo stesso punto delle mappe, vuoto o pieno */
.scelta {
  display: flex; align-items: center; gap: 12px;
  min-height: 48px; margin-top: 12px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
  font: italic 400 21px/1.2 'Baskervville', serif; text-align: left;
}
.scelta::before, .voce span::before {
  content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%;
  border: 1.15px solid var(--nero); background: transparent;
  transition: background-color .15s;
}
.scelta:hover::before, .scelta[aria-pressed="true"]::before { background: var(--nero) }

/* Dove vorreste esserci */
.scegli { padding-block: var(--pausa); scroll-margin-top: 0 }
#modulo, #grazie { margin-top: 44px; max-width: 34em }
#grazie { outline: none }
.grazie-testo { font-size: clamp(26px, 6.4vw, 36px); line-height: 1.18; margin-bottom: 20px }
#modulo .etichetta { margin-top: 36px }
#nome {
  display: block; width: 100%; margin-top: 4px; padding: 8px 0;
  background: none; border: 0; border-bottom: .6px solid var(--nero); border-radius: 0;
  color: inherit; font: inherit; font-size: 21px; line-height: 1.35;
  appearance: none;
}
#nome:focus, #nome[aria-invalid="true"] { outline: none; box-shadow: 0 1px 0 var(--nero) }
.errore { margin-top: 6px; font: italic 17px/1.3 'Baskervville', serif }
fieldset { border: 0; padding: 0; margin-top: 36px; scroll-margin-top: 40px }
legend { padding: 0; margin-bottom: 4px }
.voce { display: block; position: relative; cursor: pointer }
.voce input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer }
.voce span { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 21px }
.voce input:checked + span::before, .voce:hover span::before { background: var(--nero) }
.voce input:focus-visible + span { text-decoration: underline; text-underline-offset: 4px }
.invia {
  display: inline-block; min-height: 48px; margin-top: 28px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
  font: italic 400 26px/1.2 'Baskervville', serif;
  text-decoration: underline; text-decoration-thickness: .6px; text-underline-offset: 6px;
}
.invia:hover { text-decoration-thickness: 1.5px }
.invia:disabled { cursor: default; text-decoration: none }
button:focus-visible, a:focus-visible { outline: 1px solid var(--nero); outline-offset: 4px }

/* Il contributo: stessa carta, separato da una linea */
.contributo .pagina { padding-top: 0 }
.contributo .pagina > h2 { padding-top: 48px; border-top: .6px solid var(--nero) }
.contributo .rientro { margin-top: 44px }
dl { margin-block: 36px; max-width: 34em }
dl div + div { margin-top: 20px }
dd { margin: 2px 0 0 }
#iban { display: block; font: 400 17px/1.4 'Cabin', sans-serif; letter-spacing: .03em }
.copia {
  display: inline-block; min-height: 44px; min-width: 44px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
  font: italic 400 19px 'Baskervville', serif;
  text-decoration: underline; text-decoration-thickness: .6px; text-underline-offset: 4px;
}

/* La chiusura */
.chiusura { padding-top: var(--pausa); padding-bottom: clamp(28px, 5vw, 64px) }
.chiusura h2 { font-size: clamp(60px, 16.4vw, 196px); line-height: 1 }
.chiusura .firma { margin-top: 20px }
.monogramma { display: block; width: 112px; height: auto; margin-top: 56px }
.monogramma g { fill: none; stroke: var(--nero); stroke-width: 25; stroke-linecap: round; stroke-linejoin: round }
.colophon { margin-top: 112px; font-size: 12px }

/* Da tablet in su: i due assi diventano due colonne */
@media (min-width: 860px) {
  body { font-size: 21px }
  :root { --rientro: 41% }
  .dato, .etichetta { font-size: 15px }
  .panorama { margin-top: 96px }
  .panorama-largo { display: block }
  .panorama-stretto { display: none }

  .tappa { display: grid; grid-template-columns: 41% minmax(0, 560px) }
  .tappa h2 { font-size: clamp(56px, 6.2vw, 84px) }
  .corpo { margin-top: 0 }
  .corpo .rientro { margin-left: 0 }
  .intestazione .dato { margin-bottom: 14px }
  .momento { padding-right: 32px }
}
