:root {
  --carta: #eee9e1;            /* the paper of the page */
  --inchiostro: #141311;       /* the ink of the text */
  --grigio: #8c867d;           /* the secondary text */
  --chiaro: #cdd6b6;           /* light colour of the chosen walk (set by the script) */
  --scuro: #3c5535;            /* dark colour of the chosen walk (set by the script) */
  --condensato: 'Big Shoulders Variable', 'Arial Narrow', sans-serif;
  --serif: 'Newsreader Variable', Georgia, serif;
  --mono: 'JetBrains Mono Variable', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { background: var(--carta); color: var(--inchiostro); font-family: var(--serif); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.palco { position: relative; width: 100vw; height: 100vh; overflow: hidden; background: var(--carta); }

/* the page: the three walks */
.pagina { position: absolute; inset: 0; display: flex; flex-direction: column; padding: clamp(16px, 3.2vh, 30px) clamp(16px, 4vw, 56px); }
.pagina__tinta { position: absolute; inset: 0; background: var(--chiaro); opacity: 0; pointer-events: none; }
.pagina > *:not(.pagina__tinta) { position: relative; }
.testa { display: flex; justify-content: space-between; align-items: center; }
.marchio { display: inline-flex; align-items: center; gap: 8px; font-family: var(--condensato); font-weight: 700; font-size: clamp(15px, 2.4vh, 20px); letter-spacing: .04em; text-transform: uppercase; }
.marchio__segno { width: 18px; height: 18px; }
.etichetta { font-family: var(--mono); font-size: clamp(10px, 1.5vh, 12px); letter-spacing: .02em; color: var(--grigio); text-transform: uppercase; }

.apertura { margin-top: auto; padding-bottom: clamp(14px, 3.4vh, 34px); }
.etichetta--sopra { margin-bottom: clamp(8px, 1.6vh, 14px); }
.titolo { font-weight: 360; font-size: clamp(24px, min(5.4vw, 6.6vh), 62px); line-height: 1.02; letter-spacing: -.025em; }

.percorsi { list-style: none; }
.percorsi li { border-top: 1px solid rgba(20, 19, 17, .16); }
.percorsi li:last-child { border-bottom: 1px solid rgba(20, 19, 17, .16); }
.percorso { position: relative; width: 100%; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: clamp(10px, 2vw, 28px); padding: clamp(6px, 1.2vh, 12px) clamp(4px, .8vw, 10px); text-align: left; overflow: hidden; }
.percorso__colore { position: absolute; inset: 0; background: var(--tinta, #ccc); transform-origin: 0 50%; transform: scaleX(0); transition: transform .6s cubic-bezier(.645, .045, .355, 1); }
.percorso__nome, .percorso__dati, .percorso__freccia { position: relative; }
.percorso__nome { font-family: var(--condensato); font-weight: 560; font-size: clamp(30px, min(7.2vw, 9vh), 88px); line-height: .9; text-transform: uppercase; letter-spacing: .005em; transition: font-weight .5s cubic-bezier(.215, .61, .355, 1), color .5s, transform .6s cubic-bezier(.645, .045, .355, 1); }
.percorso__dati { font-family: var(--mono); font-size: clamp(10px, 1.5vh, 12px); color: var(--grigio); transition: color .5s; }
.percorso__freccia { width: clamp(18px, 2.4vw, 26px); height: 12px; transition: transform .6s cubic-bezier(.645, .045, .355, 1); }
.percorso.is-scelta .percorso__colore, .percorso.is-sopra .percorso__colore { transform: scaleX(1); }
.percorso.is-scelta .percorso__nome, .percorso.is-sopra .percorso__nome { font-weight: 820; color: var(--tinta-scura); transform: translateX(10px); }
.percorso.is-scelta .percorso__dati, .percorso.is-sopra .percorso__dati { color: var(--tinta-scura); }
.percorso.is-scelta .percorso__freccia, .percorso.is-sopra .percorso__freccia { transform: translateX(6px); color: var(--tinta-scura); }
.percorso:focus-visible { outline: 1.5px solid var(--inchiostro); outline-offset: -3px; }
@media (hover: hover) {
  .percorso:hover .percorso__colore { transform: scaleX(1); }
  .percorso:hover .percorso__nome { font-weight: 820; color: var(--tinta-scura); transform: translateX(10px); }
  .percorso:hover .percorso__dati { color: var(--tinta-scura); }
  .percorso:hover .percorso__freccia { transform: translateX(6px); color: var(--tinta-scura); }
}

/* the veil with its foggy tails, 200% tall above and below */
.velo { position: absolute; inset: 0; z-index: 3; background: var(--chiaro); visibility: hidden; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.velo::before, .velo::after { content: ''; position: absolute; left: 0; right: 0; height: 200%; }
.velo::before { bottom: 100%; background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--chiaro)); }
.velo::after { top: 100%; background: linear-gradient(to top, rgba(0, 0, 0, 0), var(--chiaro)); }
.velo__parola { position: relative; display: flex; color: var(--scuro); font-family: var(--condensato); font-weight: 800; line-height: .83; text-transform: uppercase; white-space: nowrap; overflow: hidden; padding: .04em .02em 0; }
.velo__lettera { display: block; }

/* the card of the walk */
.scheda { position: absolute; z-index: 4; top: 15px; right: 15px; max-height: calc(100% - 30px); width: min(646px, 35vw); min-width: 340px; background: var(--scuro); color: var(--carta); border-radius: 4px; padding: clamp(14px, 2.6vh, 26px) clamp(16px, 2vw, 28px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(20, 19, 17, .55), 0 2px 6px rgba(20, 19, 17, .12); visibility: hidden; }
.scheda__barra { display: flex; justify-content: space-between; align-items: center; }
.scheda__conta { font-family: var(--mono); font-size: 11px; opacity: .7; }
.scheda__tasti { display: flex; gap: 6px; }
.tondo { position: relative; width: 34px; height: 34px; display: grid; place-items: center; color: var(--scuro); }
.tondo__fondo { position: absolute; inset: 0; border-radius: 50%; background: var(--carta); transition: transform .5s cubic-bezier(.215, .61, .355, 1); }
.tondo__icona { position: relative; width: 15px; height: 15px; transition: transform .5s cubic-bezier(.215, .61, .355, 1); }
.tondo:focus-visible { outline: 1.5px solid var(--carta); outline-offset: 3px; border-radius: 50%; }
@media (hover: hover) {
  .tondo:hover .tondo__fondo { transform: scale(.85); }
  .tondo:hover [data-sposta="-1"] { transform: translateX(-5px); }
  .tondo:hover [data-sposta="1"] { transform: translateX(5px); }
  .tondo:hover [data-sposta="up"] { transform: translateY(-5px); }
  .tondo:hover [data-sposta="x"] { transform: rotate(90deg) scale(1.5); }
}
.tondo.is-premuto .tondo__fondo { transform: scale(.78); }
.copiato { position: absolute; top: calc(100% + 8px); right: -6px; white-space: nowrap; font-family: var(--mono); font-size: 10px; padding: 5px 9px; border-radius: 30px; background: var(--carta); color: var(--scuro); opacity: 0; pointer-events: none; }

.linea { position: absolute; background: currentColor; opacity: .35; }
.linea--o { left: 0; right: 0; height: 1px; top: calc(clamp(14px, 2.6vh, 26px) + 46px); transform-origin: 0 50%; }
.linea--v { width: 1px; top: calc(clamp(14px, 2.6vh, 26px) + 46px); bottom: 0; left: clamp(8px, 1vw, 14px); transform-origin: 50% 0; }

.scheda__corpo { margin-top: clamp(22px, 4.4vh, 46px); display: flex; flex-direction: column; min-height: 0; }
.scheda__tipo { font-family: var(--mono); font-size: 11px; opacity: .7; text-transform: uppercase; }
.scheda__nome { margin-top: 6px; font-family: var(--condensato); font-weight: 760; font-size: clamp(36px, min(5vw, 9vh), 84px); line-height: .86; text-transform: uppercase; }
.scheda__testo { margin-top: clamp(8px, 1.6vh, 16px); font-size: clamp(14px, min(1.3vw, 2.4vh), 19px); line-height: 1.32; letter-spacing: -.009em; max-width: 34ch; }
.scheda__mappa { margin-top: clamp(14px, 4vh, 44px); color: var(--chiaro); }
.scheda__mappa svg { display: block; width: 100%; height: clamp(54px, 16vh, 150px); }
.mappa__strada { stroke-dasharray: 1; stroke-dashoffset: 1; }
.mappa__tacca { stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; }
.mappa__nome { font-family: var(--mono); font-size: 8.5px; fill: currentColor; }
.scheda__tappe { list-style: none; margin-top: clamp(8px, 1.6vh, 16px); }
.tappa { position: relative; display: flex; justify-content: space-between; align-items: baseline; padding: clamp(5px, 1vh, 9px) 0; font-size: clamp(13px, min(1.1vw, 2.1vh), 16px); }
.tappa__riga { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: currentColor; opacity: .28; transform-origin: 0 50%; }
.tappa__ora { font-family: var(--mono); font-size: 11px; opacity: .7; }

.solo-lettore { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 700px) {
  .percorso { grid-template-columns: 1fr auto; }
  .percorso__dati { display: none; }
  .scheda { top: 10px; right: 10px; left: 10px; bottom: 10px; width: auto; min-width: 0; }
  .scheda__testo { max-width: none; }
}
@media (max-height: 520px) {
  .scheda__tappe .tappa:nth-child(n+4) { display: none; }
}
