/* ==========================================================
   ARCHITETTURA VERITAS — galleria fotografica della serata
   ========================================================== */

:root {
  --night:     #1a0410;
  --night-2:   #24071a;
  --wine-900:  #2c0616;
  --wine-500:  #6e1f44;
  --wine-300:  #a04a72;
  --rose:      #e7a3c0;
  --ivory:     #f9f2ea;
  --ivory-dim: rgba(249, 242, 234, .7);
  --line:      rgba(249, 242, 234, .16);
  --sans: "Jost", system-ui, sans-serif;
  --serif: "Cormorant Garamond", Georgia, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  background:
    radial-gradient(90rem 50rem at 50% -10%, #3a0a22 0%, transparent 60%),
    var(--night);
  color: var(--ivory);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
}

/* ---------- copertina ---------- */

.g-hero {
  position: relative;
  min-height: 88svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 6rem 1.4rem clamp(4.5rem, 10vh, 7rem);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.g-hero-img {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(26, 4, 16, .55) 0%, rgba(26, 4, 16, .2) 32%, rgba(26, 4, 16, .78) 72%, var(--night) 100%),
    url("../img/galleria/l/042.webp") center 40% / cover no-repeat;
  animation: hero-in 2.4s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes hero-in {
  from { opacity: 0; transform: scale(1.08); }
  to   { opacity: 1; transform: scale(1); }
}

.g-back {
  position: absolute;
  top: max(1.1rem, env(safe-area-inset-top));
  left: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem;
  border: 1px solid rgba(249, 242, 234, .32);
  border-radius: 999px;
  background: rgba(26, 4, 16, .38);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 400;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .3s, border-color .3s;
}

.g-back:hover { background: rgba(110, 31, 68, .6); border-color: rgba(249, 242, 234, .6); }

.g-hero-copy {
  max-width: 44rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  animation: rise 1.4s .3s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

.g-kicker {
  font-family: var(--sans);
  font-size: clamp(.66rem, 1.6vw, .8rem);
  font-weight: 400;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.g-title {
  font-weight: 300;
  font-size: clamp(3.6rem, 12vw, 8.2rem);
  line-height: .9;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-shadow: 0 4px 40px rgba(26, 4, 16, .6);
}

.g-sub {
  font-style: italic;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  color: var(--rose);
}

.g-intro {
  max-width: 34rem;
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.5;
  color: var(--ivory-dim);
}

.g-hq {
  max-width: 34rem;
  font-family: var(--sans);
  font-size: .82rem;
  line-height: 1.55;
  letter-spacing: .02em;
  color: var(--ivory-dim);
}

.g-hq a {
  color: var(--rose);
  font-weight: 500;
  text-underline-offset: .25em;
}

.g-ig-btn {
  margin-top: .5rem;
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  background: linear-gradient(120deg, #6e1f44, #a04a72 55%, #c8628d);
  box-shadow: 0 10px 30px rgba(160, 74, 114, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .7, .2, 1), box-shadow .3s;
}

.g-ig-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(160, 74, 114, .5), inset 0 1px 0 rgba(255, 255, 255, .25); }

.g-ig-btn.is-small { padding: .65rem 1.2rem; font-size: .72rem; }

.i-ig { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; }
.i-ig .dot { fill: currentColor; stroke: none; }

.g-scroll {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  width: 2.6rem;
  height: 2.6rem;
  margin-left: -1.3rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}

.g-scroll span {
  width: .6rem;
  height: .6rem;
  border-right: 1.5px solid var(--ivory);
  border-bottom: 1.5px solid var(--ivory);
  transform: translateY(-2px) rotate(45deg);
  animation: nudge 2.2s ease-in-out infinite;
}

@keyframes nudge {
  0%, 100% { translate: 0 -2px; }
  50%      { translate: 0 3px; }
}

/* ---------- capitoli (barra fissa) ---------- */

.g-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(26, 4, 16, .78);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}

.g-nav-inner {
  display: flex;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.g-nav-inner::-webkit-scrollbar { display: none; }

.g-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 400;
  letter-spacing: .08em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ivory-dim);
  transition: background .35s, color .35s, border-color .35s;
}

.g-chip-n {
  font-family: var(--serif);
  font-size: .95rem;
  font-weight: 500;
  color: var(--rose);
}

.g-chip-c {
  font-size: .64rem;
  opacity: .6;
}

.g-chip:hover { color: var(--ivory); border-color: rgba(249, 242, 234, .4); }

.g-chip.is-active {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--wine-900);
}

.g-chip.is-active .g-chip-n { color: var(--wine-500); }

/* ---------- capitolo ---------- */

.g-main {
  max-width: 2400px;
  margin: 0 auto;
  padding: 0 clamp(.6rem, 2vw, 2rem);
}

.g-chapter { padding: clamp(3.5rem, 9vh, 6rem) 0 1rem; }

.g-chapter-head {
  max-width: 40rem;
  margin: 0 auto clamp(1.8rem, 4vh, 2.8rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: 0 .8rem;
}

.g-roman {
  width: 3.2rem;
  height: 3.2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(231, 163, 192, .45);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--rose);
}

.g-chapter-title {
  font-weight: 300;
  font-size: clamp(2.3rem, 5.6vw, 3.8rem);
  line-height: 1;
  letter-spacing: .02em;
}

.g-chapter-text {
  font-size: clamp(1.08rem, 2.2vw, 1.25rem);
  line-height: 1.5;
  color: var(--ivory-dim);
}

.g-chapter-count {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(249, 242, 234, .5);
}

/* ---------- griglia giustificata (righe alla stessa altezza) ---------- */

.g-grid {
  --row: clamp(170px, min(18vw, 34vh), 380px);
  --gap: clamp(5px, .7vw, 10px);
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
}

.g-grid::after {
  content: "";
  flex-grow: 1000000;
}

.g-item {
  position: relative;
  flex-grow: calc(var(--r) * 100);
  width: calc(var(--r) * var(--row));
  min-width: 0;
  aspect-ratio: var(--r);
  border-radius: 4px;
  overflow: hidden;
  background: var(--c);
  transition: opacity .8s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
}

.g-probe {
  position: absolute;
  width: 0;
  height: var(--row);
  visibility: hidden;
  pointer-events: none;
}

.g-grid { position: relative; }
.g-grid.is-laid::after { display: none; }
.g-grid.is-laid .g-item { flex: none; aspect-ratio: auto; }

.js .g-item:not(.is-in) { opacity: 0; transform: translateY(18px); }

.g-open {
  position: absolute;
  inset: 0;
  display: block;
  cursor: zoom-in;
}

.g-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.001);
  transition: opacity .6s ease, transform 1.2s cubic-bezier(.2, .7, .2, 1);
}

.js .g-open img:not(.is-loaded) { opacity: 0; }

.g-item::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(26, 4, 16, .72) 100%);
  opacity: 0;
  transition: opacity .4s;
}

@media (hover: hover) {
  .g-item:hover img { transform: scale(1.045); }
  .g-item:hover::after,
  .g-item:focus-within::after { opacity: 1; }
  .g-item:hover .g-bar,
  .g-item:focus-within .g-bar { opacity: 1; transform: none; }
}

.g-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: .35rem;
  padding: .5rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .35s, transform .35s cubic-bezier(.2, .7, .2, 1);
  pointer-events: none;
}

.g-bar button {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  height: 2.1rem;
  padding: 0 .7rem;
  border-radius: 999px;
  background: rgba(26, 4, 16, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(249, 242, 234, .2);
  font-family: var(--sans);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
  transition: background .25s, border-color .25s, transform .2s;
}

.g-bar button:hover { background: rgba(110, 31, 68, .8); border-color: rgba(249, 242, 234, .45); }
.g-bar button:active { transform: scale(.94); }

.i-heart, .i-down { width: 1.05rem; height: 1.05rem; flex: none; }
.i-heart { fill: transparent; stroke: currentColor; stroke-width: 1.8; transition: fill .25s, stroke .25s; }
.i-down { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

[aria-pressed="true"] .i-heart { fill: #ff5c8a; stroke: #ff5c8a; }
[aria-pressed="true"].is-pop .i-heart { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }

@keyframes pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.45); }
  100% { transform: scale(1); }
}

.g-item { container-type: inline-size; }

/* su touch le azioni restano sempre visibili */
@media (hover: none) {
  .g-item::after { opacity: 1; background: linear-gradient(180deg, transparent 58%, rgba(26, 4, 16, .7) 100%); }
  .g-bar { opacity: 1; transform: none; padding: .3rem; gap: .25rem; }
  .g-bar button { height: 1.7rem; padding: 0 .5rem; gap: .25rem; font-size: .66rem; }
  .g-bar .i-heart, .g-bar .i-down { width: .9rem; height: .9rem; }
}

/* miniature strette: azioni una sopra l'altra */
@container (max-width: 150px) {
  .g-bar { flex-direction: column; align-items: flex-end; }
}

/* ---------- piede ---------- */

.g-foot {
  margin-top: clamp(4rem, 10vh, 7rem);
  padding: 3rem 1.4rem calc(3rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  text-align: center;
  font-size: 1.05rem;
  color: var(--ivory-dim);
}

.g-foot-title {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ivory);
}

.g-foot-home {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-underline-offset: .35em;
}

/* ---------- visore ---------- */

.lb {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: #0e0208;
  color: var(--ivory);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  overscroll-behavior: contain;
}

.lb:not([open]) { display: none; }
.lb::backdrop { background: transparent; }

.lb[open] { animation: fade-in .35s ease both; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: max(.8rem, env(safe-area-inset-top)) 1rem .6rem 1.2rem;
}

.lb-meta {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  min-width: 0;
}

.lb-chapter {
  font-size: 1.3rem;
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-index {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  color: var(--ivory-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lb-close {
  position: relative;
  flex: none;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  transition: background .25s;
}

.lb-close:hover { background: rgba(249, 242, 234, .1); }

.lb-close span::before,
.lb-close span::after,
.gate-x span::before,
.gate-x span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.1rem;
  height: 1.5px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
}

.lb-close span::after,
.gate-x span::after { transform: translate(-50%, -50%) rotate(-45deg); }

.lb-stage {
  --pad: clamp(0rem, 5vw, 5.5rem);
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

.lb-img {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pad);
  right: var(--pad);
  width: calc(100% - 2 * var(--pad));
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .5));
  transition: opacity .35s ease, transform .45s cubic-bezier(.2, .7, .2, 1);
  will-change: transform, opacity;
  -webkit-user-drag: none;
}

.lb-img.is-leaving { opacity: 0; }

.lb-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7rem;
  height: 7rem;
  margin: -3.5rem 0 0 -3.5rem;
  pointer-events: none;
  opacity: 0;
}

.lb-burst .i-heart { width: 100%; height: 100%; fill: #ff5c8a; stroke: none; filter: drop-shadow(0 6px 24px rgba(255, 92, 138, .6)); }

.lb-burst.is-on { animation: burst .9s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes burst {
  0%   { opacity: 0; transform: scale(.3); }
  25%  { opacity: 1; transform: scale(1.12); }
  45%  { transform: scale(.94); }
  70%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.3) translateY(-18px); }
}

.lb-arrow {
  position: absolute;
  top: 50%;
  width: 3.4rem;
  height: 3.4rem;
  margin-top: -1.7rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(26, 4, 16, .45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background .25s, opacity .25s;
}

.lb-arrow:hover { background: rgba(110, 31, 68, .7); }
.lb-arrow:disabled { opacity: 0; pointer-events: none; }
.lb-arrow.is-prev { left: 1rem; }
.lb-arrow.is-next { right: 1rem; }

.lb-arrow span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: .75rem;
  height: .75rem;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translate(-30%, -50%) rotate(45deg);
}

.lb-arrow.is-next span { transform: translate(-70%, -50%) rotate(-135deg); }

.lb-bottom {
  display: flex;
  justify-content: center;
  gap: .7rem;
  padding: .8rem 1rem max(1rem, env(safe-area-inset-bottom));
}

.lb-like,
.lb-dl {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  height: 3rem;
  padding: 0 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(249, 242, 234, .25);
  font-family: var(--sans);
  font-size: .84rem;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  transition: background .25s, border-color .25s, transform .2s;
}

.lb-like:hover { border-color: rgba(249, 242, 234, .5); }
.lb-like:active, .lb-dl:active { transform: scale(.96); }
.lb-like .i-heart, .lb-dl .i-down { width: 1.25rem; height: 1.25rem; }
.lb-like[aria-pressed="true"] { border-color: rgba(255, 92, 138, .55); background: rgba(255, 92, 138, .12); }

.lb-dl {
  background: var(--ivory);
  border-color: var(--ivory);
  color: var(--wine-900);
  font-weight: 500;
}

.lb-dl:hover { background: #fff; }

.lb-dl em {
  font-style: normal;
  font-weight: 400;
  font-size: .72rem;
  padding-left: .6rem;
  border-left: 1px solid rgba(44, 6, 22, .2);
  color: var(--wine-500);
}

/* ---------- finestra Instagram ---------- */

.gate {
  margin: auto;
  width: min(26rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  border: 1px solid rgba(249, 242, 234, .18);
  border-radius: 22px;
  padding: 2rem 1.6rem 1.6rem;
  background:
    radial-gradient(30rem 16rem at 50% 0%, rgba(160, 74, 114, .35), transparent 70%),
    var(--night-2);
  color: var(--ivory);
  text-align: center;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
}

.gate::backdrop {
  background: rgba(10, 1, 6, .72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.gate[open] { animation: gate-in .45s cubic-bezier(.2, .9, .3, 1.1) both; }

@keyframes gate-in {
  from { opacity: 0; transform: translateY(20px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

.gate-x {
  position: absolute;
  top: .7rem;
  right: .7rem;
}

.gate-x button {
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--ivory-dim);
}

.gate-x button:hover { background: rgba(249, 242, 234, .08); color: var(--ivory); }

.gate-thumb {
  display: block;
  width: 6.5rem;
  height: 6.5rem;
  margin: 0 auto;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
  transform: rotate(-4deg);
}

.gate-ig {
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  margin: -1.5rem auto 0 calc(50% + 1.4rem);
  position: relative;
  border-radius: 14px;
  background: linear-gradient(45deg, #f9ce34, #ee2a7b 50%, #6228d7);
  box-shadow: 0 8px 20px rgba(238, 42, 123, .4);
  color: #fff;
}

.gate-ig .i-ig { width: 1.6rem; height: 1.6rem; stroke-width: 2; }

.gate-title {
  margin-top: 1rem;
  font-weight: 400;
  font-size: 2rem;
  line-height: 1.1;
}

.gate-text {
  margin-top: .6rem;
  font-size: 1.12rem;
  line-height: 1.45;
  color: var(--ivory-dim);
}

.gate-text strong { color: var(--ivory); font-weight: 600; }

.gate-steps {
  list-style: none;
  margin-top: 1.4rem;
  display: grid;
  gap: .65rem;
}

.gate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-height: 3.3rem;
  padding: 0 1.2rem;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .25s, opacity .3s, background .3s, box-shadow .3s;
}

.gate-btn:active { transform: scale(.97); }

.gate-n {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  font-size: .78rem;
  letter-spacing: 0;
}

.gate-btn.is-ig {
  background: linear-gradient(90deg, #f9a134, #ee2a7b 50%, #8a3ab9);
  color: #fff;
  box-shadow: 0 10px 26px rgba(238, 42, 123, .35);
}

.gate-btn.is-dl {
  background: rgba(249, 242, 234, .08);
  color: rgba(249, 242, 234, .42);
  border: 1px dashed rgba(249, 242, 234, .25);
  pointer-events: none;
}

.gate-btn.is-dl .gate-n { background: rgba(249, 242, 234, .1); }

.gate.is-followed .gate-btn.is-ig { background: rgba(249, 242, 234, .1); box-shadow: none; color: var(--ivory-dim); }
.gate.is-followed .gate-btn.is-ig .gate-n { background: #3fbf7f; color: #fff; font-size: 0; }
.gate.is-followed .gate-btn.is-ig .gate-n::before { content: "\2713"; font-size: .8rem; }

.gate.is-followed .gate-btn.is-dl {
  background: var(--ivory);
  color: var(--wine-900);
  border: 1px solid var(--ivory);
  pointer-events: auto;
  box-shadow: 0 10px 28px rgba(249, 242, 234, .18);
  animation: unlock .6s cubic-bezier(.2, 1.4, .4, 1);
}

.gate.is-followed .gate-btn.is-dl .gate-n { background: var(--wine-500); color: var(--ivory); }

@keyframes unlock {
  0%   { transform: scale(.94); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.gate-note {
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: .74rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: rgba(249, 242, 234, .5);
}

/* ---------- avviso ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.2rem, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: calc(100% - 2rem);
  padding: .8rem 1.3rem;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--wine-900);
  font-family: var(--sans);
  font-size: .82rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .4);
  transform: translate(-50%, 150%);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.1), opacity .3s;
  pointer-events: none;
}

.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- smartphone ---------- */

@media (max-width: 640px) {
  html { scroll-padding-top: 4.2rem; }

  .g-hero { min-height: 92svh; padding: 5rem 1.2rem 5rem; }
  .g-hero-img { background-position: center, 72% 50%; }
  .g-hero-copy { gap: .75rem; }
  .g-kicker { letter-spacing: .2em; line-height: 1.6; }
  .g-intro { font-size: 1.06rem; }

  .g-nav-inner { justify-content: flex-start; padding: .6rem .8rem; gap: .4rem; }
  .g-chip { padding: .45rem .8rem; font-size: .7rem; }

  .g-main { padding: 0 6px; }
  .g-grid { --row: 108px; --gap: 5px; }
  .g-item { border-radius: 3px; }

  .lb-stage { --pad: 0px; }
  .lb-arrow { width: 2.8rem; height: 2.8rem; margin-top: -1.4rem; background: rgba(26, 4, 16, .55); }
  .lb-arrow.is-prev { left: .5rem; }
  .lb-arrow.is-next { right: .5rem; }
  .lb-chapter { font-size: 1.15rem; }
  .lb-like, .lb-dl { height: 3rem; padding: 0 1rem; font-size: .8rem; }
  .lb-dl em { padding-left: .5rem; }
}

@media (max-width: 380px) {
  .g-grid { --row: 96px; }
  .lb-like span { font-size: 0; }
  .lb-like span strong { font-size: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .g-item { opacity: 1; transform: none; transition: none; }
  .g-hero-img, .g-hero-copy, .gate[open], .lb[open] { animation: none; }
}
