/* =========================================================
   Franco il Lupo e la Prima Missione — stili
   Palette ricavata dalla prima tavola: crema, pergamena, ambra,
   terracotta e marrone, con verde bosco e piccoli accenti blu e rosso.
   ========================================================= */

:root {
  --crema: #f8f0df;
  --pergamena: #efdfbf;
  --pergamena-scura: #e2cc9f;
  --ambra: #d8922e;
  --ambra-chiara: #f2c46d;
  --terracotta: #a9482a;
  --terracotta-scura: #8a3920;
  --marrone: #5b3b24;
  --legno: #3b2618;
  --inchiostro: #2c1e14;
  --bosco: #3e6a3b;
  --bosco-scuro: #2b4c2b;
  --blu: #3a6aa3;
  --salvia: #dfe2c3;
  --muschio: #b7c493;
  --felce: #7f9a5c;
  --sottobosco: #1c2f1d;
  --rosso: #b33a2f;

  --testo: #3a281b;
  --testo-tenue: #6b5442;

  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: "Outfit", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  --raggio: 22px;
  --raggio-s: 12px;
  --ombra: 0 1px 2px rgb(91 59 36 / .10), 0 18px 40px -18px rgb(91 59 36 / .35);
  --ombra-forte: 0 2px 4px rgb(44 30 20 / .25), 0 30px 60px -25px rgb(20 12 6 / .7);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --focus: 0 0 0 3px var(--crema), 0 0 0 6px var(--blu);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--testo);
  background:
    radial-gradient(1000px 640px at 88% -8%, rgb(255 214 140 / .55), transparent 62%),
    radial-gradient(760px 620px at -10% 70vh, rgb(176 132 84 / .22), transparent 70%),
    /* dal beige al marrone chiaro lungo la prima schermata, poi resta marrone chiaro */
    linear-gradient(180deg, #f8f0de 0, #efe1c6 50vh, #e4cca7 100vh, #e6d0ae 140vh);
  background-color: #e6d0ae;
  -webkit-font-smoothing: antialiased;
}

/* grana leggera da carta: fissa e senza eventi, per non pesare sullo scroll */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .07;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100;
  color: var(--legno);
  line-height: 1.05;
  letter-spacing: -.015em;
  margin: 0;
}

p { margin: 0; }

a { color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 10px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: .7rem 1rem;
  background: var(--legno);
  color: var(--crema);
  border-radius: 10px;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 1rem; }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  padding: 0 .35em;
  font: 600 .85em/1.6 var(--font-body);
  color: var(--legno);
  background: var(--crema);
  border: 1px solid var(--pergamena-scura);
  border-bottom-width: 3px;
  border-radius: 6px;
}

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bosco);
}

/* ---------- Pulsanti ---------- */
.btn {
  --bg: var(--pergamena);
  --fg: var(--legno);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 48px;
  padding: .75rem 1.3rem;
  font: 600 1rem/1.1 var(--font-body);
  color: var(--fg);
  background: var(--bg);
  border: 0;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .35s var(--ease), background-color .25s, box-shadow .25s, opacity .25s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 20px; height: 20px; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { cursor: not-allowed; opacity: .38; }

.btn--primary {
  --bg: var(--terracotta);
  --fg: #fff8ec;
  min-height: 56px;
  padding: 1rem 1.6rem 1rem 1.8rem;
  font-size: 1.1rem;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 12px 24px -12px rgb(138 57 32 / .8);
}
.btn--primary:hover { --bg: var(--terracotta-scura); }
.btn--primary svg { transition: transform .35s var(--ease); }
.btn--primary:hover svg { transform: translateX(3px); }

.btn--ghost {
  --bg: transparent;
  box-shadow: inset 0 0 0 2px var(--marrone);
}
.btn--ghost:hover { --bg: var(--pergamena); }

.btn--small { min-height: 44px; padding: .6rem 1.1rem; --bg: var(--terracotta); --fg: #fff8ec; }

/* ---------- Animazioni d'ingresso (solo con JS attivo) ---------- */
.js [data-anim] {
  opacity: 0;
  transform: translateY(18px);
  animation: rise .9s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 120ms);
}
@keyframes rise { to { opacity: 1; transform: none; } }

.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Viste ---------- */
.view[hidden] { display: none !important; }

/* ==================== INTRODUZIONE ==================== */
.view--intro { overflow-x: clip; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--legno);
  text-decoration: none;
}
.brand__paw { width: 26px; height: 26px; fill: var(--terracotta); }

.link-read {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .5rem .9rem;
  font-weight: 600;
  font-size: .95rem;
  color: var(--marrone);
  text-decoration: none;
  border-radius: 999px;
  transition: background-color .25s;
}
.link-read svg { width: 20px; height: 20px; }
.link-read:hover { background: rgb(239 223 191 / .8); }

/* Hero asimmetrico: testo a sinistra, illustrazione a destra */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 6vw, 5rem);
  min-height: calc(100dvh - 88px);
}

.hero { position: relative; }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(118deg, transparent 38%, rgb(255 232 178 / .32) 50%, transparent 62%),
    linear-gradient(118deg, transparent 58%, rgb(255 232 178 / .22) 66%, transparent 74%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent);
  mask-image: linear-gradient(to bottom, #000 55%, transparent);
}

.hero__copy { display: grid; gap: 1.5rem; justify-items: start; }

.hero__title { display: grid; gap: .35rem; }
.hero__title-main {
  font-size: clamp(2.8rem, 6.4vw, 5.4rem);
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.03em;
}
.hero__title-sub {
  font-size: clamp(1.6rem, 3.4vw, 2.7rem);
  font-weight: 600;
  font-style: italic;
  color: var(--terracotta);
}

.hero__lead {
  max-width: 34rem;
  font-size: clamp(1.08rem, 1.4vw, 1.2rem);
  color: var(--testo-tenue);
}

.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: .25rem; }
.hero__meta { font-size: .95rem; color: var(--testo-tenue); }

/* cartello di legno con i valori, come nella tavola */
.signpost {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem .6rem;
  margin: .5rem 0 0;
  padding: 0;
  list-style: none;
}
.signpost li {
  padding: .3rem .8rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: .95rem;
  color: var(--legno);
  background: linear-gradient(180deg, #e9c98f, #dcb172);
  border-radius: 8px;
  box-shadow: inset 0 -2px 0 rgb(91 59 36 / .25), 0 1px 0 rgb(255 255 255 / .5);
}
.signpost li:nth-child(1) { transform: rotate(-4deg); }
.signpost li:nth-child(2) { transform: rotate(3deg) translateY(2px); }
.signpost li:nth-child(3) { transform: rotate(-2.5deg) translateY(-1px); }
.signpost li:nth-child(4) { transform: rotate(4.5deg) translateY(1px); }

/* Illustrazione nella cornice ad arco */
.hero__art {
  position: relative;
  justify-self: center;
  width: min(100%, 500px);
}

/* la foto ha già il suo bosco: cornice con le stesse proporzioni, nessun ritaglio della zampa alzata */
.arch {
  position: relative;
  margin: 0;
  aspect-ratio: 1200 / 1267;
  overflow: hidden;
  border-radius: 28px;
  background: var(--muschio);
  border: 10px solid #fbf5e8;
  box-shadow: 0 0 0 2px var(--pergamena-scura), 0 2px 4px rgb(43 76 43 / .12), 0 34px 60px -28px rgb(28 47 29 / .55);
}
.arch__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* se manca franco-hero.jpg mostriamo la posa ritagliata */
.arch.is-fallback { aspect-ratio: 9 / 10; background: #fbf9fb; }
.arch.is-fallback .arch__img { object-position: 50% 0; }

/* arco verde decorativo dietro la cornice, come una radura */
.hero__art::after {
  content: "";
  position: absolute;
  inset: -7% 14% 16% -7%;
  z-index: -1;
  border-radius: 999px 999px 32px 32px;
  background: linear-gradient(180deg, var(--muschio) 0%, var(--felce) 55%, var(--bosco) 100%);
  opacity: .85;
}

/* bagliore caldo dietro l'arco */
.hero__art::before {
  content: "";
  position: absolute;
  inset: -12% -16% -6%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(242 196 109 / .55), transparent);
  animation: glow 7s ease-in-out infinite alternate;
}
@keyframes glow { from { opacity: .7; transform: scale(.97); } to { opacity: 1; transform: scale(1.03); } }

.leaf { position: absolute; fill: var(--bosco); pointer-events: none; }
.leaf--a { width: 74px; height: 74px; left: -34px; bottom: 12%; transform: rotate(-28deg); opacity: .9; }
.leaf--b { width: 54px; height: 54px; right: -20px; top: 18%; transform: rotate(32deg); fill: var(--bosco-scuro); opacity: .8; }

.firefly {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ambra-chiara);
  box-shadow: 0 0 0 3px rgb(242 196 109 / .25);
  pointer-events: none;
  animation: drift 6s ease-in-out infinite;
  animation-delay: var(--d);
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0); opacity: .25; }
  50% { transform: translate(8px, -14px); opacity: 1; }
}

/* colline */
.hills { display: block; width: 100%; height: clamp(50px, 8vw, 110px); margin-bottom: -1px; }
.hills__back { fill: #7f9a5c; opacity: .55; }
.hills__front { fill: var(--bosco); }

/* Chi è Franco */
.about {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(3.5rem, 8vw, 7rem) max(clamp(1rem, 4vw, 2.5rem), calc((100% - 1240px) / 2 + 2.5rem));
  background:
    radial-gradient(900px 520px at 88% 100%, rgb(20 38 22 / .55), transparent 70%),
    radial-gradient(700px 420px at 8% 70%, rgb(127 154 92 / .22), transparent 70%),
    linear-gradient(180deg, var(--bosco) 0%, #335a32 55%, var(--bosco-scuro) 100%);
  color: #f3ead6;
}
.about h2 { color: #fff6e3; font-size: clamp(2rem, 4vw, 3.1rem); margin-top: .6rem; }
.about .eyebrow { color: var(--ambra-chiara); }
.about__lead { margin-top: 1.1rem; max-width: 36rem; font-size: 1.15rem; color: #e7dcc4; }

.portrait { margin: 0; justify-self: center; width: min(100%, 400px); transform: rotate(-2deg); }
.portrait__mat {
  padding: 14px;
  background: var(--crema);
  border-radius: var(--raggio-s);
  box-shadow: 0 2px 0 rgb(0 0 0 / .08), 0 26px 50px -24px rgb(16 30 14 / .8);
}
.portrait__mat img { width: 100%; border-radius: 6px; background: var(--muschio); }
.facts { margin: 2rem 0 0; display: grid; }
.facts > div {
  display: grid;
  grid-template-columns: minmax(8rem, 11rem) 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid rgb(243 234 214 / .22);
}
.facts > div:last-child { border-bottom: 1px solid rgb(243 234 214 / .22); }
.facts dt { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ambra-chiara); }
.facts dd { margin: 0; color: #efe5cf; }

/* Come si legge */
.howto {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto;
  align-items: center;
  gap: 2rem;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.5rem);
}
.howto h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.howto__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.howto__list li { padding: .85rem 0; border-top: 1px solid rgb(59 38 24 / .16); color: var(--testo-tenue); }
.howto__list li:last-child { border-bottom: 1px solid rgb(59 38 24 / .16); }
.howto__list strong { color: var(--legno); font-weight: 600; }

/* Footer: legno scuro, chiude la pagina come il suolo del bosco */
.site-footer {
  color: #e9dcc3;
  background:
    radial-gradient(700px 300px at 85% 0%, rgb(216 146 46 / .14), transparent 70%),
    linear-gradient(180deg, #4a3020 0%, var(--legno) 60%, #2e1d12 100%);
  padding: clamp(2.75rem, 6vw, 4rem) max(clamp(1rem, 4vw, 2.5rem), calc((100% - 1240px) / 2 + 2.5rem)) 1.5rem;
}
.site-footer a { color: #f6e9cf; text-underline-offset: 3px; text-decoration-color: rgb(246 233 207 / .4); }
.site-footer a:hover { text-decoration-color: currentColor; }
.site-footer :focus-visible { box-shadow: 0 0 0 3px var(--legno), 0 0 0 6px var(--ambra-chiara); }

.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
  gap: 2rem clamp(1.5rem, 4vw, 3rem);
}
.footer__brand { display: grid; gap: .8rem; align-content: start; }
.footer__name {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff6e3;
}
.footer__name svg { width: 24px; height: 24px; fill: var(--ambra-chiara); }
.footer__brand p { max-width: 42ch; font-size: .95rem; color: #d9c9ab; }

.footer__company { margin-bottom: .7rem; font-weight: 600; color: #fff6e3; }
.footer__col h2 {
  margin-bottom: .7rem;
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ambra-chiara);
}
.footer__col address, .footer__col p { font-style: normal; font-size: .93rem; line-height: 1.65; }
.footer__col p + p, .footer__col address + p { margin-top: .7rem; }
.footer__label { display: block; font-size: .8rem; color: #bba989; }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.25rem;
  border-top: 1px solid rgb(233 220 195 / .16);
  font-size: .85rem;
  color: #cbb994;
}
.footer__links { display: flex; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }

@media (max-width: 640px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* ==================== LETTORE ==================== */
.view--reader {
  --chrome: 10.5rem; /* spazio occupato da barra superiore e comandi */
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100dvh;
  color: var(--crema);
  background:
    radial-gradient(60% 55% at 50% 45%, rgb(216 146 46 / .26), transparent 75%),
    radial-gradient(80% 60% at 50% 110%, rgb(10 20 11 / .6), transparent 70%),
    linear-gradient(180deg, #2b4529 0%, #1f331f 50%, #142315 100%);
}

.reader__bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: .75rem clamp(.75rem, 3vw, 1.5rem);
}
.reader__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pergamena);
  text-align: center;
  border-radius: 6px;
}
.reader__counter {
  justify-self: end;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  font-size: .95rem;
  color: var(--pergamena);
  padding: .4rem .8rem;
  border-radius: 999px;
  background: rgb(248 240 223 / .08);
  box-shadow: inset 0 0 0 1px rgb(248 240 223 / .14);
}

.btn--bar {
  --bg: rgb(248 240 223 / .08);
  --fg: var(--crema);
  justify-self: start;
  min-height: 44px;
  padding: .55rem 1rem .55rem .7rem;
  font-size: .95rem;
  box-shadow: inset 0 0 0 1px rgb(248 240 223 / .14);
}
.btn--bar:hover { --bg: rgb(248 240 223 / .16); }

.reader__stage {
  display: grid;
  place-items: center;
  padding: .25rem clamp(.75rem, 3vw, 1.5rem);
  min-height: 0;
}

/* la tavola: sempre intera, proporzioni originali, nessun ritaglio */
.sheet {
  --ratio: 0.707;
  position: relative;
  margin: 0;
  width: min(100%, calc((100dvh - var(--chrome)) * var(--ratio)));
  aspect-ratio: var(--ratio);
  border-radius: 6px;
  background: var(--pergamena);
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06), var(--ombra-forte);
  transition: opacity .32s var(--ease), transform .32s var(--ease);
}
.sheet__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-in;
}
.sheet.is-leaving { opacity: 0; transform: translateX(calc(var(--dir, 1) * -14px)); }
.sheet.is-entering { opacity: 0; transform: translateX(calc(var(--dir, 1) * 14px)); transition: none; }

.sheet__skeleton {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background:
    linear-gradient(100deg, transparent 30%, rgb(255 255 255 / .35) 50%, transparent 70%) 0 0 / 250% 100%,
    var(--pergamena);
  animation: shimmer 1.6s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
@keyframes shimmer { from { background-position: 150% 0, 0 0; } to { background-position: -100% 0, 0 0; } }

.sheet[data-state="loading"] .sheet__skeleton { opacity: 1; }
.sheet[data-state="loading"] .sheet__img,
.sheet[data-state="error"] .sheet__img { visibility: hidden; }

.sheet__error {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .6rem;
  padding: 2rem;
  text-align: center;
  color: var(--testo);
  background: var(--pergamena);
  border-radius: 6px;
}
.sheet__error[hidden] { display: none; }
.sheet__error svg { width: 44px; height: 44px; fill: var(--terracotta); opacity: .8; }
.sheet__error-title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--legno); }
.sheet__error-text { max-width: 28ch; color: var(--testo-tenue); font-size: .98rem; }
.sheet__error code { font-size: .92em; background: rgb(91 59 36 / .1); padding: .05em .35em; border-radius: 4px; }

.reader__footer { display: grid; gap: .6rem; padding: .6rem clamp(.75rem, 3vw, 1.5rem) max(.9rem, env(safe-area-inset-bottom)); }

.progress {
  width: min(100%, 520px);
  height: 3px;
  margin: 0 auto;
  border-radius: 3px;
  background: rgb(248 240 223 / .14);
  overflow: hidden;
}
.progress__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--ambra);
  transform-origin: left;
  transform: scaleX(var(--p, 1));
  transition: transform .5s var(--ease);
}

.reader__controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .6rem;
  width: min(100%, 620px);
  margin: 0 auto;
}
.btn--nav {
  --bg: var(--crema);
  --fg: var(--legno);
  justify-self: start;
  min-width: 9.5rem;
}
.btn--nav:hover:not(:disabled) { --bg: #fff8ec; }
.btn--next { justify-self: end; --bg: var(--ambra-chiara); }
.btn--next:hover:not(:disabled) { --bg: #f6d189; }
.btn--zoom {
  --bg: transparent;
  --fg: var(--crema);
  box-shadow: inset 0 0 0 1px rgb(248 240 223 / .3);
}
.btn--zoom:hover { --bg: rgb(248 240 223 / .1); }

.view--reader :focus-visible { box-shadow: 0 0 0 3px #142315, 0 0 0 6px var(--ambra-chiara); }
.view--reader .reader__title:focus { box-shadow: none; } /* riceve il focus solo per i lettori di schermo */

.reader__note { min-height: 1.4em; text-align: center; font-size: .9rem; color: rgb(248 240 223 / .7); }

/* ==================== INGRANDIMENTO ==================== */
.zoom {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--crema);
  background: #132014;
}
.zoom[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.zoom::backdrop { background: rgb(19 32 20 / .85); }

.zoom__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .6rem clamp(.75rem, 3vw, 1.5rem);
  background: linear-gradient(90deg, #22381f, #1a2c1a);
  box-shadow: 0 1px 0 rgb(248 240 223 / .08);
}
.zoom__title { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: .95rem; color: var(--pergamena); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zoom__tools { display: flex; align-items: center; gap: .35rem; }
.zoom__level { min-width: 3.4rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; color: var(--pergamena); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--crema);
  background: rgb(248 240 223 / .08);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s, transform .2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover:not(:disabled) { background: rgb(248 240 223 / .18); }
.icon-btn:active:not(:disabled) { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn--close { background: var(--crema); color: var(--legno); margin-left: .25rem; }
.icon-btn--close:hover { background: #fff8ec !important; }
.zoom :focus-visible { box-shadow: 0 0 0 3px #132014, 0 0 0 6px var(--ambra-chiara); }

.zoom__viewport { overflow: auto; overscroll-behavior: contain; padding: 1rem; }
.zoom__viewport:focus-visible { box-shadow: inset 0 0 0 3px var(--ambra-chiara); border-radius: 0; }
.zoom__img { max-width: none; margin: 0 auto; border-radius: 4px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
  .howto { grid-template-columns: 1fr; gap: 1.25rem; }
  .howto .btn { justify-self: start; }
}

@media (max-width: 767px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 2.5rem; padding-top: .5rem; }
  .hero__art { width: min(86%, 380px); }
  .signpost { gap: .5rem .4rem; }
  .signpost li { padding: .3rem .62rem; font-size: .9rem; }
  .leaf--a { left: -22px; width: 56px; height: 56px; }
  .about { grid-template-columns: 1fr; }
  .portrait { width: min(82%, 340px); }
  .facts > div { grid-template-columns: 1fr; gap: .2rem; }

  .view--reader { --chrome: 9.5rem; }
  .reader__bar { grid-template-columns: auto 1fr; }
  .reader__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .btn--nav { min-width: 0; padding: .75rem 1rem; }
  .btn--zoom span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .btn--zoom { width: 52px; padding: 0; }
  .zoom__bar { gap: .5rem; padding-inline: .6rem; }
  .zoom__title { font-size: .85rem; }
  .zoom__tools { gap: .15rem; }
  .zoom__level { min-width: 2.9rem; font-size: .85rem; }
  .icon-btn { width: 42px; height: 42px; }
}

@media (max-width: 360px) {
  .btn--nav svg { display: none; }
  .zoom__level { min-width: 2.8rem; }
}

/* ==================== MOVIMENTO RIDOTTO ==================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js [data-anim], .js [data-reveal] { animation: none; opacity: 1; transform: none; }
  .firefly { opacity: .6; }
  .sheet__skeleton { animation: none; }
}
