/* =========================================================
   Associazione NOI Giovo — APS
   Art direction: "Sacro-moderno editoriale"
   Pure static CSS. No build step required.
   ========================================================= */

:root {
  --paper:      #F3ECE0;
  --paper-2:    #EDE3D3;
  --ink:        #211B15;
  --ink-soft:   #4B4139;
  --terra:      #C1502E;
  --terra-deep: #9E3E22;
  --olive:      #5E6B4F;
  --gold:       #C0912F;
  --line:       rgba(33, 27, 21, 0.14);
  --line-strong:rgba(33, 27, 21, 0.28);

  --f-display: "Fraunces", Georgia, serif;
  --f-body:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, monospace;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1320px;
}

* { box-sizing: border-box; }

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

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  margin: 0 !important;
  background: var(--paper) !important;
  color: var(--ink) !important;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Grain / noise overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--terra); color: var(--paper); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 72px);
}

.mono {
  font-family: var(--f-mono);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}

/* ================= NAV ================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 72px);
  transition: background-color 0.5s var(--ease), padding 0.5s var(--ease),
              box-shadow 0.5s var(--ease), color 0.5s var(--ease);
  mix-blend-mode: normal;
}
.nav.is-scrolled {
  background: rgba(243, 236, 224, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding-top: 14px;
  padding-bottom: 14px;
  box-shadow: 0 1px 0 var(--line);
}
.nav.on-dark { color: var(--paper); }
.nav.on-dark.is-scrolled { color: var(--ink); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
}
.brand .logo { height: 30px; width: auto; display: block; }
.brand .logo-dark { display: none; }
.nav:not(.on-dark) .brand .logo-light,
.nav.on-dark.is-scrolled .brand .logo-light { display: none; }
.nav:not(.on-dark) .brand .logo-dark,
.nav.on-dark.is-scrolled .brand .logo-dark { display: block; }
.brand .tag {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 3px 7px;
  border: 1px solid currentColor;
  border-radius: 999px;
  opacity: 0.75;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
}
.nav-links a {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 4px 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav-links a.active { color: var(--terra); }

.nav-toggle { display: none; }

/* ================= HERO ================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  color: var(--paper);
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: -12% 0 0 0;
  z-index: 0;
  will-change: transform;
}
.hero-media img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  object-position: center 40%;
  filter: saturate(0.95) contrast(1.03) brightness(0.72);
}
.hero-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20,15,10,0.55) 0%, rgba(20,15,10,0.28) 30%, rgba(20,15,10,0.5) 62%, rgba(20,15,10,0.94) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  padding-bottom: clamp(48px, 8vh, 110px);
  padding-top: 140px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(20px, 4vh, 40px);
  opacity: 0;
  transform: translateY(20px);
  animation: heroFade 0.9s var(--ease) 0.15s forwards;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--terra);
  box-shadow: 0 0 0 4px rgba(193,80,46,0.28);
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 6.6vw, 6rem);
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 15ch;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.line-mask { display: block; overflow: hidden; }
.line-mask > span {
  display: block;
  will-change: transform;
  transform: translateY(115%);
  animation: heroLineUp 1.15s var(--ease) forwards;
}
.hero h1 .line-mask:nth-child(1) > span { animation-delay: 0.35s; }
.hero h1 .line-mask:nth-child(2) > span { animation-delay: 0.5s; }
@keyframes heroLineUp { to { transform: translateY(0); } }

.hero-foot {
  margin-top: clamp(26px, 5vh, 48px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  animation: heroFade 0.9s var(--ease) 0.85s forwards;
}
@keyframes heroFade { to { opacity: 1; transform: none; } }
.hero-foot p {
  max-width: 46ch;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
  color: rgba(243,236,224,0.86);
  margin: 0;
}
.scroll-cue {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.8;
}
.scroll-cue .bar {
  width: 1px; height: 46px;
  background: linear-gradient(var(--paper), transparent);
  animation: cue 2.2s infinite;
  transform-origin: top;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 0; }
  40% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0) translateY(46px); opacity: 0; }
}

/* ================= MARQUEE ================= */
.marquee {
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding: 22px 0;
}
.marquee-track {
  display: flex;
  gap: 0;
  white-space: nowrap;
  will-change: transform;
}
.marquee-track span {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.6rem, 4vw, 3rem);
  padding: 0 28px;
  display: inline-flex;
  align-items: center;
}
.marquee-track span::after {
  content: "✦";
  font-style: normal;
  font-size: 0.5em;
  color: var(--terra);
  margin-left: 56px;
  transform: translateY(-0.2em);
}

/* ================= SECTIONS ================= */
section { position: relative; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(40px, 7vh, 80px);
}
.section-head .idx {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--terra);
  padding-top: 6px;
}
.section-head h2 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 18ch;
}

.mission {
  padding: clamp(80px, 14vh, 170px) 0 clamp(60px, 10vh, 120px);
}
.mission-lead {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 3.2vw, 2.6rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
  max-width: 24ch;
  margin: 0 0 clamp(50px, 9vh, 110px);
}
.mission-lead em { font-style: italic; color: var(--terra); }

.chapters {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(28px, 4vw, 64px);
  border-top: 1px solid var(--line);
  padding-top: clamp(36px, 6vh, 64px);
}
.chapter { position: relative; }
.chapter .num {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  color: var(--terra);
  line-height: 1;
  margin-bottom: 20px;
  display: block;
}
.chapter h3 {
  font-family: var(--f-body);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.chapter p {
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.62;
  margin: 0;
}

/* ================= PHOTO BAND ================= */
.band {
  padding: clamp(30px, 6vh, 70px) 0 clamp(80px, 12vh, 150px);
}
.band-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-auto-rows: 1fr;
  gap: clamp(14px, 2vw, 26px);
}
.frame {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  border-radius: 2px;
}
.frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 1.1s var(--ease);
  filter: saturate(0.9) contrast(1.03);
}
.frame:hover img { transform: scale(1.05); filter: saturate(1.05); }
.frame.tall { grid-row: span 2; min-height: 460px; }
.frame.short { min-height: 220px; }
.frame .cap {
  position: absolute;
  left: 18px; bottom: 16px;
  color: var(--paper);
  z-index: 2;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
}

/* ================= QUOTE / CTA ================= */
.callout {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(80px, 16vh, 190px) 0;
  overflow: hidden;
}
.callout blockquote {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4.6vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
  max-width: 20ch;
}
.callout blockquote em { font-style: italic; color: var(--gold); }
.callout .src {
  margin-top: 40px;
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(243,236,224,0.6);
  text-transform: uppercase;
}

/* ================= FOOTER ================= */
.footer {
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding: clamp(70px, 12vh, 130px) 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(30px, 5vw, 70px);
  align-items: start;
}
.footer .fbrand {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.footer .fbrand span { color: var(--terra); font-style: italic; }
.footer .flogo { height: clamp(58px, 7vw, 96px); width: auto; display: block; }
.footer .fbrand-sub {
  display: block;
  margin-top: 18px;
  font-family: var(--f-body);
  font-size: 14px;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
}
.footer h4 {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--terra);
  margin: 0 0 16px;
}
.footer address {
  font-style: normal;
  line-height: 1.75;
  color: var(--ink-soft);
  font-size: 15.5px;
}
.footer .fiscal p {
  margin: 0 0 8px;
  font-size: 14.5px;
  color: var(--ink-soft);
}
.footer .fiscal strong { color: var(--ink); font-weight: 600; }
.footer-bottom {
  margin-top: clamp(50px, 9vh, 90px);
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-family: var(--f-mono);
  letter-spacing: 0.06em;
}

/* ================= TRANSPARENCY PAGE ================= */
.page-hero {
  padding: clamp(150px, 22vh, 240px) 0 clamp(50px, 8vh, 90px);
  border-bottom: 1px solid var(--line);
}
.page-hero .mono { color: var(--terra); }
.page-hero h1 {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(2.8rem, 8vw, 6.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 18px 0 0;
}
.page-hero .intro {
  margin-top: clamp(28px, 5vh, 46px);
  max-width: 60ch;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.62;
}
.page-hero .intro strong { color: var(--ink); font-weight: 600; }

.years { padding: clamp(50px, 9vh, 100px) 0 clamp(70px, 12vh, 140px); }

.year-block { margin-bottom: clamp(48px, 8vh, 96px); }
.year-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 0;
}
.year-head .yr {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1;
}
.year-head .meta {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.table-scroll { overflow-x: auto; }
table.contrib {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  min-width: 640px;
}
table.contrib thead th {
  text-align: left;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-strong);
}
table.contrib td {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-soft);
}
table.contrib tbody tr { transition: background-color 0.3s var(--ease); }
table.contrib tbody tr:hover { background: rgba(193,80,46,0.05); }
table.contrib td.amount {
  font-family: var(--f-mono);
  color: var(--ink);
  white-space: nowrap;
}
table.contrib td.empty {
  color: rgba(75,65,57,0.35);
  font-style: italic;
}
.year-note {
  margin-top: 20px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Reveal animation base state (only when JS active) */
.js .reveal { opacity: 0; transform: translateY(34px); }

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .chapters { grid-template-columns: 1fr; gap: 40px; }
  .band-grid { grid-template-columns: 1fr; }
  .frame.tall { grid-row: auto; min-height: 320px; }
  .footer-grid { grid-template-columns: 1fr; gap: 44px; }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(78vw, 340px);
    background: var(--ink);
    color: var(--paper);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 28px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.55s var(--ease);
    z-index: 1001;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 22px; font-family: var(--f-display); }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    padding: 6px 0;
  }
  .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: currentColor;
    transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
  }
  .nav-toggle.open span { background: var(--paper); }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .line-mask > span { transform: none; }
  .hero-eyebrow, .hero-foot { opacity: 1; transform: none; }
}
