/* Lucore — lucore.slemball.com
   Colours, type and spacing come from slemball.com (src/lib/palette.ts, tipografia.ts, spazio.ts):
   paper and ink for the page, Fraunces for what is said, Inter for what is explained, JetBrains Mono
   for labels. Lucore adds its five lights and the dark of a desk at night, where a screen or a light
   is shown. The lights are colours of state, never of text on paper: amber on paper reads at about 2:1.

   Two ways to be seen. Without the class .movimento (no JavaScript, reduced motion, a weak device)
   every act is a still, complete page. With it, the acts become stages that stay while you scroll
   (position: sticky) and assets/lucore.js moves what is on them. The class is decided once, by the
   line in the head of index.html, before the first paint: nothing here asks prefers-reduced-motion
   again, so CSS and script never disagree. Narrow means up to 899px, everywhere. */

@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* the current light, interpolated when it changes */
@property --luce {
  syntax: "<color>";
  inherits: true;
  initial-value: #e69f00;
}

:root {
  color-scheme: light;

  /* paper and ink, from slemball.com */
  --carta: #f7f5f1;
  --carta-chiara: #fbfaf8;
  --carta-scura: #eceae6;
  --filo: #dcdad6;
  --inchiostro: #14120f;
  --attenuato: #585653;
  --ombra: #7a162e;

  /* the night: the widget's own background (codice/widget.py, C["sfondo"]) and the desk around it */
  --notte: #0b0c0f;
  --buio: #101114;
  --buio-alto: #181a1f;
  --buio-filo: #30343b;
  --buio-testo: #ecf0f4;
  --buio-fioco: #8b949e;
  --buio-spento: #24272d;

  /* the five lights (codice/icona.py, docs/18 §7): Okabe and Ito */
  --lavora: #56b4e9;
  --aspetta: #e69f00;
  --finito: #009e73;
  --errore: #d55e00;
  --quiete: #8b949e;
  --luce: #e69f00;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --margine: clamp(16px, 5vw, 72px);
  --sezione: clamp(88px, 13vh, 152px);
  --pagina: 72rem;
  --testo: 40rem;
  --testata: 60px;

  --r-chip: 6px;
  --r-scheda: 12px;
  --r-schermo: 18px;
  --ombra-scheda: 0 12px 26px -18px color-mix(in srgb, var(--ombra) 50%, transparent);
  --ombra-pannello: 0 30px 70px -34px color-mix(in srgb, var(--ombra) 48%, transparent);

  --e-posa: cubic-bezier(0.32, 0, 0.06, 1);
  --e-stato: cubic-bezier(0.4, 0, 0.2, 1);

  transition: --luce 700ms var(--e-stato);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--notte);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--testata);
}

body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  letter-spacing: -0.006em;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

[hidden] {
  display: none !important;
}

.salta {
  position: absolute;
  left: var(--margine);
  top: 8px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--inchiostro);
  color: var(--carta);
  border-radius: var(--r-chip);
  transform: translateY(-150%);
  transition: transform 160ms var(--e-stato);
}
.salta:focus {
  transform: none;
}

.contenitore {
  width: 100%;
  max-width: calc(var(--pagina) + 2 * var(--margine));
  margin: 0 auto;
  padding: 0 var(--margine);
}

.carta {
  background: var(--carta);
  color: var(--inchiostro);
}
.buio {
  background: var(--notte);
  color: var(--buio-testo);
}

/* ------------------------------------------------------------------ the light dot
   The dot of codice/icona.py: the colour inside, a rim a quarter darker, or a grey ring when there is
   nothing to say. Its glow breathes: 4.2 s for every light, the double beat for "needs you"
   (docs/18 §7). The 3D light follows the same two curves. */

.punto {
  --c: var(--luce);
  position: relative;
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0 84%, color-mix(in srgb, var(--c) 75%, black) 86% 100%);
  vertical-align: middle;
}
.punto::after {
  content: "";
  position: absolute;
  inset: -60%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 55%, transparent) 0, transparent 66%);
  opacity: 0.8;
  pointer-events: none;
}
.punto[data-stato="lavora"] { --c: var(--lavora); }
.punto[data-stato="aspetta"] { --c: var(--aspetta); }
.punto[data-stato="finito"] { --c: var(--finito); }
.punto[data-stato="errore"] { --c: var(--errore); }
.punto[data-stato="quiete"] {
  background: transparent;
  box-shadow: inset 0 0 0 0.16em var(--quiete);
}
.punto[data-stato="quiete"]::after {
  display: none;
}

@keyframes respira {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1.04); }
}
@keyframes battito {
  0%, 8% { opacity: 0.45; transform: scale(0.94); }
  15% { opacity: 1; transform: scale(1.06); }
  23% { opacity: 0.6; transform: scale(0.97); }
  33% { opacity: 0.92; transform: scale(1.03); }
  44%, 100% { opacity: 0.45; transform: scale(0.94); }
}
.movimento .punto::after {
  animation: respira 4.2s ease-in-out infinite;
}
.movimento .punto[data-stato="aspetta"]::after {
  animation: battito 2.6s linear infinite;
}

/* ------------------------------------------------------------------ the word mark
   "lucore" in lowercase, Inter 800 like a product name on slemball.com, with the o as the light. */

.marchio {
  display: inline-flex;
  align-items: baseline;
  margin: 0;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
  color: var(--inchiostro);
  text-decoration: none;
  white-space: nowrap;
}
.marchio .o {
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin: 0 0.035em 0 0.05em;
}
.marchio .o.punto::after {
  inset: -70%;
}

/* lit letters: the light of the o falls on the letters next to it. Still, the light sits where the o is;
   moving, assets/lucore.js puts it on the o wherever the o goes (--lx, --ly, measured on each part). */
.marchio .lettere {
  --lx: 112%;
  --ly: 62%;
  color: var(--buio-spento);
  background: radial-gradient(
    circle at var(--lx) var(--ly),
    color-mix(in srgb, var(--luce) 70%, white) 0,
    color-mix(in srgb, var(--luce) 48%, var(--buio-spento)) calc(var(--raggio, 1.5em) * 0.42),
    var(--buio-spento) var(--raggio, 1.5em)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.marchio .lettere:last-child {
  --lx: -12%;
}

/* ------------------------------------------------------------------ header */

.testata {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  color: var(--inchiostro);
  /* nearly opaque on paper, and no saturate: the dark frames and the amber screens passing under it
     tinted the bar grey and pink */
  background: color-mix(in srgb, var(--carta) 96%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--filo);
  transition: background-color 300ms var(--e-stato), border-color 300ms var(--e-stato), color 300ms var(--e-stato);
}
.testata.su-buio {
  color: var(--buio-testo);
  background: color-mix(in srgb, var(--notte) 55%, transparent);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.testata .contenitore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--testata);
}
.testata .marchio {
  font-size: 1.6rem;
  color: inherit;
}
.indice {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.indice a {
  text-decoration: none;
  opacity: 0.72;
  padding: 6px 0;
}
.indice a:hover,
.indice a[aria-current="true"] {
  opacity: 1;
}
@media (max-width: 640px) {
  .indice {
    display: none;
  }
}

/* ------------------------------------------------------------------ type */

.etichetta {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--attenuato);
}
.buio .etichetta {
  color: var(--buio-fioco);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: inherit;
}

.frase {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.9vw, 3.75rem);
  font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30, "WONK" 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.definizione {
  max-width: 39ch;
  margin: 22px 0 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.5;
  letter-spacing: -0.011em;
  text-wrap: pretty;
}

.corpo {
  max-width: var(--testo);
  margin: 16px 0 0;
  color: var(--attenuato);
  text-wrap: pretty;
}
.buio .corpo {
  color: #aeb6bf;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.08em 0.36em;
  border-radius: 4px;
  background: var(--carta-scura);
  color: var(--inchiostro);
  white-space: nowrap;
}

/* words that light up as they pass (assets/lucore.js splits them, only with motion) */
.movimento [data-accende] .parola {
  opacity: var(--accesa, 0.16);
  transition: opacity 240ms linear;
}

/* ------------------------------------------------------------------ sections */

.sezione {
  padding: var(--sezione) 0 0;
}
.sezione:last-of-type {
  padding-bottom: var(--sezione);
}
.testa-sezione {
  max-width: 48rem;
}

.movimento .entra {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 720ms var(--e-posa), transform 720ms var(--e-posa);
  transition-delay: var(--ritardo, 0ms);
}
.movimento .entra.dentro {
  opacity: 1;
  transform: none;
}

/* grain and a soft light that follows the pointer, on the dark stages */
.aria {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(320px circle at var(--mx, -999px) var(--my, -999px), rgba(255, 255, 255, 0.045), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.55;
  mix-blend-mode: soft-light;
  z-index: 1;
}

/* ================================================================== act 1 · night, and your screen: the widget */

.notte {
  position: relative;
}
.notte .palco {
  position: relative;
  overflow: hidden;
  padding: calc(var(--testata) + clamp(48px, 10vh, 112px)) var(--margine) clamp(64px, 10vh, 112px);
  background:
    radial-gradient(70% 55% at 50% 38%, #15171c 0, transparent 70%),
    var(--notte);
}
.notte .apertura {
  position: relative;
  z-index: 3;
  max-width: 62rem;
  margin: 0 auto;
  text-align: center;
}
.notte .apertura .etichetta {
  margin-bottom: clamp(14px, 3vh, 28px);
}
.marchio.grande {
  font-size: clamp(4.5rem, min(19vw, 31svh), 17rem);
  color: var(--buio-testo);
}
.marchio.grande .segnaposto {
  border-radius: 50%;
  background: radial-gradient(circle, var(--luce) 0 84%, color-mix(in srgb, var(--luce) 75%, black) 86% 100%);
  box-shadow: 0 0 0.4em color-mix(in srgb, var(--luce) 60%, transparent), 0 0 1.2em color-mix(in srgb, var(--luce) 35%, transparent);
}
.notte h1 {
  max-width: 24ch;
  margin: clamp(18px, 3.5vh, 36px) auto 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.75rem);
  font-weight: 340;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  line-height: 1.08;
  letter-spacing: -0.024em;
  text-wrap: balance;
}
.notte .definizione {
  max-width: 40ch;
  margin: clamp(14px, 2.4vh, 22px) auto 0;
  color: #b6bdc6;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
}
.stato-lavoro {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: clamp(16px, 3vh, 26px) 0 0;
  font-size: 0.875rem;
  color: var(--buio-fioco);
}
.stato-lavoro .punto {
  font-size: 9px;
}
@media (max-width: 640px) {
  .stato-lavoro {
    max-width: 30ch; /* on two lines the dot stays by the words, and the two go to the centre together */
    text-align: left;
  }
}
.giu {
  display: none;
}

/* the screen: wallpaper, the real widget, the taskbar with the dot by the clock */
.schermo {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  aspect-ratio: 16 / 10;
  min-height: 362px; /* the whole card above the taskbar, on a phone too: 282 + 52 + a margin */
  margin: clamp(48px, 9vh, 96px) auto 0;
  border-radius: var(--r-schermo);
  overflow: hidden;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
/* what is on the screen sits in its bottom right corner, which the second step enlarges (--zoom): the
   strip, the line and the dot are small, and on a whole dark screen the eye had nothing to read */
.angolo {
  position: absolute;
  inset: 0;
  transform-origin: 100% 100%;
}
.movimento .angolo {
  transform: scale(var(--zoom, 1));
  will-change: transform;
}
.carta-da-parati {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(90% 70% at 20% 15%, #2b2f38 0, transparent 60%),
    radial-gradient(80% 70% at 85% 95%, #1f2229 0, transparent 70%),
    linear-gradient(160deg, #17191e, #121418);
}
.forme-widget {
  position: absolute;
  right: 14px;
  bottom: calc(40px + 12px);
  width: 302px;
  max-width: calc(100% - 28px);
  aspect-ratio: 302 / 282;
}
.forme-widget picture {
  display: contents;
}
.forme-widget .w {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.5));
}
.forme-widget .w-striscia,
.forme-widget .w-luce {
  opacity: 0;
}
.forme-widget .w-luce {
  width: 44%;
}
.evidenza {
  position: absolute;
  left: 1.5%;
  right: 1.5%;
  top: 2.4%;
  height: 7%;
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--aspetta), 0 0 22px color-mix(in srgb, var(--aspetta) 55%, transparent);
  opacity: 0;
  pointer-events: none;
}
.barra {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 14px;
  background: rgba(30, 32, 38, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-family: var(--sans);
  font-size: 12px;
  color: #d9dee4;
  font-variant-numeric: tabular-nums;
}
.barra .punto {
  font-size: 13px;
}
.barra .icone {
  display: flex;
  gap: 10px;
  margin: 0 auto;
}
.barra .icone i {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.13);
}

.didascalie {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 28px clamp(20px, 3vw, 40px);
  max-width: 62rem;
  margin: clamp(40px, 7vh, 72px) auto 0;
  padding: 0;
  list-style: none;
}
.didascalie li {
  display: block;
}
.didascalie .n {
  display: block;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--buio-fioco);
}
.didascalie .t {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.8vw, 1.6rem);
  font-weight: 380;
  font-variation-settings: "opsz" 48, "SOFT" 30;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.didascalie .d {
  display: block;
  margin-top: 8px;
  color: #aeb6bf;
  font-size: 0.9375rem;
  text-wrap: pretty;
}
.forma-ferma {
  display: block;
  margin-top: 12px;
}
.forma-ferma img {
  width: auto;
  max-width: 100%;
}
.luce-viaggio {
  display: none;
}

/* ---------- act 1, moving */
.movimento .notte {
  height: 340vh;
}
.movimento .notte .palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 0;
}
.movimento .notte .apertura {
  position: absolute;
  left: var(--margine);
  right: var(--margine);
  top: calc(var(--testata) + 50% - var(--testata) / 2);
  transform: translateY(calc(-50% - var(--sale, 0px)));
  opacity: var(--vis, 1);
  margin: 0 auto;
  will-change: transform, opacity;
}
.movimento .notte .apertura .marchio .segnaposto {
  background: transparent;
  box-shadow: none;
}
/* at the foot of the stage, not under the words: on a 585-point screen the words fill it */
.movimento .giu {
  display: block;
  position: absolute;
  left: 50%;
  bottom: max(10px, 2.4vh);
  z-index: 3;
  margin: 0;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--buio-fioco);
}
.movimento .giu span::after {
  content: "";
  display: block;
  width: 1px;
  height: clamp(16px, 4.5vh, 36px);
  margin: 8px auto 0;
  background: linear-gradient(var(--buio-fioco), transparent);
}
/* a short screen (Kevin's, 1280 x 585): a smaller word mark and wider lines leave room for the hint */
@media (max-height: 700px) {
  .marchio.grande {
    font-size: clamp(4rem, min(19vw, 26svh), 17rem);
  }
  .notte .definizione {
    max-width: 50ch;
  }
  .movimento .giu span {
    font-size: 0; /* the thread only: the word would touch the line above */
  }
}
.movimento .notte .schermo {
  position: absolute;
  inset: 0;
  max-width: none;
  min-height: 0;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  will-change: opacity;
}
.movimento .notte .barra .punto-barra {
  visibility: hidden;
}
.movimento .notte .forme-widget .w-scheda {
  opacity: 0;
}
.movimento .didascalie {
  position: absolute;
  left: var(--margine);
  top: calc(var(--testata) + 50% - var(--testata) / 2);
  transform: translateY(-50%);
  display: block;
  width: min(30rem, calc(100% - 302px - 3 * var(--margine)));
  margin: 0;
}
.movimento .didascalie li {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  transform: translateY(calc(-50% + var(--dy, 0px)));
  opacity: var(--vis, 0);
  will-change: opacity, transform;
}
.movimento .didascalie .t {
  font-size: clamp(1.6rem, 3vw, 2.75rem);
  font-weight: 340;
  font-variation-settings: "opsz" 96, "SOFT" 40;
  line-height: 1.08;
  letter-spacing: -0.022em;
}
.movimento .didascalie .d {
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  margin-top: 14px;
  max-width: 34ch;
}
.movimento .forma-ferma {
  display: none;
}
.movimento .luce-viaggio {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  width: 100px;
  height: 100px;
  font-size: 100px;
  transform-origin: 0 0;
  will-change: transform;
}
.movimento .luce-viaggio::after {
  inset: -110%;
}

/* narrow screens: the screen becomes a framed monitor under the caption */
@media (max-width: 899px) {
  .movimento .notte .schermo {
    inset: auto 12px 12px 12px;
    height: min(64svh, 560px);
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }
  .movimento .didascalie {
    top: calc(var(--testata) + 18px);
    transform: none;
    width: auto;
    right: var(--margine);
  }
  .movimento .didascalie li {
    transform: translateY(var(--dy, 0px));
  }
  .movimento .didascalie .t {
    font-size: clamp(1.45rem, 6.4vw, 2rem);
  }
  .movimento .didascalie .d {
    font-size: 0.9375rem;
    margin-top: 8px;
  }
}
/* a short phone (320 x 568): the caption and the card would touch. A lower screen, a smaller card */
@media (max-width: 899px) and (max-height: 640px) {
  .movimento .notte .schermo {
    height: min(56svh, 330px);
  }
  .movimento .forme-widget {
    transform: scale(0.86);
    transform-origin: 100% 100%;
  }
  .movimento .didascalie .t {
    font-size: 1.35rem;
  }
  .movimento .didascalie .d {
    font-size: 0.875rem;
  }
}

/* ================================================================== the details */

.stati {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}
.stati li {
  position: relative;
  padding-left: 22px;
}
.stati .punto {
  position: absolute;
  left: 0;
  top: 0.38em;
  font-size: 12px;
}
.stati .punto::after {
  display: none;
}

.righe {
  display: grid;
  gap: clamp(56px, 10vh, 112px);
  margin-top: clamp(48px, 8vh, 88px);
}
.riga {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.riga.girata .testo-riga {
  order: 2;
}
.testo-riga h3 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 400;
  font-variation-settings: "opsz" 48, "SOFT" 30;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.testo-riga .corpo {
  max-width: 36rem;
}
.segni {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
  max-width: 36rem;
}
.segni li {
  position: relative;
  padding-left: 40px;
  color: var(--attenuato);
}
.segni li .segno {
  position: absolute;
  left: 0;
  top: -1px;
}
.segno {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--inchiostro);
  color: var(--carta);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.scatto-dentro .segno {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  background: var(--carta);
  color: var(--inchiostro);
  box-shadow: 0 0 0 4px rgba(247, 245, 241, 0.18), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.figura {
  margin: 0;
}
.figura img {
  height: auto;
}
.figura figcaption {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--attenuato);
}
/* a widget screenshot at its real size on a 150% screen, on a dark ground; it tilts toward the pointer */
.scatto {
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--r-schermo);
  background:
    radial-gradient(100% 80% at 20% 0, #262a31 0, transparent 70%),
    #15171b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), var(--ombra-pannello);
  perspective: 900px;
}
.scatto-dentro {
  position: relative;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}
.scatto-dentro img {
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.55));
}
@media (max-width: 899px) {
  .riga {
    grid-template-columns: minmax(0, 1fr);
  }
  .riga.girata .testo-riga {
    order: 0;
  }
}

/* how it reads: under the two rows, in the same section (what you see, and where it comes from) */
.lettura {
  margin-top: clamp(64px, 11vh, 120px);
}
.titoletto {
  max-width: 30ch;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 2.2vw, 2rem);
  font-weight: 400;
  font-variation-settings: "opsz" 48, "SOFT" 30;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.fatti {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: clamp(28px, 4vh, 44px) 0 0;
  padding: 0;
  list-style: none;
}
.fatti li {
  padding-top: 18px;
  border-top: 1px solid var(--filo);
}
.fatti h4 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.fatti p {
  margin: 10px 0 0;
  color: var(--attenuato);
  text-wrap: pretty;
}
@media (max-width: 899px) {
  .fatti {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================================================================== act 3 · the light */

.luce-atto {
  position: relative;
  margin-top: var(--sezione);
}
/* The stage has its own background: the grain (.aria) blends with what the stage paints, and a sticky
   stage is a group of its own. Without it the grain lands as a white veil (#2f3033 instead of the night). */
.luce-atto .palco {
  position: relative;
  overflow: hidden;
  background: var(--notte);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(24px, 5vh, 48px);
  padding: calc(var(--testata) + clamp(48px, 9vh, 96px)) var(--margine) clamp(48px, 9vh, 96px);
}
.alone {
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(120vw, 1400px);
  aspect-ratio: 1;
  translate: -50% -50%; /* apart from transform, which the breathing animates */
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--luce) 26%, transparent) 0, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.movimento .alone {
  animation: respira 4.2s ease-in-out infinite;
}
.movimento[data-stato-pagina="aspetta"] .alone {
  animation: battito 2.6s linear infinite;
}
.testa-luce {
  position: relative;
  z-index: 2;
  justify-self: stretch;
  max-width: var(--pagina);
  width: 100%;
  margin: 0 auto;
}
.marchio.enorme {
  position: relative;
  z-index: 2;
  font-size: clamp(4.5rem, min(17vw, 34svh), 15rem);
  color: var(--buio-testo);
}
.sotto-luce {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 18px;
}
.scelte {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.scelta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 16px 8px 13px;
  border: 1px solid var(--buio-filo);
  border-radius: 999px;
  background: rgba(16, 17, 20, 0.6);
  color: var(--buio-testo);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background-color 160ms var(--e-stato), border-color 160ms var(--e-stato);
}
.scelta:hover {
  border-color: #4a505a;
}
.scelta[aria-pressed="true"] {
  background: var(--buio-alto);
  border-color: color-mix(in srgb, var(--c, #8b949e) 75%, transparent);
}
.scelta .punto {
  font-size: 12px;
}
.scelta .punto::after {
  display: none;
}
.cosa-dice {
  min-height: 1.6em;
  margin: 0;
  font-size: 0.9375rem;
  color: var(--buio-fioco);
  text-align: center;
}
.coda-luce {
  padding: clamp(24px, 5vh, 56px) 0 var(--sezione);
}
.coda-luce .corpo {
  max-width: 46rem;
  margin: 0 auto;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  text-align: center;
}
.movimento .luce-atto {
  height: 380vh;
}
.movimento .luce-atto .palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding-top: calc(var(--testata) + 24px);
  padding-bottom: 24px;
  grid-template-rows: auto 1fr auto;
}
.movimento .luce-atto .marchio.enorme {
  align-self: center;
}

/* ================================================================== act 4 · the object
   Still (no motion): the four renders, each beside its words. Moving: the renders become a film that
   the scroll leafs through on a canvas (assets/lucore.js, assets/sequenza/), the words take turns on
   the left, and while it is apart the names of the parts sit on threads. */

.oggetto-atto .palco {
  position: relative;
  padding: calc(var(--testata) + clamp(32px, 7vh, 72px)) var(--margine) clamp(48px, 9vh, 96px);
  background: var(--notte);
}
.vista3d {
  display: none;
}
.testi-oggetto {
  display: grid;
  gap: clamp(40px, 7vh, 80px);
  max-width: var(--pagina);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}
.testo-oggetto {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.testo-oggetto:nth-child(even) .fermo {
  order: 2;
}
.fermo {
  margin: 0;
}
.fermo img {
  width: 100%;
  height: auto;
}
/* every still says what it is: the object isn't built yet */
.fermo figcaption {
  margin-top: 8px;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--buio-fioco);
}
.testo-oggetto h3 {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-weight: 380;
  font-variation-settings: "opsz" 48, "SOFT" 30;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.nota-render {
  max-width: var(--pagina);
  margin: clamp(32px, 5vh, 56px) auto 0;
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: var(--buio-fioco);
}
@media (max-width: 899px) {
  .testo-oggetto {
    grid-template-columns: minmax(0, 1fr);
  }
  .testo-oggetto:nth-child(even) .fermo {
    order: 0;
  }
}

/* ---------- act 4, moving */
.movimento.con3d .oggetto-atto {
  height: 520vh;
}
.movimento.con3d .oggetto-atto .palco {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: 0;
  overflow: hidden;
}
.movimento.con3d .vista3d {
  display: block;
  position: absolute;
  inset: 0;
}
.movimento.con3d .vista3d canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.movimento.con3d .fermo {
  display: none;
}
.movimento.con3d .testi-oggetto {
  position: absolute;
  left: var(--margine);
  top: calc(var(--testata) + 50% - var(--testata) / 2);
  transform: translateY(-50%);
  display: block;
  width: min(27rem, 36%);
  margin: 0;
  z-index: 2;
}
.movimento.con3d .testo-oggetto {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: block;
  transform: translateY(calc(-50% + var(--dy, 0px)));
  opacity: var(--vis, 0);
  will-change: opacity, transform;
}
.movimento.con3d .nota-render {
  position: absolute;
  left: var(--margine);
  bottom: max(14px, 2.4vh);
  z-index: 2;
  max-width: 36rem;
  margin: 0;
}
@media (max-width: 899px) {
  .movimento.con3d .testi-oggetto {
    top: calc(var(--testata) + 16px);
    transform: none;
    left: var(--margine);
    right: var(--margine);
    width: auto;
  }
  .movimento.con3d .testo-oggetto {
    transform: translateY(var(--dy, 0px));
  }
  .movimento.con3d .testo-oggetto .definizione {
    font-size: 0.9375rem;
  }
  .movimento.con3d .testo-oggetto .frase {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }
  .movimento.con3d .nota-render {
    right: var(--margine);
    text-align: center;
  }
}

/* the names of the parts: a dot on the part, a thread, the name a little outside (assets/lucore.js) */
.etichette3d {
  display: none;
}
.movimento.con3d .etichette3d {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.etichetta3d,
.filo3d,
.ancora3d {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  will-change: transform, opacity;
}
.etichetta3d {
  display: block;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(11, 12, 15, 0.74);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--buio-testo);
  font-size: 0.8125rem;
  line-height: 1;
  white-space: nowrap;
}
.filo3d {
  height: 1px;
  transform-origin: 0 50%;
  background: rgba(236, 240, 244, 0.42);
}
.ancora3d {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--aspetta);
  box-shadow: 0 0 0 2px rgba(11, 12, 15, 0.7), 0 0 10px var(--aspetta);
}

/* ================================================================== where it is */

.elenco-stato {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 64px);
  margin: clamp(36px, 6vh, 56px) 0 0;
  padding: 0;
  list-style: none;
}
.elenco-stato li {
  padding: 18px 0;
  border-top: 1px solid var(--filo);
}
.elenco-stato h3 {
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--attenuato);
}
.elenco-stato p {
  margin: 8px 0 0;
  text-wrap: pretty;
}
.scrivimi {
  margin: clamp(48px, 8vh, 80px) 0 0;
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 360;
  font-variation-settings: "opsz" 96, "SOFT" 30;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.scrivimi a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .elenco-stato {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ================================================================== footer */

.piede {
  padding: 40px 0 48px;
  background: var(--carta);
  border-top: 1px solid var(--filo);
  font-size: 0.875rem;
  color: var(--attenuato);
}
.piede .contenitore {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 40px;
  align-items: start;
}
.firma {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--inchiostro);
}
.firma .punto {
  font-size: 9px;
}
.piede p {
  margin: 0;
  max-width: 62ch;
}
.piede p + p {
  margin-top: 8px;
}
@media (max-width: 640px) {
  .piede .contenitore {
    grid-template-columns: minmax(0, 1fr);
  }
}
