/* Caratteri ospitati in locale (SIL OFL 1.1, vedi assets/fonts/LICENZA.txt), solo set latin. */
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("../fonts/cinzel.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 400 500; font-display: swap;
  src: url("../fonts/cormorant-garamond-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("../fonts/source-sans-3.woff2") format("woff2"); }

@property --x { syntax: "<length-percentage>"; inherits: true; initial-value: 72%; }
@property --y { syntax: "<length-percentage>"; inherits: true; initial-value: 46%; }

:root {
  --dark: #0e0e0d;
  --dark-2: #171715;
  --dark-3: #201f1c;
  --dark-line: rgba(236, 228, 210, .12);
  --light: #f4f0e8;
  --light-2: #e9e3d6;
  --line: #d3cbbb;
  --ink: #191816;
  --ink-soft: #5b5850;
  --on-dark: #ece6d9;
  --on-dark-soft: #a7a194;
  --bone: #e9e1cf;
  --accent: #d9a441;
  --accent-hi: #ecbe68;
  --accent-ink: #8a5d0f;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 4px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--light);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--dark); }

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.15; }
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: .03em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 2.9rem); max-width: 20ch; }
h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: .01em; }
h4 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); position: relative; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--dark); padding: 10px 16px; border-radius: var(--radius);
}
.skip:focus-visible { top: 12px; }

.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  transition: background .35s var(--ease), border-color .35s var(--ease), backdrop-filter .35s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(14, 14, 13, .86);
  backdrop-filter: blur(10px) saturate(1.2);
  border-bottom-color: var(--dark-line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--on-dark); text-decoration: none; }
.brand-mark { width: auto; height: 46px; opacity: 1; margin: -6px 0 -6px -4px; transition: transform .4s var(--ease); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-name { font-family: var(--font-display); letter-spacing: .1em; font-size: .92rem; white-space: nowrap; }

.brand-name { transition: opacity .45s var(--ease), transform .45s var(--ease); }
/* .show-name e --fade (sotto) sono impostati da main.js durante lo scorrimento */
.js .site-header:not(.show-name) .brand-name { opacity: 0; transform: translateX(-8px); }

.nav { display: flex; align-items: center; gap: 30px; }
.nav a {
  position: relative; color: var(--on-dark-soft); text-decoration: none;
  font-size: .9rem; letter-spacing: .04em; transition: color .2s; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--on-dark); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }
.nav .nav-cta { color: var(--accent); border: 1px solid rgba(217, 164, 65, .45); padding: 7px 16px; border-radius: 99px; }
.nav .nav-cta::after { display: none; }
.nav .nav-cta:hover { background: var(--accent); color: var(--dark); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 1.5px; margin: 6px 0; background: var(--on-dark); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

@media (max-width: 1140px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 72px 0 auto; flex-direction: column; align-items: stretch; gap: 0;
    max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain;
    background: rgba(14, 14, 13, .97); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--dark-line);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s, transform .25s var(--ease), visibility .25s;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 16px var(--gutter); border-top: 1px solid var(--dark-line); font-size: 1.05rem; }
  .nav a::after { display: none; }
  .nav .nav-cta { border: 0; border-top: 1px solid var(--dark-line); border-radius: 0; padding: 16px var(--gutter); }
  .site-header:has(.nav.open) { background: rgba(14, 14, 13, .97); }
}
@media (max-width: 400px) { .brand-name { font-size: .78rem; letter-spacing: .06em; } }

.hero {
  position: relative; overflow: clip; isolation: isolate;
  min-height: 100svh; display: flex; align-items: center;
  background: var(--dark); color: var(--on-dark);
  padding: 100px 0 130px;
}

.hero-light {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(circle 520px at var(--x) var(--y), rgba(217, 164, 65, .16), rgba(217, 164, 65, .05) 45%, transparent 75%),
    radial-gradient(ellipse 120% 80% at 50% 120%, #1c1a16, transparent 70%);
}

.hero-creature {
  position: absolute; inset: 0; z-index: -1;
  opacity: .92;
  -webkit-mask-image: radial-gradient(circle 300px at var(--x) var(--y), #000 0%, rgba(0,0,0,.55) 40%, rgba(0,0,0,.06) 100%);
          mask-image: radial-gradient(circle 300px at var(--x) var(--y), #000 0%, rgba(0,0,0,.55) 40%, rgba(0,0,0,.06) 100%);
}

.hero-creature img { position: absolute; right: 9%; top: 8%; height: 84%; width: auto; max-width: none; }

.hero-swarm {
  position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%;
  fill: var(--accent); opacity: .85; pointer-events: none;
  --cone: 260px;   /* letto da main.js (coneRadius) */
  -webkit-mask-image: radial-gradient(circle var(--cone) at var(--x) var(--y), #000 0%, rgba(0,0,0,.45) 45%, transparent 100%);
          mask-image: radial-gradient(circle var(--cone) at var(--x) var(--y), #000 0%, rgba(0,0,0,.45) 45%, transparent 100%);
}

@media (max-width: 760px) { .hero-swarm { --cone: 180px; } }
.hero.auto .hero-light, .hero.auto .hero-creature, .hero.auto .hero-swarm { animation: drift 14s ease-in-out infinite alternate; }
@keyframes drift {
  0%   { --x: 70%; --y: 32%; }
  35%  { --x: 82%; --y: 52%; }
  70%  { --x: 66%; --y: 66%; }
  100% { --x: 76%; --y: 40%; }
}

.hero-inner { width: 100%; container-type: inline-size; }
.hero h1 {
  font-size: clamp(3.2rem, 9vw, 7.4rem); line-height: .98; letter-spacing: .02em;
  margin-bottom: 32px; text-shadow: 0 2px 40px rgba(0,0,0,.6);
}

.hero h1.name-title {
  display: grid; width: 8.6em; max-width: 100%;
  font-size: clamp(2.4rem, min(5.6vw, 7.6vh), 4.5rem); line-height: 1.04; letter-spacing: 0;
  margin-bottom: 26px;
}
.nt-line { display: flex; justify-content: space-between; }
.nt-sub { font-size: .42em; line-height: 1; margin-top: .9em; color: var(--on-dark); opacity: .85; }
.nt-sub .sp { width: .6em; }

.motto {
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--accent); margin: 0 0 18px; letter-spacing: .01em;
}
.lead {
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.45; color: var(--on-dark); opacity: .85; max-width: 36ch;
}
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }

.scroll-cue {
  position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--on-dark); text-decoration: none; font-size: .74rem; font-weight: 600; letter-spacing: .3em; text-transform: uppercase;
  opacity: calc(.85 * var(--fade, 1)); transition: opacity .45s ease-out, color .25s;
}
.scroll-cue.gone { visibility: hidden; }
.scroll-cue span { padding-left: .3em; }
.scroll-cue i {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(236, 230, 217, .4);
  animation: cue 2.6s ease-in-out infinite; transition: border-color .25s;
}
.scroll-cue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue:hover, .scroll-cue:focus-visible { opacity: var(--fade, 1); color: var(--accent); }
.scroll-cue:hover i, .scroll-cue:focus-visible i { border-color: var(--accent); }
@keyframes cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

@media (max-width: 760px) {
  .hero { align-items: flex-end; padding-bottom: 140px; }
  .hero-creature { opacity: .8;
    -webkit-mask-image: radial-gradient(circle 300px at var(--x) var(--y), #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%);
            mask-image: radial-gradient(circle 300px at var(--x) var(--y), #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%); }
  .hero-creature img { right: 4%; top: 80px; height: clamp(140px, calc(100svh - 680px), 310px); }
  .hero h1 { margin-bottom: 22px; }
  .hero h1.name-title { font-size: calc((100vw - 2 * var(--gutter)) / 8.6); font-size: calc(100cqw / 8.6); }
  .hero .actions { gap: 10px; margin-top: 32px; }
  .hero .actions .btn { padding: 13px 18px; font-size: .9rem; }
}

/* Tablet in verticale. Stessa media query di portraitMQ in main.js: l'altezza del palpigrade la calcola sizePalp(). */
@media (min-width: 761px) and (max-aspect-ratio: 4/5) {
  .hero { align-items: flex-end; padding-bottom: 150px; }
  .hero-creature { opacity: .85;
    -webkit-mask-image: radial-gradient(circle 360px at var(--x) var(--y), #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%);
            mask-image: radial-gradient(circle 360px at var(--x) var(--y), #000 0%, rgba(0,0,0,.6) 40%, rgba(0,0,0,.3) 100%); }
  .hero-creature img { right: 7%; top: 96px; height: clamp(220px, calc(100svh - 555px - 24vw), 620px); }
  .hero h1.name-title { font-size: calc((100vw - 2 * var(--gutter)) / 8.6); font-size: calc(100cqw / 8.6); margin-bottom: 30px; }
  .motto { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 22px; }
  .lead { font-size: clamp(1.5rem, 2.7vw, 2.05rem); max-width: 32ch; }
  .hero .actions { margin-top: 44px; }
  .hero .actions .btn { padding: 17px 32px; font-size: 1.02rem; }
}

@media (max-width: 760px) and (max-height: 760px) {
  .hero-creature img { display: none; }
}

.hero-label {
  position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none;
  font-size: .8rem; letter-spacing: .04em; white-space: nowrap;
  color: var(--accent-hi); text-shadow: 0 1px 8px rgba(0, 0, 0, .9);
  opacity: 0; transition: opacity .35s ease;
}
.hero-label.visible { opacity: .92; transition: opacity 1s var(--ease) .3s; }
.hero-label.simbolo { color: var(--on-dark); }
.hero-label em { font-style: italic; }
@media (prefers-reduced-motion: reduce) { .hero-label { transition: none; } }
@media (max-width: 640px) { .hero-label { font-size: .72rem; letter-spacing: .02em; } }

.hero-inner > * { animation: rise 1.1s var(--ease) both; }
.hero-inner > :nth-child(2) { animation-delay: .12s; }
.hero-inner > :nth-child(3) { animation-delay: .24s; }
.hero-inner > :nth-child(4) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 99px;
  font-weight: 600; font-size: .95rem; letter-spacing: .03em; text-decoration: none;
  border: 1px solid transparent;
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--dark); }
.btn-primary:hover { background: var(--accent-hi); box-shadow: 0 10px 40px -10px rgba(217,164,65,.6); }
.btn-ghost { border-color: rgba(236, 230, 217, .28); color: var(--on-dark); }
.btn-ghost:hover { border-color: var(--on-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--light); }

.section { position: relative; padding: clamp(80px, 12vw, 150px) 0; overflow: clip; }
.alt { background: var(--light-2); }
.dark { background: var(--dark); color: var(--on-dark); }
.dark a { color: var(--accent); }

.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; }
.section-head.split .intro { margin: 0; }
.section-head.split h2 { margin-bottom: 0; }
@media (max-width: 860px) { .section-head.split { grid-template-columns: 1fr; gap: 20px; } }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  font-size: .76rem; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--accent-ink); margin-bottom: 22px;
}
.eyebrow .num {
  font-family: var(--font-display); font-size: .95rem; letter-spacing: .05em; font-weight: 500;
  display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow .num::after { content: ""; width: 16px; height: 1px; background: currentColor; opacity: .5; }
.dark .eyebrow { color: var(--accent); }

.intro { max-width: 52ch; font-size: 1.1rem; color: var(--ink-soft); }
.dark .intro { color: var(--on-dark-soft); }
.center { text-align: center; margin-top: 44px; }

.about-top { display: grid; gap: clamp(32px, 6vw, 96px); }
.about-top { grid-template-columns: 1.25fr 1fr; align-items: end; margin-bottom: clamp(48px, 6vw, 80px); }
.about-top .section-head { margin: 0; }
.about-text { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 3.5vw, 48px); }
.about-text p { margin: 0; }
.big-lead {
  font-family: var(--font-serif); font-style: italic; font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  line-height: 1.32; color: var(--ink); margin: 0;
  padding-left: 28px; border-left: 2px solid var(--accent);
}
.about-text p { color: var(--ink-soft); }
.about-text strong { color: var(--ink); font-weight: 600; }
@media (max-width: 960px) { .about-text { grid-template-columns: 1fr 1fr; } }
@media (max-width: 860px) {
  .about-top { grid-template-columns: 1fr; gap: 28px; }
  .about-text { grid-template-columns: 1fr; gap: 1em; }
}

.stats-band { position: relative; background: var(--dark-2); color: var(--on-dark); padding: clamp(56px, 8vw, 96px) 0; overflow: clip; }
.stats { list-style: none; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stats li { padding: 8px 28px; border-left: 1px solid var(--dark-line); display: flex; flex-direction: column; gap: 12px; }
.stats li:first-child { border-left: 0; padding-left: 0; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.4rem, 4.6vw, 3.6rem); line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.stat-label { color: var(--on-dark-soft); font-size: .95rem; line-height: 1.45; max-width: 18ch; }
@media (max-width: 860px) {
  .stats { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .stats li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 420px) { .stats li { padding: 4px 16px; } }

.topics { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: clamp(28px, 4vw, 56px); }
.topics li { position: relative; padding: 32px 0 40px; border-top: 1px solid var(--line); }
.topics li::before {
  content: ""; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease);
}
.topics li:hover::before, .topics li.in-focus::before { transform: scaleX(1); }
.topic-num { display: block; font-family: var(--font-display); color: var(--accent-ink); font-size: 1.25rem; font-weight: 500; letter-spacing: .08em; line-height: 1; margin: 0; }

.topic-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.topic-icon { width: 72px; height: 48px; overflow: visible; transform-origin: 85% 50%; fill: var(--accent-ink); opacity: .9; transition: transform .5s var(--ease), opacity .3s; }
.topics li:hover .topic-icon, .topics li.in-focus .topic-icon { transform: rotate(-8deg) scale(1.06); opacity: 1; }

.topic-icon.icon-palp { stroke: var(--accent-ink); stroke-width: 11; stroke-linejoin: round; stroke-linecap: round; }
.topics h3 { color: var(--ink); font-size: 1.25rem; font-weight: 600; }
.topics p { color: var(--ink-soft); margin: 0; }
@media (max-width: 960px) { .topics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .topics { grid-template-columns: 1fr; } .topics li { padding: 26px 0 30px; } }

.pubs { margin-top: clamp(72px, 10vw, 120px); }
.pubs-head { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: end; margin-bottom: 48px; }
.pubs-head p { color: var(--ink-soft); margin: 0; max-width: 46ch; }
.sub { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.6rem, 2.8vw, 2.1rem); letter-spacing: .03em; margin: 0; }
@media (max-width: 860px) { .pubs-head { grid-template-columns: 1fr; gap: 14px; } }

.books { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 56px); }
.book { display: grid; grid-template-columns: 170px 1fr; gap: 32px; align-items: center; }
.book-info p { color: var(--ink-soft); margin: 0; }
.book-info h4 { font-size: 1.3rem; color: var(--ink); margin-bottom: .4em; }
.meta { font-size: .88rem; color: var(--accent-ink) !important; margin-bottom: .8em !important; letter-spacing: .02em; }

.cover {
  width: 100%; height: auto; border-radius: 2px 4px 4px 2px;
  outline: 1px solid rgba(236, 228, 210, .14); outline-offset: -1px;
  box-shadow: 0 28px 44px -20px rgba(40,30,10,.55);
  transform: perspective(900px) rotateY(-12deg); transition: transform .6s var(--ease), box-shadow .6s;
}
.book:hover .cover, .book:focus-within .cover { transform: perspective(900px) rotateY(-3deg) translateY(-4px); box-shadow: 0 34px 54px -20px rgba(40,30,10,.6); }

.book { position: relative; cursor: pointer; }
.book-title { color: var(--ink) !important; text-decoration: none; transition: color .25s; }
.book-title::after { content: ""; position: absolute; inset: -12px; border-radius: 8px; }
.book-title:focus-visible { outline: none; }
.book-title:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 0; }
.book:hover .book-title { color: var(--accent-ink) !important; }
.book-link { display: inline-block; margin-top: 14px; font-size: .9rem; font-weight: 600; letter-spacing: .03em; color: var(--accent-ink); }
.book-link span { display: inline-block; transition: transform .3s var(--ease); }
.book:hover .book-link span, .book:focus-within .book-link span { transform: translateX(5px); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (max-width: 960px) { .books { grid-template-columns: 1fr; gap: 48px; } }
@media (max-width: 480px) { .book { grid-template-columns: 116px 1fr; gap: 22px; } }

.fauna { background: #050505; }

.fauna-strip {
  --h: 320px;
  list-style: none; margin: 0 calc((100% - 100vw) / 2) 0 0; padding: 0 var(--gutter) 4px 0;
  display: flex; gap: 20px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity; scrollbar-width: none;
  cursor: grab;
}
.fauna-strip::-webkit-scrollbar { display: none; }
.fauna-strip.dragging { cursor: grabbing; scroll-snap-type: none; }
.fauna-strip.dragging .fauna-item { pointer-events: none; }
.fauna-strip:focus-visible { outline-offset: 8px; }
.fauna-strip li { flex: 0 0 auto; scroll-snap-align: start; }
.fauna-strip figure { margin: 0; width: min-content; }
.fauna-item { display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: #000; cursor: zoom-in; }
.fauna-item img { height: var(--h); width: auto; max-width: none; transition: transform .8s var(--ease), filter .5s; filter: brightness(.9); -webkit-user-drag: none; user-select: none; }
.fauna-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(236, 228, 210, .08);
  border-radius: inherit; transition: box-shadow .4s;
}
.fauna-item:hover img, .fauna-item:focus-visible img { transform: scale(1.035); filter: brightness(1.05); }
.fauna-item:hover::after { box-shadow: inset 0 0 0 1px rgba(217, 164, 65, .5); }
.fauna-strip figcaption { padding: 14px 2px 0; display: flex; flex-direction: column; gap: 2px; font-size: .98rem; color: var(--on-dark); }
.fauna-strip figcaption em { font-style: italic; }
.fauna-strip figcaption .nome, .lightbox figcaption .nome { font-weight: 400; white-space: nowrap; }
.fauna-strip figcaption span { color: var(--on-dark-soft); font-size: .92rem; line-height: 1.45; }
.fauna-strip figcaption small { display: none; }

.js .fauna-strip .reveal { transform: none; }

.fauna-controls { display: flex; align-items: center; gap: 12px; margin-top: 32px; }

.fauna-count { flex: 1; margin: 0; font-family: var(--font-display); font-size: .95rem; letter-spacing: .12em; color: var(--on-dark-soft); font-variant-numeric: tabular-nums; }
.fauna-count .fc-cur { color: var(--on-dark); }
.fauna-nav {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: none; border: 1px solid var(--dark-line); color: var(--on-dark);
  font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
  transition: border-color .2s, color .2s, opacity .2s;
}
.fauna-nav:hover { border-color: var(--accent); color: var(--accent); }
.fauna-nav[aria-disabled="true"] { opacity: .3; cursor: default; border-color: var(--dark-line); color: var(--on-dark); }
@media (max-width: 640px) {
  .fauna-strip { --h: 240px; gap: 14px; }
  .fauna-strip figcaption span { font-size: .86rem; }
  .fauna-nav { display: none; }
}

.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5, 5, 5, .96); color: var(--on-dark);
  display: none; align-items: center; justify-content: center;
}
.lightbox[open] { display: flex; animation: fade .3s var(--ease); }
.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
@keyframes fade { from { opacity: 0; } }
.lightbox figure { margin: 0; max-width: min(1200px, 86vw); display: flex; flex-direction: column; align-items: center; gap: 16px; }
.lightbox img { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: var(--radius); }
.lightbox figcaption { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.lightbox figcaption span { color: var(--on-dark-soft); }
.lightbox figcaption small { color: var(--accent); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; margin-top: 4px; }
.lightbox button {
  position: absolute; background: none; border: 1px solid var(--dark-line); color: var(--on-dark);
  width: 52px; height: 52px; border-radius: 50%; font-size: 1.8rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: border-color .2s, color .2s, background .2s;
}
.lightbox button:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox figure { max-width: 100vw; padding: 0 12px; }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
}
body:has(.lightbox[open]) { overflow: hidden; }

.activity-mosaic { display: grid; grid-template-columns: 2.6fr 1fr 1fr; gap: 12px; height: clamp(300px, 26vw, 360px); }
.activity-mosaic figure { margin: 0; position: relative; overflow: hidden; border-radius: var(--radius); background: var(--dark); }
.activity-mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.activity-mosaic figure:nth-child(2) img { object-position: 50% 30%; }
.activity-mosaic figure:nth-child(3) img { object-position: 80% 50%; }
.activity-mosaic figure:hover img { transform: scale(1.03); }
@media (max-width: 760px) {
  .activity-mosaic { grid-template-columns: 1fr 1fr; height: auto; }
  .activity-mosaic .am-big { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
  .activity-mosaic figure:not(.am-big) { aspect-ratio: 3 / 4; }
}

.follow-buttons { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

.about-photo { margin: clamp(48px, 7vw, 88px) 0 0; position: relative; }
.about-photo img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 55%; border-radius: var(--radius); }
@media (max-width: 640px) { .about-photo img { aspect-ratio: 4 / 3; } }
.about-photo figcaption { margin-top: 12px; font-size: .95rem; color: var(--ink-soft); }

.instagram-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.instagram-grid a { display: block; position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius); background: var(--dark-2); }
.instagram-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease), filter .4s; filter: saturate(.9); }
.instagram-grid a::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(14,14,13,.55));
  opacity: 0; transition: opacity .4s;
}
.instagram-grid a:hover img, .instagram-grid a:focus-visible img { transform: scale(1.06); filter: saturate(1.05); }
.instagram-grid a:hover::after { opacity: 1; }
.instagram-grid a.is-video::before {
  content: ""; position: absolute; z-index: 1; top: 10px; right: 10px;
  border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
@media (max-width: 760px) { .instagram-grid { grid-template-columns: repeat(3, 1fr); } }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(28px, 4vw, 56px); counter-reset: step; position: relative; }
.steps::before {
  content: ""; position: absolute; top: 28px; left: 28px; right: 139px; height: 1px;
  background: repeating-linear-gradient(270deg, var(--ink) 0 4px, transparent 4px 10px); opacity: .3;
}
.steps li { counter-increment: step; position: relative; }
.steps li::before {
  content: counter(step, upper-roman);
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 28px;
  border-radius: 50%; background: var(--light-2); border: 1px solid var(--ink);
  font-family: var(--font-display); font-size: 1.05rem; position: relative;
}
.steps li:hover::before { background: var(--ink); color: var(--light); }
.steps h3 { font-size: 1.25rem; }
.steps p { color: var(--ink-soft); margin: 0; }

.steps-wrap { position: relative; }
.speleo {
  position: absolute; width: 37px; height: 89px; pointer-events: none; overflow: visible;
  left: calc(100% - 28px - 1.7px); top: 22px;   /* px interi: con valori frazionari il browser arrotonda e la corda fa uno scalino */
}
.speleo-rope { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; opacity: .3; }

/* Unità SVG (1px = 1,189): trattini di 4px con vuoti decrescenti, poi tratto continuo. */
.speleo-anchor { vector-effect: none; stroke-width: 1.19;
  stroke-dasharray: 0 5.95 4.76 5 4.76 4.04 4.76 3.09 4.76 2.26 4.76 1.55 4.76 .95 4.76 .48 4.76 .12 999 1; }
.speleo-limb, .speleo-torso { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.speleo-limb { stroke-width: 3; }
.speleo-torso { stroke-width: 4.4; }
.speleo-head, .speleo-helmet { fill: var(--ink); }
.speleo-helmet { stroke: var(--light-2); stroke-width: .6; }
.speleo-finger { fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.speleo-tail { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: round; opacity: .55; }
.speleo-lamp { fill: var(--accent); }

.speleo-body { transform: translate(0, 61.6px); }
.speleo-rope-top { display: none; }
@media (min-width: 761px) {
  .steps li:last-child { padding-right: 52px; }
}
.speleo-beam { fill: var(--accent); opacity: .35; }
@media (max-width: 760px) {
  .steps { grid-template-columns: 1fr; }
  .steps-wrap { padding-bottom: 110px; }
  .speleo { width: 44px; height: 106px; left: 6px; top: auto; bottom: 4px; }
  .speleo-anchor, .speleo-rope-hang { display: none; }
  .speleo-body { transform: translate(0, 30px); }
  .speleo-rope-top { display: inline; stroke-dasharray: 0 5 4 4.2 4 3.4 4 2.6 4 1.9 4 1.3 4 .8 4 .4 4 .1 999 1; }
  .steps::before { top: 28px; bottom: 60px; left: 28px; right: auto; width: 1px; height: auto;
    background: repeating-linear-gradient(0deg, var(--ink) 0 4px, transparent 4px 10px); }
  .steps li { padding-left: 84px; min-height: 56px; }
  .steps li::before { position: absolute; left: 0; top: 0; margin: 0; }
}

.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.support-grid .section-head { margin: 0; }
.support-creature {
  position: absolute; left: 3%; bottom: -12%; width: 360px; opacity: .05; transform: rotate(-24deg); pointer-events: none;
}
.donate-card {
  position: relative; padding: clamp(28px, 4vw, 44px);
  background: linear-gradient(160deg, var(--dark-3), var(--dark-2));
  border: 1px solid var(--dark-line); border-radius: 8px;
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.9);
}
.donate-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(217,164,65,.6), transparent 40%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.donate-card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; letter-spacing: .04em; margin-bottom: 1.2em; }
.donate-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; }
.donate-card dt { color: var(--on-dark-soft); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; }
.donate-card dd { margin: 0; }
.iban-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .04em; }
.copy {
  font: inherit; font-size: .78rem; letter-spacing: .08em; cursor: pointer;
  background: none; color: var(--accent); border: 1px solid rgba(217,164,65,.45); border-radius: 99px; padding: 4px 14px;
  min-height: 44px; min-width: 64px;
}
.copy:hover { background: var(--accent); color: var(--dark); }
.thanks { margin: 28px 0 0; padding-top: 22px; border-top: 1px solid var(--dark-line); font-family: var(--font-serif); font-style: italic; font-size: 1.2rem; color: var(--on-dark-soft); }

.thanks .heart { width: 1em; height: 1em; vertical-align: -.12em; margin-left: .2em; fill: var(--accent); }
@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .donate-card dl { grid-template-columns: 1fr; gap: 4px; } .donate-card dd { margin-bottom: 14px; } }

.mail-big {
  display: inline-flex; align-items: baseline; gap: .4em; max-width: 100%;
  font-family: var(--font-serif); font-style: italic; font-weight: 500;
  font-size: clamp(1.7rem, 5.4vw, 4rem); line-height: 1.1;
  color: var(--ink); text-decoration: none; overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 56px;
  transition: color .25s, border-color .25s;
}
.mail-big span { color: var(--accent-ink); transition: transform .3s var(--ease); }
.mail-big:hover { color: var(--accent-ink); border-color: var(--accent-ink); }
.mail-big:hover span { transform: translateX(8px); }
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.contact-info { display: flex; flex-direction: column; gap: 36px; }
.contact h3 { font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; margin-bottom: 1em; }
.contact p { font-size: 1.12rem; margin: 0; }
.contact a { color: var(--ink); }
.contact a:hover { color: var(--accent-ink); }
.contact .contact-note { font-size: .98rem; color: var(--ink-soft); margin-top: 14px; max-width: 40ch; }
.contact .contact-note a { color: var(--accent-ink); font-weight: 600; white-space: nowrap; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.map-card {
  position: relative; overflow: hidden;
  background: var(--dark); color: var(--on-dark); border-radius: 8px;
}

.map-photo {
  height: 110px;
  background:
    linear-gradient(to top, var(--dark) 0%, rgba(14,14,13,0) 45%),
    url("../img/grotta-di-bossea.jpg") center 32% / cover;
}
.map-body { padding: 0 clamp(20px, 2.6vw, 26px) clamp(18px, 2.4vw, 22px); }
.map-label {
  display: inline-block; margin: 0 0 10px; padding: 4px 12px;
  font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-hi); border: 1px solid rgba(236, 190, 104, .55); border-radius: 99px;
}
.map-place { font-family: var(--font-display); font-size: 1.3rem; letter-spacing: .03em; margin: 0 0 4px; }
.map-sub { color: var(--on-dark-soft); font-size: .9rem; margin: 0 0 14px; }
.map-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.map-actions .btn { padding: 10px 18px; font-size: .85rem; min-height: 44px; }
.map-card .btn-ghost { color: var(--on-dark); }
@media (max-width: 520px) { .map-photo { height: 120px; } .map-actions .btn { flex: 1 1 100%; justify-content: center; } }

.social { display: flex; align-items: center; gap: 14px; margin-top: clamp(48px, 7vw, 80px); padding-top: 32px; border-top: 1px solid var(--line); }
.social p { margin: 0 8px 0 0; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-soft); font-weight: 600; }
.social-icon {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); color: var(--ink);
  transition: background .25s, color .25s, border-color .25s, transform .25s var(--ease);
}
.social-icon svg { width: 20px; height: 20px; }
.social-icon rect, .social-icon circle { fill: none; stroke: currentColor; stroke-width: 1.7; }
.social-icon .fill, .social-icon path { fill: currentColor; stroke: none; }
.social-icon:hover, .social-icon:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--light); transform: translateY(-2px); }

#contatti { padding-bottom: clamp(56px, 7vw, 88px); }
.site-footer { position: relative; background: var(--dark); color: var(--on-dark-soft); padding: 72px 0 28px; overflow: clip; }
.footer-main { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; align-items: start; }
.footer-logo { width: 220px; height: auto; opacity: .9; }
.footer-motto { font-family: var(--font-serif); font-style: italic; font-size: 1.25rem; color: var(--accent); margin: 18px 0 0; }
.site-footer .footer-title { font-size: .74rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--on-dark); margin: 6px 0 16px; }
.footer-col p { margin: 0; font-size: .95rem; line-height: 1.75; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-col a { display: inline-block; padding: 2px 0; font-size: .95rem; color: var(--on-dark-soft); text-decoration: none; transition: color .2s; }
.footer-col a::after { content: "→"; display: inline-block; margin-left: .45em; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--accent); }
.footer-col a:hover::after, .footer-col a:focus-visible::after { opacity: 1; transform: none; }

.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--dark-line); font-size: .8rem; }
.footer-bottom p { margin: 0; }
.footer-bottom .sep { margin: 0 .45em; opacity: .6; }
.footer-bottom a { color: var(--on-dark-soft); text-decoration-color: rgba(167, 161, 148, .4); }
.footer-bottom a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.footer-bottom .footer-top { text-decoration: none; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; font-size: .72rem;
  border: 1px solid var(--dark-line); border-radius: 99px; padding: 8px 16px; transition: color .2s, border-color .2s; }
.footer-bottom .footer-top:hover, .footer-bottom .footer-top:focus-visible { color: var(--accent); border-color: var(--accent); }
@media (max-width: 860px) {
  .footer-main { grid-template-columns: 1fr 1fr; gap: 40px 32px; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .footer-logo { width: 190px; }
  .footer-main { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

.back-link { color: var(--accent); text-decoration: none; font-size: .9rem; border: 1px solid rgba(217, 164, 65, .45); padding: 7px 16px; border-radius: 99px; white-space: nowrap; }
.back-link:hover { background: var(--accent); color: var(--dark); }
@media (max-width: 560px) { .legal-header .brand-name { display: none; } }
.legal { padding-top: calc(72px + clamp(40px, 7vw, 80px)); }
.legal .wrap { max-width: calc(46rem + 2 * var(--gutter)); }
.legal p, .legal li, .legal dd, .legal td { color: var(--ink); font-size: 1rem; line-height: 1.7; }
.legal a:not(.btn) { color: var(--accent-ink); }

.legal-head { border-bottom: 1px solid var(--ink); padding-bottom: 28px; margin-bottom: 36px; }
.legal .legal-kicker { font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 14px; }
.legal h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: .02em; margin: 0 0 10px; }
.legal .legal-ref { margin: 0; color: var(--ink-soft); }
.legal .legal-date { margin: 6px 0 0; font-size: .85rem; color: var(--ink-soft); }

.legal-summary { border: 1px solid rgba(25, 24, 22, .18); background: var(--light-2); border-radius: var(--radius); padding: 18px 22px; margin-bottom: 8px; }
.legal .legal-summary-title { font-size: .74rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 6px; }
.legal-summary p:last-child { margin: 0; }

.legal-art { border-top: 1px solid rgba(25, 24, 22, .14); padding-top: 26px; margin-top: 30px; }
.legal h2 { font-family: var(--font-body); font-weight: 600; font-size: 1.08rem; letter-spacing: 0; max-width: none; margin: 0 0 .8em; display: flex; gap: .6em; }
.legal h2 span { color: var(--ink-soft); min-width: 1.4em; }
.legal ol { padding-left: 1.6em; margin: 0 0 1em; }
.legal li { margin-bottom: .35em; }
.legal-data { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.legal-data dt { font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); padding-top: .25em; }
.legal-data dd { margin: 0; }
.legal-table { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
.legal-table th { text-align: left; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); padding: 0 12px 8px 0; border-bottom: 1px solid var(--ink); }
.legal-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid rgba(25, 24, 22, .14); vertical-align: top; }
.legal-table td:first-child { width: 48%; }
@media (max-width: 560px) {
  .legal-data { grid-template-columns: 1fr; gap: 0; }
  .legal-data dd { margin-bottom: 10px; }
  .legal-table thead { display: none; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: auto !important; }
  .legal-table tr { border-bottom: 1px solid rgba(25, 24, 22, .14); padding: 10px 0; }
  .legal-table td { border: 0; padding: 0; }
  .legal .legal-table td:last-child { color: var(--ink-soft); font-size: .92rem; }
}
.legal-back { margin-top: 3em; }

.todo { background: #ffe58a; color: #3a2e00; padding: 0 5px; border-radius: 3px; font-family: var(--font-body); font-size: .92em; }
