@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage-grotesque-latin-standard-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}
@font-face {
  font-family: "Rubik Mono";
  src: url("/fonts/rubik-mono-one-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

/* Tema chiaro (predefinito): giallo acido, rosa, blu. */
:root {
  --fondo: #fff35c;
  --carta: #fffbe0;
  --inchiostro: #121015;
  --tenue: #4a4436;
  --rosa: #ff2e88;
  --blu: #2b46ff;
  --verde: #00c27a;
  --su-rosa: #121015;
  --su-blu: #ffffff;
  --ombra: #121015;
  --margine: clamp(16px, 4vw, 48px);
  color-scheme: light;
}

/* Tema scuro: stesso carattere, fondo notturno. Va tenuto uguale nei due blocchi. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #121015;
    --carta: #1f1b24;
    --inchiostro: #fff6d6;
    --tenue: #b9ae95;
    --rosa: #ff4f9f;
    --blu: #7186ff;
    --verde: #2ee6a0;
    --su-rosa: #121015;
    --su-blu: #121015;
    --ombra: #fff35c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #121015;
  --carta: #1f1b24;
  --inchiostro: #fff6d6;
  --tenue: #b9ae95;
  --rosa: #ff4f9f;
  --blu: #7186ff;
  --verde: #2ee6a0;
  --su-rosa: #121015;
  --su-blu: #121015;
  --ombra: #fff35c;
  color-scheme: dark;
}

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

html { scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Bricolage", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--rosa); }
:focus-visible { outline: 3px solid var(--blu); outline-offset: 3px; }
::selection { background: var(--rosa); color: var(--su-rosa); }

.salta {
  position: absolute; left: var(--margine); top: -100px; z-index: 10;
  background: var(--inchiostro); color: var(--fondo); padding: .5rem 1rem;
}
.salta:focus { top: 1rem; }

/* Testata */
.testata {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 1rem;
  padding: .75rem var(--margine);
  background: var(--fondo);
  border-bottom: 3px solid var(--inchiostro);
}
.marchio {
  font-family: "Rubik Mono", sans-serif; font-size: 1rem;
  text-decoration: none; letter-spacing: -.02em;
}
.marchio span { color: var(--rosa); }
.menu { margin-left: auto; display: flex; gap: 1.25rem; font-weight: 700; }
.menu a { text-decoration: none; }
.menu a:hover { text-decoration: underline; }
.tema {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 2px solid var(--inchiostro); border-radius: 50%;
  background: var(--carta); color: var(--inchiostro); cursor: pointer;
}
.tema:hover { background: var(--rosa); color: var(--su-rosa); }
@media (max-width: 480px) { .menu { display: none; } .tema { margin-left: auto; } }

/* Titoli enormi con lettere che reagiscono al puntatore */
.gigante {
  margin: 0;
  font-weight: 800; font-stretch: 75%;
  text-transform: uppercase;
  line-height: .8; letter-spacing: -.02em;
}
.gigante .riga { display: block; }
.lettera {
  display: inline-block;
  font-weight: var(--peso, 800);
  font-stretch: var(--larghezza, 75%);
  transform: translateY(var(--salto, 0));
  transition: font-weight .25s, font-stretch .25s, transform .25s, color .25s;
}
.riga-rosa { color: var(--rosa); }
.riga-blu { color: var(--blu); }

/* Apertura */
.apertura {
  position: relative;
  min-height: calc(100svh - 64px);
  padding: clamp(2rem, 6vw, 4rem) var(--margine) 4rem;
  display: flex; flex-direction: column; justify-content: center;
}
.apertura .gigante { font-size: clamp(4.2rem, 21vw, 19rem); position: relative; z-index: 1; }
.occhiello {
  margin: 0 0 1.5rem;
  font-family: "Rubik Mono", sans-serif; font-size: clamp(.7rem, 1.6vw, .9rem);
  text-transform: uppercase; max-width: 34ch;
}
.sottotitolo {
  margin: 2rem 0 0; max-width: 34ch;
  font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.25; font-weight: 500;
  position: relative; z-index: 1;
}
.sottotitolo strong { background: var(--inchiostro); color: var(--fondo); padding: 0 .25em; font-weight: 800; }
.suggerimento {
  margin: 2rem 0 0; font-size: .875rem; color: var(--tenue);
}
@media (hover: none) { .suggerimento { display: none; } }

/* Adesivi trascinabili */
.adesivi { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.adesivo {
  position: absolute; left: var(--x); top: var(--y);
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--r));
  pointer-events: auto; cursor: grab; user-select: none; touch-action: none;
  filter: drop-shadow(4px 4px 0 var(--ombra));
  transition: filter .2s;
}
.adesivo.preso { cursor: grabbing; filter: drop-shadow(10px 12px 0 var(--ombra)); transition: none; }
.adesivo-stella {
  --x: 74%; --y: 7%; --r: 12deg;
  width: clamp(96px, 14vw, 150px); aspect-ratio: 1;
  display: grid; place-items: center; text-align: center;
  background: var(--verde); color: #121015;
  font-family: "Rubik Mono", sans-serif; font-size: clamp(.7rem, 1.4vw, .95rem); line-height: 1.1;
  clip-path: polygon(50% 0, 61% 18%, 82% 10%, 80% 32%, 100% 40%, 85% 56%, 96% 76%, 74% 78%, 68% 100%, 50% 87%, 32% 100%, 26% 78%, 4% 76%, 15% 56%, 0 40%, 20% 32%, 18% 10%, 39% 18%);
}
.adesivo-tondo {
  --x: 70%; --y: 58%; --r: -8deg;
  width: clamp(110px, 15vw, 170px); aspect-ratio: 1;
  border-radius: 50%; background: var(--rosa);
}
.adesivo-tondo svg { display: block; width: 100%; height: 100%; }
.adesivo-tondo text {
  font-family: "Rubik Mono", sans-serif; font-size: 9.4px; letter-spacing: .5px; fill: #121015;
}
.adesivo-tondo .cuore { fill: #fff35c; stroke: #121015; stroke-width: 3; stroke-linejoin: round; }
.adesivo-nastro {
  --x: 52%; --y: 88%; --r: -4deg;
  padding: .4rem 1rem;
  background: var(--blu); color: var(--su-blu);
  font-family: "Rubik Mono", sans-serif; font-size: clamp(.7rem, 1.5vw, .9rem); text-transform: uppercase;
}
@media (max-width: 640px) {
  .adesivo-stella { --x: 8%; --y: 76%; }
  .adesivo-tondo { --x: 58%; --y: 73%; }
  .adesivo-nastro { --x: 6%; --y: 93%; }
}

/* Nastro che scorre */
.nastro {
  overflow: hidden;
  background: var(--inchiostro); color: var(--fondo);
  border-block: 3px solid var(--inchiostro);
  transform: rotate(-2deg) scale(1.04);
  margin: 1rem 0 3rem;
}
.nastro-scorre {
  display: flex; width: max-content;
  animation: scorre 40s linear infinite;
}
.nastro span {
  padding: .9rem 1.5rem;
  font-family: "Rubik Mono", sans-serif; font-size: clamp(1rem, 2.4vw, 1.5rem); text-transform: uppercase;
  white-space: nowrap;
}
.nastro span::after { content: "✶"; margin-left: 3rem; color: var(--rosa); }
@keyframes scorre { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .nastro-scorre { animation: none; flex-wrap: wrap; width: auto; }
}

/* Etichette di sezione */
.etichetta {
  margin: 0 0 2rem;
  font-family: "Rubik Mono", sans-serif; font-weight: 400;
  font-size: clamp(1.4rem, 4vw, 2.5rem); line-height: 1.1; text-transform: uppercase;
}
.etichetta span { display: block; font-family: "Bricolage", sans-serif; font-size: 1rem; text-transform: none; color: var(--tenue); font-weight: 600; margin-top: .4rem; }

/* Manifesto */
.manifesto { padding: 3rem var(--margine) 4rem; }
.articoli { list-style: none; margin: 0; padding: 0; border-top: 3px solid var(--inchiostro); }
.articoli li {
  display: grid; grid-template-columns: auto 1fr; column-gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(1.25rem, 3vw, 2rem) 0;
  border-bottom: 3px solid var(--inchiostro);
  transition: background .2s, color .2s, padding .2s;
}
.articoli .numero {
  grid-row: span 2;
  font-family: "Rubik Mono", sans-serif; font-size: clamp(1.5rem, 5vw, 3.5rem); line-height: 1;
  color: var(--rosa);
  -webkit-text-stroke: 2px var(--inchiostro);
}
.articoli p {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 4rem); font-weight: 800; font-stretch: 85%;
  line-height: .98; letter-spacing: -.02em;
}
.articoli small { margin-top: .6rem; font-size: clamp(1rem, 1.8vw, 1.2rem); color: var(--tenue); font-weight: 500; }
@media (hover: hover) {
  .articoli li:hover { background: var(--rosa); color: var(--su-rosa); padding-inline: clamp(.75rem, 2vw, 1.5rem); }
  .articoli li:hover .numero { color: var(--fondo); }
  .articoli li:hover small { color: var(--su-rosa); }
  .articoli li:nth-child(even):hover { background: var(--blu); color: var(--su-blu); }
  .articoli li:nth-child(even):hover small { color: var(--su-blu); }
}

/* Confessionale */
.confessionale { padding: 3rem var(--margine) 5rem; }
.cabina {
  position: relative;
  max-width: 900px;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  background: var(--carta);
  border: 3px solid var(--inchiostro);
  box-shadow: 10px 10px 0 var(--rosa);
  transform: rotate(-1deg);
}
.peccato {
  margin: 0; min-height: 3.2em;
  font-size: clamp(1.5rem, 4.2vw, 2.9rem); font-weight: 800; font-stretch: 85%; line-height: 1.05;
}
.peccato.nuovo { animation: entra .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes entra { from { transform: scale(.9) rotate(-2deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .peccato.nuovo { animation: none; } }
.penitenza { margin: 1rem 0 2rem; color: var(--tenue); font-weight: 500; }
.bottone {
  font: inherit; font-weight: 800; font-size: 1.1rem;
  padding: .9rem 1.6rem;
  background: var(--inchiostro); color: var(--fondo);
  border: 3px solid var(--inchiostro); border-radius: 999px;
  box-shadow: 5px 5px 0 var(--blu);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.bottone:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--blu); }
.bottone:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--blu); }

/* Chiusura */
.chiusura { padding: 2rem var(--margine) 4rem; border-top: 3px solid var(--inchiostro); }
.gigante-chiusura { font-size: clamp(3.4rem, 15vw, 14rem); }

/* Piede */
.piede {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.5rem var(--margine) calc(1.5rem + env(safe-area-inset-bottom));
  background: var(--inchiostro); color: var(--fondo);
  font-weight: 600;
}
.piede p { margin: 0; }
.piede a:hover { color: var(--rosa); }
.tenue { opacity: .75; }

/* Pagina 404 */
.vuota { min-height: 100svh; padding: 3rem var(--margine); display: flex; flex-direction: column; justify-content: center; gap: 1.5rem; }
.vuota .gigante { font-size: clamp(3rem, 14vw, 12rem); }
.vuota p { margin: 0; font-size: 1.25rem; font-weight: 600; }

.solo-lettori {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.nastro-copia { display: contents; }
@media (max-width: 640px) {
  .apertura .gigante { font-size: clamp(4.2rem, 31vw, 19rem); }
  .apertura { justify-content: flex-start; padding-top: 4.5rem; }
}
