/* Pagina interattiva di un Refuso (inc/refuso.php, assets/js/refuso.js).
   Slider, scheda a schermo intero e immagini a maschera vengono da redazione.css. */

.nz-rf {
	--gutter: 12px;
	--col-left: calc(max(0px, (100vw - var(--measure) - 2 * var(--margin)) / 2) + var(--margin));
	--cards-visible: 3.4;
	--fs-name: clamp(1.25rem, 1rem + 0.9vw, 1.875rem);
	--dash: linear-gradient(to right, var(--ink) 0 55%, transparent 55% 100%);
	overflow-x: clip;
}
.nz-rf > section { max-width: calc(var(--measure) + 2 * var(--margin)); margin: 0 auto; padding: 0 var(--margin); }
.nz-rf [data-rv], .nz-rf [data-rv-p] { visibility: hidden; }
.nz-rf .is-split { visibility: visible; }
html:not(.nz-rf-on) .nz-rf [data-rv], html:not(.nz-rf-on) .nz-rf [data-rv-p] { visibility: visible; }
.nz-rf .is-split:not([data-single-line]) { display: grid; align-content: start; }
.nz-rf-head { font-size: var(--step-head); letter-spacing: -0.045em; line-height: 0.95; margin-bottom: 28px; }

/* ---------- copertina ---------- */
.nz-rf-cover { min-height: calc(100svh - 80px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; column-gap: clamp(24px, 4vw, 64px); align-items: end; padding-top: clamp(32px, 5vw, 72px) !important; padding-bottom: 24px !important; }
.nz-rf-cover__kicker { grid-column: 1 / -1; margin: 0; font-weight: 700; font-size: var(--step-small); color: var(--ink); letter-spacing: 0.08em; text-transform: uppercase; }
.nz-rf-cover__word { grid-column: 1 / -1; margin: 10px 0 0; font-size: clamp(5rem, 1rem + 17vw, 19rem); line-height: 0.8; letter-spacing: -0.06em; color: var(--ink); white-space: nowrap; }
.nz-rf-char { display: inline-block; overflow: hidden; padding: 0.06em 0.02em 0.1em; margin: -0.06em -0.02em -0.1em; vertical-align: top; }
.nz-rf-char > span { display: inline-block; }
.nz-rf-cover__title { grid-column: 1; align-self: start; margin: 24px 0 0; font-size: var(--step-lead); line-height: 1.2; font-weight: 600; color: var(--ink-strong); max-width: 22ch; }
.nz-rf-cover__art { grid-column: 2; grid-row: 3 / 5; align-self: stretch; min-height: 280px; margin: 24px 0 0; }
.nz-rf-cover__art .nz-rimg__inner { inset: -8% 0; }
.nz-rf-cover__down { grid-column: 1; align-self: end; font-weight: 700; text-decoration: none; }
.nz-rf-cover__down span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) { .nz-rf-cover__down span { animation: nz-rf-bounce 1.6s ease-in-out infinite; } }
@keyframes nz-rf-bounce { 50% { transform: translateY(5px); } }
html.nz-a-still .nz-rf-cover__down span { animation: none; }

/* ---------- editoriale con refusi ---------- */
.nz-rf-ed { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(20px, 4vw, 64px); margin-top: clamp(96px, 12vw, 180px) !important; }
.nz-rf-ed__p { font-size: clamp(1.35rem, 1rem + 1.4vw, 2.25rem); line-height: 1.22; letter-spacing: -0.025em; color: var(--ink-strong); margin: 0 0 0.8em; }
.nz-rf-ed__sign { font-weight: 700; color: var(--ink); }
.nz-rf-ed__hint { margin-top: 18px; font-size: var(--step-small); color: var(--muted); }
.nz-typo { position: relative; display: inline-grid; vertical-align: baseline; cursor: pointer; outline-offset: 3px; }
.nz-typo > span { grid-area: 1 / 1; transition: transform 500ms var(--ease), opacity 400ms var(--ease); }
.nz-typo__wrong { text-decoration: underline wavy var(--ink); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
.nz-typo__right { opacity: 0; transform: translateY(-70%); color: var(--ink); }
.nz-typo::after { content: "‸"; position: absolute; left: 50%; top: -0.55em; transform: translateX(-50%) scale(0); color: var(--ink); font-weight: 800; transition: transform 300ms var(--ease); }
.nz-typo.is-fixed .nz-typo__wrong { opacity: 0; transform: translateY(70%); }
.nz-typo.is-fixed .nz-typo__right { opacity: 1; transform: none; }
.nz-typo.is-fixed::after { animation: nz-rf-caret 900ms var(--ease) both; }
@keyframes nz-rf-caret { 0% { transform: translateX(-50%) scale(0); } 30% { transform: translateX(-50%) scale(1.3); } 70% { transform: translateX(-50%) scale(1); opacity: 1; } 100% { transform: translateX(-50%) scale(1); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .nz-typo > span, .nz-typo::after { transition: none; animation: none !important; } }

/* ---------- le opere: slider da bordo a bordo ---------- */
.nz-rf-works { margin-top: clamp(96px, 12vw, 180px) !important; }
.nz-rf-works__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.nz-rf-works__count { margin: 0; color: var(--muted); font-weight: 600; }
.nz-rf-slider { --card-w: calc((100vw - var(--col-left)) / var(--cards-visible)); width: 100vw; margin-left: calc(50% - 50vw); }
.nz-rf-track { display: flex; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
html:not(.nz-rf-on) .nz-rf-track { overflow-x: auto; }
.nz-rf-slide { position: relative; left: var(--col-left); flex-shrink: 0; width: var(--card-w); padding-right: var(--gutter); }
.nz-rf-card { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: grab; -webkit-tap-highlight-color: transparent; }
.nz-rf-track:active .nz-rf-card { cursor: grabbing; }
.nz-rf-card__media { aspect-ratio: 4 / 5; width: 100%; }
.nz-rf-card__media img { position: absolute; top: 0; left: -10%; width: 120%; max-width: none; height: 100%; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.nz-rf-card__no { display: block; margin-top: 14px; font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; color: var(--ink); }
.nz-rf-card__title { display: block; margin-top: 6px; font-size: var(--fs-name); font-weight: 800; letter-spacing: -0.035em; line-height: 1.03; color: var(--ink-strong); }
.nz-rf-card__author { display: block; margin-top: 4px; font-size: var(--step-small); font-weight: 600; color: var(--muted); }
.nz-rf-card.is-flipping .nz-rf-card__media { visibility: hidden; }
.nz-rf-hint { margin: 20px 0 0 var(--col-left); font-size: var(--step-small); color: var(--muted); }

/* ---------- per tecnica ---------- */
.nz-rf-tech { position: relative; margin-top: clamp(96px, 12vw, 180px) !important; }
.nz-rf-dash { height: 1.5px; background-image: var(--dash); background-size: 14px 100%; background-repeat: repeat-x; }
.nz-rf-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: start; min-height: clamp(84px, 8vw, 132px); }
.nz-rf-row > .nz-rf-dash { grid-column: 1 / -1; }
.nz-rf-row__head { grid-column: 1 / 8; display: flex; align-items: flex-end; gap: 14px; padding-top: 6px; min-width: 0; }
.nz-rf-row__num { flex-shrink: 0; font-size: var(--fs-name); font-weight: 700; padding-bottom: 0.3em; color: var(--muted); font-variant-numeric: tabular-nums; }
.nz-rf-row__title { min-width: 0; font-size: clamp(2.25rem, 0.6rem + 5.4vw, 6rem); line-height: 0.86; letter-spacing: -0.055em; overflow-wrap: anywhere; }
.nz-rf-row__names { grid-column: 8 / 13; position: relative; z-index: 2; margin: 0; padding-top: 14px; font-size: var(--fs-name); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; color: var(--ink-strong); }
.nz-rf-name { position: relative; cursor: pointer; transition: opacity 200ms ease; }
.nz-rf-name::after { content: ""; position: absolute; inset: -0.22em -0.18em; }
.nz-rf-name:focus-visible { outline: 3px solid var(--ink-strong); outline-offset: 2px; border-radius: 4px; }
.nz-rf-rows.is-dimmed .nz-rf-name, .nz-rf-rows.is-dimmed .nz-rf-sep { opacity: var(--dim, 0.3); }
.nz-rf-rows.is-dimmed .nz-rf-name.is-active { opacity: 1; }
.nz-rf-hover { position: absolute; z-index: 1; top: 0; left: 0; width: clamp(170px, 17vw, 300px); aspect-ratio: 4 / 5; pointer-events: none; visibility: hidden; }
.nz-rf-hover.is-on { visibility: visible; }
.nz-rf-hover.is-flipping { visibility: hidden; }
.nz-rf-layer { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-img); }
.nz-rf-layer__inner { position: absolute; inset: 0; background: var(--surface); }
.nz-rf-layer img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none), (pointer: coarse) { .nz-rf-hover { display: none; } }

/* ---------- in registro: due inchiostri che combaciano scorrendo ---------- */
.nz-rf-reg { height: 240vh; margin-top: clamp(64px, 8vw, 120px) !important; }
.nz-rf-reg__sticky { position: sticky; top: 0; height: 100svh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.nz-rf-reg__text p { font-size: var(--step-lead); line-height: 1.3; color: var(--ink-strong); }
.nz-rf-reg__meter { margin-top: 24px; font: 800 clamp(2.5rem, 1rem + 4vw, 4.5rem)/1 var(--font); letter-spacing: -0.04em; color: var(--ink) !important; transition: color 300ms; }
.nz-rf-reg.is-aligned .nz-rf-reg__meter { color: var(--ink-strong) !important; }
.nz-rf-reg__meter::after { content: ""; }
.nz-rf-reg.is-aligned .nz-rf-reg__meter::after { content: " ✓"; }
.nz-rf-reg__art { position: relative; aspect-ratio: 4 / 5; max-height: 78svh; justify-self: center; width: min(100%, 520px); isolation: isolate; }
.nz-rf-reg__layer { position: absolute; inset: 0; border-radius: var(--r-img); overflow: hidden; mix-blend-mode: multiply; will-change: transform; }
.nz-rf-reg__layer img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.35); mix-blend-mode: screen; }
.nz-rf-reg__layer--red { background: var(--ink); }
.nz-rf-reg__layer--black { background: var(--ink-strong); opacity: 0.85; }

/* ---------- colophon ---------- */
.nz-rf-colophon { margin-top: clamp(64px, 8vw, 120px) !important; padding-bottom: var(--gap-section) !important; }
.nz-rf-authors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 20px 12px; }
.nz-rf-authors li { display: grid; justify-items: center; gap: 8px; text-align: center; font-size: 14px; font-weight: 700; line-height: 1.2; }
.nz-rf-authors img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); } /* taste-skill-ignore: anello rosso attorno all'avatar */
.nz-rf-colophon__print { display: flex; align-items: center; gap: 12px; margin: 40px 0; color: var(--muted); font-weight: 600; }
.nz-rf-colophon__print img { width: 72px; height: 72px; }
.nz-rf-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 45%, transparent); padding-top: 24px; }
.nz-rf-nav a:not(.nz-btn) { display: grid; gap: 2px; text-decoration: none; }
.nz-rf-nav a:not(.nz-btn) span { font-size: var(--step-small); color: var(--muted); font-weight: 600; }
.nz-rf-nav a:not(.nz-btn) strong { font-size: var(--step-lead); letter-spacing: -0.03em; color: var(--ink); }
.nz-rf-nav__all { grid-column: 2; }
.nz-rf-nav__next { grid-column: 3; text-align: right; justify-self: end; }

/* ---------- scheda dell'opera ---------- */
.nz-rf-ov__no { grid-column: 1 / -1; margin: 18px 0 0; font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; color: var(--ink); }
.nz-rf-ov__author { grid-column: 2 / 6; margin: 22px 0 0; font-weight: 700; color: var(--ink-strong); }
.nz-rf-ov__author span { display: inline-flex; align-items: center; gap: 10px; }
.nz-rf-ov__author img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.nz-rf-ov__step { position: fixed; z-index: 3; right: calc(2 * var(--ov-inset, 12px)); bottom: calc(2 * var(--ov-inset, 12px)); display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--ink-strong); color: var(--bg); }
.nz-rf-ov__step button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: inherit; font-size: 20px; cursor: pointer; }
.nz-rf-ov__step button:hover { background: var(--ink); }
.nz-rf-ov__step span { min-width: 48px; text-align: center; font: 700 13px/1 ui-monospace, "SF Mono", Menlo, monospace; }

/* ---------- tablet e telefono ---------- */
@media (max-width: 991px) {
	.nz-rf { --cards-visible: 1.9; }
	.nz-rf-cover { grid-template-columns: 1fr; min-height: 0; }
	.nz-rf-cover__art { grid-column: 1; grid-row: auto; aspect-ratio: 4 / 3; min-height: 0; }
	.nz-rf-cover__down { margin-top: 20px; }
	.nz-rf-ed { grid-template-columns: 1fr; }
	.nz-rf-row { min-height: 0; padding-bottom: 20px; }
	.nz-rf-row__head, .nz-rf-row__names { grid-column: 1 / -1; }
	.nz-rf-row__names { padding-left: calc(2 * 100% / 12); }
	.nz-rf-reg { height: 200vh; }
	.nz-rf-reg__sticky { grid-template-columns: 1fr; align-content: center; gap: 16px; }
	.nz-rf-reg__art { max-height: 52svh; width: auto; }
	.nz-rf-ov__author { grid-column: 3 / 12; }
}
@media (max-width: 640px) {
	.nz-rf { --cards-visible: 1.25; }
	.nz-rf-cover__word { font-size: 26vw; }
	.nz-rf-row__names { padding-left: 0; }
	.nz-rf-nav { grid-template-columns: 1fr 1fr; }
	.nz-rf-nav__all { grid-column: 1 / -1; grid-row: 2; justify-self: start; }
	.nz-rf-ov__author { grid-column: 1 / -1; }
	.nz-rf-ov__step { left: calc(2 * var(--ov-inset, 12px)); right: auto; }
}

/* ---------- barra del Refuso: nome, "Ferma il movimento", Sommario ---------- */
.nz-rf-bar { position: sticky; top: var(--rf-bar-top, 72px); z-index: 45; display: flex; align-items: center; gap: 8px; padding: 8px var(--margin); background: var(--bg); border-bottom: 1.5px dashed color-mix(in srgb, var(--ink) 35%, transparent); }
.nz-rf-bar__name { font: 700 12px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.nz-rf-bar__sp { flex: 1; }
.nz-rf-pill { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 2px solid var(--ink); border-radius: var(--r-pill); background: transparent; color: var(--ink); font: 600 var(--step-small)/1 var(--font); cursor: pointer; }
.nz-rf-pill:hover, .nz-rf-pill[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
@media (max-width: 560px) { .nz-rf-bar__name { display: none; } .nz-rf-bar__sp { display: none; } .nz-rf-bar { justify-content: flex-end; } .nz-rf-pill { font-size: 13px; padding: 0 12px; } }

/* ---------- sommario a schermo ---------- */
.nz-rf-toc { position: fixed; inset: 0; z-index: 310; overflow-y: auto; background: var(--bg); padding: 28px max(var(--margin), calc((100vw - var(--measure)) / 2)) 48px; }
.nz-rf-toc[hidden] { display: none; }
.nz-rf-toc__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.nz-rf-toc__head h2 { font-size: var(--step-head); }
.nz-rf-toc ol { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 2px; }
.nz-rf-toc a, .nz-rf-ribbon a { text-decoration: none; }
.nz-rf-toc a { display: grid; grid-template-columns: 4ch 1fr; gap: 16px; padding: 14px 0; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 35%, transparent); font-weight: 800; font-size: var(--step-lead); letter-spacing: -0.03em; color: var(--ink-strong); }
.nz-rf-toc a:hover { color: var(--ink); }
.nz-rf-toc a span, .nz-rf-ribbon a span { font: 700 12px/1.8 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.06em; color: var(--ink); }
.nz-rf-toc a em, .nz-rf-ribbon a em { font-style: normal; font-weight: 500; font-size: 0.7em; color: var(--muted); }

/* ---------- copertina viva: lo zero si apre ---------- */
.nz-rf-open { height: 210vh; position: relative; max-width: none !important; padding: 0 !important; }
/* lo spazio sotto testata e barra del Refuso */
.nz-rf-open { --rf-room: calc(100svh - var(--rf-bar-top, 72px) - 56px); }
.nz-rf-open__stage { position: sticky; top: calc(var(--rf-bar-top, 72px) + 56px); height: var(--rf-room); display: grid; place-items: center; overflow: hidden; }
.nz-rf-open__art { width: min(86vw, calc((var(--rf-room) - 96px) * 0.8)); aspect-ratio: 4 / 5; position: relative; background: var(--ink); border-radius: var(--r-img); overflow: hidden; transform-origin: 50% 47%; will-change: transform; }
.nz-rf-open__art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nz-rf-open__art text { font-family: var(--font); font-weight: 800; fill: var(--bg); }
.nz-rf-open__rows text { font-size: 16px; font-weight: 600 !important; fill: var(--ink-strong) !important; opacity: 0.45; }
.nz-rf-open__no { fill: var(--ink-strong) !important; }
.nz-rf-open__ink { stroke: var(--ink-strong); }
.nz-rf-open__caret { fill: var(--ink-strong); animation: nz-rf-blink 0.9s steps(1) infinite; }
@keyframes nz-rf-blink { 50% { opacity: 0; } }
.nz-rf-open__hint { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font: 600 13px/1 ui-monospace, "SF Mono", Menlo, monospace; color: var(--muted); transition: opacity 300ms; }
.nz-rf-open__hint::after { content: "↓"; display: block; margin-top: 8px; animation: nz-rf-bounce 1.6s ease-in-out infinite; }
.nz-rf-open.is-open .nz-rf-open__hint { opacity: 0; }
.nz-rf-open.is-still { height: auto; }
.nz-rf-open.is-still .nz-rf-open__stage { position: relative; height: auto; padding: 48px 0; }
html.nz-a-still .nz-rf-open__caret, html.nz-a-still .nz-rf-open__hint::after { animation: none; }

/* ---------- sommario a nastro ---------- */
.nz-rf-ribbon { max-width: none !important; padding: 22px 0 !important; border-block: 1.5px dashed color-mix(in srgb, var(--ink) 35%, transparent); overflow: hidden; margin-top: clamp(56px, 7vw, 100px); }
.nz-rf-ribbon__track { display: flex; gap: 48px; width: max-content; animation: nz-rf-ribbon 60s linear infinite; }
.nz-rf-ribbon:hover .nz-rf-ribbon__track, .nz-rf-ribbon:focus-within .nz-rf-ribbon__track { animation-play-state: paused; }
.nz-rf-ribbon ul { display: flex; gap: 48px; list-style: none; margin: 0; padding: 0; }
.nz-rf-ribbon a { display: inline-flex; align-items: baseline; gap: 10px; white-space: nowrap; font-weight: 800; font-size: var(--step-lead); letter-spacing: -0.03em; color: var(--ink-strong); }
.nz-rf-ribbon a:hover { color: var(--ink); text-decoration: underline; }
@keyframes nz-rf-ribbon { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .nz-rf-ribbon { overflow-x: auto; } .nz-rf-ribbon__track { animation: none; } .nz-rf-ribbon ul[aria-hidden] { display: none; } }
html.nz-a-still .nz-rf-ribbon { overflow-x: auto; }
html.nz-a-still .nz-rf-ribbon ul[aria-hidden] { display: none; }

/* ---------- editoriale: testo e note a margine ---------- */
.nz-rf-ed__body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: clamp(20px, 3vw, 44px); align-items: start; }
.nz-rf-ed__notes { display: grid; gap: 12px; position: sticky; top: calc(var(--rf-bar-top, 72px) + 72px); }
.nz-rf-note { padding: 14px 16px; border-radius: 16px; background: var(--surface); font-size: var(--step-small); line-height: 1.45; color: var(--ink-strong); }
.nz-rf-note b { display: block; margin-bottom: 4px; font: 700 11px/1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.08em; color: var(--ink); text-transform: uppercase; }
.nz-rf-note[hidden] { display: none; }
@media (max-width: 991px) { .nz-rf-ed__body { grid-template-columns: 1fr; } .nz-rf-ed__notes { position: static; } }
