:root {
  --carta: #f6f3ee;
  --bianco: #ffffff;
  --inchiostro: #1c1b18;
  --grigio: #77726a;
  --tenue: #a7a198;
  --linea: rgba(28, 27, 24, 0.09);
  --accento: #2f6b52;
  --ombra: 0 1px 2px rgba(28, 27, 24, 0.05), 0 6px 18px -8px rgba(28, 27, 24, 0.16);
  --ombra-su: 0 2px 4px rgba(28, 27, 24, 0.06), 0 18px 34px -14px rgba(28, 27, 24, 0.28);
  --raggio: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--carta);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }

.stage {
  position: relative;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 3.2vh, 30px) clamp(16px, 4vw, 48px) 0;
}

/* ---------- the journal ---------- */
.testa {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1060px, 100%);
  margin: 0 auto;
}
.marchio { display: flex; align-items: center; gap: 8px; font-weight: 640; font-stretch: 112%; font-size: 15px; letter-spacing: -0.01em; }
.marchio__segno { width: 22px; height: 22px; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.voci { display: flex; gap: 20px; margin-left: 8px; font-size: 13px; color: var(--grigio); }
.voci a { transition: color 0.2s; }
.iscriviti {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 560;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: var(--carta);
}

.sezione {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(1060px, 100%);
  margin: 0 auto;
  padding-bottom: clamp(14px, 4vh, 40px);
}
.sezione__testa { display: flex; align-items: baseline; gap: 12px; margin-bottom: clamp(10px, 2.6vh, 22px); }
.sezione__titolo { font-size: clamp(22px, min(3.6vw, 6vh), 40px); font-weight: 620; font-stretch: 108%; letter-spacing: -0.03em; line-height: 1; }
.sezione__conto { font-size: 13px; color: var(--grigio); }

.griglia { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(12px, 1.8vw, 22px); }

/* ---------- the card ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bianco);
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
  overflow: hidden;
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.35s;
  -webkit-tap-highlight-color: transparent;
}
.card:focus-visible { box-shadow: var(--ombra), 0 0 0 2px var(--accento); }
.card__foto { position: relative; height: min(17vw, 34vh); overflow: hidden; }
.card__foto img, .lettore__foto img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.card__foto img { transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card__testo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px 16px; }
.card__tag, .lettore__tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accento); }
.card__titolo, .lettore__titolo { font-size: clamp(14px, min(1.5vw, 2.6vh), 18px); font-weight: 600; font-stretch: 104%; letter-spacing: -0.015em; line-height: 1.18; }
.card__meta { font-size: 12px; color: var(--grigio); }
.card__freccia {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translate(-4px, 4px) scale(0.8);
  transition: opacity 0.25s, transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.card__freccia svg { width: 14px; height: 14px; fill: none; stroke: var(--inchiostro); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card.is-hover { box-shadow: var(--ombra-su); }
.card.is-hover .card__foto img { transform: scale(1.05); }
.card.is-hover .card__freccia { opacity: 1; transform: none; }
@media (hover: hover) {
  .voci a:hover { color: var(--inchiostro); }
  .card:hover { box-shadow: var(--ombra-su); }
  .card:hover .card__foto img { transform: scale(1.05); }
  .card:hover .card__freccia { opacity: 1; transform: none; }
}

/* the narrow box: the cards become rows, photo on the left */
@media (max-width: 620px) {
  .voci { display: none; }
  .griglia { grid-template-columns: 1fr; gap: clamp(8px, 1.8vh, 12px); }
  .card { flex-direction: row; align-items: center; padding: 8px; }
  .card__foto { width: min(76px, 17vh); height: min(76px, 17vh); flex: none; border-radius: 11px; }
  .card__testo { padding: 2px 34px 2px 12px; gap: 4px; }
  .card__titolo, .lettore__titolo { font-size: 14px; }
  .card__tag, .lettore__tag { font-size: 10px; }
  .card__meta { font-size: 11px; }
  .card__freccia { top: 50%; margin-top: -13px; width: 26px; height: 26px; background: var(--carta); }
}

/* ---------- the open page ---------- */
.lettore {
  position: absolute;
  z-index: 5;
  background: var(--bianco);
  overflow: hidden;
  transform-origin: 50% 0;
  box-shadow: 0 30px 60px -30px rgba(28, 27, 24, 0.35);
}
.lettore[hidden] { display: none; }
.lettore.is-pieno { inset: 0; }
.lettore__foto { position: absolute; left: 0; top: 0; overflow: hidden; z-index: 1; }
.lettore__foto::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16), transparent 34%);
  opacity: var(--velo, 0);
}
.lettore__scorri {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.lettore__scorri::-webkit-scrollbar { display: none; }
.lettore__colonna { position: relative; background: var(--bianco); padding-top: 22px; padding-bottom: 56px; }
.lettore__tag, .lettore__titolo { display: block; transform-origin: 0 0; will-change: transform; }
.lettore__titolo { margin-top: 8px; }
.lettore__meta { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--linea); }
.autore__viso {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 620;
  color: var(--accento);
  background: #e6eee9;
}
.autore__nome { display: flex; flex-direction: column; font-size: 12px; color: var(--grigio); line-height: 1.35; }
.autore__nome b { font-weight: 600; color: var(--inchiostro); }
.lettore__corpo { margin-top: 18px; font-size: 15px; line-height: 1.62; color: #3a3833; }
.lettore__corpo p + p, .lettore__corpo blockquote, .lettore__corpo blockquote + p { margin-top: 14px; }
.lettore__corpo blockquote { font-size: 1.28em; line-height: 1.32; font-weight: 560; font-stretch: 104%; letter-spacing: -0.015em; color: var(--accento); }
.riga { display: block; overflow: hidden; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.riga > span { display: block; will-change: transform; }

.lettore__presa {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  top: 0;
  height: 54px;
  display: flex;
  justify-content: center;
  padding-top: 9px;
  touch-action: none;
  cursor: grab;
}
.lettore__presa span { width: 38px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.8); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); opacity: var(--presa, 0); }
.lettore__chiudi {
  position: absolute;
  z-index: 4;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lettore__chiudi svg { width: 16px; height: 16px; fill: none; stroke: var(--inchiostro); stroke-width: 2; stroke-linecap: round; transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1); }
.lettore__chiudi.is-hover svg { transform: rotate(90deg); }
@media (hover: hover) {
  .lettore__chiudi:hover svg { transform: rotate(90deg); }
}

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 10;
  fill: var(--inchiostro);
  stroke: var(--bianco);
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .card__foto img, .card__freccia, .lettore__chiudi svg { transition: opacity 0.25s; transform: none !important; }
}
.lettore.is-muove .lettore__colonna { background: transparent; }
