/* The floor plan that assembles as you scroll. Colours in :root (the Playground palette). */
:root {
  --carta: #f3f2ec;
  --inchiostro: #282828;
  --grigio: #b3b3af;
  --tenue: #72726f;
  --linea: #8c8b86;
  --fantasma: #d3d2cb;
  --accento: #f15534;
  --scheda: #282828;
  --scheda-testo: #f3f2ec;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--carta); }
body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.corsa { position: relative; height: 400vh; }
.palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100lvh;
  max-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(6px, 1.6vh, 16px);
  padding: clamp(12px, 3.2vh, 32px) clamp(14px, 3vw, 40px);
  overflow: hidden;
}
/* the paper grain, a tiny tile of noise drawn in SVG */
.grana {
  position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .44 0 0 0 0 .4 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.mono, .testa, .piede, .scheda, .quota-testo { font-family: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, monospace; }

.testa { position: relative; display: flex; justify-content: space-between; align-items: center; font-size: clamp(9px, 1.5vh, 12px); letter-spacing: .06em; text-transform: uppercase; }
.marchio { display: flex; align-items: center; gap: 7px; font-weight: 600; }
.marchio svg { width: 1.6em; height: 1.6em; fill: none; stroke: var(--inchiostro); stroke-width: 1.6; stroke-linejoin: round; }
.conto { display: flex; align-items: center; gap: 10px; color: var(--tenue); }
.conto__cifra {
  position: relative; display: inline-block; height: 1.7em; width: 1.9em; overflow: hidden;
  border: 1px solid var(--grigio); color: var(--inchiostro); text-align: center; line-height: 1.7em; font-weight: 600;
  transition: border-color .3s, color .3s;
}
.conto__cifra.ha { border-color: var(--accento); color: var(--accento); }
.conto__rullo { display: flex; flex-direction: column; }
.conto__rullo span { display: block; height: 1.7em; }

.tavola { position: relative; display: grid; place-items: center; min-height: 0; }
.pianta {
  position: relative;
  width: 300px;   /* set in script.js: the biggest 4:3 box that fits the room left between header and footer */
  height: 225px;
}
.disegno { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.guida line { stroke: var(--fantasma); stroke-width: .5; stroke-dasharray: 2 3; }
.fantasma rect { fill: none; stroke: var(--grigio); stroke-width: .8; }
.muri rect { fill: var(--inchiostro); transform-box: fill-box; transform-origin: 50% 50%; }
.porte path { fill: none; stroke: var(--tenue); stroke-width: .8; }
.porte .anta { stroke: var(--inchiostro); stroke-width: 1.4; }
.finestra rect { fill: var(--carta); stroke: var(--inchiostro); stroke-width: .9; }
.arredi * { fill: none; stroke: var(--linea); stroke-width: .9; transform-box: fill-box; transform-origin: 50% 50%; }
.arredi .scala { stroke: var(--tenue); }
.quote line, .quote path { stroke: var(--tenue); stroke-width: .7; fill: none; }
.quote .quota { transform-box: fill-box; transform-origin: 50% 50%; }
.quota-testo { fill: var(--tenue); stroke: none; font-size: 8.5px; letter-spacing: .04em; }
.segni .segno { transform-box: fill-box; transform-origin: 50% 50%; }
.segni .quadro { fill: var(--accento); }
.segni .cuore { fill: var(--carta); }
.segni .eco { fill: none; stroke: var(--accento); stroke-width: 1; }
.segni .guida-scheda { fill: none; stroke: var(--accento); stroke-width: .9; }

.schede { position: absolute; inset: 0; pointer-events: none; }
.scheda {
  position: absolute;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: 46%;
  padding: .55em .7em .6em;
  background: var(--scheda);
  color: var(--scheda-testo);
  font-size: clamp(8px, 1.45vh, 11.5px);
  line-height: 1.3;
  box-shadow: 0 10px 24px -14px rgba(40, 40, 40, .55);
  opacity: 0;
  visibility: hidden;
}
.etichetta {
  position: absolute;
  padding: .25em .5em;
  background: var(--carta);
  border: 1px solid var(--accento);
  color: var(--accento);
  font-family: 'JetBrains Mono Variable', 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(7.5px, 1.25vh, 10px);
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
}
.scheda__tag { color: var(--accento); text-transform: uppercase; letter-spacing: .08em; font-size: .86em; }
.scheda__testo { font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif; font-weight: 560; font-size: 1.12em; }
.scheda__fix { color: #b8b7b0; }

.frasi { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.frase {
  grid-area: 1 / 1;
  font-size: clamp(28px, min(8.4vw, 9.5vh), 96px);
  font-weight: 560;
  font-stretch: 112%;
  letter-spacing: -.035em;
  line-height: .95;
  text-align: center;
  max-width: 11ch;
  text-transform: uppercase;
}

.piede { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-size: clamp(9px, 1.45vh, 11.5px); }
.stato {
  display: flex; align-items: stretch; background: var(--scheda); color: var(--scheda-testo);
  min-width: min(62vw, 300px);
}
.stato__tag { padding: .7em .8em; background: var(--accento); color: #fff; text-transform: uppercase; letter-spacing: .08em; }
.stato__righe { position: relative; flex: 1; overflow: hidden; }
.stato__righe span { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 .9em; white-space: nowrap; opacity: 0; }
.piede__lato { color: var(--tenue); text-transform: uppercase; letter-spacing: .06em; text-align: right; }

@media (max-width: 520px) {
  .piede__lato { display: none; }
  .stato { min-width: 0; flex: 1; }
  .scheda { max-width: 54%; }
}
