/* =========================================================
   RESET & BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Roboto', sans-serif;
  color: #364153;
  background: #fff;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
video { display: block; }

/* =========================================================
   DESIGN TOKENS
========================================================= */
:root {
  --blue:       #2458ba;
  --dark:       #364153;
  --mid:        #4a5565;
  --light:      #d1d5dc;
  --muted:      #99a1af;
  --title-dark: #101828;
  --bg-light:   #f0f3fa;
  --white:      #ffffff;
  --black:      #000000;
  --shadow-card: 0 0 9.3px rgba(0,0,0,0.06), 0 0 2px rgba(0,0,0,0.03);
  --radius-card: 10px;
}

/* =========================================================
   FIXED CTA BUTTON
========================================================= */
#cta-fixed {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 70px;
  border: 1.5px solid rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.10);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  color: white;
  font-family: 'Inter', 'Roboto', sans-serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.2px;
  cursor: pointer;
  transition:
    background   0.28s ease,
    border-color 0.28s ease,
    transform    0.18s ease,
    box-shadow   0.28s ease,
    color        0.28s ease;
  box-shadow: 0 2px 20px rgba(0,0,0,0.18);
  will-change: transform;
}
#cta-fixed svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  fill: currentColor;
  transition: transform 0.2s ease;
}
#cta-fixed:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0,0,0,0.25);
}
#cta-fixed:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 1px 8px rgba(0,0,0,0.2);
}
/* State after hero */
#cta-fixed.dark-bg {
  background: rgba(36,88,186,0.88);
  border-color: rgba(36,88,186,0.4);
  color: white;
  box-shadow: 0 4px 24px rgba(36,88,186,0.35);
}
#cta-fixed.dark-bg:hover {
  background: rgba(36,88,186,1);
}

/* =========================================================
   HERO SECTION
========================================================= */
#hero {
  position: relative;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
}

.hero-video-wrap {
  position: absolute;
  top: -15%;
  left: 0;
  right: 0;
  bottom: -15%;
  will-change: transform;
}
.hero-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.58) 0%,
    rgba(0,0,0,0.35) 45%,
    rgba(0,0,0,0.65) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 95px 80px;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.hero-logo img {
  height: 50px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  flex-shrink: 0;
}

.hero-text {
  max-width: 860px;
}
.hero-text h1 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5.1vw, 69px);
  line-height: 0.97;
  color: white;
  letter-spacing: -3px;
  margin-bottom: 14px;
}
.hero-text p {
  font-family: 'Roboto', sans-serif;
  font-weight: 300;
  font-size: clamp(15px, 1.6vw, 22px);
  line-height: 1.33;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.07px;
  opacity: 0; /* animated in via JS */
}

/* =========================================================
   SHARED
========================================================= */
.section-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 3.2vw, 44px);
  line-height: 1;
  color: var(--blue);
  letter-spacing: -2px;
}

.body-text {
  font-weight: 300;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.52;
  color: var(--dark);
  letter-spacing: -0.31px;
}
.body-text p + p { margin-top: 16px; }

/* =========================================================
   IL PROGETTO O.A.S.I.
========================================================= */
#progetto {
  background: var(--white);
  padding: 130px 16px;
  position: relative;
  overflow: hidden;
}

.progetto-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 80px;
  align-items: flex-start;
}

.progetto-title {
  flex: 1 0 0;
  min-width: 0;
}
.progetto-title .main {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1;
  color: var(--blue);
  letter-spacing: -2px;
  display: block;
}
.progetto-title .sub {
  display: block;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(16px, 1.7vw, 24px);
  color: var(--blue);
  letter-spacing: -1px;
  margin-top: 8px;
  line-height: 1.2;
}

.progetto-body { flex: 1 0 0; min-width: 0; }

/* =========================================================
   CHI SIAMO
========================================================= */
#chi-siamo {
  background: var(--bg-light);
  padding: 130px 16px;
  position: relative;
  overflow: hidden;
}

.chisiamo-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 80px;
  align-items: flex-start;
}

.chisiamo-image {
  flex: 1 0 0;
  min-width: 0;
  max-width: 537px;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  background: white;
}
.chisiamo-image img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: var(--radius-card);
}

.chisiamo-text {
  flex: 1 0 0;
  min-width: 0;
  padding-top: 16px;
}
.chisiamo-text .section-heading { margin-bottom: 24px; }

/* =========================================================
   IL NOSTRO OBIETTIVO
========================================================= */
#obiettivo {
  background: var(--white);
  padding: 130px 48px;
  overflow: hidden;
}

.obiettivo-header {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}
.obiettivo-header .section-heading { margin-bottom: 24px; }
.obiettivo-header p {
  font-weight: 300;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.52;
  color: var(--dark);
  letter-spacing: -0.31px;
}

.cards-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 1152px;
  margin: 0 auto;
}

.card {
  background: var(--white);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: default;
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.28s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(36,88,186,0.12), 0 2px 8px rgba(0,0,0,0.05);
}
.card:active {
  transform: translateY(-2px);
}

.card-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 26px;
  flex-shrink: 0;
}
.card-icon img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}
.card-icon.no-bg {
  background: transparent;
}
.card-icon.no-bg img {
  width: 64px;
  height: 64px;
}
.card h3 {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 600;
  font-size: 21px;
  line-height: 1.29;
  color: var(--mid);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.31px;
}
.card p {
  font-weight: 300;
  font-size: 16px;
  line-height: 1.38;
  color: var(--mid);
  text-align: center;
  letter-spacing: -0.31px;
}

/* =========================================================
   VIDEO SEPARATOR
========================================================= */
#video-separator {
  position: relative;
  height: 600px;
  overflow: hidden;
}
.sep-video-wrap {
  position: absolute;
  top: -15%;
  left: 0;
  right: 0;
  bottom: -15%;
  will-change: transform;
}
.sep-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   FAI UNA DONAZIONE
========================================================= */
#donazione {
  padding: 100px 16px;
  background: linear-gradient(144.43deg, #f0f3fa 0%, #d6e3ff 100%);
}

.donazione-inner {
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}
.donazione-inner .section-heading {
  color: var(--title-dark);
  font-size: clamp(28px, 2.6vw, 36px);
}

.donazione-lead {
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.4;
  color: var(--title-dark);
  opacity: 0.9;
  letter-spacing: -0.45px;
  margin-top: 24px;
  margin-bottom: 48px;
}

.donation-card {
  background: var(--white);
  border-radius: 16px;
  padding: 48px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.18);
  text-align: left;
}

.donation-card h3 {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 24px;
  line-height: 1.33;
  color: var(--title-dark);
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

.donation-field {
  background: #f9fafb;
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease;
}
.donation-field:last-of-type { margin-bottom: 0; }
.donation-field:hover { background: #f1f4f8; }
.donation-field:hover .copy-hint { opacity: 1; }

.field-label {
  font-size: 13px;
  font-weight: 400;
  color: var(--mid);
  letter-spacing: -0.15px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.copy-hint {
  font-size: 11px;
  color: var(--blue);
  opacity: 0;
  transition: opacity 0.2s;
  font-weight: 500;
}
.field-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--title-dark);
  letter-spacing: -0.31px;
  line-height: 1.5;
  word-break: break-word;
}
.field-value.iban {
  font-family: 'Roboto Mono', 'Menlo', monospace;
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.donation-note {
  border-top: 1px solid #e5e7eb;
  padding-top: 32px;
  margin-top: 32px;
  font-size: 14px;
  color: var(--mid);
  text-align: center;
  line-height: 1.5;
  letter-spacing: -0.15px;
}

/* Toast copy feedback */
#copy-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--title-dark);
  color: white;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 40px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  white-space: nowrap;
}
#copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =========================================================
   FOOTER
========================================================= */
footer {
  background: var(--black);
  padding: 48px 16px;
  color: white;
}
.footer-inner {
  max-width: 1152px;
  margin: 0 auto;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 48px;
}
.footer-col h4 {
  font-family: 'Roboto', sans-serif;
  font-weight: 500;
  font-size: 20px;
  color: white;
  letter-spacing: -0.45px;
  margin-bottom: 16px;
  line-height: 1.4;
}
.footer-col p,
.footer-col a {
  font-size: 16px;
  font-weight: 400;
  color: var(--light);
  letter-spacing: -0.31px;
  line-height: 1.5;
}
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.footer-contact-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.footer-contact-item a { transition: color 0.2s; }
.footer-contact-item a:hover { color: white; }

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.footer-links a {
  transition: color 0.2s;
  display: inline-block;
}
.footer-links a:hover { color: white; }
.footer-links a:active { opacity: 0.7; }

.footer-bottom {
  border-top: 1px solid #1e2939;
  padding-top: 32px;
  text-align: center;
}
.footer-bottom p {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: -0.31px;
}

/* =========================================================
   MODAL
========================================================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}
.modal.is-open {
  pointer-events: all;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  transform: translateY(28px) scale(0.97);
  transition: transform 0.32s cubic-bezier(0.34,1.4,0.64,1);
  overflow: hidden;
}
.modal.is-open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.modal-title {
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2vw, 26px);
  color: var(--blue);
  letter-spacing: -1px;
}
.modal-close {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #f3f4f6;
  color: var(--mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover {
  background: #e5e7eb;
  color: var(--title-dark);
  transform: scale(1.1);
}
.modal-close:active { transform: scale(0.95); }

.modal-body {
  padding: 32px;
  overflow-y: auto;
  flex: 1;
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark);
  -webkit-overflow-scrolling: touch;
}

/* ── Privacy / legal modal typography ── */
.privacy-body h3 {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 32px 0 10px;
}
.privacy-body h3:first-of-type { margin-top: 0; }
.privacy-body p { margin-bottom: 12px; }
.privacy-body p.pp-intro {
  font-size: 14px;
  color: var(--mid);
  border-left: 3px solid var(--blue);
  padding-left: 14px;
  margin-bottom: 20px;
}
.privacy-body ul {
  margin: 0 0 14px 0;
  padding-left: 20px;
}
.privacy-body ul li {
  margin-bottom: 6px;
}
.privacy-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy-body a:hover { opacity: .75; }

@media (max-width: 540px) {
  .modal { padding: 12px 8px; align-items: flex-end; }
  .modal-box { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-header { padding: 20px 20px; }
  .modal-body { padding: 20px; }
}

/* =========================================================
   LETTER SPLIT ANIMATION
========================================================= */
.char {
  display: inline-block;
  will-change: transform, opacity;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1100px) {
  .hero-overlay { padding: 40px 60px 64px; }
  #obiettivo { padding: 100px 40px; }
}

@media (max-width: 860px) {
  .hero-overlay { padding: 32px 32px 56px; }

  .progetto-inner,
  .chisiamo-inner {
    flex-direction: column;
    gap: 36px;
    max-width: 600px;
    margin: 0 auto;
  }
  #progetto  { padding: 80px 24px; }
  #chi-siamo { padding: 80px 24px; }

  .chisiamo-image { max-width: 100%; }

  #obiettivo { padding: 80px 24px; }
  .cards-row { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }

  .donazione-inner { max-width: 100%; }
  .donation-card { padding: 32px 24px; }

  .footer-cols { grid-template-columns: 1fr 1fr; }

  #cta-fixed { top: 16px; right: 16px; padding: 11px 18px; font-size: 14px; }
}

@media (max-width: 540px) {
  .hero-overlay { padding: 24px 20px 48px; }
  .hero-text h1 { letter-spacing: -2px; }

  #obiettivo { padding: 64px 16px; }
  .cards-row { grid-template-columns: 1fr; }

  .footer-cols { grid-template-columns: 1fr; gap: 32px; }
  .donation-card { padding: 28px 16px; }
  #video-separator { height: 400px; }
}
