@font-face {
  font-family: "Sharp Grotesk";
  src: url("/_s/sharp-grotesk-book20.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f5f2ed;      /* Isabelline */
  --muted: #b0a99b;   /* Grullo */
  --ink: #141414;     /* Eerie Black */
  --gap: 12px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Sharp Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Copertina con animazione d'ingresso */
.cover { position: relative; height: 100svh; display: grid; place-items: end start; overflow: hidden; background: var(--ink); color: var(--bg); }
.cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); animation: reveal 1.8s cubic-bezier(.2,.7,.1,1) .1s forwards; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,20,20,.65), rgba(20,20,20,0) 55%); }
.cover-text { position: relative; z-index: 1; padding: clamp(24px, 6vw, 72px); max-width: 900px; opacity: 0; transform: translateY(16px); animation: rise 1s ease .9s forwards; }
.cover .logo { height: 28px; margin-bottom: 28px; filter: invert(1); }
.cover h1 { font-size: clamp(36px, 7vw, 88px); line-height: 1; letter-spacing: -.02em; font-weight: 400; }
.cover p { margin-top: 14px; font-size: clamp(16px, 2vw, 20px); opacity: .85; }
.enter { display: inline-block; margin-top: 28px; padding: 12px 22px; border: 1px solid currentColor; border-radius: 999px; text-decoration: none; }
.enter:hover { background: var(--bg); color: var(--ink); }
@keyframes reveal { to { opacity: 1; transform: scale(1); } }
@keyframes rise { to { opacity: 1; transform: none; } }

/* Galleria */
main#galleria { padding: clamp(16px, 4vw, 48px); }
.bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #6d675d; font-size: 14px; margin-bottom: 20px; }
.grid { columns: 3 320px; column-gap: var(--gap); }
.item { position: relative; break-inside: avoid; margin-bottom: var(--gap); background: #e7e2da; overflow: hidden; cursor: zoom-in; }
.item img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s ease, transform .6s ease; }
.item img.loaded { opacity: 1; }
.item:hover img { transform: scale(1.02); }
.badge { position: absolute; left: 10px; top: 10px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: rgba(20,20,20,.7); color: var(--bg); }
.dl { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--bg); text-decoration: none; opacity: 0; transition: opacity .2s; }
.item:hover .dl, .item:focus-within .dl { opacity: 1; }
@media (hover: none) { .dl { opacity: 1; } }

footer { padding: 48px 0 64px; display: grid; place-items: center; }
.mark { height: 22px; opacity: .6; }

/* Lightbox */
.lightbox { width: 100vw; height: 100svh; max-width: none; max-height: none; border: 0; padding: 0; background: rgba(20,20,20,.96); color: var(--bg); }
.lightbox::backdrop { background: transparent; }
.stage { position: absolute; inset: 56px 16px 72px; display: grid; place-items: center; }
.stage img, .stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .close { position: absolute; top: 8px; right: 16px; font-size: 32px; }
.lightbox nav { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; justify-content: center; align-items: center; gap: 28px; }
.lightbox nav button { font-size: 24px; padding: 4px 12px; }
.dl-one { padding: 10px 22px; border: 1px solid currentColor; border-radius: 999px; text-decoration: none; }

/* Pagine semplici */
.gone { min-height: 100svh; display: grid; place-content: center; justify-items: center; text-align: center; gap: 16px; padding: 24px; }
.gone .logo { height: 30px; margin-bottom: 16px; }
.gone h1 { font-weight: 400; font-size: 28px; }

@media (prefers-reduced-motion: reduce) {
  .cover-img, .cover-text { animation: none; opacity: 1; transform: none; }
  .item img { transition: none; }
}

/* Admin */
.admin { max-width: 1000px; margin: 0 auto; padding: 32px 16px 64px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; color: #6d675d; font-size: 14px; }
.admin-head .logo { height: 24px; }
.admin h2 { font-weight: 400; font-size: 22px; margin: 32px 0 16px; }
#new { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; align-items: end; }
#new label { display: grid; gap: 6px; font-size: 14px; color: #6d675d; }
#new input, #new select { font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid var(--muted); border-radius: 8px; background: #fff; }
.btn { padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 14px; white-space: nowrap; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--muted); }
.row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; border-top: 1px solid #ddd6cb; }
.row.off { opacity: .55; }
.row small { display: block; color: #6d675d; font-size: 13px; }
.stats { display: flex; gap: 16px; font-size: 14px; color: #6d675d; }
.actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
#info { border: 0; border-radius: 12px; padding: 24px; max-width: 560px; width: calc(100% - 32px); }
#info h3 { font-weight: 400; margin: 16px 0 8px; }
#info p, #info ol { font-size: 14px; margin-bottom: 16px; }
.note { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: #fff; border: 1px solid var(--muted); font-size: 14px; word-break: break-all; }
